README.khadas-vim2 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. U-Boot for Khadas VIM2
  2. =======================
  3. Khadas VIM2 is an Open Source DIY Box manufactured by Shenzhen Wesion
  4. Technology Co., Ltd with the following specifications:
  5. - Amlogic S912 ARM Cortex-A53 octo-core SoC @ 1.5GHz
  6. - ARM Mali T860 GPU
  7. - 2/3GB DDR4 SDRAM
  8. - 10/100/1000 Ethernet
  9. - HDMI 2.0 4K/60Hz display
  10. - 40-pin GPIO header
  11. - 2 x USB 2.0 Host, 1 x USB 2.0 Type-C OTG
  12. - 16GB/32GB/64GB eMMC
  13. - 2MB SPI Flash
  14. - microSD
  15. - SDIO Wifi Module, Bluetooth
  16. - Two channels IR receiver
  17. Currently the u-boot port supports the following devices:
  18. - serial
  19. - eMMC, microSD
  20. - Ethernet
  21. - I2C
  22. - Regulators
  23. - Reset controller
  24. - Clock controller
  25. - USB Host
  26. - ADC
  27. U-Boot compilation
  28. ==================
  29. > export CROSS_COMPILE=aarch64-none-elf-
  30. > make khadas-vim2_defconfig
  31. > make
  32. Image creation
  33. ==============
  34. Amlogic doesn't provide sources for the firmware and for tools needed
  35. to create the bootloader image, so it is necessary to obtain them from
  36. the git tree published by the board vendor:
  37. > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  38. > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  39. > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  40. > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  41. > 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
  42. > git clone https://github.com/khadas/u-boot -b khadas-vim-v2015.01 vim-u-boot
  43. > cd vim-u-boot
  44. > make kvim2_defconfig
  45. > make
  46. > export FIPDIR=$PWD/fip
  47. Go back to mainline U-Boot source tree then :
  48. > mkdir fip
  49. > cp $FIPDIR/gxl/bl2.bin fip/
  50. > cp $FIPDIR/gxl/acs.bin fip/
  51. > cp $FIPDIR/gxl/bl21.bin fip/
  52. > cp $FIPDIR/gxl/bl30.bin fip/
  53. > cp $FIPDIR/gxl/bl301.bin fip/
  54. > cp $FIPDIR/gxl/bl31.img fip/
  55. > cp u-boot.bin fip/bl33.bin
  56. > $FIPDIR/blx_fix.sh \
  57. fip/bl30.bin \
  58. fip/zero_tmp \
  59. fip/bl30_zero.bin \
  60. fip/bl301.bin \
  61. fip/bl301_zero.bin \
  62. fip/bl30_new.bin \
  63. bl30
  64. > python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
  65. > $FIPDIR/blx_fix.sh \
  66. fip/bl2_acs.bin \
  67. fip/zero_tmp \
  68. fip/bl2_zero.bin \
  69. fip/bl21.bin \
  70. fip/bl21_zero.bin \
  71. fip/bl2_new.bin \
  72. bl2
  73. > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
  74. > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
  75. > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
  76. > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig
  77. > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
  78. --output fip/u-boot.bin \
  79. --bl2 fip/bl2.n.bin.sig \
  80. --bl30 fip/bl30_new.bin.enc \
  81. --bl31 fip/bl31.img.enc \
  82. --bl33 fip/bl33.bin.enc
  83. and then write the image to SD with:
  84. > DEV=/dev/your_sd_device
  85. > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
  86. > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444