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