khadas-vim2.rst 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. U-Boot for Khadas VIM2
  3. =======================
  4. Khadas VIM2 is an Open Source DIY Box manufactured by Shenzhen Wesion
  5. Technology Co., Ltd with the following specifications:
  6. - Amlogic S912 ARM Cortex-A53 octo-core SoC @ 1.5GHz
  7. - ARM Mali T860 GPU
  8. - 2/3GB DDR4 SDRAM
  9. - 10/100/1000 Ethernet
  10. - HDMI 2.0 4K/60Hz display
  11. - 40-pin GPIO header
  12. - 2 x USB 2.0 Host, 1 x USB 2.0 Type-C OTG
  13. - 16GB/32GB/64GB eMMC
  14. - 2MB SPI Flash
  15. - microSD
  16. - SDIO Wifi Module, Bluetooth
  17. - Two channels IR receiver
  18. U-Boot compilation
  19. ------------------
  20. .. code-block:: bash
  21. $ export CROSS_COMPILE=aarch64-none-elf-
  22. $ make khadas-vim2_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/khadas/u-boot -b khadas-vim-v2015.01 vim-u-boot
  36. $ cd vim-u-boot
  37. $ make kvim2_defconfig
  38. $ make
  39. $ export FIPDIR=$PWD/fip
  40. Go back to mainline U-Boot source tree then :
  41. .. code-block:: bash
  42. $ mkdir fip
  43. $ cp $FIPDIR/gxl/bl2.bin fip/
  44. $ cp $FIPDIR/gxl/acs.bin fip/
  45. $ cp $FIPDIR/gxl/bl21.bin fip/
  46. $ cp $FIPDIR/gxl/bl30.bin fip/
  47. $ cp $FIPDIR/gxl/bl301.bin fip/
  48. $ cp $FIPDIR/gxl/bl31.img fip/
  49. $ cp u-boot.bin fip/bl33.bin
  50. $ $FIPDIR/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. $ python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
  59. $ $FIPDIR/blx_fix.sh \
  60. fip/bl2_acs.bin \
  61. fip/zero_tmp \
  62. fip/bl2_zero.bin \
  63. fip/bl21.bin \
  64. fip/bl21_zero.bin \
  65. fip/bl2_new.bin \
  66. bl2
  67. $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
  68. $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
  69. $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
  70. $ $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig
  71. $ $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
  72. --output fip/u-boot.bin \
  73. --bl2 fip/bl2.n.bin.sig \
  74. --bl30 fip/bl30_new.bin.enc \
  75. --bl31 fip/bl31.img.enc \
  76. --bl33 fip/bl33.bin.enc
  77. and then write the image to SD with:
  78. .. code-block:: bash
  79. $ DEV=/dev/your_sd_device
  80. $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
  81. $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444