-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathreadme.rk3328-no-sd-boot
53 lines (47 loc) · 2.96 KB
/
readme.rk3328-no-sd-boot
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
IMPORTANT: all the below is not finished and not working yet - for a working version
based on an older version of ayufans rockchip u-boot see misc.rk3328-no-sd-boot/rockchip-u-boot
to make this work with mainline the changes from there would have to be adjusted to mainline,
mainly the mmc entries in the dtb would have to be changed accordingly to use the ext
version of sdmmc like in my h96max-rk3328 linux mainline kernel dtb and its surrounding
patches ...
arm trusted firmware:
# not sure if this is really used in this scenario - i think this stage is still
# running from the original boot blocks on emmc - but cannot hurt to have it anyway
git clone https://github.com/ARM-software/arm-trusted-firmware.git
mv arm-trusted-firmware arm-trusted-firmware-rk3328
cd arm-trusted-firmware-rk3328
git checkout v2.3
make realclean
make PLAT=rk3328 DEBUG=1 bl31
# result: build/rk3328/debug/bl31/bl31.elf
cd ..
u-boot:
git clone https://gitlab.denx.de/u-boot/u-boot.git/
mv u-boot u-boot-mainline-rk3328-no-sd-boot
cd u-boot-mainline-rk3328-no-sd-boot
git checkout v2020.07
# get atf from aft build
cp ../arm-trusted-firmware-rk3328/build/rk3328/debug/bl31/bl31.elf .
patch -p1 < /compile/doc/u-boot-misc/misc.rk3328-no-sd-boot/rk3328-h96max-no-sd-boot.patch
cp /compile/doc/u-boot-misc/misc.rk3328-no-sd-boot/h96max-rk3328_defconfig configs
cp /compile/doc/u-boot-misc/misc.rk3328-no-sd-boot/rk3328-h96max.dts arch/arm/dts
cp /compile/doc/u-boot-misc/misc.rk3328-no-sd-boot/rk3328-h96max-u-boot.dtsi arch/arm/dts
make h96max-rk3328_defconfig
make
# this step for my only worked using the x86 binary of loaderimage on an x86 machine
loaderimage --pack --uboot ./u-boot-dtb.bin u-boot-image-for-emmc-h96max-rk3328.img 0x200000
# write to emmc via:
# backup old u-boot image - 0x2000 is 8192 but we actually want 16384, but rkdeveloptool has an offset
# of 0x2000 (at least my version) so 0x2000 actually is 0x4000 = 16384
# update: it looks like this offset is in place when using the rkdeveloptool in loader mode - in this
# mode the first 8192 sectors are not visible/accessible result ing in that 0x2000 offset ... if it
# is used in maskrom mode then everything is visible/accessible starting from 0x0 ... please keep
# this in mind for the rkdeveloptool usage below - that assume loader mode and thus the 0x2000 offset
# for maskrom mode this would mean: 0x2000 -> 0x4000 and 0x6000 -> 0x8000 below, the second 0x2000
# of the rkdeveloptool rl command is a length and stays the same in that case
rkdeveloptool rl 0x2000 0x2000 u-boot-image-backup-from-emmc-h96max-rk3328.img
# write the new one - same 0x2000 magic here
rkdeveloptool wl 0x2000 u-boot-image-for-emmc-h96max-rk3328.img
# afterwards the new u-boot should be started from the old first level boot stages using the old
# trust.img coming at 0x6000 (real) = 24576 still being on emmc after the new u-boot ... the new
# u-boot should boot properly from sd card or usb via extlinux or boot.scr then ...