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