beelink-gtking.rst 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. U-Boot for Beelink GT-King (S922X)
  3. ==================================
  4. The Shenzen AZW (Beelink) GT-King is based on the Amlogic W400 reference board with an
  5. S922X-H chip and the following specifications:
  6. - 4GB LPDDR4 RAM
  7. - 64GB eMMC storage
  8. - 10/100/1000 Base-T Ethernet
  9. - AP6356S Wireless (802.11 a/b/g/n/ac, BT 4.1)
  10. - HDMI 2.1 video
  11. - S/PDIF optical output
  12. - Analogue audio output
  13. - 1x USB 2.0 port
  14. - 2x USB 3.0 ports
  15. - IR receiver
  16. - 1x micro SD card slot
  17. Beelink do not provide public schematics, but have been willing to share them with known
  18. distro developers to assist with development.
  19. U-Boot Compilation
  20. ------------------
  21. .. code-block:: bash
  22. $ export CROSS_COMPILE=aarch64-none-elf-
  23. $ make beelink-gtking_defconfig
  24. $ make
  25. U-Boot Signing with Pre-Built FIP repo
  26. --------------------------------------
  27. .. code-block:: bash
  28. $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
  29. $ cd amlogic-boot-fip
  30. $ mkdir my-output-dir
  31. $ ./build-fip.sh beelink-s922x /path/to/u-boot/u-boot.bin my-output-dir
  32. U-Boot Manual Signing
  33. ---------------------
  34. Beelink released an Amlogic "SDK" dump in their forums, but the U-Boot sources included
  35. result in 2GB RAM detected. The following FIPs were generated with newer sources and
  36. detect 4GB RAM: https://github.com/LibreELEC/amlogic-boot-fip/tree/master/beelink-s922x
  37. .. code-block:: bash
  38. $ wget https://github.com/LibreELEC/amlogic-boot-fip/archive/master.zip
  39. $ unzip master.zip
  40. $ export FIPDIR=$PWD/amlogic-boot-fip/beelink-s922x
  41. Go back to the mainline U-Boot source tree then:
  42. .. code-block:: bash
  43. $ mkdir fip
  44. $ cp $FIPDIR/* fip/
  45. $ cp u-boot.bin fip/bl33.bin
  46. $ sh fip/blx_fix.sh \
  47. fip/bl30.bin \
  48. fip/zero_tmp \
  49. fip/bl30_zero.bin \
  50. fip/bl301.bin \
  51. fip/bl301_zero.bin \
  52. fip/bl30_new.bin \
  53. bl30
  54. $ sh fip/blx_fix.sh \
  55. fip/bl2.bin \
  56. fip/zero_tmp \
  57. fip/bl2_zero.bin \
  58. fip/acs.bin \
  59. fip/bl21_zero.bin \
  60. fip/bl2_new.bin \
  61. bl2
  62. $ fip/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \
  63. --output fip/bl30_new.bin.g12a.enc \
  64. --level v3
  65. $ fip/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \
  66. --output fip/bl30_new.bin.enc \
  67. --level v3 --type bl30
  68. $ fip/aml_encrypt_g12b --bl3sig --input fip/bl31.img \
  69. --output fip/bl31.img.enc \
  70. --level v3 --type bl31
  71. $ fip/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \
  72. --output fip/bl33.bin.enc \
  73. --level v3 --type bl33
  74. $ fip/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \
  75. --output fip/bl2.n.bin.sig
  76. $ fip/aml_encrypt_g12b --bootmk \
  77. --output fip/u-boot.bin \
  78. --bl2 fip/bl2.n.bin.sig \
  79. --bl30 fip/bl30_new.bin.enc \
  80. --bl31 fip/bl31.img.enc \
  81. --bl33 fip/bl33.bin.enc \
  82. --ddrfw1 fip/ddr4_1d.fw \
  83. --ddrfw2 fip/ddr4_2d.fw \
  84. --ddrfw3 fip/ddr3_1d.fw \
  85. --ddrfw4 fip/piei.fw \
  86. --ddrfw5 fip/lpddr4_1d.fw \
  87. --ddrfw6 fip/lpddr4_2d.fw \
  88. --ddrfw7 fip/diag_lpddr4.fw \
  89. --ddrfw8 fip/aml_ddr.fw \
  90. --level v3
  91. Then write U-Boot to SD or eMMC with:
  92. .. code-block:: bash
  93. $ DEV=/dev/boot_device
  94. $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
  95. $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440