Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 3 | U-Boot for Beelink GT-King Pro (S922X) |
| 4 | ====================================== |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 5 | |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 6 | The Shenzen AZW (Beelink) GT-King Pro is based on the Amlogic W400 reference board with |
| 7 | an S922X-H chip and the following specifications: |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 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 | - Analogue audio output |
| 15 | - 1x RS232 port |
| 16 | - 2x USB 2.0 port |
| 17 | - 2x USB 3.0 ports |
| 18 | - IR receiver |
| 19 | - 1x SD card slot |
| 20 | - 1x Power on/off button |
| 21 | |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 22 | Beelink do not provide public schematics, but have been willing to share them with known |
| 23 | distro developers to assist with development. |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 24 | |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 25 | U-Boot Compilation |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 26 | ------------------ |
| 27 | |
| 28 | .. code-block:: bash |
| 29 | |
| 30 | $ export CROSS_COMPILE=aarch64-none-elf- |
| 31 | $ make beelink-gtkingpro_defconfig |
| 32 | $ make |
| 33 | |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 34 | U-Boot Signing with Pre-Built FIP repo |
| 35 | -------------------------------------- |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 36 | |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 37 | .. code-block:: bash |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 38 | |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 39 | $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 |
| 40 | $ cd amlogic-boot-fip |
| 41 | $ mkdir my-output-dir |
| 42 | $ ./build-fip.sh beelink-s922x /path/to/u-boot/u-boot.bin my-output-dir |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 43 | |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 44 | U-Boot Manual Signing |
| 45 | --------------------- |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 46 | |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 47 | Beelink released an Amlogic "SDK" dump in their forums, but the U-Boot sources included |
| 48 | result in 2GB RAM detected. The following FIPs were generated with newer sources and |
| 49 | detect 4GB RAM: https://github.com/LibreELEC/amlogic-boot-fip/tree/master/beelink-s922x |
Neil Armstrong | 2ea9868 | 2022-03-02 10:42:22 +0100 | [diff] [blame] | 50 | |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 51 | .. code-block:: bash |
| 52 | |
| 53 | $ wget https://github.com/LibreELEC/amlogic-boot-fip/archive/master.zip |
| 54 | $ unzip master.zip |
| 55 | $ export FIPDIR=$PWD/amlogic-boot-fip/beelink-s922x |
| 56 | |
| 57 | Go back to the mainline U-Boot source tree then: |
| 58 | |
| 59 | .. code-block:: bash |
| 60 | |
| 61 | $ mkdir fip |
| 62 | $ cp $FIPDIR/* fip/ |
| 63 | $ cp u-boot.bin fip/bl33.bin |
| 64 | |
| 65 | $ sh fip/blx_fix.sh \ |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 66 | fip/bl30.bin \ |
| 67 | fip/zero_tmp \ |
| 68 | fip/bl30_zero.bin \ |
| 69 | fip/bl301.bin \ |
| 70 | fip/bl301_zero.bin \ |
| 71 | fip/bl30_new.bin \ |
| 72 | bl30 |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 73 | |
| 74 | $ sh fip/blx_fix.sh \ |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 75 | fip/bl2.bin \ |
| 76 | fip/zero_tmp \ |
| 77 | fip/bl2_zero.bin \ |
| 78 | fip/acs.bin \ |
| 79 | fip/bl21_zero.bin \ |
| 80 | fip/bl2_new.bin \ |
| 81 | bl2 |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 82 | |
| 83 | $ fip/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \ |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 84 | --output fip/bl30_new.bin.g12a.enc \ |
| 85 | --level v3 |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 86 | $ fip/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \ |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 87 | --output fip/bl30_new.bin.enc \ |
| 88 | --level v3 --type bl30 |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 89 | $ fip/aml_encrypt_g12b --bl3sig --input fip/bl31.img \ |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 90 | --output fip/bl31.img.enc \ |
| 91 | --level v3 --type bl31 |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 92 | $ fip/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \ |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 93 | --output fip/bl33.bin.enc \ |
| 94 | --level v3 --type bl33 |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 95 | $ fip/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \ |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 96 | --output fip/bl2.n.bin.sig |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 97 | $ fip/aml_encrypt_g12b --bootmk \ |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 98 | --output fip/u-boot.bin \ |
| 99 | --bl2 fip/bl2.n.bin.sig \ |
| 100 | --bl30 fip/bl30_new.bin.enc \ |
| 101 | --bl31 fip/bl31.img.enc \ |
| 102 | --bl33 fip/bl33.bin.enc \ |
| 103 | --ddrfw1 fip/ddr4_1d.fw \ |
| 104 | --ddrfw2 fip/ddr4_2d.fw \ |
| 105 | --ddrfw3 fip/ddr3_1d.fw \ |
| 106 | --ddrfw4 fip/piei.fw \ |
| 107 | --ddrfw5 fip/lpddr4_1d.fw \ |
| 108 | --ddrfw6 fip/lpddr4_2d.fw \ |
| 109 | --ddrfw7 fip/diag_lpddr4.fw \ |
| 110 | --ddrfw8 fip/aml_ddr.fw \ |
| 111 | --level v3 |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 112 | |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 113 | Then write U-Boot to SD or eMMC with: |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 114 | |
| 115 | .. code-block:: bash |
| 116 | |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 117 | $ DEV=/dev/boot_device |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 118 | $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 |
Christian Hewitt | 1d12042 | 2023-03-20 11:45:41 +0000 | [diff] [blame] | 119 | $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 |