blob: 2fb50c5f7b55fd7e7f6aaa389be5f4854953379e [file] [log] [blame]
Christian Hewitt702b8302020-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
Neil Armstrong4c605122022-03-02 10:42:22 +010047For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `beelink-s922x`
48
Christian Hewitt702b8302020-12-18 08:45:45 +000049.. code-block:: bash
50
51 $ wget https://github.com/LibreELEC/amlogic-boot-fip/archive/master.zip
52 $ unzip master.zip
53 $ export FIPDIR=$PWD/amlogic-boot-fip/beelink-s922x
54
55Go back to the mainline U-Boot source tree then:
56
57.. code-block:: bash
58
59 $ mkdir fip
60 $ cp $FIPDIR/* fip/
61 $ cp u-boot.bin fip/bl33.bin
62
63 $ sh fip/blx_fix.sh \
64 fip/bl30.bin \
65 fip/zero_tmp \
66 fip/bl30_zero.bin \
67 fip/bl301.bin \
68 fip/bl301_zero.bin \
69 fip/bl30_new.bin \
70 bl30
71
72 $ sh fip/blx_fix.sh \
73 fip/bl2.bin \
74 fip/zero_tmp \
75 fip/bl2_zero.bin \
76 fip/acs.bin \
77 fip/bl21_zero.bin \
78 fip/bl2_new.bin \
79 bl2
80
81 $ fip/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \
82 --output fip/bl30_new.bin.g12a.enc \
83 --level v3
84 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \
85 --output fip/bl30_new.bin.enc \
86 --level v3 --type bl30
87 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl31.img \
88 --output fip/bl31.img.enc \
89 --level v3 --type bl31
90 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \
91 --output fip/bl33.bin.enc \
92 --level v3 --type bl33
93 $ fip/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \
94 --output fip/bl2.n.bin.sig
95 $ fip/aml_encrypt_g12b --bootmk \
96 --output fip/u-boot.bin \
97 --bl2 fip/bl2.n.bin.sig \
98 --bl30 fip/bl30_new.bin.enc \
99 --bl31 fip/bl31.img.enc \
100 --bl33 fip/bl33.bin.enc \
101 --ddrfw1 fip/ddr4_1d.fw \
102 --ddrfw2 fip/ddr4_2d.fw \
103 --ddrfw3 fip/ddr3_1d.fw \
104 --ddrfw4 fip/piei.fw \
105 --ddrfw5 fip/lpddr4_1d.fw \
106 --ddrfw6 fip/lpddr4_2d.fw \
107 --ddrfw7 fip/diag_lpddr4.fw \
108 --ddrfw8 fip/aml_ddr.fw \
109 --level v3
110
111and then write the image to SD with:
112
113.. code-block:: bash
114
115 $ DEV=/dev/your_sd_device
116 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
117 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444