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 #define CONFIG_SYS_BOOTM_LEN (16 << 20)
22 #define V_OSCK 24000000 /* Clock output from T2 */
23 #define V_SCLK (V_OSCK)
25 #define CONFIG_HSMMC2_8BIT
27 #ifndef CONFIG_SPL_BUILD
28 #define CONFIG_EXTRA_ENV_SETTINGS \
29 "loadaddr=0x80200000\0" \
30 "kloadaddr=0x84000000\0" \
31 "fdtaddr=0x85000000\0" \
32 "fdt_high=0xffffffff\0" \
33 "rdaddr=0x81000000\0" \
35 "fdtfile=am335x-shc.dtb\0" \
37 "serverip=10.55.152.184\0" \
38 "rootpath=/srv/nfs/shc-rootfs\0" \
39 "console=ttyO0,115200n8\0" \
44 "active_root=root1\0" \
45 "inactive_root=root2\0" \
46 "mmcrootfstype=ext4 rootwait\0" \
48 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
51 "bootargs_defaults=setenv bootargs " \
52 "console=${console} " \
54 "mmcargs=run bootargs_defaults;" \
55 "setenv bootargs ${bootargs} " \
57 "rootfstype=${mmcrootfstype} ip=${ip_method}\0" \
58 "netargs=setenv bootargs console=${console} " \
61 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
63 "bootenv=uEnv.txt\0" \
64 "loadbootenv=if fatload mmc ${mmcdev} ${loadaddr} ${bootenv}; then " \
65 "echo Loaded environment from ${bootenv}; " \
66 "run importbootenv; " \
68 "importbootenv=echo Importing environment variables from uEnv.txt ...; " \
69 "env import -t $loadaddr $filesize\0" \
70 "loaduimagefat=fatload mmc ${mmcdev} ${kloadaddr} ${bootfile}\0" \
71 "loaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${kloadaddr} /boot/${bootfile}\0" \
72 "loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /boot/${fdtfile}\0" \
73 "netloaduimage=tftp ${loadaddr} ${bootfile}\0" \
74 "netloadfdt=tftp ${fdtaddr} ${fdtfile}\0" \
75 "mmcboot=echo Booting Linux from ${mmcdevice} ...; " \
77 "if run loadfdt; then " \
78 "echo device tree detected; " \
79 "bootm ${kloadaddr} - ${fdtaddr}; " \
81 "bootm ${kloadaddr}; " \
83 "netboot=echo Booting from network ...; " \
84 "setenv autoload no; " \
86 "run netloaduimage; " \
88 "echo NFS path: ${serverip}:${rootpath};" \
89 "if run netloadfdt; then " \
90 "echo device tree detected; " \
91 "bootm ${loadaddr} - ${fdtaddr}; " \
93 "bootm ${loadaddr}; " \
95 "emmc_erase=if test ${harakiri} = 1 ; then echo erase emmc ...; setenv mmcdev 1; mmc erase 0 200; reset; fi; \0" \
96 "mmcpart_gp=mmcpart gp 1 40; \0" \
97 "mmcpart_enhance=mmcpart enhance 0 64; \0" \
98 "mmcpart_rel_write=mmcpart rel_write 1f; \0" \
99 "mmcpart_commit=mmcpart commit 1; \0" \
100 "mmc_hw_part=run mmcpart_gp; run mmcpart_enhance; run mmcpart_rel_write; run mmcpart_commit; \0" \
101 "led_success=gpio set 22; \0" \
102 "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" \
103 "uenv_exec=if test -n $uenvcmd; then " \
104 "echo Running uenvcmd ...; " \
107 "sd_setup=echo SD/MMC-Card detected on device 0; " \
108 "setenv mmcdevice SD; " \
109 "setenv mmcdev 0; " \
110 "setenv mmcpart 2; " \
111 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0" \
112 "emmc_setup=echo eMMC detected on device 1; " \
113 "setenv mmcdevice eMMC; " \
114 "setenv mmcdev 1; " \
116 "if test ${active_root} = root2; then " \
117 "echo Active root is partition 6 (root2); " \
118 "setenv mmcpart 6; " \
120 "echo Active root is partition 5 (root1); " \
121 "setenv mmcpart 5; " \
123 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0"
124 #endif /* #ifndef CONFIG_SPL_BUILD */
126 #if defined CONFIG_SHC_NETBOOT
129 #elif defined CONFIG_SHC_SDBOOT /* !defined CONFIG_SHC_NETBOOT */
132 #elif defined CONFIG_SHC_ICT
133 /* ICT adapter boots only u-boot and does HW partitioning */
135 #else /* !defined CONFIG_SHC_NETBOOT, !defined CONFIG_SHC_SDBOOT */
136 /* Regular Boot from internal eMMC */
138 #endif /* Regular Boot */
140 /* NS16550 Configuration */
141 #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
142 #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
143 #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
144 #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
145 #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
146 #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
148 #endif /* ! __CONFIG_AM335X_SHC_H */