README.nanopi-k2 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. U-Boot for NanoPi-K2
  2. ====================
  3. NanoPi-K2 is a single board computer manufactured by FriendlyElec
  4. with the following specifications:
  5. - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz
  6. - ARM Mali 450 GPU
  7. - 2GB DDR3 SDRAM
  8. - Gigabit Ethernet
  9. - HDMI 2.0 4K/60Hz display
  10. - 40-pin GPIO header
  11. - 4 x USB 2.0 Host, 1 x USB OTG
  12. - eMMC, microSD
  13. - Infrared receiver
  14. Schematics are available on the manufacturer website.
  15. Currently the u-boot port supports the following devices:
  16. - serial
  17. - eMMC, microSD
  18. - Ethernet
  19. u-boot compilation
  20. ==================
  21. > export CROSS_COMPILE=aarch64-none-elf-
  22. > make nanopi-k2_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. > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  30. > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  31. > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  32. > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  33. > 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
  34. > git clone https://github.com/BayLibre/u-boot.git -b libretech-cc amlogic-u-boot
  35. > git clone https://github.com/friendlyarm/u-boot.git -b nanopi-k2-v2015.01 amlogic-u-boot
  36. > cd amlogic-u-boot
  37. > sed -i 's/aarch64-linux-gnu-/aarch64-none-elf-/' Makefile
  38. > sed -i 's/arm-linux-/arm-none-eabi-/' arch/arm/cpu/armv8/gxb/firmware/scp_task/Makefile
  39. > make nanopi-k2_defconfig
  40. > make
  41. > export FIPDIR=$PWD/fip
  42. Go back to mainline U-Boot source tree then :
  43. > mkdir fip
  44. > cp $FIPDIR/gxb/bl2.bin fip/
  45. > cp $FIPDIR/gxb/acs.bin fip/
  46. > cp $FIPDIR/gxb/bl21.bin fip/
  47. > cp $FIPDIR/gxb/bl30.bin fip/
  48. > cp $FIPDIR/gxb/bl301.bin fip/
  49. > cp $FIPDIR/gxb/bl31.img fip/
  50. > cp u-boot.bin fip/bl33.bin
  51. > $FIPDIR/blx_fix.sh \
  52. fip/bl30.bin \
  53. fip/zero_tmp \
  54. fip/bl30_zero.bin \
  55. fip/bl301.bin \
  56. fip/bl301_zero.bin \
  57. fip/bl30_new.bin \
  58. bl30
  59. > $FIPDIR/fip_create \
  60. --bl30 fip/bl30_new.bin \
  61. --bl31 fip/bl31.img \
  62. --bl33 fip/bl33.bin \
  63. fip/fip.bin
  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. > cat fip/bl2_new.bin fip/fip.bin > fip/boot_new.bin
  74. > $FIPDIR/gxb/aml_encrypt_gxb --bootsig \
  75. --input fip/boot_new.bin
  76. --output fip/u-boot.bin
  77. and then write the image to SD with:
  78. > DEV=/dev/your_sd_device
  79. > dd if=fip/u-boot.bin of=$DEV conv=fsync,notrunc bs=512 seek=1