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_VERSION_VARIABLE
63 #define CONFIG_ENV_IS_IN_MMC 1
66 * in case of SD Card or Network boot we want to have a possibility to
67 * debrick the shc, therefore do not read environment from eMMC
69 #if defined(CONFIG_SHC_SDBOOT) || defined(CONFIG_SHC_NETBOOT)
70 #define CONFIG_SYS_MMC_ENV_DEV 0
72 #define CONFIG_SYS_MMC_ENV_DEV 1
76 * Info when using boot partitions: As environment resides within first
77 * 128 kB, MLO must start at 128 kB == 0x20000
78 * ENV at MMC Boot0 Partition - 0/Undefined=user, 1=boot0, 2=boot1,
81 #define CONFIG_ENV_SIZE 0x1000 /* 4 KB */
82 #define CONFIG_ENV_OFFSET 0x7000 /* 28 kB */
84 #define CONFIG_HSMMC2_8BIT
86 #define CONFIG_ENV_OFFSET_REDUND 0x9000 /* 36 kB */
87 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
89 /* Enhance our eMMC support / experience. */
90 #define CONFIG_CMD_GPT
91 #define CONFIG_EFI_PARTITION
92 #ifdef CONFIG_SPL_BUILD
93 #undef CONFIG_ISO_PARTITION
95 #ifndef CONFIG_SHC_ICT
97 * In builds other than ICT, reset to retry after timeout
98 * Define a timeout after which a stopped bootloader continues autoboot
99 * (only works with CONFIG_RESET_TO_RETRY)
101 # define CONFIG_BOOT_RETRY_TIME 30
102 # define CONFIG_RESET_TO_RETRY
105 #define CONFIG_ENV_VARS_UBOOT_CONFIG
106 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
108 #ifndef CONFIG_SPL_BUILD
109 #define CONFIG_EXTRA_ENV_SETTINGS \
110 "loadaddr=0x80200000\0" \
111 "kloadaddr=0x84000000\0" \
112 "fdtaddr=0x85000000\0" \
113 "fdt_high=0xffffffff\0" \
114 "rdaddr=0x81000000\0" \
115 "bootfile=uImage\0" \
116 "fdtfile=am335x-shc.dtb\0" \
118 "serverip=10.55.152.184\0" \
119 "rootpath=/srv/nfs/shc-rootfs\0" \
120 "console=ttyO0,115200n8\0" \
125 "active_root=root1\0" \
126 "inactive_root=root2\0" \
127 "mmcrootfstype=ext4 rootwait\0" \
129 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
132 "bootargs_defaults=setenv bootargs " \
133 "console=${console} " \
135 "mmcargs=run bootargs_defaults;" \
136 "setenv bootargs ${bootargs} " \
138 "rootfstype=${mmcrootfstype} ip=${ip_method}\0" \
139 "netargs=setenv bootargs console=${console} " \
142 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
144 "bootenv=uEnv.txt\0" \
145 "loadbootenv=if fatload mmc ${mmcdev} ${loadaddr} ${bootenv}; then " \
146 "echo Loaded environment from ${bootenv}; " \
147 "run importbootenv; " \
149 "importbootenv=echo Importing environment variables from uEnv.txt ...; " \
150 "env import -t $loadaddr $filesize\0" \
151 "loaduimagefat=fatload mmc ${mmcdev} ${kloadaddr} ${bootfile}\0" \
152 "loaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${kloadaddr} /boot/${bootfile}\0" \
153 "loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /boot/${fdtfile}\0" \
154 "netloaduimage=tftp ${loadaddr} ${bootfile}\0" \
155 "netloadfdt=tftp ${fdtaddr} ${fdtfile}\0" \
156 "mmcboot=echo Booting Linux from ${mmcdevice} ...; " \
158 "if run loadfdt; then " \
159 "echo device tree detected; " \
160 "bootm ${kloadaddr} - ${fdtaddr}; " \
162 "bootm ${kloadaddr}; " \
164 "netboot=echo Booting from network ...; " \
165 "setenv autoload no; " \
167 "run netloaduimage; " \
169 "echo NFS path: ${serverip}:${rootpath};" \
170 "if run netloadfdt; then " \
171 "echo device tree detected; " \
172 "bootm ${loadaddr} - ${fdtaddr}; " \
174 "bootm ${loadaddr}; " \
176 "emmc_erase=if test ${harakiri} = 1 ; then echo erase emmc ...; setenv mmcdev 1; mmc erase 0 200; reset; fi; \0" \
177 "mmcpart_gp=mmcpart gp 1 40; \0" \
178 "mmcpart_enhance=mmcpart enhance 0 64; \0" \
179 "mmcpart_rel_write=mmcpart rel_write 1f; \0" \
180 "mmcpart_commit=mmcpart commit 1; \0" \
181 "mmc_hw_part=run mmcpart_gp; run mmcpart_enhance; run mmcpart_rel_write; run mmcpart_commit; \0" \
182 "led_success=gpio set 22; \0" \
183 "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" \
184 "uenv_exec=if test -n $uenvcmd; then " \
185 "echo Running uenvcmd ...; " \
188 "sd_setup=echo SD/MMC-Card detected on device 0; " \
189 "setenv mmcdevice SD; " \
190 "setenv mmcdev 0; " \
191 "setenv mmcpart 2; " \
192 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0" \
193 "emmc_setup=echo eMMC detected on device 1; " \
194 "setenv mmcdevice eMMC; " \
195 "setenv mmcdev 1; " \
197 "if test ${active_root} = root2; then " \
198 "echo Active root is partition 6 (root2); " \
199 "setenv mmcpart 6; " \
201 "echo Active root is partition 5 (root1); " \
202 "setenv mmcpart 5; " \
204 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0"
205 #endif /* #ifndef CONFIG_SPL_BUILD */
207 #if defined CONFIG_SHC_NETBOOT
209 # define CONFIG_BOOTCOMMAND \
211 "if run netboot; then " \
212 "echo Booting from network; " \
214 "echo ERROR: Cannot boot from network!; " \
218 #elif defined CONFIG_SHC_SDBOOT /* !defined CONFIG_SHC_NETBOOT */
220 # define CONFIG_BOOTCOMMAND \
221 "if mmc dev 0; mmc rescan; then " \
224 "echo ERROR: SD/MMC-Card not detected!; " \
227 "if run loaduimage; then " \
228 "echo Bootable SD/MMC-Card inserted, booting from it!; " \
231 "echo ERROR: Unable to load uImage from SD/MMC-Card!; " \
235 #elif defined CONFIG_SHC_ICT
236 /* ICT adapter boots only u-boot and does HW partitioning */
237 # define CONFIG_BOOTCOMMAND \
238 "if mmc dev 0; mmc rescan; then " \
241 "echo ERROR: SD/MMC-Card not detected!; " \
246 #else /* !defined CONFIG_SHC_NETBOOT, !defined CONFIG_SHC_SDBOOT */
247 /* Regular Boot from internal eMMC */
248 # define CONFIG_BOOTCOMMAND \
249 "if mmc dev 1; mmc rescan; then " \
252 "echo ERROR: eMMC device not detected!; " \
255 "if run loaduimage; then " \
258 "echo ERROR Unable to load uImage from eMMC!; " \
259 "echo Performing Rollback!; " \
260 "setenv _active_ ${active_root}; " \
261 "setenv _inactive_ ${inactive_root}; " \
262 "setenv active_root ${_inactive_}; " \
263 "setenv inactive_root ${_active_}; " \
268 #endif /* Regular Boot */
270 /* NS16550 Configuration */
271 #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
272 #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
273 #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
274 #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
275 #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
276 #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
277 #define CONFIG_BAUDRATE 115200
278 #define CONFIG_CONS_INDEX 1
281 #define CONFIG_POWER_TPS65217
284 #define CONFIG_SPL_POWER_SUPPORT
285 #define CONFIG_SPL_YMODEM_SUPPORT
287 #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds"
289 #ifndef CONFIG_SPL_USBETH_SUPPORT
290 /* To support eMMC booting */
291 #define CONFIG_STORAGE_EMMC
292 #define CONFIG_FASTBOOT_FLASH_MMC_DEV 1
296 * Disable MMC DM for SPL build and can be re-enabled after adding
299 #ifdef CONFIG_SPL_BUILD
304 #define CONFIG_CMD_DHCP
305 #define CONFIG_CMD_PING
306 #define CONFIG_DRIVER_TI_CPSW
308 #define CONFIG_BOOTP_DEFAULT
309 #define CONFIG_BOOTP_DNS
310 #define CONFIG_BOOTP_DNS2
311 #define CONFIG_BOOTP_SEND_HOSTNAME
312 #define CONFIG_BOOTP_GATEWAY
313 #define CONFIG_BOOTP_SUBNETMASK
314 #define CONFIG_NET_RETRY_COUNT 10
315 #define CONFIG_NET_MULTI
316 #define CONFIG_PHY_GIGE
317 #define CONFIG_PHYLIB
318 #define CONFIG_PHY_ADDR 0
319 #define CONFIG_PHY_SMSC
321 /* I2C configuration */
322 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
323 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
324 #define CONFIG_SYS_I2C_SPEED 400000
325 #define CONFIG_SYS_I2C_SLAVE 1
327 #define CONFIG_SHOW_BOOT_PROGRESS
329 #if defined CONFIG_SHC_NETBOOT
330 #ifdef CONFIG_SPL_BUILD
331 #define CONFIG_SPL_NET_SUPPORT
332 #define CONFIG_SPL_ETH_SUPPORT
333 #define CONFIG_SPL_NET_VCI_STRING "AM335x U-Boot SPL"
334 #define CONFIG_SPL_ENV_SUPPORT
335 #define CONFIG_SPL_MMC_SUPPORT
336 #define CONFIG_ENV_IS_NOWHERE
337 #undef CONFIG_ENV_IS_IN_MMC
340 #endif /* ! __CONFIG_AM335X_SHC_H */