pre-generated-fip.rst 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. Pre-Generated FIP File Repo
  3. ===========================
  4. Pre-built Flattened Image Package (FIP) sources and Amlogic signing binaries for many
  5. commercially available boards and some Android STB devices are collected for use with
  6. distro build-systems here: https://github.com/LibreELEC/amlogic-boot-fip
  7. Using the pre-built FIP sources to sign U-Boot is simple, e.g. for LePotato:
  8. .. code-block:: bash
  9. $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
  10. $ cd amlogic-boot-fip
  11. $ mkdir my-output-dir
  12. $ ./build-fip.sh lepotato /path/to/u-boot/u-boot.bin my-output-dir
  13. Then write U-Boot to SD or eMMC with:
  14. .. code-block:: bash
  15. $ DEV=/dev/boot_device
  16. $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
  17. $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440
  18. Files Included
  19. --------------
  20. Amlogic ARMv8 SoCs use a vendor modified variant of the ARM Trusted Firmware-A boot
  21. architecture. See documentation here: https://www.trustedfirmware.org/projects/tf-a/
  22. Trusted Firmware-A uses the following boot elements (simplified):
  23. - BL1: First boot step implemented in ROM on Amlogic SoCs
  24. - BL2: Second boot step used to initialize the SoC main clocks & DDR interface. BL21
  25. and ACS board-specific binaries must be "inserted" into the BL2 binary before signing
  26. and packaging in order to be flashed on the platform
  27. - BL30: Amlogic Secure Co-Processor (SCP) firmware used to handle all system management
  28. operations (DVFS, suspend/resume, ..)
  29. - BL301: Amlogic Secure Co-Processor (SCP) board-specific firmware "plug-in" to handle
  30. custom DVFS & suspend-resume parameters
  31. - BL31: Initializes the interrupt controller and the system management interface (PSCI)
  32. - BL32 (Optional): Is the Trusted Environment Execution (TEE) Operating System used to
  33. run secure Trusted Apps, e.g. OP-TEE
  34. - BL33: Is the last non-secure step, usually U-Boot which loads Linux
  35. Amlogic sources provide the following binaries:
  36. - bl2.bin
  37. - bl30.bin
  38. - bl30.bin
  39. - bl31.img
  40. - bl32.bin
  41. For G12A/B and SM1 Amlogic also provides DDR drivers used by the BL2 binary:
  42. - ddr4_1d.fw
  43. - ddr4_2d.fw
  44. - ddr3_1d.fw
  45. - piei.fw
  46. - lpddr4_1d.fw
  47. - lpddr4_2d.fw
  48. - diag_lpddr4.fw
  49. - aml_ddr.fw
  50. The following files are generated from the Amlogic U-Boot fork:
  51. - acs.bin: Contains the PLL & DDR parameters for the board
  52. - bl301.bin: Contains the DVFS & suspend-resume handling code for the board
  53. - bl33.bin: U-boot binary image
  54. The acs.bin and bl301.bin files use U-Boot GPL-2.0+ headers and U-Boot build system and
  55. are thus considered to be issued from GPL-2.0+ source code.
  56. Amlogic alo provides pre-compiled x86_64 and Python2 binaries:
  57. - aml_encrypt_gxb
  58. - aml_encrypt_gxl
  59. - aml_encrypt_g12a
  60. - aml_encrypt_g12b
  61. - acs_tool.pyc
  62. The repo replaces the pre-compiled acs_tool.pyc with a Python3 acs_tool.py that can be
  63. used with modern build hosts.
  64. The repo also provides the following files used with GXBB boards:
  65. - bl1.bin.hardkernel
  66. - aml_chksum
  67. The repo also supports the open-source 'gxlimg' signing tool that can be used to sign
  68. U-Boot binaries for GXL/GXM/G12A/G12B/SM1 boards: https://github.com/repk/gxlimg
  69. Licensing
  70. ---------
  71. The licence of Amlogic provided binaries was not historically clear but has now been
  72. clarified. The current Amlogic distribution licence is below:
  73. .. code-block:: C
  74. // Copyright (C) 2018 Amlogic, Inc. All rights reserved.
  75. //
  76. // All information contained herein is Amlogic confidential.
  77. //
  78. // This software is provided to you pursuant to Software License
  79. // Agreement (SLA) with Amlogic Inc ("Amlogic"). This software may be
  80. // used only in accordance with the terms of this agreement.
  81. //
  82. // Redistribution and use in source and binary forms, with or without
  83. // modification is strictly prohibited without prior written permission
  84. // from Amlogic.
  85. //
  86. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  87. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  88. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  89. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  90. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  91. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  92. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  93. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  94. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  95. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  96. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.