1 /* SPDX-License-Identifier: GPL-2.0+ */
4 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
9 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
12 #ifndef __CONFIG_AM335X_SHC_H
13 #define __CONFIG_AM335X_SHC_H
15 #include <configs/ti_am335x_common.h>
17 /* settings we don;t want on this board */
20 #define CONFIG_CMD_CACHE
22 #ifndef CONFIG_SPL_BUILD
23 # define CONFIG_TIMESTAMP
26 #define CONFIG_SYS_BOOTM_LEN (16 << 20)
29 #define V_OSCK 24000000 /* Clock output from T2 */
30 #define V_SCLK (V_OSCK)
33 * in case of SD Card or Network boot we want to have a possibility to
34 * debrick the shc, therefore do not read environment from eMMC
36 #if defined(CONFIG_SHC_SDBOOT) || defined(CONFIG_SHC_NETBOOT)
37 #define CONFIG_SYS_MMC_ENV_DEV 0
39 #define CONFIG_SYS_MMC_ENV_DEV 1
43 * Info when using boot partitions: As environment resides within first
44 * 128 kB, MLO must start at 128 kB == 0x20000
45 * ENV at MMC Boot0 Partition - 0/Undefined=user, 1=boot0, 2=boot1,
48 #define CONFIG_ENV_SIZE 0x1000 /* 4 KB */
49 #define CONFIG_ENV_OFFSET 0x7000 /* 28 kB */
51 #define CONFIG_HSMMC2_8BIT
53 #define CONFIG_ENV_OFFSET_REDUND 0x9000 /* 36 kB */
54 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
56 #ifndef CONFIG_SHC_ICT
58 * In builds other than ICT, reset to retry after timeout
59 * Define a timeout after which a stopped bootloader continues autoboot
60 * (only works with CONFIG_RESET_TO_RETRY)
62 # define CONFIG_BOOT_RETRY_TIME 30
63 # define CONFIG_RESET_TO_RETRY
66 #ifndef CONFIG_SPL_BUILD
67 #define CONFIG_EXTRA_ENV_SETTINGS \
68 "loadaddr=0x80200000\0" \
69 "kloadaddr=0x84000000\0" \
70 "fdtaddr=0x85000000\0" \
71 "fdt_high=0xffffffff\0" \
72 "rdaddr=0x81000000\0" \
74 "fdtfile=am335x-shc.dtb\0" \
76 "serverip=10.55.152.184\0" \
77 "rootpath=/srv/nfs/shc-rootfs\0" \
78 "console=ttyO0,115200n8\0" \
83 "active_root=root1\0" \
84 "inactive_root=root2\0" \
85 "mmcrootfstype=ext4 rootwait\0" \
87 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
90 "bootargs_defaults=setenv bootargs " \
91 "console=${console} " \
93 "mmcargs=run bootargs_defaults;" \
94 "setenv bootargs ${bootargs} " \
96 "rootfstype=${mmcrootfstype} ip=${ip_method}\0" \
97 "netargs=setenv bootargs console=${console} " \
100 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
102 "bootenv=uEnv.txt\0" \
103 "loadbootenv=if fatload mmc ${mmcdev} ${loadaddr} ${bootenv}; then " \
104 "echo Loaded environment from ${bootenv}; " \
105 "run importbootenv; " \
107 "importbootenv=echo Importing environment variables from uEnv.txt ...; " \
108 "env import -t $loadaddr $filesize\0" \
109 "loaduimagefat=fatload mmc ${mmcdev} ${kloadaddr} ${bootfile}\0" \
110 "loaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${kloadaddr} /boot/${bootfile}\0" \
111 "loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /boot/${fdtfile}\0" \
112 "netloaduimage=tftp ${loadaddr} ${bootfile}\0" \
113 "netloadfdt=tftp ${fdtaddr} ${fdtfile}\0" \
114 "mmcboot=echo Booting Linux from ${mmcdevice} ...; " \
116 "if run loadfdt; then " \
117 "echo device tree detected; " \
118 "bootm ${kloadaddr} - ${fdtaddr}; " \
120 "bootm ${kloadaddr}; " \
122 "netboot=echo Booting from network ...; " \
123 "setenv autoload no; " \
125 "run netloaduimage; " \
127 "echo NFS path: ${serverip}:${rootpath};" \
128 "if run netloadfdt; then " \
129 "echo device tree detected; " \
130 "bootm ${loadaddr} - ${fdtaddr}; " \
132 "bootm ${loadaddr}; " \
134 "emmc_erase=if test ${harakiri} = 1 ; then echo erase emmc ...; setenv mmcdev 1; mmc erase 0 200; reset; fi; \0" \
135 "mmcpart_gp=mmcpart gp 1 40; \0" \
136 "mmcpart_enhance=mmcpart enhance 0 64; \0" \
137 "mmcpart_rel_write=mmcpart rel_write 1f; \0" \
138 "mmcpart_commit=mmcpart commit 1; \0" \
139 "mmc_hw_part=run mmcpart_gp; run mmcpart_enhance; run mmcpart_rel_write; run mmcpart_commit; \0" \
140 "led_success=gpio set 22; \0" \
141 "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" \
142 "uenv_exec=if test -n $uenvcmd; then " \
143 "echo Running uenvcmd ...; " \
146 "sd_setup=echo SD/MMC-Card detected on device 0; " \
147 "setenv mmcdevice SD; " \
148 "setenv mmcdev 0; " \
149 "setenv mmcpart 2; " \
150 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0" \
151 "emmc_setup=echo eMMC detected on device 1; " \
152 "setenv mmcdevice eMMC; " \
153 "setenv mmcdev 1; " \
155 "if test ${active_root} = root2; then " \
156 "echo Active root is partition 6 (root2); " \
157 "setenv mmcpart 6; " \
159 "echo Active root is partition 5 (root1); " \
160 "setenv mmcpart 5; " \
162 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0"
163 #endif /* #ifndef CONFIG_SPL_BUILD */
165 #if defined CONFIG_SHC_NETBOOT
167 # define CONFIG_BOOTCOMMAND \
169 "if run netboot; then " \
170 "echo Booting from network; " \
172 "echo ERROR: Cannot boot from network!; " \
176 #elif defined CONFIG_SHC_SDBOOT /* !defined CONFIG_SHC_NETBOOT */
178 # define CONFIG_BOOTCOMMAND \
179 "if mmc dev 0; mmc rescan; then " \
182 "echo ERROR: SD/MMC-Card not detected!; " \
185 "if run loaduimage; then " \
186 "echo Bootable SD/MMC-Card inserted, booting from it!; " \
189 "echo ERROR: Unable to load uImage from SD/MMC-Card!; " \
193 #elif defined CONFIG_SHC_ICT
194 /* ICT adapter boots only u-boot and does HW partitioning */
195 # define CONFIG_BOOTCOMMAND \
196 "if mmc dev 0; mmc rescan; then " \
199 "echo ERROR: SD/MMC-Card not detected!; " \
204 #else /* !defined CONFIG_SHC_NETBOOT, !defined CONFIG_SHC_SDBOOT */
205 /* Regular Boot from internal eMMC */
206 # define CONFIG_BOOTCOMMAND \
207 "if mmc dev 1; mmc rescan; then " \
210 "echo ERROR: eMMC device not detected!; " \
213 "if run loaduimage; then " \
216 "echo ERROR Unable to load uImage from eMMC!; " \
217 "echo Performing Rollback!; " \
218 "setenv _active_ ${active_root}; " \
219 "setenv _inactive_ ${inactive_root}; " \
220 "setenv active_root ${_inactive_}; " \
221 "setenv inactive_root ${_active_}; " \
226 #endif /* Regular Boot */
228 /* NS16550 Configuration */
229 #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
230 #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
231 #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
232 #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
233 #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
234 #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
237 #define CONFIG_POWER_TPS65217
242 * Disable MMC DM for SPL build and can be re-enabled after adding
245 #ifdef CONFIG_SPL_BUILD
250 #define CONFIG_BOOTP_DEFAULT
251 #define CONFIG_BOOTP_DNS2
252 #define CONFIG_BOOTP_SEND_HOSTNAME
253 #define CONFIG_NET_RETRY_COUNT 10
254 #define CONFIG_PHY_SMSC
256 /* I2C configuration */
257 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
258 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
259 #define CONFIG_SYS_I2C_SPEED 400000
260 #define CONFIG_SYS_I2C_SLAVE 1
262 #define CONFIG_SHOW_BOOT_PROGRESS
263 #endif /* ! __CONFIG_AM335X_SHC_H */