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 */
19 #ifndef CONFIG_SPL_BUILD
20 # define CONFIG_TIMESTAMP
23 #define CONFIG_SYS_BOOTM_LEN (16 << 20)
26 #define V_OSCK 24000000 /* Clock output from T2 */
27 #define V_SCLK (V_OSCK)
29 #define CONFIG_HSMMC2_8BIT
31 #ifndef CONFIG_SHC_ICT
33 * In builds other than ICT, reset to retry after timeout
34 * Define a timeout after which a stopped bootloader continues autoboot
35 * (only works with CONFIG_RESET_TO_RETRY)
37 # define CONFIG_BOOT_RETRY_TIME 30
38 # define CONFIG_RESET_TO_RETRY
41 #ifndef CONFIG_SPL_BUILD
42 #define CONFIG_EXTRA_ENV_SETTINGS \
43 "loadaddr=0x80200000\0" \
44 "kloadaddr=0x84000000\0" \
45 "fdtaddr=0x85000000\0" \
46 "fdt_high=0xffffffff\0" \
47 "rdaddr=0x81000000\0" \
49 "fdtfile=am335x-shc.dtb\0" \
51 "serverip=10.55.152.184\0" \
52 "rootpath=/srv/nfs/shc-rootfs\0" \
53 "console=ttyO0,115200n8\0" \
58 "active_root=root1\0" \
59 "inactive_root=root2\0" \
60 "mmcrootfstype=ext4 rootwait\0" \
62 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
65 "bootargs_defaults=setenv bootargs " \
66 "console=${console} " \
68 "mmcargs=run bootargs_defaults;" \
69 "setenv bootargs ${bootargs} " \
71 "rootfstype=${mmcrootfstype} ip=${ip_method}\0" \
72 "netargs=setenv bootargs console=${console} " \
75 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
77 "bootenv=uEnv.txt\0" \
78 "loadbootenv=if fatload mmc ${mmcdev} ${loadaddr} ${bootenv}; then " \
79 "echo Loaded environment from ${bootenv}; " \
80 "run importbootenv; " \
82 "importbootenv=echo Importing environment variables from uEnv.txt ...; " \
83 "env import -t $loadaddr $filesize\0" \
84 "loaduimagefat=fatload mmc ${mmcdev} ${kloadaddr} ${bootfile}\0" \
85 "loaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${kloadaddr} /boot/${bootfile}\0" \
86 "loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /boot/${fdtfile}\0" \
87 "netloaduimage=tftp ${loadaddr} ${bootfile}\0" \
88 "netloadfdt=tftp ${fdtaddr} ${fdtfile}\0" \
89 "mmcboot=echo Booting Linux from ${mmcdevice} ...; " \
91 "if run loadfdt; then " \
92 "echo device tree detected; " \
93 "bootm ${kloadaddr} - ${fdtaddr}; " \
95 "bootm ${kloadaddr}; " \
97 "netboot=echo Booting from network ...; " \
98 "setenv autoload no; " \
100 "run netloaduimage; " \
102 "echo NFS path: ${serverip}:${rootpath};" \
103 "if run netloadfdt; then " \
104 "echo device tree detected; " \
105 "bootm ${loadaddr} - ${fdtaddr}; " \
107 "bootm ${loadaddr}; " \
109 "emmc_erase=if test ${harakiri} = 1 ; then echo erase emmc ...; setenv mmcdev 1; mmc erase 0 200; reset; fi; \0" \
110 "mmcpart_gp=mmcpart gp 1 40; \0" \
111 "mmcpart_enhance=mmcpart enhance 0 64; \0" \
112 "mmcpart_rel_write=mmcpart rel_write 1f; \0" \
113 "mmcpart_commit=mmcpart commit 1; \0" \
114 "mmc_hw_part=run mmcpart_gp; run mmcpart_enhance; run mmcpart_rel_write; run mmcpart_commit; \0" \
115 "led_success=gpio set 22; \0" \
116 "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" \
117 "uenv_exec=if test -n $uenvcmd; then " \
118 "echo Running uenvcmd ...; " \
121 "sd_setup=echo SD/MMC-Card detected on device 0; " \
122 "setenv mmcdevice SD; " \
123 "setenv mmcdev 0; " \
124 "setenv mmcpart 2; " \
125 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0" \
126 "emmc_setup=echo eMMC detected on device 1; " \
127 "setenv mmcdevice eMMC; " \
128 "setenv mmcdev 1; " \
130 "if test ${active_root} = root2; then " \
131 "echo Active root is partition 6 (root2); " \
132 "setenv mmcpart 6; " \
134 "echo Active root is partition 5 (root1); " \
135 "setenv mmcpart 5; " \
137 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0"
138 #endif /* #ifndef CONFIG_SPL_BUILD */
140 #if defined CONFIG_SHC_NETBOOT
142 # define CONFIG_BOOTCOMMAND \
144 "if run netboot; then " \
145 "echo Booting from network; " \
147 "echo ERROR: Cannot boot from network!; " \
151 #elif defined CONFIG_SHC_SDBOOT /* !defined CONFIG_SHC_NETBOOT */
153 # define CONFIG_BOOTCOMMAND \
154 "if mmc dev 0; mmc rescan; then " \
157 "echo ERROR: SD/MMC-Card not detected!; " \
160 "if run loaduimage; then " \
161 "echo Bootable SD/MMC-Card inserted, booting from it!; " \
164 "echo ERROR: Unable to load uImage from SD/MMC-Card!; " \
168 #elif defined CONFIG_SHC_ICT
169 /* ICT adapter boots only u-boot and does HW partitioning */
170 # define CONFIG_BOOTCOMMAND \
171 "if mmc dev 0; mmc rescan; then " \
174 "echo ERROR: SD/MMC-Card not detected!; " \
179 #else /* !defined CONFIG_SHC_NETBOOT, !defined CONFIG_SHC_SDBOOT */
180 /* Regular Boot from internal eMMC */
181 # define CONFIG_BOOTCOMMAND \
182 "if mmc dev 1; mmc rescan; then " \
185 "echo ERROR: eMMC device not detected!; " \
188 "if run loaduimage; then " \
191 "echo ERROR Unable to load uImage from eMMC!; " \
192 "echo Performing Rollback!; " \
193 "setenv _active_ ${active_root}; " \
194 "setenv _inactive_ ${inactive_root}; " \
195 "setenv active_root ${_inactive_}; " \
196 "setenv inactive_root ${_active_}; " \
201 #endif /* Regular Boot */
203 /* NS16550 Configuration */
204 #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
205 #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
206 #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
207 #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
208 #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
209 #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
212 #define CONFIG_POWER_TPS65217
217 * Disable MMC DM for SPL build and can be re-enabled after adding
220 #ifdef CONFIG_SPL_BUILD
225 #define CONFIG_NET_RETRY_COUNT 10
227 /* I2C configuration */
228 #define CONFIG_SYS_I2C_SPEED 400000
229 #define CONFIG_SYS_I2C_SLAVE 1
230 #endif /* ! __CONFIG_AM335X_SHC_H */