blob: 5964ccc74c26d70705c2ee8bcf03e2005aa0c16b [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_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" \
34 "bootfile=uImage\0" \
35 "fdtfile=am335x-shc.dtb\0" \
36 "verify=no\0" \
37 "serverip=10.55.152.184\0" \
38 "rootpath=/srv/nfs/shc-rootfs\0" \
39 "console=ttyO0,115200n8\0" \
40 "optargs=quiet\0" \
41 "mmcdev=1\0" \
42 "harakiri=0\0" \
43 "mmcpart=2\0" \
44 "active_root=root1\0" \
45 "inactive_root=root2\0" \
46 "mmcrootfstype=ext4 rootwait\0" \
47 "nfsopts=nolock\0" \
48 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
49 "::off\0" \
50 "ip_method=none\0" \
51 "bootargs_defaults=setenv bootargs " \
52 "console=${console} " \
53 "${optargs}\0" \
54 "mmcargs=run bootargs_defaults;" \
55 "setenv bootargs ${bootargs} " \
56 "root=${mmcroot} " \
57 "rootfstype=${mmcrootfstype} ip=${ip_method}\0" \
58 "netargs=setenv bootargs console=${console} " \
59 "${optargs} " \
60 "root=/dev/nfs " \
61 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
62 "ip=dhcp\0" \
63 "bootenv=uEnv.txt\0" \
64 "loadbootenv=if fatload mmc ${mmcdev} ${loadaddr} ${bootenv}; then " \
65 "echo Loaded environment from ${bootenv}; " \
66 "run importbootenv; " \
67 "fi;\0" \
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} ...; " \
76 "run mmcargs; " \
77 "if run loadfdt; then " \
78 "echo device tree detected; " \
79 "bootm ${kloadaddr} - ${fdtaddr}; " \
80 "else " \
81 "bootm ${kloadaddr}; " \
82 "fi; \0" \
83 "netboot=echo Booting from network ...; " \
84 "setenv autoload no; " \
85 "dhcp; " \
86 "run netloaduimage; " \
87 "run netargs; " \
88 "echo NFS path: ${serverip}:${rootpath};" \
89 "if run netloadfdt; then " \
90 "echo device tree detected; " \
91 "bootm ${loadaddr} - ${fdtaddr}; " \
92 "else " \
93 "bootm ${loadaddr}; " \
94 "fi; \0" \
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 ...; " \
105 "run uenvcmd; " \
106 "fi;\0" \
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; " \
115 "run emmc_erase; " \
116 "if test ${active_root} = root2; then " \
117 "echo Active root is partition 6 (root2); " \
118 "setenv mmcpart 6; " \
119 "else " \
120 "echo Active root is partition 5 (root1); " \
121 "setenv mmcpart 5; " \
122 "fi; " \
123 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0"
124#endif /* #ifndef CONFIG_SPL_BUILD */
125
126#if defined CONFIG_SHC_NETBOOT
127/* Network Boot */
Heiko Schocherf1163962016-06-07 08:31:25 +0200128
129#elif defined CONFIG_SHC_SDBOOT /* !defined CONFIG_SHC_NETBOOT */
130/* SD-Card Boot */
Heiko Schocherf1163962016-06-07 08:31:25 +0200131
132#elif defined CONFIG_SHC_ICT
133/* ICT adapter boots only u-boot and does HW partitioning */
Heiko Schocherf1163962016-06-07 08:31:25 +0200134
135#else /* !defined CONFIG_SHC_NETBOOT, !defined CONFIG_SHC_SDBOOT */
136/* Regular Boot from internal eMMC */
Heiko Schocherf1163962016-06-07 08:31:25 +0200137
138#endif /* Regular Boot */
139
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 */
Heiko Schocherf1163962016-06-07 08:31:25 +0200147
Heiko Schocherf1163962016-06-07 08:31:25 +0200148#endif /* ! __CONFIG_AM335X_SHC_H */