xref: /openbmc/u-boot/include/configs/pfla02.h (revision 9c5b0097)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) Stefano Babic <sbabic@denx.de>
4  */
5 
6 
7 #ifndef __PCM058_CONFIG_H
8 #define __PCM058_CONFIG_H
9 
10 #ifdef CONFIG_SPL
11 #define CONFIG_SYS_SPI_U_BOOT_OFFS	(64 * 1024)
12 #include "imx6_spl.h"
13 #endif
14 
15 #include "mx6_common.h"
16 
17 /* Thermal */
18 #define CONFIG_IMX_THERMAL
19 
20 /* Serial */
21 #define CONFIG_MXC_UART
22 #define CONFIG_MXC_UART_BASE	       UART4_BASE
23 #define CONSOLE_DEV		"ttymxc3"
24 
25 /* Early setup */
26 
27 
28 /* Size of malloc() pool */
29 #define CONFIG_SYS_MALLOC_LEN		(8 * SZ_1M)
30 
31 /* Ethernet */
32 #define CONFIG_MII
33 #define IMX_FEC_BASE			ENET_BASE_ADDR
34 #define CONFIG_FEC_XCV_TYPE		RGMII
35 #define CONFIG_ETHPRIME			"FEC"
36 #define CONFIG_FEC_MXC_PHYADDR		3
37 
38 /* SPI Flash */
39 #define CONFIG_SF_DEFAULT_BUS		2
40 #define CONFIG_SF_DEFAULT_CS		0
41 #define CONFIG_SF_DEFAULT_SPEED		20000000
42 #define CONFIG_SF_DEFAULT_MODE		SPI_MODE_0
43 
44 /* I2C Configs */
45 #define CONFIG_SYS_I2C
46 #define CONFIG_SYS_I2C_MXC
47 #define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 0 */
48 #define CONFIG_SYS_I2C_SPEED		  100000
49 
50 #ifndef CONFIG_SPL_BUILD
51 #define CONFIG_CMD_NAND
52 /* Enable NAND support */
53 #define CONFIG_CMD_NAND_TRIMFFS
54 #define CONFIG_SYS_MAX_NAND_DEVICE	1
55 #define CONFIG_SYS_NAND_BASE		0x40000000
56 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
57 #define CONFIG_SYS_NAND_ONFI_DETECTION
58 #endif
59 
60 /* DMA stuff, needed for GPMI/MXS NAND support */
61 
62 /* Filesystem support */
63 
64 /* Various command support */
65 
66 /* Physical Memory Map */
67 #define CONFIG_NR_DRAM_BANKS           1
68 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
69 
70 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
71 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
72 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
73 
74 #define CONFIG_SYS_INIT_SP_OFFSET \
75 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
76 #define CONFIG_SYS_INIT_SP_ADDR \
77 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
78 
79 /* MMC Configs */
80 #define CONFIG_SYS_FSL_ESDHC_ADDR	0
81 #define CONFIG_SYS_FSL_USDHC_NUM	2
82 
83 /* Environment organization */
84 #define CONFIG_ENV_IS_IN_SPI_FLASH
85 #define CONFIG_ENV_SIZE                (16 * 1024)
86 #define CONFIG_ENV_OFFSET		(1024 * SZ_1K)
87 #define CONFIG_ENV_SECT_SIZE		(64 * SZ_1K)
88 #define CONFIG_ENV_SPI_BUS             CONFIG_SF_DEFAULT_BUS
89 #define CONFIG_ENV_SPI_CS              CONFIG_SF_DEFAULT_CS
90 #define CONFIG_ENV_SPI_MODE            CONFIG_SF_DEFAULT_MODE
91 #define CONFIG_ENV_SPI_MAX_HZ          CONFIG_SF_DEFAULT_SPEED
92 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
93 #define CONFIG_ENV_OFFSET_REDUND       (CONFIG_ENV_OFFSET + \
94 						CONFIG_ENV_SECT_SIZE)
95 #define CONFIG_ENV_SIZE_REDUND         CONFIG_ENV_SIZE
96 
97 #ifdef CONFIG_ENV_IS_IN_NAND
98 #define CONFIG_ENV_OFFSET              (0x1E0000)
99 #define CONFIG_ENV_SECT_SIZE           (128 * SZ_1K)
100 #endif
101 
102 /* Default environment */
103 #define CONFIG_EXTRA_ENV_SETTINGS \
104 	"addcons=setenv bootargs ${bootargs} "				\
105 		"console=${console},${baudrate}\0"			\
106 	"addip=setenv bootargs ${bootargs} "				\
107 		"ip=${ipaddr}:${serverip}:${gatewayip}:"		\
108 		"${netmask}:${hostname}:${netdev}:off\0"		\
109 	"addmisc=setenv bootargs ${bootargs} ${miscargs}\0"		\
110 	"addmtd=run mtdnand;run mtdspi;"				\
111 		"setenv bootargs ${bootargs} ${mtdparts}\0"		\
112 	"mtdnand=setenv mtdparts mtdparts=gpmi-nand:"			\
113 		"40m(Kernels),400m(root),-(nand)\0"			\
114 	"mtdspi=setenv mtdparts ${mtdparts}"				\
115 		"';spi2.0:1024k(bootloader),"				\
116 			"64k(env1),64k(env2),-(rescue)'\0"		\
117 	"bootcmd=if test -n ${rescue};"					\
118 		"then run swupdate;fi;run nandboot;run swupdate\0"	\
119 	"bootfile=uImage\0"						\
120 	"bootimage=uImage\0"						\
121 	"console=ttymxc3\0"						\
122 	"fdt_addr_r=0x18000000\0"					\
123 	"fdt_file=pfla02.dtb\0"						\
124 	"fdt_high=0xffffffff\0"						\
125 	"initrd_high=0xffffffff\0"					\
126 	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"		\
127 	"miscargs=panic=1 quiet\0"					\
128 	"mmcargs=setenv bootargs root=${mmcroot} rw rootwait\0"		\
129 	"mmcboot=if run mmcload;then "					\
130 		"run mmcargs addcons addmisc;"				\
131 			"bootm;fi\0"					\
132 	"mmcload=mmc rescan;"						\
133 		"load mmc 0:${mmcpart} ${kernel_addr_r} boot/fitImage\0"\
134 	"mmcpart=1\0"							\
135 	"mmcroot=/dev/mmcblk0p1\0"					\
136 	"ubiroot=1\0"							\
137 	"nandargs=setenv bootargs ubi.mtd=1 "				\
138 		"root=ubi0:rootfs${ubiroot} rootfstype=ubifs\0"		\
139 	"nandboot=run mtdnand;ubi part nand0,0;"			\
140 		"ubi readvol ${kernel_addr_r} kernel${ubiroot};"	\
141 		"run nandargs addip addcons addmtd addmisc;"		\
142 		"bootm ${kernel_addr_r}\0"				\
143 	"net_nfs=tftp ${kernel_addr_r} ${board_name}/${bootfile};"	\
144 		"tftp ${fdt_addr_r} ${board_name}/${fdt_file};"		\
145 		"run nfsargs addip addcons addmtd addmisc;"		\
146 		"bootm ${kernel_addr_r} - ${fdt_addr_r}\0"		\
147 	"net_nfs_fit=tftp ${kernel_addr_r} ${board_name}/${fitfile};"	\
148 		"run nfsargs addip addcons addmtd addmisc;"		\
149 		"bootm ${kernel_addr_r}\0"				\
150 	"nfsargs=setenv bootargs root=/dev/nfs"				\
151 		" nfsroot=${serverip}:${nfsroot},v3 panic=1\0"		\
152 	"swupdate=setenv bootargs root=/dev/ram;"			\
153 		"run addip addcons addmtd addmisc;"			\
154 		"sf probe;"						\
155 		"sf read ${kernel_addr_r} 120000 600000;"		\
156 		"sf read 14000000 730000 800000;"			\
157 		"bootm ${kernel_addr_r} 14000000\0"
158 
159 #endif
160