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
24 #define CONFIG_CMD_CACHE
26 #ifndef CONFIG_SPL_BUILD
27 # define CONFIG_TIMESTAMP
30 #define CONFIG_SYS_BOOTM_LEN (16 << 20)
33 #define V_OSCK 24000000 /* Clock output from T2 */
34 #define V_SCLK (V_OSCK)
37 * in case of SD Card or Network boot we want to have a possibility to
38 * debrick the shc, therefore do not read environment from eMMC
40 #if defined(CONFIG_SHC_SDBOOT) || defined(CONFIG_SHC_NETBOOT)
41 #define CONFIG_SYS_MMC_ENV_DEV 0
43 #define CONFIG_SYS_MMC_ENV_DEV 1
47 * Info when using boot partitions: As environment resides within first
48 * 128 kB, MLO must start at 128 kB == 0x20000
49 * ENV at MMC Boot0 Partition - 0/Undefined=user, 1=boot0, 2=boot1,
52 #define CONFIG_ENV_SIZE 0x1000 /* 4 KB */
53 #define CONFIG_ENV_OFFSET 0x7000 /* 28 kB */
55 #define CONFIG_HSMMC2_8BIT
57 #define CONFIG_ENV_OFFSET_REDUND 0x9000 /* 36 kB */
58 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
60 #ifndef CONFIG_SHC_ICT
62 * In builds other than ICT, reset to retry after timeout
63 * Define a timeout after which a stopped bootloader continues autoboot
64 * (only works with CONFIG_RESET_TO_RETRY)
66 # define CONFIG_BOOT_RETRY_TIME 30
67 # define CONFIG_RESET_TO_RETRY
70 #define CONFIG_ENV_VARS_UBOOT_CONFIG
71 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
73 #ifndef CONFIG_SPL_BUILD
74 #define CONFIG_EXTRA_ENV_SETTINGS \
75 "loadaddr=0x80200000\0" \
76 "kloadaddr=0x84000000\0" \
77 "fdtaddr=0x85000000\0" \
78 "fdt_high=0xffffffff\0" \
79 "rdaddr=0x81000000\0" \
81 "fdtfile=am335x-shc.dtb\0" \
83 "serverip=10.55.152.184\0" \
84 "rootpath=/srv/nfs/shc-rootfs\0" \
85 "console=ttyO0,115200n8\0" \
90 "active_root=root1\0" \
91 "inactive_root=root2\0" \
92 "mmcrootfstype=ext4 rootwait\0" \
94 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
97 "bootargs_defaults=setenv bootargs " \
98 "console=${console} " \
100 "mmcargs=run bootargs_defaults;" \
101 "setenv bootargs ${bootargs} " \
103 "rootfstype=${mmcrootfstype} ip=${ip_method}\0" \
104 "netargs=setenv bootargs console=${console} " \
107 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
109 "bootenv=uEnv.txt\0" \
110 "loadbootenv=if fatload mmc ${mmcdev} ${loadaddr} ${bootenv}; then " \
111 "echo Loaded environment from ${bootenv}; " \
112 "run importbootenv; " \
114 "importbootenv=echo Importing environment variables from uEnv.txt ...; " \
115 "env import -t $loadaddr $filesize\0" \
116 "loaduimagefat=fatload mmc ${mmcdev} ${kloadaddr} ${bootfile}\0" \
117 "loaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${kloadaddr} /boot/${bootfile}\0" \
118 "loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /boot/${fdtfile}\0" \
119 "netloaduimage=tftp ${loadaddr} ${bootfile}\0" \
120 "netloadfdt=tftp ${fdtaddr} ${fdtfile}\0" \
121 "mmcboot=echo Booting Linux from ${mmcdevice} ...; " \
123 "if run loadfdt; then " \
124 "echo device tree detected; " \
125 "bootm ${kloadaddr} - ${fdtaddr}; " \
127 "bootm ${kloadaddr}; " \
129 "netboot=echo Booting from network ...; " \
130 "setenv autoload no; " \
132 "run netloaduimage; " \
134 "echo NFS path: ${serverip}:${rootpath};" \
135 "if run netloadfdt; then " \
136 "echo device tree detected; " \
137 "bootm ${loadaddr} - ${fdtaddr}; " \
139 "bootm ${loadaddr}; " \
141 "emmc_erase=if test ${harakiri} = 1 ; then echo erase emmc ...; setenv mmcdev 1; mmc erase 0 200; reset; fi; \0" \
142 "mmcpart_gp=mmcpart gp 1 40; \0" \
143 "mmcpart_enhance=mmcpart enhance 0 64; \0" \
144 "mmcpart_rel_write=mmcpart rel_write 1f; \0" \
145 "mmcpart_commit=mmcpart commit 1; \0" \
146 "mmc_hw_part=run mmcpart_gp; run mmcpart_enhance; run mmcpart_rel_write; run mmcpart_commit; \0" \
147 "led_success=gpio set 22; \0" \
148 "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" \
149 "uenv_exec=if test -n $uenvcmd; then " \
150 "echo Running uenvcmd ...; " \
153 "sd_setup=echo SD/MMC-Card detected on device 0; " \
154 "setenv mmcdevice SD; " \
155 "setenv mmcdev 0; " \
156 "setenv mmcpart 2; " \
157 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0" \
158 "emmc_setup=echo eMMC detected on device 1; " \
159 "setenv mmcdevice eMMC; " \
160 "setenv mmcdev 1; " \
162 "if test ${active_root} = root2; then " \
163 "echo Active root is partition 6 (root2); " \
164 "setenv mmcpart 6; " \
166 "echo Active root is partition 5 (root1); " \
167 "setenv mmcpart 5; " \
169 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0"
170 #endif /* #ifndef CONFIG_SPL_BUILD */
172 #if defined CONFIG_SHC_NETBOOT
174 # define CONFIG_BOOTCOMMAND \
176 "if run netboot; then " \
177 "echo Booting from network; " \
179 "echo ERROR: Cannot boot from network!; " \
183 #elif defined CONFIG_SHC_SDBOOT /* !defined CONFIG_SHC_NETBOOT */
185 # define CONFIG_BOOTCOMMAND \
186 "if mmc dev 0; mmc rescan; then " \
189 "echo ERROR: SD/MMC-Card not detected!; " \
192 "if run loaduimage; then " \
193 "echo Bootable SD/MMC-Card inserted, booting from it!; " \
196 "echo ERROR: Unable to load uImage from SD/MMC-Card!; " \
200 #elif defined CONFIG_SHC_ICT
201 /* ICT adapter boots only u-boot and does HW partitioning */
202 # define CONFIG_BOOTCOMMAND \
203 "if mmc dev 0; mmc rescan; then " \
206 "echo ERROR: SD/MMC-Card not detected!; " \
211 #else /* !defined CONFIG_SHC_NETBOOT, !defined CONFIG_SHC_SDBOOT */
212 /* Regular Boot from internal eMMC */
213 # define CONFIG_BOOTCOMMAND \
214 "if mmc dev 1; mmc rescan; then " \
217 "echo ERROR: eMMC device not detected!; " \
220 "if run loaduimage; then " \
223 "echo ERROR Unable to load uImage from eMMC!; " \
224 "echo Performing Rollback!; " \
225 "setenv _active_ ${active_root}; " \
226 "setenv _inactive_ ${inactive_root}; " \
227 "setenv active_root ${_inactive_}; " \
228 "setenv inactive_root ${_active_}; " \
233 #endif /* Regular Boot */
235 /* NS16550 Configuration */
236 #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
237 #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
238 #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
239 #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
240 #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
241 #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
242 #define CONFIG_CONS_INDEX 1
245 #define CONFIG_POWER_TPS65217
249 #ifndef CONFIG_SPL_USBETH_SUPPORT
250 #define CONFIG_FASTBOOT_FLASH_MMC_DEV 1
254 * Disable MMC DM for SPL build and can be re-enabled after adding
257 #ifdef CONFIG_SPL_BUILD
262 #define CONFIG_CMD_DHCP
263 #define CONFIG_CMD_PING
264 #define CONFIG_DRIVER_TI_CPSW
266 #define CONFIG_BOOTP_DEFAULT
267 #define CONFIG_BOOTP_DNS
268 #define CONFIG_BOOTP_DNS2
269 #define CONFIG_BOOTP_SEND_HOSTNAME
270 #define CONFIG_BOOTP_GATEWAY
271 #define CONFIG_BOOTP_SUBNETMASK
272 #define CONFIG_NET_RETRY_COUNT 10
273 #define CONFIG_NET_MULTI
274 #define CONFIG_PHY_ADDR 0
275 #define CONFIG_PHY_SMSC
277 /* I2C configuration */
278 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
279 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
280 #define CONFIG_SYS_I2C_SPEED 400000
281 #define CONFIG_SYS_I2C_SLAVE 1
283 #define CONFIG_SHOW_BOOT_PROGRESS
284 #endif /* ! __CONFIG_AM335X_SHC_H */