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