libretech-cc.rst 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. U-Boot for LibreTech CC 'LePotato' (S905X)
  3. ==========================================
  4. LibreTech CC is a Single Board Computer manufactured by Libre Computer Technology with
  5. the following specifications:
  6. v1:
  7. - Amlogic S905X ARM Cortex-A53 quad-core SoC @ 1.5GHz
  8. - ARM Mali 450 GPU
  9. - 2GB DDR3 SDRAM
  10. - 10/100 Ethernet
  11. - HDMI 2.0 4K/60Hz display
  12. - 40-pin GPIO header
  13. - 4 x USB 2.0 Host
  14. - eMMC, microSD
  15. - Infrared receiver
  16. - Jack for CVBS and Audio
  17. v2:
  18. - Added SPI NOR
  19. - Removed Jack
  20. Schematics are available on the manufacturer website.
  21. U-Boot Compilation
  22. ------------------
  23. .. code-block:: bash
  24. $ export CROSS_COMPILE=aarch64-none-elf-
  25. $ make libretech-cc_defconfig
  26. $ make
  27. Use libretech-cc_v2_defconfig for v2.
  28. U-Boot Signing with Pre-Built FIP repo
  29. --------------------------------------
  30. .. code-block:: bash
  31. $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
  32. $ cd amlogic-boot-fip
  33. $ mkdir my-output-dir
  34. $ ./build-fip.sh lepotato /path/to/u-boot/u-boot.bin my-output-dir
  35. U-Boot Manual Signing
  36. ---------------------
  37. Amlogic does not provide sources for the firmware and tools needed to create a bootloader
  38. image so it is necessary to obtain binaries from sources published by the board vendor:
  39. .. code-block:: bash
  40. $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  41. $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  42. $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
  43. $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
  44. $ 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
  45. $ git clone https://github.com/BayLibre/u-boot.git -b libretech-cc amlogic-u-boot
  46. $ cd amlogic-u-boot
  47. $ make libretech_cc_defconfig
  48. $ make
  49. $ export FIPDIR=$PWD/fip
  50. Go back to the mainline U-Boot source tree then:
  51. .. code-block:: bash
  52. $ mkdir fip
  53. $ cp $FIPDIR/gxl/bl2.bin fip/
  54. $ cp $FIPDIR/gxl/acs.bin fip/
  55. $ cp $FIPDIR/gxl/bl21.bin fip/
  56. $ cp $FIPDIR/gxl/bl30.bin fip/
  57. $ cp $FIPDIR/gxl/bl301.bin fip/
  58. $ cp $FIPDIR/gxl/bl31.img fip/
  59. $ cp u-boot.bin fip/bl33.bin
  60. $ $FIPDIR/blx_fix.sh \
  61. fip/bl30.bin \
  62. fip/zero_tmp \
  63. fip/bl30_zero.bin \
  64. fip/bl301.bin \
  65. fip/bl301_zero.bin \
  66. fip/bl30_new.bin \
  67. bl30
  68. $ $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
  69. $ $FIPDIR/blx_fix.sh \
  70. fip/bl2_acs.bin \
  71. fip/zero_tmp \
  72. fip/bl2_zero.bin \
  73. fip/bl21.bin \
  74. fip/bl21_zero.bin \
  75. fip/bl2_new.bin \
  76. bl2
  77. $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
  78. $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
  79. $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
  80. $ $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig
  81. $ $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
  82. --output fip/u-boot.bin \
  83. --bl2 fip/bl2.n.bin.sig \
  84. --bl30 fip/bl30_new.bin.enc \
  85. --bl31 fip/bl31.img.enc \
  86. --bl33 fip/bl33.bin.enc
  87. Then write U-Boot to SD or eMMC with:
  88. .. code-block:: bash
  89. $ DEV=/dev/boot_device
  90. $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
  91. $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440