Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
| 3 | U-Boot for Beelink GT-King Pro |
| 4 | ============================== |
| 5 | |
| 6 | The Shenzen AZW (Beelink) GT-King Pro is based on the Amlogic W400 reference |
| 7 | board 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 | - 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 | |
| 22 | Beelink do not provide public schematics, but have been willing |
| 23 | to share them with known distro developers on request. |
| 24 | |
| 25 | U-Boot compilation |
| 26 | ------------------ |
| 27 | |
| 28 | .. code-block:: bash |
| 29 | |
| 30 | $ export CROSS_COMPILE=aarch64-none-elf- |
| 31 | $ make beelink-gtkingpro_defconfig |
| 32 | $ make |
| 33 | |
| 34 | Image creation |
| 35 | -------------- |
| 36 | |
| 37 | Amlogic does not provide sources for the firmware and for tools needed |
| 38 | to create the bootloader image. Beelink have provided the Amlogic "SDK" |
| 39 | in their forums, but the u-boot sources included result in 2GB RAM being |
| 40 | detected. The following FIPs were generated with newer private sources |
| 41 | and give correct (4GB) RAM detection: |
| 42 | |
| 43 | https://github.com/LibreELEC/amlogic-boot-fip/tree/master/beelink-s922x |
| 44 | |
| 45 | NB: Beelink use a common board config for GT-King, GT-King Pro and the |
| 46 | GS-King-X model, hence the "beelink-s922x" name. |
| 47 | |
Neil Armstrong | 2ea9868 | 2022-03-02 10:42:22 +0100 | [diff] [blame] | 48 | For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `beelink-s922x` |
| 49 | |
Christian Hewitt | 9ffb74f5 | 2020-12-18 08:45:45 +0000 | [diff] [blame] | 50 | .. 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 | |
| 56 | Go 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 \ |
| 65 | 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 |
| 72 | |
| 73 | $ sh fip/blx_fix.sh \ |
| 74 | 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 |
| 81 | |
| 82 | $ fip/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \ |
| 83 | --output fip/bl30_new.bin.g12a.enc \ |
| 84 | --level v3 |
| 85 | $ fip/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \ |
| 86 | --output fip/bl30_new.bin.enc \ |
| 87 | --level v3 --type bl30 |
| 88 | $ fip/aml_encrypt_g12b --bl3sig --input fip/bl31.img \ |
| 89 | --output fip/bl31.img.enc \ |
| 90 | --level v3 --type bl31 |
| 91 | $ fip/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \ |
| 92 | --output fip/bl33.bin.enc \ |
| 93 | --level v3 --type bl33 |
| 94 | $ fip/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \ |
| 95 | --output fip/bl2.n.bin.sig |
| 96 | $ fip/aml_encrypt_g12b --bootmk \ |
| 97 | --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 |
| 111 | |
| 112 | and then write the image to SD with: |
| 113 | |
| 114 | .. code-block:: bash |
| 115 | |
| 116 | $ DEV=/dev/your_sd_device |
| 117 | $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 |
| 118 | $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 |