beelink-gskingx.rst 4.0 KB

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