odroid-n2.rst 4.2 KB

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