README.odroid-n2 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. U-Boot for ODROID-N2
  2. ====================
  3. ODROID-N2 is a single board computer manufactured by Hardkernel
  4. Co. Ltd with the following specifications:
  5. - Amlogic S922X ARM Cortex-A53 dual-core + Cortex-A73 quad-core SoC
  6. - 4GB DDR4 SDRAM
  7. - Gigabit Ethernet
  8. - HDMI 2.1 4K/60Hz display
  9. - 40-pin GPIO header
  10. - 4 x USB 3.0 Host, 1 x USB OTG
  11. - eMMC, microSD
  12. - Infrared receiver
  13. Schematics are available on the manufacturer website.
  14. Currently the u-boot port supports the following devices:
  15. - serial
  16. - eMMC, microSD
  17. - Ethernet
  18. - I2C
  19. - Regulators
  20. - Reset controller
  21. - Clock controller
  22. - ADC
  23. u-boot compilation
  24. ==================
  25. > export ARCH=arm
  26. > export CROSS_COMPILE=aarch64-none-elf-
  27. > make odroid-n2_defconfig
  28. > make
  29. Image creation
  30. ==============
  31. Amlogic doesn't provide sources for the firmware and for tools needed
  32. to create the bootloader image, so it is necessary to obtain them from
  33. the git tree published by the board vendor:
  34. > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  35. > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  36. > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  37. > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  38. > 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
  39. > DIR=odroid-n2
  40. > git clone --depth 1 \
  41. https://github.com/hardkernel/u-boot.git -b odroidn2-v2015.01 \
  42. $DIR
  43. > cd odroid-n2
  44. > make odroidn2_defconfig
  45. > make
  46. > export UBOOTDIR=$PWD
  47. Go back to mainline U-Boot source tree then :
  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/hardkernel/odroidn2/firmware/acs.bin fip/
  52. > cp $UBOOTDIR/fip/g12b/bl2.bin fip/
  53. > cp $UBOOTDIR/fip/g12b/bl30.bin fip/
  54. > cp $UBOOTDIR/fip/g12b/bl31.img fip/
  55. > cp $UBOOTDIR/fip/g12b/ddr3_1d.fw fip/
  56. > cp $UBOOTDIR/fip/g12b/ddr4_1d.fw fip/
  57. > cp $UBOOTDIR/fip/g12b/ddr4_2d.fw fip/
  58. > cp $UBOOTDIR/fip/g12b/diag_lpddr4.fw fip/
  59. > cp $UBOOTDIR/fip/g12b/lpddr4_1d.fw fip/
  60. > cp $UBOOTDIR/fip/g12b/lpddr4_2d.fw fip/
  61. > cp $UBOOTDIR/fip/g12b/piei.fw fip/
  62. > cp $UBOOTDIR/fip/g12b/aml_ddr.fw fip/
  63. > cp u-boot.bin fip/bl33.bin
  64. > sh fip/blx_fix.sh \
  65. fip/bl30.bin \
  66. fip/zero_tmp \
  67. fip/bl30_zero.bin \
  68. fip/bl301.bin \
  69. fip/bl301_zero.bin \
  70. fip/bl30_new.bin \
  71. bl30
  72. > sh fip/blx_fix.sh \
  73. fip/bl2.bin \
  74. fip/zero_tmp \
  75. fip/bl2_zero.bin \
  76. fip/acs.bin \
  77. fip/bl21_zero.bin \
  78. fip/bl2_new.bin \
  79. bl2
  80. > $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \
  81. --output fip/bl30_new.bin.g12a.enc \
  82. --level v3
  83. > $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \
  84. --output fip/bl30_new.bin.enc \
  85. --level v3 --type bl30
  86. > $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl31.img \
  87. --output fip/bl31.img.enc \
  88. --level v3 --type bl31
  89. > $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \
  90. --output fip/bl33.bin.enc \
  91. --level v3 --type bl33 --compress lz4
  92. > $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \
  93. --output fip/bl2.n.bin.sig
  94. > $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bootmk \
  95. --output fip/u-boot.bin \
  96. --bl2 fip/bl2.n.bin.sig \
  97. --bl30 fip/bl30_new.bin.enc \
  98. --bl31 fip/bl31.img.enc \
  99. --bl33 fip/bl33.bin.enc \
  100. --ddrfw1 fip/ddr4_1d.fw \
  101. --ddrfw2 fip/ddr4_2d.fw \
  102. --ddrfw3 fip/ddr3_1d.fw \
  103. --ddrfw4 fip/piei.fw \
  104. --ddrfw5 fip/lpddr4_1d.fw \
  105. --ddrfw6 fip/lpddr4_2d.fw \
  106. --ddrfw7 fip/diag_lpddr4.fw \
  107. --ddrfw8 fip/aml_ddr.fw \
  108. --level v3
  109. and then write the image to SD with:
  110. > DEV=/dev/your_sd_device
  111. > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
  112. > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444