blob: 56ce2cb2736d376a3ec483f137a7155037aeffee [file] [log] [blame]
Christian Hewitt9ffb74f52020-12-18 08:45:45 +00001.. SPDX-License-Identifier: GPL-2.0+
2
3U-Boot for Beelink GT-King
4==========================
5
6The Shenzen AZW (Beelink) GT-King is based on the Amlogic W400 reference
7board with an S922X-H chip.
8
9- 4GB LPDDR4 RAM
10- 64GB eMMC storage
11- 10/100/1000 Base-T Ethernet
12- AP6356S Wireless (802.11 a/b/g/n/ac, BT 4.1)
13- HDMI 2.1 video
14- S/PDIF optical output
15- Analogue audio output
16- 1x USB 2.0 port
17- 2x USB 3.0 ports
18- IR receiver
19- 1x micro SD card slot
20
21Beelink do not provide public schematics, but have been willing
22to share them with known distro developers on request.
23
24U-Boot compilation
25------------------
26
27.. code-block:: bash
28
29 $ export CROSS_COMPILE=aarch64-none-elf-
30 $ make beelink-gtking_defconfig
31 $ make
32
33Image creation
34--------------
35
36Amlogic does not provide sources for the firmware and for tools needed
37to create the bootloader image. Beelink have provided the Amlogic "SDK"
38in their forums, but the u-boot sources included result in 2GB RAM being
39detected. The following FIPs were generated with newer private sources
40and give correct (4GB) RAM detection:
41
42https://github.com/LibreELEC/amlogic-boot-fip/tree/master/beelink-s922x
43
44NB: Beelink use a common board config for GT-King, GT-King Pro and the
45GS-King-X model, hence the "beelink-s922x" name.
46
47.. code-block:: bash
48
49 $ wget https://github.com/LibreELEC/amlogic-boot-fip/archive/master.zip
50 $ unzip master.zip
51 $ export FIPDIR=$PWD/amlogic-boot-fip/beelink-s922x
52
53Go back to the mainline U-Boot source tree then:
54
55.. code-block:: bash
56
57 $ mkdir fip
58 $ cp $FIPDIR/* fip/
59 $ cp u-boot.bin fip/bl33.bin
60
61 $ sh fip/blx_fix.sh \
62 fip/bl30.bin \
63 fip/zero_tmp \
64 fip/bl30_zero.bin \
65 fip/bl301.bin \
66 fip/bl301_zero.bin \
67 fip/bl30_new.bin \
68 bl30
69
70 $ sh fip/blx_fix.sh \
71 fip/bl2.bin \
72 fip/zero_tmp \
73 fip/bl2_zero.bin \
74 fip/acs.bin \
75 fip/bl21_zero.bin \
76 fip/bl2_new.bin \
77 bl2
78
79 $ fip/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \
80 --output fip/bl30_new.bin.g12a.enc \
81 --level v3
82 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \
83 --output fip/bl30_new.bin.enc \
84 --level v3 --type bl30
85 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl31.img \
86 --output fip/bl31.img.enc \
87 --level v3 --type bl31
88 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \
89 --output fip/bl33.bin.enc \
90 --level v3 --type bl33
91 $ fip/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \
92 --output fip/bl2.n.bin.sig
93 $ fip/aml_encrypt_g12b --bootmk \
94 --output fip/u-boot.bin \
95 --bl2 fip/bl2.n.bin.sig \
96 --bl30 fip/bl30_new.bin.enc \
97 --bl31 fip/bl31.img.enc \
98 --bl33 fip/bl33.bin.enc \
99 --ddrfw1 fip/ddr4_1d.fw \
100 --ddrfw2 fip/ddr4_2d.fw \
101 --ddrfw3 fip/ddr3_1d.fw \
102 --ddrfw4 fip/piei.fw \
103 --ddrfw5 fip/lpddr4_1d.fw \
104 --ddrfw6 fip/lpddr4_2d.fw \
105 --ddrfw7 fip/diag_lpddr4.fw \
106 --ddrfw8 fip/aml_ddr.fw \
107 --level v3
108
109and then write the image to SD with:
110
111.. code-block:: bash
112
113 $ DEV=/dev/your_sd_device
114 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
115 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444