forked from eewiki/u-boot-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0001-mx6qsabre_common-uEnv.txt-bootz-n-fixes.patch
197 lines (191 loc) · 6.67 KB
/
0001-mx6qsabre_common-uEnv.txt-bootz-n-fixes.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
From feb845a61c93562ca91cbf98726e17a222d00690 Mon Sep 17 00:00:00 2001
From: Robert Nelson <[email protected]>
Date: Tue, 1 Nov 2016 10:17:21 -0500
Subject: [PATCH] mx6qsabre_common: uEnv.txt, bootz, n fixes
Signed-off-by: Robert Nelson <[email protected]>
---
include/configs/mx6sabre_common.h | 139 +++++++++++++++++++++++++++++++++-----
1 file changed, 121 insertions(+), 18 deletions(-)
diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h
index e404d5b..1408e5a 100644
--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -72,9 +72,12 @@
"image=zImage\0" \
"fdt_file=undefined\0" \
"fdt_addr=0x18000000\0" \
+ "rdaddr=0x12A00000\0" \
"boot_fdt=try\0" \
"ip_dyn=yes\0" \
- "console=" CONSOLE_DEV "\0" \
+ "console=ttymxc0,115200\0" \
+ "optargs=\0" \
+ "cmdline=\0" \
"dfuspi=dfu 0 sf 0:0:10000000:0\0" \
"dfu_alt_info_spl=spl raw 0x400\0" \
"dfu_alt_info_img=u-boot raw 0x10000\0" \
@@ -83,7 +86,8 @@
"initrd_high=0xffffffff\0" \
"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
"mmcpart=1\0" \
- "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
+ "mmcroot=/dev/mmcblk0p2 ro\0" \
+ "mmcrootfstype=ext4 rootwait fixrtc\0" \
"update_sd_firmware=" \
"if test ${ip_dyn} = yes; then " \
"setenv get_cmd dhcp; " \
@@ -98,15 +102,55 @@
"fi; " \
"fi\0" \
EMMC_ENV \
- "mmcargs=setenv bootargs console=${console},${baudrate} " \
- "root=${mmcroot}\0" \
+ "mmcargs=setenv bootargs console=${console}" \
+ "${optargs} " \
+ "root=${mmcroot} " \
+ "rootfstype=${mmcrootfstype} " \
+ "${cmdline}\0" \
"loadbootscript=" \
"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
"bootscript=echo Running bootscript from mmc ...; " \
"source\0" \
- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
- "mmcboot=echo Booting from mmc ...; " \
+ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
+ "loadrd=load mmc ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \
+ "loadfdt=echo loading ${fdtdir}/${fdt_file} ...; load mmc ${bootpart} ${fdt_addr} ${fdtdir}/${fdt_file}\0" \
+ "mmcboot=mmc dev ${mmcdev}; " \
+ "if mmc rescan; then " \
+ "echo SD/MMC found on device ${mmcdev};" \
+ "setenv bootpart ${mmcdev}:1; " \
+ "echo Checking for: /uEnv.txt ...;" \
+ "if test -e mmc ${bootpart} /uEnv.txt; then " \
+ "load mmc ${bootpart} ${loadaddr} /uEnv.txt;" \
+ "env import -t ${loadaddr} ${filesize};" \
+ "echo Loaded environment from /uEnv.txt;" \
+ "echo Checking if uenvcmd is set ...;" \
+ "if test -n ${uenvcmd}; then " \
+ "echo Running uenvcmd ...;" \
+ "run uenvcmd;" \
+ "fi;" \
+ "fi; " \
+ "echo Checking for: /boot/uEnv.txt ...;" \
+ "for i in 1 2 3 4 5 6 7 ; do " \
+ "setenv mmcpart ${i};" \
+ "setenv bootpart ${mmcdev}:${mmcpart};" \
+ "if test -e mmc ${bootpart} /boot/uEnv.txt; then " \
+ "load mmc ${bootpart} ${loadaddr} /boot/uEnv.txt;" \
+ "env import -t ${loadaddr} ${filesize};" \
+ "echo Loaded environment from /boot/uEnv.txt;" \
+ "if test -n ${dtb}; then " \
+ "setenv fdt_file ${dtb};" \
+ "echo Using: dtb=${fdt_file} ...;" \
+ "fi;" \
+ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \
+ "if test -n ${uname_r}; then " \
+ "echo Running uname_boot ...;" \
+ "setenv mmcroot /dev/mmcblk${mmckernel}p${mmcpart} ro;" \
+ "run uname_boot;" \
+ "fi;" \
+ "fi;" \
+ "done;" \
+ "fi;\0" \
+ "mmcboot_old=echo Booting from mmc ...; " \
"run mmcargs; " \
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
"if run loadfdt; then " \
@@ -145,6 +189,70 @@
"else " \
"bootz; " \
"fi;\0" \
+ "uname_boot="\
+ "setenv bootdir /boot; " \
+ "setenv bootfile vmlinuz-${uname_r}; " \
+ "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \
+ "echo loading ${bootdir}/${bootfile} ...; "\
+ "run loadimage;" \
+ "setenv fdtdir /boot/dtbs/${uname_r}; " \
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
+ "run loadfdt;" \
+ "else " \
+ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
+ "run loadfdt;" \
+ "else " \
+ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
+ "run loadfdt;" \
+ "else " \
+ "setenv fdtdir /boot/dtb-${uname_r}; " \
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
+ "run loadfdt;" \
+ "else " \
+ "setenv fdtdir /boot/dtbs; " \
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
+ "run loadfdt;" \
+ "else " \
+ "setenv fdtdir /boot/dtb; " \
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
+ "run loadfdt;" \
+ "else " \
+ "setenv fdtdir /boot; " \
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
+ "run loadfdt;" \
+ "else " \
+ "echo; echo unable to find ${fdt_file} ...; echo booting legacy ...;"\
+ "run mmcargs;" \
+ "echo debug: [${bootargs}] ... ;" \
+ "echo debug: [bootz ${loadaddr}] ... ;" \
+ "bootz ${loadaddr}; " \
+ "fi;" \
+ "fi;" \
+ "fi;" \
+ "fi;" \
+ "fi;" \
+ "fi;" \
+ "fi; " \
+ "setenv rdfile initrd.img-${uname_r}; " \
+ "if test -e mmc ${bootpart} ${bootdir}/${rdfile}; then " \
+ "echo loading ${bootdir}/${rdfile} ...; "\
+ "run loadrd;" \
+ "if test -n ${uuid}; then " \
+ "setenv mmcroot UUID=${uuid} ro;" \
+ "fi;" \
+ "run mmcargs;" \
+ "echo debug: [${bootargs}] ... ;" \
+ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}] ... ;" \
+ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}; " \
+ "else " \
+ "run mmcargs;" \
+ "echo debug: [${bootargs}] ... ;" \
+ "echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;" \
+ "bootz ${loadaddr} - ${fdt_addr}; " \
+ "fi;" \
+ "fi;\0" \
"findfdt="\
"if test $fdt_file = undefined; then " \
"if test $board_name = SABREAUTO && test $board_rev = MX6QP; then " \
@@ -165,17 +273,12 @@
#define CONFIG_BOOTCOMMAND \
"run findfdt;" \
- "mmc dev ${mmcdev};" \
- "if mmc rescan; then " \
- "if run loadbootscript; then " \
- "run bootscript; " \
- "else " \
- "if run loadimage; then " \
- "run mmcboot; " \
- "else run netboot; " \
- "fi; " \
- "fi; " \
- "else run netboot; fi"
+ "setenv mmcdev 1;" \
+ "setenv mmckernel 0;" \
+ "run mmcboot;" \
+ "setenv mmcdev 0;" \
+ "setenv mmckernel 0;" \
+ "run mmcboot;"
#define CONFIG_ARP_TIMEOUT 200UL
--
2.10.1