p200.rst 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. U-Boot for Amlogic P200 (S905)
  3. ==============================
  4. P200 is a reference board manufactured by Amlogic with the following specification:
  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. - 2x USB 2.0 Host
  11. - eMMC, microSD
  12. - Infrared receiver
  13. - SDIO WiFi Module
  14. - CVBS + Stereo Audio Jack
  15. Schematics are available from Amlogic on demand.
  16. U-Boot Compilation
  17. ------------------
  18. .. code-block:: bash
  19. $ export CROSS_COMPILE=aarch64-none-elf-
  20. $ make p200_defconfig
  21. $ make
  22. U-Boot Signing with Pre-Built FIP repo
  23. --------------------------------------
  24. .. code-block:: bash
  25. $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
  26. $ cd amlogic-boot-fip
  27. $ mkdir my-output-dir
  28. $ ./build-fip.sh p200 /path/to/u-boot/u-boot.bin my-output-dir
  29. U-Boot Manual Signing
  30. ---------------------
  31. Amlogic does not provide sources for the firmware and tools needed to create a bootloader
  32. image but sources have been shared by Linux development contractor, Baylibre:
  33. .. code-block:: bash
  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. $ git clone https://github.com/BayLibre/u-boot.git -b n-amlogic-openlinux-20170606 amlogic-u-boot
  40. $ cd amlogic-u-boot
  41. $ make gxb_p200_v1_defconfig
  42. $ make
  43. $ export FIPDIR=$PWD/fip
  44. Go back to the mainline U-Boot source tree then:
  45. .. code-block:: bash
  46. $ mkdir fip
  47. $ cp $FIPDIR/gxb/bl2.bin fip/
  48. $ cp $FIPDIR/gxb/acs.bin fip/
  49. $ cp $FIPDIR/gxb/bl21.bin fip/
  50. $ cp $FIPDIR/gxb/bl30.bin fip/
  51. $ cp $FIPDIR/gxb/bl301.bin fip/
  52. $ cp $FIPDIR/gxb/bl31.img fip/
  53. $ cp u-boot.bin fip/bl33.bin
  54. $ wget https://github.com/LibreELEC/amlogic-boot-fip/raw/master/nanopi-k2/bl1.bin.hardkernel fip/bl1.bin.hardkernel
  55. $ chmod +x fip/bl1.bin.hardkernel
  56. $ wget https://github.com/LibreELEC/amlogic-boot-fip/raw/master/nanopi-k2/aml_chksum fip/aml_chksum
  57. $ chmod +x fip/aml_chksum
  58. $ $FIPDIR/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. $ python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
  67. $ $FIPDIR/blx_fix.sh \
  68. fip/bl2_acs.bin \
  69. fip/zero_tmp \
  70. fip/bl2_zero.bin \
  71. fip/bl21.bin \
  72. fip/bl21_zero.bin \
  73. fip/bl2_new.bin \
  74. bl2
  75. $ $FIPDIR/fip_create --bl30 fip/bl30_new.bin \
  76. --bl31 fip/bl31.img \
  77. --bl33 fip/bl33.bin \
  78. fip/fip.bin
  79. $ cat fip/bl2_new.bin fip/fip.bin >fip/boot_new.bin
  80. $ $FIPDIR/gxb/aml_encrypt_gxb --bootsig \
  81. --input fip/boot_new.bin \
  82. --output fip/u-boot.bin
  83. and then write the image to SD with:
  84. .. code-block:: bash
  85. $ DEV=/dev/boot_device
  86. $ dd if=fip/u-boot.bin of=fip/u-boot.bin.gxbb bs=512 conv=fsync
  87. $ dd if=fip/u-boot.bin of=fip/u-boot.bin.gxbb bs=512 seek=9 skip=8 count=87 conv=fsync,notrunc
  88. $ dd if=/dev/zero of=fip/u-boot.bin.gxbb bs=512 seek=8 count=1 conv=fsync,notrunc
  89. $ dd if=bl1.bin.hardkernel of=fip/u-boot.bin.gxbb bs=512 seek=2 skip=2 count=1 conv=fsync,notrunc
  90. $ ./aml_chksum fip/u-boot.bin.gxbb
  91. $ dd if=fip/u-boot.gxbb of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
  92. $ dd if=fip/u-boot.gxbb of=$DEV conv=fsync,notrunc bs=1 count=440