u200.rst 4.5 KB

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