README.khadas-vim2 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 ARCH=arm
  30. > export CROSS_COMPILE=aarch64-none-elf-
  31. > make khadas-vim2_defconfig
  32. > make
  33. Image creation
  34. ==============
  35. Amlogic doesn't provide sources for the firmware and for tools needed
  36. to create the bootloader image, so it is necessary to obtain them from
  37. the git tree published by the board vendor:
  38. > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  39. > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  40. > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  41. > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  42. > 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
  43. > git clone https://github.com/khadas/u-boot -b khadas-vim-v2015.01 vim-u-boot
  44. > cd vim-u-boot
  45. > make kvim2_defconfig
  46. > make
  47. > export FIPDIR=$PWD/fip
  48. Go back to mainline U-Boot source tree then :
  49. > mkdir fip
  50. > cp $FIPDIR/gxl/bl2.bin fip/
  51. > cp $FIPDIR/gxl/acs.bin fip/
  52. > cp $FIPDIR/gxl/bl21.bin fip/
  53. > cp $FIPDIR/gxl/bl30.bin fip/
  54. > cp $FIPDIR/gxl/bl301.bin fip/
  55. > cp $FIPDIR/gxl/bl31.img fip/
  56. > cp u-boot.bin fip/bl33.bin
  57. > $FIPDIR/blx_fix.sh \
  58. fip/bl30.bin \
  59. fip/zero_tmp \
  60. fip/bl30_zero.bin \
  61. fip/bl301.bin \
  62. fip/bl301_zero.bin \
  63. fip/bl30_new.bin \
  64. bl30
  65. > python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
  66. > $FIPDIR/blx_fix.sh \
  67. fip/bl2_acs.bin \
  68. fip/zero_tmp \
  69. fip/bl2_zero.bin \
  70. fip/bl21.bin \
  71. fip/bl21_zero.bin \
  72. fip/bl2_new.bin \
  73. bl2
  74. > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
  75. > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
  76. > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
  77. > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig
  78. > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
  79. --output fip/u-boot.bin \
  80. --bl2 fip/bl2.n.bin.sig \
  81. --bl30 fip/bl30_new.bin.enc \
  82. --bl31 fip/bl31.img.enc \
  83. --bl33 fip/bl33.bin.enc
  84. and then write the image to SD with:
  85. > DEV=/dev/your_sd_device
  86. > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
  87. > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444