u200.rst 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. U-Boot for Amlogic U200 (S905X2)
  3. ================================
  4. U200 is a reference board manufactured by Amlogic with the following specification:
  5. - Amlogic S905D2 ARM Cortex-A53 quad-core SoC
  6. - 2GB DDR4 SDRAM
  7. - 10/100 Ethernet (Internal PHY)
  8. - 1x USB 3.0 Host
  9. - eMMC
  10. - SDcard
  11. - Infrared receiver
  12. - SDIO WiFi Module
  13. - MIPI DSI Connector
  14. - Audio HAT Connector
  15. - PCI-E M.2 Connector
  16. Schematics are available from Amlogic on demand.
  17. U-Boot Compilation
  18. ------------------
  19. .. code-block:: bash
  20. $ export CROSS_COMPILE=aarch64-none-elf-
  21. $ make u200_defconfig
  22. $ make
  23. U-Boot Signing with Pre-Built FIP repo
  24. --------------------------------------
  25. .. code-block:: bash
  26. $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
  27. $ cd amlogic-boot-fip
  28. $ mkdir my-output-dir
  29. $ ./build-fip.sh u200 /path/to/u-boot/u-boot.bin my-output-dir
  30. U-Boot Manual Signing
  31. ---------------------
  32. Amlogic does not provide sources for the firmware and tools needed to create a bootloader
  33. image so it is necessary to obtain binaries from sources published by the board vendor:
  34. .. code-block:: bash
  35. $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  36. $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  37. $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  38. $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  39. $ 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
  40. $ git clone https://github.com/BayLibre/u-boot.git -b buildroot-openlinux-20180418 amlogic-u-boot
  41. $ cd amlogic-u-boot
  42. $ make g12a_u200_v1_defconfig
  43. $ make
  44. $ export UBOOTDIR=$PWD
  45. Download the latest Amlogic buildroot package and extract it:
  46. .. code-block:: bash
  47. $ wget http://openlinux2.amlogic.com:8000/ARM/filesystem/Linux_BSP/buildroot_openlinux_kernel_4.9_fbdev_20180706.tar.gz
  48. $ tar xfz buildroot_openlinux_kernel_4.9_fbdev_20180706.tar.gz buildroot_openlinux_kernel_4.9_fbdev_20180706/bootloader
  49. $ export BRDIR=$PWD/buildroot_openlinux_kernel_4.9_fbdev_20180706
  50. $ export FIPDIR=$BRDIR/bootloader/uboot-repo/fip
  51. Go back to the mainline U-Boot source tree then:
  52. .. code-block:: bash
  53. $ mkdir fip
  54. $ wget https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh -O fip/blx_fix.sh
  55. $ cp $UBOOTDIR/build/scp_task/bl301.bin fip/
  56. $ cp $UBOOTDIR/build/board/amlogic/g12a_u200_v1/firmware/acs.bin fip/
  57. $ cp $BRDIR/bootloader/uboot-repo/bl2/bin/g12a/bl2.bin fip/
  58. $ cp $BRDIR/bootloader/uboot-repo/bl30/bin/g12a/bl30.bin fip/
  59. $ cp $BRDIR/bootloader/uboot-repo/bl31_1.3/bin/g12a/bl31.img fip/
  60. $ cp $FIPDIR/g12a/ddr3_1d.fw fip/
  61. $ cp $FIPDIR/g12a/ddr4_1d.fw fip/
  62. $ cp $FIPDIR/g12a/ddr4_2d.fw fip/
  63. $ cp $FIPDIR/g12a/diag_lpddr4.fw fip/
  64. $ cp $FIPDIR/g12a/lpddr4_1d.fw fip/
  65. $ cp $FIPDIR/g12a/lpddr4_2d.fw fip/
  66. $ cp $FIPDIR/g12a/piei.fw fip/
  67. $ cp u-boot.bin fip/bl33.bin
  68. $ sh fip/blx_fix.sh \
  69. fip/bl30.bin \
  70. fip/zero_tmp \
  71. fip/bl30_zero.bin \
  72. fip/bl301.bin \
  73. fip/bl301_zero.bin \
  74. fip/bl30_new.bin \
  75. bl30
  76. $ sh fip/blx_fix.sh \
  77. fip/bl2.bin \
  78. fip/zero_tmp \
  79. fip/bl2_zero.bin \
  80. fip/acs.bin \
  81. fip/bl21_zero.bin \
  82. fip/bl2_new.bin \
  83. bl2
  84. $ $FIPDIR/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \
  85. --output fip/bl30_new.bin.g12a.enc \
  86. --level v3
  87. $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \
  88. --output fip/bl30_new.bin.enc \
  89. --level v3 --type bl30
  90. $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \
  91. --output fip/bl31.img.enc \
  92. --level v3 --type bl31
  93. $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \
  94. --output fip/bl33.bin.enc \
  95. --level v3 --type bl33
  96. $ $FIPDIR/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \
  97. --output fip/bl2.n.bin.sig
  98. $ $FIPDIR/g12a/aml_encrypt_g12a --bootmk \
  99. --output fip/u-boot.bin \
  100. --bl2 fip/bl2.n.bin.sig \
  101. --bl30 fip/bl30_new.bin.enc \
  102. --bl31 fip/bl31.img.enc \
  103. --bl33 fip/bl33.bin.enc \
  104. --ddrfw1 fip/ddr4_1d.fw \
  105. --ddrfw2 fip/ddr4_2d.fw \
  106. --ddrfw3 fip/ddr3_1d.fw \
  107. --ddrfw4 fip/piei.fw \
  108. --ddrfw5 fip/lpddr4_1d.fw \
  109. --ddrfw6 fip/lpddr4_2d.fw \
  110. --ddrfw7 fip/diag_lpddr4.fw \
  111. --level v3
  112. Then write U-Boot to SD or eMMC with:
  113. .. code-block:: bash
  114. $ DEV=/dev/boot_device
  115. $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
  116. $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440