3 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
8 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
10 * SPDX-License-Identifier: GPL-2.0+
13 #ifndef __CONFIG_AM335X_SHC_H
14 #define __CONFIG_AM335X_SHC_H
16 #include <configs/ti_am335x_common.h>
18 /* settings we don;t want on this board */
19 #undef CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC
20 #undef CONFIG_CMD_EXT4
21 #undef CONFIG_CMD_EXT4_WRITE
22 #undef CONFIG_CMD_MMC_SPI
26 #define CONFIG_CMD_CACHE
28 #ifndef CONFIG_SPL_BUILD
29 # define CONFIG_TIMESTAMP
33 #define CONFIG_SYS_BOOTM_LEN (16 << 20)
35 #define MACH_TYPE_BOSCH_SHC_B 9001
36 #define MACH_TYPE_BOSCH_SHC_B2 9002
37 #define MACH_TYPE_BOSCH_SHC_C 9003
38 #define MACH_TYPE_BOSCH_SHC_C2 9004
39 #define MACH_TYPE_BOSCH_SHC_C3 9005
40 #define MACH_TYPE_BOSCH_SHC 9006
41 #ifdef CONFIG_B_SAMPLE
42 # define CONFIG_MACH_TYPE MACH_TYPE_BOSCH_SHC_B
43 #elif defined CONFIG_B2_SAMPLE
44 # define CONFIG_MACH_TYPE MACH_TYPE_BOSCH_SHC_B2
45 #elif defined CONFIG_C_SAMPLE
46 # define CONFIG_MACH_TYPE MACH_TYPE_BOSCH_SHC_C
47 #elif defined CONFIG_C2_SAMPLE
48 # define CONFIG_MACH_TYPE MACH_TYPE_BOSCH_SHC_C2
49 #elif defined CONFIG_C3_SAMPLE
50 # define CONFIG_MACH_TYPE MACH_TYPE_BOSCH_SHC_C3
51 #elif defined CONFIG_SERIES
52 # define CONFIG_MACH_TYPE MACH_TYPE_BOSCH_SHC
53 #endif /* #ifdef CONFIG_B_SAMPLE */
55 #define CONFIG_BOARD_LATE_INIT
58 #define V_OSCK 24000000 /* Clock output from T2 */
59 #define V_SCLK (V_OSCK)
61 #define CONFIG_ENV_IS_IN_MMC 1
64 * in case of SD Card or Network boot we want to have a possibility to
65 * debrick the shc, therefore do not read environment from eMMC
67 #if defined(CONFIG_SHC_SDBOOT) || defined(CONFIG_SHC_NETBOOT)
68 #define CONFIG_SYS_MMC_ENV_DEV 0
70 #define CONFIG_SYS_MMC_ENV_DEV 1
74 * Info when using boot partitions: As environment resides within first
75 * 128 kB, MLO must start at 128 kB == 0x20000
76 * ENV at MMC Boot0 Partition - 0/Undefined=user, 1=boot0, 2=boot1,
79 #define CONFIG_ENV_SIZE 0x1000 /* 4 KB */
80 #define CONFIG_ENV_OFFSET 0x7000 /* 28 kB */
82 #define CONFIG_HSMMC2_8BIT
84 #define CONFIG_ENV_OFFSET_REDUND 0x9000 /* 36 kB */
85 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
87 /* Enhance our eMMC support / experience. */
88 #define CONFIG_CMD_GPT
89 #define CONFIG_EFI_PARTITION
90 #ifdef CONFIG_SPL_BUILD
91 #undef CONFIG_ISO_PARTITION
93 #ifndef CONFIG_SHC_ICT
95 * In builds other than ICT, reset to retry after timeout
96 * Define a timeout after which a stopped bootloader continues autoboot
97 * (only works with CONFIG_RESET_TO_RETRY)
99 # define CONFIG_BOOT_RETRY_TIME 30
100 # define CONFIG_RESET_TO_RETRY
103 #define CONFIG_ENV_VARS_UBOOT_CONFIG
104 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
106 #ifndef CONFIG_SPL_BUILD
107 #define CONFIG_EXTRA_ENV_SETTINGS \
108 "loadaddr=0x80200000\0" \
109 "kloadaddr=0x84000000\0" \
110 "fdtaddr=0x85000000\0" \
111 "fdt_high=0xffffffff\0" \
112 "rdaddr=0x81000000\0" \
113 "bootfile=uImage\0" \
114 "fdtfile=am335x-shc.dtb\0" \
116 "serverip=10.55.152.184\0" \
117 "rootpath=/srv/nfs/shc-rootfs\0" \
118 "console=ttyO0,115200n8\0" \
123 "active_root=root1\0" \
124 "inactive_root=root2\0" \
125 "mmcrootfstype=ext4 rootwait\0" \
127 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
130 "bootargs_defaults=setenv bootargs " \
131 "console=${console} " \
133 "mmcargs=run bootargs_defaults;" \
134 "setenv bootargs ${bootargs} " \
136 "rootfstype=${mmcrootfstype} ip=${ip_method}\0" \
137 "netargs=setenv bootargs console=${console} " \
140 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
142 "bootenv=uEnv.txt\0" \
143 "loadbootenv=if fatload mmc ${mmcdev} ${loadaddr} ${bootenv}; then " \
144 "echo Loaded environment from ${bootenv}; " \
145 "run importbootenv; " \
147 "importbootenv=echo Importing environment variables from uEnv.txt ...; " \
148 "env import -t $loadaddr $filesize\0" \
149 "loaduimagefat=fatload mmc ${mmcdev} ${kloadaddr} ${bootfile}\0" \
150 "loaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${kloadaddr} /boot/${bootfile}\0" \
151 "loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /boot/${fdtfile}\0" \
152 "netloaduimage=tftp ${loadaddr} ${bootfile}\0" \
153 "netloadfdt=tftp ${fdtaddr} ${fdtfile}\0" \
154 "mmcboot=echo Booting Linux from ${mmcdevice} ...; " \
156 "if run loadfdt; then " \
157 "echo device tree detected; " \
158 "bootm ${kloadaddr} - ${fdtaddr}; " \
160 "bootm ${kloadaddr}; " \
162 "netboot=echo Booting from network ...; " \
163 "setenv autoload no; " \
165 "run netloaduimage; " \
167 "echo NFS path: ${serverip}:${rootpath};" \
168 "if run netloadfdt; then " \
169 "echo device tree detected; " \
170 "bootm ${loadaddr} - ${fdtaddr}; " \
172 "bootm ${loadaddr}; " \
174 "emmc_erase=if test ${harakiri} = 1 ; then echo erase emmc ...; setenv mmcdev 1; mmc erase 0 200; reset; fi; \0" \
175 "mmcpart_gp=mmcpart gp 1 40; \0" \
176 "mmcpart_enhance=mmcpart enhance 0 64; \0" \
177 "mmcpart_rel_write=mmcpart rel_write 1f; \0" \
178 "mmcpart_commit=mmcpart commit 1; \0" \
179 "mmc_hw_part=run mmcpart_gp; run mmcpart_enhance; run mmcpart_rel_write; run mmcpart_commit; \0" \
180 "led_success=gpio set 22; \0" \
181 "fusecmd=mmc dev 1; if mmcpart iscommitted; then echo HW Partitioning already committed; mmcpart list; else run mmc_hw_part; fi; run led_success; \0" \
182 "uenv_exec=if test -n $uenvcmd; then " \
183 "echo Running uenvcmd ...; " \
186 "sd_setup=echo SD/MMC-Card detected on device 0; " \
187 "setenv mmcdevice SD; " \
188 "setenv mmcdev 0; " \
189 "setenv mmcpart 2; " \
190 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0" \
191 "emmc_setup=echo eMMC detected on device 1; " \
192 "setenv mmcdevice eMMC; " \
193 "setenv mmcdev 1; " \
195 "if test ${active_root} = root2; then " \
196 "echo Active root is partition 6 (root2); " \
197 "setenv mmcpart 6; " \
199 "echo Active root is partition 5 (root1); " \
200 "setenv mmcpart 5; " \
202 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0"
203 #endif /* #ifndef CONFIG_SPL_BUILD */
205 #if defined CONFIG_SHC_NETBOOT
207 # define CONFIG_BOOTCOMMAND \
209 "if run netboot; then " \
210 "echo Booting from network; " \
212 "echo ERROR: Cannot boot from network!; " \
216 #elif defined CONFIG_SHC_SDBOOT /* !defined CONFIG_SHC_NETBOOT */
218 # define CONFIG_BOOTCOMMAND \
219 "if mmc dev 0; mmc rescan; then " \
222 "echo ERROR: SD/MMC-Card not detected!; " \
225 "if run loaduimage; then " \
226 "echo Bootable SD/MMC-Card inserted, booting from it!; " \
229 "echo ERROR: Unable to load uImage from SD/MMC-Card!; " \
233 #elif defined CONFIG_SHC_ICT
234 /* ICT adapter boots only u-boot and does HW partitioning */
235 # define CONFIG_BOOTCOMMAND \
236 "if mmc dev 0; mmc rescan; then " \
239 "echo ERROR: SD/MMC-Card not detected!; " \
244 #else /* !defined CONFIG_SHC_NETBOOT, !defined CONFIG_SHC_SDBOOT */
245 /* Regular Boot from internal eMMC */
246 # define CONFIG_BOOTCOMMAND \
247 "if mmc dev 1; mmc rescan; then " \
250 "echo ERROR: eMMC device not detected!; " \
253 "if run loaduimage; then " \
256 "echo ERROR Unable to load uImage from eMMC!; " \
257 "echo Performing Rollback!; " \
258 "setenv _active_ ${active_root}; " \
259 "setenv _inactive_ ${inactive_root}; " \
260 "setenv active_root ${_inactive_}; " \
261 "setenv inactive_root ${_active_}; " \
266 #endif /* Regular Boot */
268 /* NS16550 Configuration */
269 #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
270 #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
271 #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
272 #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
273 #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
274 #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
275 #define CONFIG_BAUDRATE 115200
276 #define CONFIG_CONS_INDEX 1
279 #define CONFIG_POWER_TPS65217
283 #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds"
285 #ifndef CONFIG_SPL_USBETH_SUPPORT
286 #define CONFIG_FASTBOOT_FLASH_MMC_DEV 1
290 * Disable MMC DM for SPL build and can be re-enabled after adding
293 #ifdef CONFIG_SPL_BUILD
298 #define CONFIG_CMD_DHCP
299 #define CONFIG_CMD_PING
300 #define CONFIG_DRIVER_TI_CPSW
302 #define CONFIG_BOOTP_DEFAULT
303 #define CONFIG_BOOTP_DNS
304 #define CONFIG_BOOTP_DNS2
305 #define CONFIG_BOOTP_SEND_HOSTNAME
306 #define CONFIG_BOOTP_GATEWAY
307 #define CONFIG_BOOTP_SUBNETMASK
308 #define CONFIG_NET_RETRY_COUNT 10
309 #define CONFIG_NET_MULTI
310 #define CONFIG_PHY_GIGE
311 #define CONFIG_PHYLIB
312 #define CONFIG_PHY_ADDR 0
313 #define CONFIG_PHY_SMSC
315 /* I2C configuration */
316 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
317 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
318 #define CONFIG_SYS_I2C_SPEED 400000
319 #define CONFIG_SYS_I2C_SLAVE 1
321 #define CONFIG_SHOW_BOOT_PROGRESS
323 #if defined CONFIG_SHC_NETBOOT
324 #ifdef CONFIG_SPL_BUILD
325 #define CONFIG_ENV_IS_NOWHERE
326 #undef CONFIG_ENV_IS_IN_MMC
329 #endif /* ! __CONFIG_AM335X_SHC_H */