blob: c7a7a18dc854d29524fa8beb7d44448e974b36a8 [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
19#ifndef CONFIG_SPL_BUILD
20# define CONFIG_TIMESTAMP
Heiko Schocherf1163962016-06-07 08:31:25 +020021#endif
22
23#define CONFIG_SYS_BOOTM_LEN (16 << 20)
24
Heiko Schocherf1163962016-06-07 08:31:25 +020025/* Clock Defines */
26#define V_OSCK 24000000 /* Clock output from T2 */
27#define V_SCLK (V_OSCK)
28
Heiko Schocherf1163962016-06-07 08:31:25 +020029#define CONFIG_HSMMC2_8BIT
30
Heiko Schocherf1163962016-06-07 08:31:25 +020031#ifndef CONFIG_SHC_ICT
32/*
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)
36 */
37# define CONFIG_BOOT_RETRY_TIME 30
38# define CONFIG_RESET_TO_RETRY
39#endif
40
Heiko Schocherf1163962016-06-07 08:31:25 +020041#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" \
48 "bootfile=uImage\0" \
49 "fdtfile=am335x-shc.dtb\0" \
50 "verify=no\0" \
51 "serverip=10.55.152.184\0" \
52 "rootpath=/srv/nfs/shc-rootfs\0" \
53 "console=ttyO0,115200n8\0" \
54 "optargs=quiet\0" \
55 "mmcdev=1\0" \
56 "harakiri=0\0" \
57 "mmcpart=2\0" \
58 "active_root=root1\0" \
59 "inactive_root=root2\0" \
60 "mmcrootfstype=ext4 rootwait\0" \
61 "nfsopts=nolock\0" \
62 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
63 "::off\0" \
64 "ip_method=none\0" \
65 "bootargs_defaults=setenv bootargs " \
66 "console=${console} " \
67 "${optargs}\0" \
68 "mmcargs=run bootargs_defaults;" \
69 "setenv bootargs ${bootargs} " \
70 "root=${mmcroot} " \
71 "rootfstype=${mmcrootfstype} ip=${ip_method}\0" \
72 "netargs=setenv bootargs console=${console} " \
73 "${optargs} " \
74 "root=/dev/nfs " \
75 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
76 "ip=dhcp\0" \
77 "bootenv=uEnv.txt\0" \
78 "loadbootenv=if fatload mmc ${mmcdev} ${loadaddr} ${bootenv}; then " \
79 "echo Loaded environment from ${bootenv}; " \
80 "run importbootenv; " \
81 "fi;\0" \
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} ...; " \
90 "run mmcargs; " \
91 "if run loadfdt; then " \
92 "echo device tree detected; " \
93 "bootm ${kloadaddr} - ${fdtaddr}; " \
94 "else " \
95 "bootm ${kloadaddr}; " \
96 "fi; \0" \
97 "netboot=echo Booting from network ...; " \
98 "setenv autoload no; " \
99 "dhcp; " \
100 "run netloaduimage; " \
101 "run netargs; " \
102 "echo NFS path: ${serverip}:${rootpath};" \
103 "if run netloadfdt; then " \
104 "echo device tree detected; " \
105 "bootm ${loadaddr} - ${fdtaddr}; " \
106 "else " \
107 "bootm ${loadaddr}; " \
108 "fi; \0" \
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 ...; " \
119 "run uenvcmd; " \
120 "fi;\0" \
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; " \
129 "run emmc_erase; " \
130 "if test ${active_root} = root2; then " \
131 "echo Active root is partition 6 (root2); " \
132 "setenv mmcpart 6; " \
133 "else " \
134 "echo Active root is partition 5 (root1); " \
135 "setenv mmcpart 5; " \
136 "fi; " \
137 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0"
138#endif /* #ifndef CONFIG_SPL_BUILD */
139
140#if defined CONFIG_SHC_NETBOOT
141/* Network Boot */
Heiko Schocherf1163962016-06-07 08:31:25 +0200142
143#elif defined CONFIG_SHC_SDBOOT /* !defined CONFIG_SHC_NETBOOT */
144/* SD-Card Boot */
Heiko Schocherf1163962016-06-07 08:31:25 +0200145
146#elif defined CONFIG_SHC_ICT
147/* ICT adapter boots only u-boot and does HW partitioning */
Heiko Schocherf1163962016-06-07 08:31:25 +0200148
149#else /* !defined CONFIG_SHC_NETBOOT, !defined CONFIG_SHC_SDBOOT */
150/* Regular Boot from internal eMMC */
Heiko Schocherf1163962016-06-07 08:31:25 +0200151
152#endif /* Regular Boot */
153
154/* NS16550 Configuration */
155#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
156#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
157#define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
158#define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
159#define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
160#define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
Heiko Schocherf1163962016-06-07 08:31:25 +0200161
162/* PMIC support */
163#define CONFIG_POWER_TPS65217
164
165/* SPL */
Heiko Schocherf1163962016-06-07 08:31:25 +0200166
Heiko Schocherf1163962016-06-07 08:31:25 +0200167/*
168 * Disable MMC DM for SPL build and can be re-enabled after adding
169 * DM support in SPL
170 */
171#ifdef CONFIG_SPL_BUILD
172#undef CONFIG_DM_MMC
173#undef CONFIG_TIMER
174#endif
175
Heiko Schocherf1163962016-06-07 08:31:25 +0200176#define CONFIG_NET_RETRY_COUNT 10
Heiko Schocherf1163962016-06-07 08:31:25 +0200177#endif /* ! __CONFIG_AM335X_SHC_H */