README.w400 4.3 KB

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