-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboot.txt
55 lines (46 loc) · 1.47 KB
/
boot.txt
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
#
# SolidRun i.MX6 Debian Boot Script
#
# Copyright: 2018 Josua Mayer
#
# This is a transitional boot-script to handle updates
# in the boot process with the legacy 2013.10 U-Boot.
#
# parse version variable, if any
# (enabled on builds since March 2018)
if test -n "$ver"; then
# copy version string to memory
env export 0x12000000 ver
# now memory looks like this
# "ver=U-Boot 2017.11-"...
# copy major to start of variable
# 4 bytes from offset 11 to offset 4
cp.b 0x1200000b 0x12000004 4
# append minor version
# 2 bytes from offset 16, to offset 8
cp.b 0x12000010 0x12000008 2
# terminate with null byte
mw.b 0x1200000a 0 1
# read back variable
env import 0x12000000
else
# set fall-back version as 0 (we really don't know)
setenv ver 0
fi
# apply compatibility hacks for older versions as necessary
if test $ver < 201711; then
# There are now seperate DTBs for devices without eMMC!
if test -n "$somrev" && test "$somrev" == "-som-v15"; then
# Because we can't tell from this U-Boot, assume eMMC is present.
echo "Assuming eMMC is present,"
echo "for proper detection, upgrade U-Boot to 2017.11 or later."
# overriding the somrev variable is enough to fixup the existing autodetectfdt macro
setenv somrev "-emmc-som-v15"
fi
# Letting the original boot logic kick back in, it will now search for a script in /boot/
fi
# unset ver if it didn't exist before
if test $ver == 0; then
setenv -f ver
fi
echo "Compatibility Boot-script finished, returning to U-Boot."