blob: dedef91ba59010b0bfc523d2d7e81b1ac36563f7 [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 *
Nishanth Menoneaa39c62023-11-01 15:56:03 -05009 * Copyright (C) 2011 Texas Instruments Incorporated - https://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/* Clock Defines */
20#define V_OSCK 24000000 /* Clock output from T2 */
21#define V_SCLK (V_OSCK)
22
Heiko Schocherf1163962016-06-07 08:31:25 +020023#ifndef CONFIG_SPL_BUILD
Tom Rinic9edebe2022-12-04 10:03:50 -050024#define CFG_EXTRA_ENV_SETTINGS \
Heiko Schocherf1163962016-06-07 08:31:25 +020025 "loadaddr=0x80200000\0" \
26 "kloadaddr=0x84000000\0" \
27 "fdtaddr=0x85000000\0" \
28 "fdt_high=0xffffffff\0" \
29 "rdaddr=0x81000000\0" \
30 "bootfile=uImage\0" \
31 "fdtfile=am335x-shc.dtb\0" \
32 "verify=no\0" \
33 "serverip=10.55.152.184\0" \
34 "rootpath=/srv/nfs/shc-rootfs\0" \
35 "console=ttyO0,115200n8\0" \
36 "optargs=quiet\0" \
37 "mmcdev=1\0" \
38 "harakiri=0\0" \
39 "mmcpart=2\0" \
40 "active_root=root1\0" \
41 "inactive_root=root2\0" \
42 "mmcrootfstype=ext4 rootwait\0" \
43 "nfsopts=nolock\0" \
44 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
45 "::off\0" \
46 "ip_method=none\0" \
47 "bootargs_defaults=setenv bootargs " \
48 "console=${console} " \
49 "${optargs}\0" \
50 "mmcargs=run bootargs_defaults;" \
51 "setenv bootargs ${bootargs} " \
52 "root=${mmcroot} " \
53 "rootfstype=${mmcrootfstype} ip=${ip_method}\0" \
54 "netargs=setenv bootargs console=${console} " \
55 "${optargs} " \
56 "root=/dev/nfs " \
57 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
58 "ip=dhcp\0" \
59 "bootenv=uEnv.txt\0" \
60 "loadbootenv=if fatload mmc ${mmcdev} ${loadaddr} ${bootenv}; then " \
61 "echo Loaded environment from ${bootenv}; " \
62 "run importbootenv; " \
63 "fi;\0" \
64 "importbootenv=echo Importing environment variables from uEnv.txt ...; " \
65 "env import -t $loadaddr $filesize\0" \
66 "loaduimagefat=fatload mmc ${mmcdev} ${kloadaddr} ${bootfile}\0" \
67 "loaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${kloadaddr} /boot/${bootfile}\0" \
68 "loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /boot/${fdtfile}\0" \
69 "netloaduimage=tftp ${loadaddr} ${bootfile}\0" \
70 "netloadfdt=tftp ${fdtaddr} ${fdtfile}\0" \
71 "mmcboot=echo Booting Linux from ${mmcdevice} ...; " \
72 "run mmcargs; " \
73 "if run loadfdt; then " \
74 "echo device tree detected; " \
75 "bootm ${kloadaddr} - ${fdtaddr}; " \
76 "else " \
77 "bootm ${kloadaddr}; " \
78 "fi; \0" \
79 "netboot=echo Booting from network ...; " \
80 "setenv autoload no; " \
81 "dhcp; " \
82 "run netloaduimage; " \
83 "run netargs; " \
84 "echo NFS path: ${serverip}:${rootpath};" \
85 "if run netloadfdt; then " \
86 "echo device tree detected; " \
87 "bootm ${loadaddr} - ${fdtaddr}; " \
88 "else " \
89 "bootm ${loadaddr}; " \
90 "fi; \0" \
91 "emmc_erase=if test ${harakiri} = 1 ; then echo erase emmc ...; setenv mmcdev 1; mmc erase 0 200; reset; fi; \0" \
92 "mmcpart_gp=mmcpart gp 1 40; \0" \
93 "mmcpart_enhance=mmcpart enhance 0 64; \0" \
94 "mmcpart_rel_write=mmcpart rel_write 1f; \0" \
95 "mmcpart_commit=mmcpart commit 1; \0" \
96 "mmc_hw_part=run mmcpart_gp; run mmcpart_enhance; run mmcpart_rel_write; run mmcpart_commit; \0" \
97 "led_success=gpio set 22; \0" \
98 "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" \
99 "uenv_exec=if test -n $uenvcmd; then " \
100 "echo Running uenvcmd ...; " \
101 "run uenvcmd; " \
102 "fi;\0" \
103 "sd_setup=echo SD/MMC-Card detected on device 0; " \
104 "setenv mmcdevice SD; " \
105 "setenv mmcdev 0; " \
106 "setenv mmcpart 2; " \
107 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0" \
108 "emmc_setup=echo eMMC detected on device 1; " \
109 "setenv mmcdevice eMMC; " \
110 "setenv mmcdev 1; " \
111 "run emmc_erase; " \
112 "if test ${active_root} = root2; then " \
113 "echo Active root is partition 6 (root2); " \
114 "setenv mmcpart 6; " \
115 "else " \
116 "echo Active root is partition 5 (root1); " \
117 "setenv mmcpart 5; " \
118 "fi; " \
119 "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0"
120#endif /* #ifndef CONFIG_SPL_BUILD */
121
122#if defined CONFIG_SHC_NETBOOT
123/* Network Boot */
Heiko Schocherf1163962016-06-07 08:31:25 +0200124
125#elif defined CONFIG_SHC_SDBOOT /* !defined CONFIG_SHC_NETBOOT */
126/* SD-Card Boot */
Heiko Schocherf1163962016-06-07 08:31:25 +0200127
128#elif defined CONFIG_SHC_ICT
129/* ICT adapter boots only u-boot and does HW partitioning */
Heiko Schocherf1163962016-06-07 08:31:25 +0200130
131#else /* !defined CONFIG_SHC_NETBOOT, !defined CONFIG_SHC_SDBOOT */
132/* Regular Boot from internal eMMC */
Heiko Schocherf1163962016-06-07 08:31:25 +0200133
134#endif /* Regular Boot */
135
136/* NS16550 Configuration */
Tom Rinidf6a2152022-11-16 13:10:28 -0500137#define CFG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
138#define CFG_SYS_NS16550_COM2 0x48022000 /* UART1 */
139#define CFG_SYS_NS16550_COM3 0x48024000 /* UART2 */
140#define CFG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
141#define CFG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
142#define CFG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
Heiko Schocherf1163962016-06-07 08:31:25 +0200143
Heiko Schocherf1163962016-06-07 08:31:25 +0200144#endif /* ! __CONFIG_AM335X_SHC_H */