xref: /openbmc/u-boot/include/configs/pfla02.h (revision fd0bc623)
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 IMX_FEC_BASE			ENET_BASE_ADDR
33 #define CONFIG_FEC_XCV_TYPE		RGMII
34 #define CONFIG_ETHPRIME			"FEC"
35 #define CONFIG_FEC_MXC_PHYADDR		3
36 
37 /* SPI Flash */
38 
39 /* I2C Configs */
40 #define CONFIG_SYS_I2C
41 #define CONFIG_SYS_I2C_MXC
42 #define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 0 */
43 #define CONFIG_SYS_I2C_SPEED		  100000
44 
45 #ifndef CONFIG_SPL_BUILD
46 #define CONFIG_CMD_NAND
47 /* Enable NAND support */
48 #define CONFIG_CMD_NAND_TRIMFFS
49 #define CONFIG_SYS_MAX_NAND_DEVICE	1
50 #define CONFIG_SYS_NAND_BASE		0x40000000
51 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
52 #define CONFIG_SYS_NAND_ONFI_DETECTION
53 #endif
54 
55 /* DMA stuff, needed for GPMI/MXS NAND support */
56 
57 /* Filesystem support */
58 
59 /* Various command support */
60 
61 /* Physical Memory Map */
62 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
63 
64 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
65 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
66 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
67 
68 #define CONFIG_SYS_INIT_SP_OFFSET \
69 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
70 #define CONFIG_SYS_INIT_SP_ADDR \
71 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
72 
73 /* MMC Configs */
74 #define CONFIG_SYS_FSL_ESDHC_ADDR	0
75 #define CONFIG_SYS_FSL_USDHC_NUM	2
76 
77 /* Environment organization */
78 #define CONFIG_ENV_IS_IN_SPI_FLASH
79 #define CONFIG_ENV_SIZE                (16 * 1024)
80 #define CONFIG_ENV_OFFSET		(1024 * SZ_1K)
81 #define CONFIG_ENV_SECT_SIZE		(64 * SZ_1K)
82 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
83 #define CONFIG_ENV_OFFSET_REDUND       (CONFIG_ENV_OFFSET + \
84 						CONFIG_ENV_SECT_SIZE)
85 #define CONFIG_ENV_SIZE_REDUND         CONFIG_ENV_SIZE
86 
87 #ifdef CONFIG_ENV_IS_IN_NAND
88 #define CONFIG_ENV_OFFSET              (0x1E0000)
89 #define CONFIG_ENV_SECT_SIZE           (128 * SZ_1K)
90 #endif
91 
92 /* Default environment */
93 #define CONFIG_EXTRA_ENV_SETTINGS \
94 	"addcons=setenv bootargs ${bootargs} "				\
95 		"console=${console},${baudrate}\0"			\
96 	"addip=setenv bootargs ${bootargs} "				\
97 		"ip=${ipaddr}:${serverip}:${gatewayip}:"		\
98 		"${netmask}:${hostname}:${netdev}:off\0"		\
99 	"addmisc=setenv bootargs ${bootargs} ${miscargs}\0"		\
100 	"addmtd=run mtdnand;run mtdspi;"				\
101 		"setenv bootargs ${bootargs} ${mtdparts}\0"		\
102 	"mtdnand=setenv mtdparts mtdparts=gpmi-nand:"			\
103 		"40m(Kernels),400m(root),-(nand)\0"			\
104 	"mtdspi=setenv mtdparts ${mtdparts}"				\
105 		"';spi2.0:1024k(bootloader),"				\
106 			"64k(env1),64k(env2),-(rescue)'\0"		\
107 	"bootcmd=if test -n ${rescue};"					\
108 		"then run swupdate;fi;run nandboot;run swupdate\0"	\
109 	"bootfile=uImage\0"						\
110 	"bootimage=uImage\0"						\
111 	"console=ttymxc3\0"						\
112 	"fdt_addr_r=0x18000000\0"					\
113 	"fdt_file=pfla02.dtb\0"						\
114 	"fdt_high=0xffffffff\0"						\
115 	"initrd_high=0xffffffff\0"					\
116 	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"		\
117 	"miscargs=panic=1 quiet\0"					\
118 	"mmcargs=setenv bootargs root=${mmcroot} rw rootwait\0"		\
119 	"mmcboot=if run mmcload;then "					\
120 		"run mmcargs addcons addmisc;"				\
121 			"bootm;fi\0"					\
122 	"mmcload=mmc rescan;"						\
123 		"load mmc 0:${mmcpart} ${kernel_addr_r} boot/fitImage\0"\
124 	"mmcpart=1\0"							\
125 	"mmcroot=/dev/mmcblk0p1\0"					\
126 	"ubiroot=1\0"							\
127 	"nandargs=setenv bootargs ubi.mtd=1 "				\
128 		"root=ubi0:rootfs${ubiroot} rootfstype=ubifs\0"		\
129 	"nandboot=run mtdnand;ubi part nand0,0;"			\
130 		"ubi readvol ${kernel_addr_r} kernel${ubiroot};"	\
131 		"run nandargs addip addcons addmtd addmisc;"		\
132 		"bootm ${kernel_addr_r}\0"				\
133 	"net_nfs=tftp ${kernel_addr_r} ${board_name}/${bootfile};"	\
134 		"tftp ${fdt_addr_r} ${board_name}/${fdt_file};"		\
135 		"run nfsargs addip addcons addmtd addmisc;"		\
136 		"bootm ${kernel_addr_r} - ${fdt_addr_r}\0"		\
137 	"net_nfs_fit=tftp ${kernel_addr_r} ${board_name}/${fitfile};"	\
138 		"run nfsargs addip addcons addmtd addmisc;"		\
139 		"bootm ${kernel_addr_r}\0"				\
140 	"nfsargs=setenv bootargs root=/dev/nfs"				\
141 		" nfsroot=${serverip}:${nfsroot},v3 panic=1\0"		\
142 	"swupdate=setenv bootargs root=/dev/ram;"			\
143 		"run addip addcons addmtd addmisc;"			\
144 		"sf probe;"						\
145 		"sf read ${kernel_addr_r} 120000 600000;"		\
146 		"sf read 14000000 730000 800000;"			\
147 		"bootm ${kernel_addr_r} 14000000\0"
148 
149 #endif
150