-
Notifications
You must be signed in to change notification settings - Fork 18
/
readme.h616-legacy
68 lines (60 loc) · 3.48 KB
/
readme.h616-legacy
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
# this is all very much work in progress - trying to get the orangepi
# zero 2 u-boot sources to compile and maybe later adjust them here
# and there until we have some working mainline u-boot for the h616
#
# important: although we are building for a 64bit aarch64 architecture
# u-boot seems to be built in 32bit and thus a 32bit (armv7l) system
# is required for the below compilation
#
# some notes about comparing the android dts to the opi zero 2 one:
# - dtc -I dts -O dts -s sun50i-h313-x96q.dts.android | sed 's,phandle\ =.*,phandle,g' > /tmp/a
# - dtc -I dts -O dts -s sun50i-h616-orangepi-zero2.dts | sed 's,phandle\ =.*,phandle,g' > /tmp/b
# - diff -u /tmp/a /tmp/b # to see the differences, leaving out the not relevant changed phandles
# - adjust what makes sense from the android dts in the opi zero 2 dts
boot0 etc. blobs and tools:
git clone https://github.com/orangepi-xunlong/orangepi-build.git
# blobs are then in orangepi-build/external/packages/pack-uboot/sun50iw9/bin
# tools are then in orangepi-build/external/packages/pack-uboot/sun50iw9/tools
# tools are x86_64 binaries
# a copy of those blobs and tools is in misc.h616-legacy/sdk-files
# some info about them: https://linux-sunxi.org/SDK_build_howto#Manual_Build_of_Separate_Components
# a dump of it can be found at misc.h616-legacy/sdk-info/SDK-build-howto-from-linux-sunxi.org.html
u-boot:
git clone https://github.com/orangepi-xunlong/u-boot-orangepi.git
cd u-boot-orangepi
git checkout v2018.05-sun50iw9
# add a hack to load the dtb from the default fdt_addr_r instead of the u-boot internal one
patch -p1 < /compile/doc/u-boot-misc/misc.h616-legacy/load-dtb-from-default-fdt-addr.patch
# add some more defconfig options
patch -p1 < /compile/doc/u-boot-misc/misc.h616-legacy/add-some-more-defconfig-options.patch
# make bootargs provided via APPEND in extlinux.conf actually work - see patch for details
patch -p1 < /compile/doc/u-boot-misc/misc.h616-legacy/fix-bootparam-transmission.patch
make orangepi_zero2_defconfig
make
# result: u-boot.bin = u-boot-sun50iw9p1.bin
legacy h616 u-boot assembly:
# based on: (from https://github.com/orangepi-xunlong/orangepi-build.git)
# - scripts/pack-uboot.sh
# - external/config/sources/families/include/sunxi64_common.inc
# to be done on an x86_64 machine!
mkdir u-boot-workdir-orangepi
cd u-boot-workdir-orangepi
git clone https://github.com/hexdump0815/u-boot-misc.git
# get the u-boot.bin from the build on the armv7l machine here
scp armv7lmachine:/compile/source/u-boot-orangepi/u-boot.bin u-boot.fex
cp u-boot-misc/misc.h616-legacy/sdk-files/bin/* .
cp u-boot-misc/misc.h616-legacy/dtb/sun50i-h313-x96q.dts .
u-boot-misc/misc.h616-legacy/sdk-files/tools/dtc -p 2048 -W no-unit_address_vs_reg -@ -O dtb -o sun50iw9p1-u-boot.dtb -b 0 sun50i-h313-x96q.dts
unix2dos sys_config.fex
u-boot-misc/misc.h616-legacy/sdk-files/tools/script sys_config.fex
cp sun50iw9p1-u-boot.dtb sunxi.fex
u-boot-misc/misc.h616-legacy/sdk-files/tools/update_dtb sunxi.fex 4096
u-boot-misc/misc.h616-legacy/sdk-files/tools/update_boot0 boot0_sdcard.fex sys_config.bin SDMMC_CARD
u-boot-misc/misc.h616-legacy/sdk-files/tools/update_uboot -no_merge u-boot.fex sys_config.bin
grep -v dtbo boot_package.cfg > boot_package.cfg.no-dtbo
unix2dos boot_package.cfg.no-dtbo
u-boot-misc/misc.h616-legacy/sdk-files/tools/dragonsecboot -pack boot_package.cfg.no-dtbo
# prepare it for imagebuilder/sonaremin
dd if=/dev/zero of=boot-h616-legacy.dd bs=8k count=1
cat boot0_sdcard.fex >> boot-h616-legacy.dd
dd if=boot_package.fex of=boot-h616-legacy.dd bs=8k seek=2050