blob: 8171b698c76f4cb73267eab0731a341d4289bc84 [file] [log] [blame]
Christian Hewitt9ffb74f52020-12-18 08:45:45 +00001.. SPDX-License-Identifier: GPL-2.0+
2
Christian Hewitt1d90c302023-03-20 11:45:40 +00003U-Boot for Beelink GT-King (S922X)
4==================================
Christian Hewitt9ffb74f52020-12-18 08:45:45 +00005
Christian Hewitt1d90c302023-03-20 11:45:40 +00006The Shenzen AZW (Beelink) GT-King is based on the Amlogic W400 reference board with an
7S922X-H chip and the following specifications:
Christian Hewitt9ffb74f52020-12-18 08:45:45 +00008
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
Christian Hewitt1d90c302023-03-20 11:45:40 +000021Beelink do not provide public schematics, but have been willing to share them with known
22distro developers to assist with development.
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000023
Christian Hewitt1d90c302023-03-20 11:45:40 +000024U-Boot Compilation
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000025------------------
26
27.. code-block:: bash
28
29 $ export CROSS_COMPILE=aarch64-none-elf-
30 $ make beelink-gtking_defconfig
31 $ make
32
Christian Hewitt1d90c302023-03-20 11:45:40 +000033U-Boot Signing with Pre-Built FIP repo
34--------------------------------------
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000035
Christian Hewitt1d90c302023-03-20 11:45:40 +000036.. code-block:: bash
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000037
Christian Hewitt1d90c302023-03-20 11:45:40 +000038 $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
39 $ cd amlogic-boot-fip
40 $ mkdir my-output-dir
41 $ ./build-fip.sh beelink-s922x /path/to/u-boot/u-boot.bin my-output-dir
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000042
Christian Hewitt1d90c302023-03-20 11:45:40 +000043U-Boot Manual Signing
44---------------------
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000045
Christian Hewitt1d90c302023-03-20 11:45:40 +000046Beelink released an Amlogic "SDK" dump in their forums, but the U-Boot sources included
47result in 2GB RAM detected. The following FIPs were generated with newer sources and
48detect 4GB RAM: https://github.com/LibreELEC/amlogic-boot-fip/tree/master/beelink-s922x
Neil Armstrong2ea98682022-03-02 10:42:22 +010049
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000050.. code-block:: bash
51
52 $ wget https://github.com/LibreELEC/amlogic-boot-fip/archive/master.zip
53 $ unzip master.zip
54 $ export FIPDIR=$PWD/amlogic-boot-fip/beelink-s922x
55
56Go back to the mainline U-Boot source tree then:
57
58.. code-block:: bash
59
60 $ mkdir fip
61 $ cp $FIPDIR/* fip/
62 $ cp u-boot.bin fip/bl33.bin
63
64 $ sh fip/blx_fix.sh \
Christian Hewitt1d90c302023-03-20 11:45:40 +000065 fip/bl30.bin \
66 fip/zero_tmp \
67 fip/bl30_zero.bin \
68 fip/bl301.bin \
69 fip/bl301_zero.bin \
70 fip/bl30_new.bin \
71 bl30
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000072
73 $ sh fip/blx_fix.sh \
Christian Hewitt1d90c302023-03-20 11:45:40 +000074 fip/bl2.bin \
75 fip/zero_tmp \
76 fip/bl2_zero.bin \
77 fip/acs.bin \
78 fip/bl21_zero.bin \
79 fip/bl2_new.bin \
80 bl2
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000081
82 $ fip/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \
Christian Hewitt1d90c302023-03-20 11:45:40 +000083 --output fip/bl30_new.bin.g12a.enc \
84 --level v3
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000085 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \
Christian Hewitt1d90c302023-03-20 11:45:40 +000086 --output fip/bl30_new.bin.enc \
87 --level v3 --type bl30
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000088 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl31.img \
Christian Hewitt1d90c302023-03-20 11:45:40 +000089 --output fip/bl31.img.enc \
90 --level v3 --type bl31
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000091 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \
Christian Hewitt1d90c302023-03-20 11:45:40 +000092 --output fip/bl33.bin.enc \
93 --level v3 --type bl33
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000094 $ fip/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \
Christian Hewitt1d90c302023-03-20 11:45:40 +000095 --output fip/bl2.n.bin.sig
Christian Hewitt9ffb74f52020-12-18 08:45:45 +000096 $ fip/aml_encrypt_g12b --bootmk \
Christian Hewitt1d90c302023-03-20 11:45:40 +000097 --output fip/u-boot.bin \
98 --bl2 fip/bl2.n.bin.sig \
99 --bl30 fip/bl30_new.bin.enc \
100 --bl31 fip/bl31.img.enc \
101 --bl33 fip/bl33.bin.enc \
102 --ddrfw1 fip/ddr4_1d.fw \
103 --ddrfw2 fip/ddr4_2d.fw \
104 --ddrfw3 fip/ddr3_1d.fw \
105 --ddrfw4 fip/piei.fw \
106 --ddrfw5 fip/lpddr4_1d.fw \
107 --ddrfw6 fip/lpddr4_2d.fw \
108 --ddrfw7 fip/diag_lpddr4.fw \
109 --ddrfw8 fip/aml_ddr.fw \
110 --level v3
Christian Hewitt9ffb74f52020-12-18 08:45:45 +0000111
Christian Hewitt1d90c302023-03-20 11:45:40 +0000112Then write U-Boot to SD or eMMC with:
Christian Hewitt9ffb74f52020-12-18 08:45:45 +0000113
114.. code-block:: bash
115
Christian Hewitt1d90c302023-03-20 11:45:40 +0000116 $ DEV=/dev/boot_device
Christian Hewitt9ffb74f52020-12-18 08:45:45 +0000117 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
Christian Hewitt1d90c302023-03-20 11:45:40 +0000118 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440