s400.rst 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. U-Boot for Amlogic S400 (A113X)
  3. ===============================
  4. S400 is a reference board manufactured by Amlogic with the following specifications:
  5. - Amlogic A113X ARM Cortex-A53 quad-core SoC @ 1.2GHz
  6. - 1GB DDR4 SDRAM
  7. - 10/100 Ethernet
  8. - 2x USB 2.0 Host
  9. - eMMC
  10. - Infrared receiver
  11. - SDIO WiFi Module
  12. - MIPI DSI Connector
  13. - Audio HAT Connector
  14. - PCI-E M.2 Connectors
  15. Schematics are available from Amlogic on demand.
  16. U-Boot Compilation
  17. ------------------
  18. .. code-block:: bash
  19. $ export CROSS_COMPILE=aarch64-none-elf-
  20. $ make s400_defconfig
  21. $ make
  22. U-Boot Signing with Pre-Built FIP repo
  23. --------------------------------------
  24. .. code-block:: bash
  25. $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
  26. $ cd amlogic-boot-fip
  27. $ mkdir my-output-dir
  28. $ ./build-fip.sh s400 /path/to/u-boot/u-boot.bin my-output-dir
  29. U-Boot Manual Signing
  30. ---------------------
  31. Amlogic does not provide sources for the firmware and tools needed to create a bootloader
  32. image but sources have been shared by Linux development contractor, Baylibre:
  33. .. code-block:: bash
  34. $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  35. $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  36. $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  37. $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  38. $ export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
  39. $ git clone https://github.com/BayLibre/u-boot.git -b n-amlogic-openlinux-20170606 amlogic-u-boot
  40. $ cd amlogic-u-boot
  41. $ make axg_s400_v1_defconfig
  42. $ make
  43. $ export FIPDIR=$PWD/fip
  44. Go back to mainline U-Boot source tree then :
  45. .. code-block:: bash
  46. $ mkdir fip
  47. $ cp $FIPDIR/axg/bl2.bin fip/
  48. $ cp $FIPDIR/axg/acs.bin fip/
  49. $ cp $FIPDIR/axg/bl21.bin fip/
  50. $ cp $FIPDIR/axg/bl30.bin fip/
  51. $ cp $FIPDIR/axg/bl301.bin fip/
  52. $ cp $FIPDIR/axg/bl31.img fip/
  53. $ cp u-boot.bin fip/bl33.bin
  54. $ $FIPDIR/blx_fix.sh \
  55. fip/bl30.bin \
  56. fip/zero_tmp \
  57. fip/bl30_zero.bin \
  58. fip/bl301.bin \
  59. fip/bl301_zero.bin \
  60. fip/bl30_new.bin \
  61. bl30
  62. $ $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
  63. $ $FIPDIR/blx_fix.sh \
  64. fip/bl2_acs.bin \
  65. fip/zero_tmp \
  66. fip/bl2_zero.bin \
  67. fip/bl21.bin \
  68. fip/bl21_zero.bin \
  69. fip/bl2_new.bin \
  70. bl2
  71. $ $FIPDIR/axg/aml_encrypt_axg --bl3sig --input fip/bl30_new.bin \
  72. --output fip/bl30_new.bin.enc \
  73. --level v3 --type bl30
  74. $ $FIPDIR/axg/aml_encrypt_axg --bl3sig --input fip/bl31.img \
  75. --output fip/bl31.img.enc \
  76. --level v3 --type bl31
  77. $ $FIPDIR/axg/aml_encrypt_axg --bl3sig --input fip/bl33.bin --compress lz4 \
  78. --output fip/bl33.bin.enc \
  79. --level v3 --type bl33
  80. $ $FIPDIR/axg/aml_encrypt_axg --bl2sig --input fip/bl2_new.bin \
  81. --output fip/bl2.n.bin.sig
  82. $ $FIPDIR/axg/aml_encrypt_axg --bootmk \
  83. --output fip/u-boot.bin \
  84. --bl2 fip/bl2.n.bin.sig \
  85. --bl30 fip/bl30_new.bin.enc \
  86. --bl31 fip/bl31.img.enc \
  87. --bl33 fip/bl33.bin.enc --level v3
  88. Then write U-Boot to SD or eMMC with:
  89. .. code-block:: bash
  90. $ DEV=/dev/boot_device
  91. $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
  92. $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440