blob: 5ed4eb3b3c25c8a6e6cd1086fe680ee903411c5e [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Heiko Schocherf1163962016-06-07 08:31:25 +02002/*
3 * (C) Copyright 2016
4 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
5 *
6 * Based on:
7 * am335x_evm.h
8 *
9 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
Heiko Schocherf1163962016-06-07 08:31:25 +020010 */
11
12#ifndef __CONFIG_AM335X_SHC_H
13#define __CONFIG_AM335X_SHC_H
14
15#include <configs/ti_am335x_common.h>
16
17/* settings we don;t want on this board */
Heiko Schocherf1163962016-06-07 08:31:25 +020018
Heiko Schocherf1163962016-06-07 08:31:25 +020019#define CONFIG_SYS_BOOTM_LEN (16 << 20)
20
Heiko Schocherf1163962016-06-07 08:31:25 +020021/* Clock Defines */
22#define V_OSCK 24000000 /* Clock output from T2 */
23#define V_SCLK (V_OSCK)
24
Heiko Schocherf1163962016-06-07 08:31:25 +020025#define CONFIG_HSMMC2_8BIT
26
Heiko Schocherf1163962016-06-07 08:31:25 +020027#ifndef CONFIG_SHC_ICT
28/*
29 * In builds other than ICT, reset to retry after timeout
30 * Define a timeout after which a stopped bootloader continues autoboot
31 * (only works with CONFIG_RESET_TO_RETRY)
32 */
33# define CONFIG_BOOT_RETRY_TIME 30
34# define CONFIG_RESET_TO_RETRY
35#endif
36
Heiko Schocherf1163962016-06-07 08:31:25 +020037#ifndef CONFIG_SPL_BUILD
38#define CONFIG_EXTRA_ENV_SETTINGS \
39 "loadaddr=0x80200000\0" \
40 "kloadaddr=0x84000000\0" \
41 "fdtaddr=0x85000000\0" \
42 "fdt_high=0xffffffff\0" \
43 "rdaddr=0x81000000\0" \
44 "bootfile=uImage\0" \
45 "fdtfile=am335x-shc.dtb\0" \
46 "verify=no\0" \
47 "serverip=10.55.152.184\0" \
48 "rootpath=/srv/nfs/shc-rootfs\0" \
49 "console=ttyO0,115200n8\0" \
50 "optargs=quiet\0" \
51 "mmcdev=1\0" \
52 "harakiri=0\0" \
53 "mmcpart=2\0" \
54 "active_root=root1\0" \
55 "inactive_root=root2\0" \
56 "mmcrootfstype=ext4 rootwait\0" \
57 "nfsopts=nolock\0" \
58 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
59 "::off\0" \
60 "ip_method=none\0" \
61 "bootargs_defaults=setenv bootargs " \
62 "console=${console} " \
63 "${optargs}\0" \
64 "mmcargs=run bootargs_defaults;" \
65 "setenv bootargs ${bootargs} " \
66 "root=${mmcroot} " \
67 "rootfstype=${mmcrootfstype} ip=${ip_method}\0" \
68 "netargs=setenv bootargs console=${console} " \
69 "${optargs} " \
70 "root=/dev/nfs " \
71 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
72 "ip=dhcp\0" \
73 "bootenv=uEnv.txt\0" \
74 "loadbootenv=if fatload mmc ${mmcdev} ${loadaddr} ${bootenv}; then " \
75 "echo Loaded environment from ${bootenv}; " \
76 "run importbootenv; " \
77 "fi;\0" \
78 "importbootenv=echo Importing environment variables from uEnv.txt ...; " \
79 "env import -t $loadaddr $filesize\0" \
80 "loaduimagefat=fatload mmc ${mmcdev} ${kloadaddr} ${bootfile}\0" \
81 "loaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${kloadaddr} /boot/${bootfile}\0" \
82 "loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /boot/${fdtfile}\0" \
83 "netloaduimage=tftp ${loadaddr} ${bootfile}\0" \
84 "netloadfdt=tftp ${fdtaddr} ${fdtfile}\0" \
85 "mmcboot=echo Booting Linux from ${mmcdevice} ...; " \
86 "run mmcargs; " \
87 "if run loadfdt; then " \
88 "echo device tree detected; " \
89 "bootm ${kloadaddr} - ${fdtaddr}; " \
90 "else " \
91 "bootm ${kloadaddr}; " \
92 "fi; \0" \
93 "netboot=echo Booting from network ...; " \
94 "setenv autoload no; " \
95 "dhcp; " \
96 "run netloaduimage; " \
97 "run netargs; " \
98 "echo NFS path: ${serverip}:${rootpath};" \
99 "if run netloadfdt; then " \
100 "echo device tree detected; " \
101 "bootm ${loadaddr} - ${fdtaddr}; " \
102 "else " \
103 "bootm ${loadaddr}; " \
104 "fi; \0" \
105 "emmc_erase=if test ${harakiri} = 1 ; then echo erase emmc ...; setenv mmcdev 1; mmc erase 0 200; reset; fi; \0" \
106 "mmcpart_gp=mmcpart gp 1 40; \0" \
107 "mmcpart_enhance=mmcpart enhance 0 64; \0" \
108 "mmcpart_rel_write=mmcpart rel_write 1f; \0" \
109 "mmcpart_commit=mmcpart commit 1; \0" \
110 "mmc_hw_part=run mmcpart_gp; run mmcpart_enhance; run mmcpart_rel_write; run mmcpart_commit; \0" \
111 "led_success=gpio set 22; \0" \
112 "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" \
113 "uenv_exec=if test -n $uenvcmd; then " \
114 "echo Running uenvcmd ...; " \
115 "run uenvcmd; " \
116 "fi;\0" \
117 "sd_setup=echo SD/MMC-Card detected on device 0; " \
118 "setenv mmcdevice SD; " \
119 "setenv mmcdev 0; " \
120 "setenv mmcpart 2; " \
121 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0" \
122 "emmc_setup=echo eMMC detected on device 1; " \
123 "setenv mmcdevice eMMC; " \
124 "setenv mmcdev 1; " \
125 "run emmc_erase; " \
126 "if test ${active_root} = root2; then " \
127 "echo Active root is partition 6 (root2); " \
128 "setenv mmcpart 6; " \
129 "else " \
130 "echo Active root is partition 5 (root1); " \
131 "setenv mmcpart 5; " \
132 "fi; " \
133 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0"
134#endif /* #ifndef CONFIG_SPL_BUILD */
135
136#if defined CONFIG_SHC_NETBOOT
137/* Network Boot */
Heiko Schocherf1163962016-06-07 08:31:25 +0200138
139#elif defined CONFIG_SHC_SDBOOT /* !defined CONFIG_SHC_NETBOOT */
140/* SD-Card Boot */
Heiko Schocherf1163962016-06-07 08:31:25 +0200141
142#elif defined CONFIG_SHC_ICT
143/* ICT adapter boots only u-boot and does HW partitioning */
Heiko Schocherf1163962016-06-07 08:31:25 +0200144
145#else /* !defined CONFIG_SHC_NETBOOT, !defined CONFIG_SHC_SDBOOT */
146/* Regular Boot from internal eMMC */
Heiko Schocherf1163962016-06-07 08:31:25 +0200147
148#endif /* Regular Boot */
149
150/* NS16550 Configuration */
151#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
152#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
153#define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
154#define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
155#define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
156#define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
Heiko Schocherf1163962016-06-07 08:31:25 +0200157
158/* PMIC support */
159#define CONFIG_POWER_TPS65217
160
161/* SPL */
Heiko Schocherf1163962016-06-07 08:31:25 +0200162
Heiko Schocherf1163962016-06-07 08:31:25 +0200163/*
164 * Disable MMC DM for SPL build and can be re-enabled after adding
165 * DM support in SPL
166 */
167#ifdef CONFIG_SPL_BUILD
168#undef CONFIG_DM_MMC
169#undef CONFIG_TIMER
170#endif
171
Heiko Schocherf1163962016-06-07 08:31:25 +0200172#define CONFIG_NET_RETRY_COUNT 10
Heiko Schocherf1163962016-06-07 08:31:25 +0200173#endif /* ! __CONFIG_AM335X_SHC_H */