Skip to content

Commit 34d8d1c

Browse files
committed
add: am43xx_evm patchset
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
1 parent 7457deb commit 34d8d1c

File tree

1 file changed

+259
-0
lines changed

1 file changed

+259
-0
lines changed
+259
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
From 8089dac75177447f251fe4050cb81cdee33d392f Mon Sep 17 00:00:00 2001
2+
From: Robert Nelson <robertcnelson@gmail.com>
3+
Date: Mon, 8 Jan 2018 16:08:45 -0600
4+
Subject: [PATCH] am43xx_evm fixes
5+
6+
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
7+
---
8+
configs/am43xx_evm_defconfig | 7 +++
9+
include/configs/am43xx_evm.h | 6 ++
10+
include/configs/ti_armv7_common.h | 128 +++++++++++++++++++++++++++++++++++++-
11+
include/environment/ti/mmc.h | 43 ++++++++++---
12+
4 files changed, 172 insertions(+), 12 deletions(-)
13+
14+
diff --git a/configs/am43xx_evm_defconfig b/configs/am43xx_evm_defconfig
15+
index c1802140dc..afddebff06 100644
16+
--- a/configs/am43xx_evm_defconfig
17+
+++ b/configs/am43xx_evm_defconfig
18+
@@ -55,3 +55,10 @@ CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
19+
CONFIG_USB_GADGET_VENDOR_NUM=0x0403
20+
CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00
21+
CONFIG_USB_GADGET_DOWNLOAD=y
22+
+CONFIG_AUTOBOOT_KEYED=y
23+
+CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
24+
+CONFIG_AUTOBOOT_DELAY_STR="d"
25+
+CONFIG_AUTOBOOT_STOP_STR=" "
26+
+CONFIG_CMD_FS_GENERIC=y
27+
+CONFIG_FS_BTRFS=y
28+
+CONFIG_CMD_BTRFS=y
29+
diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h
30+
index 302181bd2d..dc5fc94f42 100644
31+
--- a/include/configs/am43xx_evm.h
32+
+++ b/include/configs/am43xx_evm.h
33+
@@ -200,6 +200,8 @@
34+
"setenv fdtfile am437x-idk-evm.dtb; fi; " \
35+
"if test $fdtfile = undefined; then " \
36+
"echo WARNING: Could not determine device tree; fi; \0" \
37+
+ EEWIKI_BOOT \
38+
+ EEWIKI_UNAME_BOOT \
39+
NANDARGS \
40+
NETARGS \
41+
DFUARGS \
42+
@@ -209,6 +211,10 @@
43+
"run update_to_fit;" \
44+
"fi;" \
45+
"run findfdt; " \
46+
+ "setenv devtype mmc; " \
47+
+ "setenv mmcblk 0; " \
48+
+ "setenv mmcdev 0; " \
49+
+ "run boot;" \
50+
"run envboot;" \
51+
"run mmcboot;" \
52+
"run usbboot;" \
53+
diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
54+
index 91e139853c..6d770ec1aa 100644
55+
--- a/include/configs/ti_armv7_common.h
56+
+++ b/include/configs/ti_armv7_common.h
57+
@@ -129,6 +129,132 @@
58+
/* Boot Argument Buffer Size */
59+
#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
60+
61+
+#define EEWIKI_BOOT \
62+
+ "boot=${devtype} dev ${mmcdev}; " \
63+
+ "if ${devtype} rescan; then " \
64+
+ "echo SD/MMC found on device ${mmcdev};" \
65+
+ "setenv bootpart ${mmcdev}:1; " \
66+
+ "echo Checking for: /uEnv.txt ...;" \
67+
+ "if test -e ${devtype} ${bootpart} /uEnv.txt; then " \
68+
+ "load ${devtype} ${bootpart} ${loadaddr} /uEnv.txt;" \
69+
+ "env import -t ${loadaddr} ${filesize};" \
70+
+ "echo Loaded environment from /uEnv.txt;" \
71+
+ "echo Checking if uenvcmd is set ...;" \
72+
+ "if test -n ${uenvcmd}; then " \
73+
+ "echo Running uenvcmd ...;" \
74+
+ "run uenvcmd;" \
75+
+ "fi;" \
76+
+ "fi; " \
77+
+ "echo Checking for: /boot/uEnv.txt ...;" \
78+
+ "for i in 1 2 3 4 5 6 7 ; do " \
79+
+ "setenv mmcpart ${i};" \
80+
+ "setenv bootpart ${mmcdev}:${mmcpart};" \
81+
+ "if test -e ${devtype} ${bootpart} /boot/uEnv.txt; then " \
82+
+ "load ${devtype} ${bootpart} ${loadaddr} /boot/uEnv.txt;" \
83+
+ "env import -t ${loadaddr} ${filesize};" \
84+
+ "echo Loaded environment from /boot/uEnv.txt;" \
85+
+ "if test -n ${dtb}; then " \
86+
+ "setenv fdtfile ${dtb};" \
87+
+ "echo Using: dtb=${fdtfile} ...;" \
88+
+ "fi;" \
89+
+ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \
90+
+ "if test -n ${uname_r}; then " \
91+
+ "setenv oldroot /dev/mmcblk${mmcblk}p${mmcpart};" \
92+
+ "echo Running uname_boot ...;" \
93+
+ "run uname_boot;" \
94+
+ "fi;" \
95+
+ "fi;" \
96+
+ "done;" \
97+
+ "fi;\0" \
98+
+
99+
+#define EEWIKI_UNAME_BOOT \
100+
+ "uname_boot="\
101+
+ "setenv bootdir /boot; " \
102+
+ "setenv bootfile vmlinuz-${uname_r}; " \
103+
+ "if test -e ${devtype} ${bootpart} ${bootdir}/${bootfile}; then " \
104+
+ "echo loading ${bootdir}/${bootfile} ...; "\
105+
+ "run loadimage;" \
106+
+ "setenv fdtdir /boot/dtbs/${uname_r}; " \
107+
+ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
108+
+ "run loadfdt;" \
109+
+ "else " \
110+
+ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \
111+
+ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
112+
+ "run loadfdt;" \
113+
+ "else " \
114+
+ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \
115+
+ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
116+
+ "run loadfdt;" \
117+
+ "else " \
118+
+ "setenv fdtdir /boot/dtb-${uname_r}; " \
119+
+ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
120+
+ "run loadfdt;" \
121+
+ "else " \
122+
+ "setenv fdtdir /boot/dtbs; " \
123+
+ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
124+
+ "run loadfdt;" \
125+
+ "else " \
126+
+ "setenv fdtdir /boot/dtb; " \
127+
+ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
128+
+ "run loadfdt;" \
129+
+ "else " \
130+
+ "setenv fdtdir /boot; " \
131+
+ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
132+
+ "run loadfdt;" \
133+
+ "else " \
134+
+ "echo; echo unable to find ${fdtfile} ...; echo booting legacy ...;"\
135+
+ "run args_mmc;" \
136+
+ "echo debug: [${bootargs}] ... ;" \
137+
+ "echo debug: [bootz ${loadaddr}] ... ;" \
138+
+ "bootz ${loadaddr}; " \
139+
+ "fi;" \
140+
+ "fi;" \
141+
+ "fi;" \
142+
+ "fi;" \
143+
+ "fi;" \
144+
+ "fi;" \
145+
+ "fi; " \
146+
+ "setenv rdfile initrd.img-${uname_r}; " \
147+
+ "if test -e ${devtype} ${bootpart} ${bootdir}/${rdfile}; then " \
148+
+ "echo loading ${bootdir}/${rdfile} ...; "\
149+
+ "run loadrd;" \
150+
+ "if test -n ${netinstall_enable}; then " \
151+
+ "run args_netinstall; run message;" \
152+
+ "echo debug: [${bootargs}] ... ;" \
153+
+ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \
154+
+ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \
155+
+ "fi;" \
156+
+ "if test -n ${uenv_root}; then " \
157+
+ "run args_uenv_root;" \
158+
+ "echo debug: [${bootargs}] ... ;" \
159+
+ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \
160+
+ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \
161+
+ "fi;" \
162+
+ "if test -n ${uuid}; then " \
163+
+ "run args_mmc_uuid;" \
164+
+ "echo debug: [${bootargs}] ... ;" \
165+
+ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \
166+
+ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \
167+
+ "else " \
168+
+ "run args_mmc_old;" \
169+
+ "echo debug: [${bootargs}] ... ;" \
170+
+ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \
171+
+ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \
172+
+ "fi;" \
173+
+ "else " \
174+
+ "if test -n ${uenv_root}; then " \
175+
+ "run args_uenv_root;" \
176+
+ "echo debug: [${bootargs}] ... ;" \
177+
+ "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \
178+
+ "bootz ${loadaddr} - ${fdtaddr}; " \
179+
+ "fi;" \
180+
+ "run args_mmc_old;" \
181+
+ "echo debug: [${bootargs}] ... ;" \
182+
+ "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \
183+
+ "bootz ${loadaddr} - ${fdtaddr}; " \
184+
+ "fi;" \
185+
+ "fi;\0" \
186+
+
187+
/*
188+
* When we have SPI, NOR or NAND flash we expect to be making use of
189+
* mtdparts, both for ease of use in U-Boot and for passing information
190+
@@ -236,6 +362,4 @@
191+
#define NETARGS ""
192+
#endif
193+
194+
-#include <config_distro_defaults.h>
195+
-
196+
#endif /* __CONFIG_TI_ARMV7_COMMON_H__ */
197+
diff --git a/include/environment/ti/mmc.h b/include/environment/ti/mmc.h
198+
index 4305ebdaaf..4c7a323180 100644
199+
--- a/include/environment/ti/mmc.h
200+
+++ b/include/environment/ti/mmc.h
201+
@@ -12,22 +12,45 @@
202+
#define DEFAULT_MMC_TI_ARGS \
203+
"mmcdev=0\0" \
204+
"mmcrootfstype=ext4 rootwait\0" \
205+
- "finduuid=part uuid mmc ${bootpart} uuid\0" \
206+
+ "finduuid=part uuid ${devtype} ${bootpart} uuid\0" \
207+
"args_mmc=run finduuid;setenv bootargs console=${console} " \
208+
"${optargs} " \
209+
- "root=PARTUUID=${uuid} rw " \
210+
- "rootfstype=${mmcrootfstype}\0" \
211+
- "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
212+
- "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
213+
+ "root=PARTUUID=${uuid} ro " \
214+
+ "rootfstype=${mmcrootfstype} " \
215+
+ "${cmdline}\0" \
216+
+ "args_mmc_old=setenv bootargs console=${console} " \
217+
+ "${optargs} " \
218+
+ "root=${oldroot} ro " \
219+
+ "rootfstype=${mmcrootfstype} " \
220+
+ "${cmdline}\0" \
221+
+ "args_mmc_uuid=setenv bootargs console=${console} " \
222+
+ "${optargs} " \
223+
+ "root=UUID=${uuid} ro " \
224+
+ "rootfstype=${mmcrootfstype} " \
225+
+ "${cmdline}\0" \
226+
+ "args_uenv_root=setenv bootargs console=${console} " \
227+
+ "${optargs} " \
228+
+ "root=${uenv_root} ro " \
229+
+ "rootfstype=${mmcrootfstype} " \
230+
+ "${musb} ${cmdline}\0" \
231+
+ "args_netinstall=setenv bootargs ${netinstall_bootargs} " \
232+
+ "${optargs} " \
233+
+ "${cape_disable} " \
234+
+ "${cape_enable} " \
235+
+ "root=/dev/ram rw " \
236+
+ "${cmdline}\0" \
237+
+ "loadbootscript=load ${devtype} ${mmcdev} ${loadaddr} boot.scr\0" \
238+
+ "bootscript=echo Running bootscript from ${devtype}${mmcdev} ...; " \
239+
"source ${loadaddr}\0" \
240+
"bootenvfile=uEnv.txt\0" \
241+
- "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
242+
+ "importbootenv=echo Importing environment from ${devtype}${mmcdev} ...; " \
243+
"env import -t ${loadaddr} ${filesize}\0" \
244+
- "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}\0" \
245+
+ "loadbootenv=fatload ${devtype} ${mmcdev} ${loadaddr} ${bootenvfile}\0" \
246+
"loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
247+
- "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
248+
- "envboot=mmc dev ${mmcdev}; " \
249+
- "if mmc rescan; then " \
250+
+ "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \
251+
+ "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \
252+
+ "envboot=${devtype} dev ${mmcdev}; " \
253+
+ "if ${devtype} rescan; then " \
254+
"echo SD/MMC found on device ${mmcdev};" \
255+
"if run loadbootscript; then " \
256+
"run bootscript;" \
257+
--
258+
2.15.1
259+

0 commit comments

Comments
 (0)