diff options
Diffstat (limited to 'doc/board')
39 files changed, 2786 insertions, 1306 deletions
diff --git a/doc/board/amlogic/bananapi-cm4io.rst b/doc/board/amlogic/bananapi-cm4io.rst new file mode 100644 index 0000000..672cbee --- /dev/null +++ b/doc/board/amlogic/bananapi-cm4io.rst @@ -0,0 +1,153 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +U-Boot for BananaPi CM4 with CM4IO (A311D) +========================================== + +BPI-CM4 is a system-on-module board manufactured by Sinovoip. It follows the Raspberry Pi +CM4 interface specification but with a single HDMI port and a single DSI output: + + - Amlogic A311D Arm Cortex-A53 dual-core + Cortex-A73 quad-core SoC + - 4GB DDR4 SDRAM + - 16GB eMMC + - NPU + - HDMI 2.1 display + - Gigabit Ethernet + - RTL8822CS WiFi (a/b/g/n/ac) + BT 5.0 + +BPI-CM4IO is a carrier board for the BPI-CM4 module with the following specification: + + - CM4 interface + - HDMI interface + - MIPI CSI interface + - MIPI DSI interface + - Ethernet interface + - PCIe interface + - SD (micro) + - SIM (micro) + - 26-pin GPIO + - UART serial + - 1x USB-C (power) + - 2x USB 2.0 + +Schematics are available from the manufacturer: https://wiki.banana-pi.org/Banana_Pi_BPI-CM4 + +U-Boot Compilation +------------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=aarch64-none-elf- + $ make bananapi-cm4io_defconfig + $ make + +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh bananapi-cm4io /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: + +.. code-block:: bash + + $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + $ 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 + + $ DIR=bananapi-cm4io + $ git clone --depth 1 https://github.com/Dangku/amlogic-u-boot.git -b khadas-g12b-v2015.01-m2s $DIR + + $ cd $DIR + $ make bananapi_cm4_defconfig + $ make + $ export UBDIR=$PWD + +Go back to the mainline U-Boot source tree then: + +.. code-block:: bash + + $ mkdir fip + + $ wget https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh -O fip/blx_fix.sh + $ cp $UBDIR/build/scp_task/bl301.bin fip/ + $ cp $UBDIR/build/board/bananapi/bananpi_cm4/firmware/acs.bin fip/ + $ cp $UBDIR/fip/g12a/bl2.bin fip/ + $ cp $UBDIR/fip/g12a/bl30.bin fip/ + $ cp $UBDIR/fip/g12a/bl31.img fip/ + $ cp $UBDIR/fip/g12a/ddr3_1d.fw fip/ + $ cp $UBDIR/fip/g12a/ddr4_1d.fw fip/ + $ cp $UBDIR/fip/g12a/ddr4_2d.fw fip/ + $ cp $UBDIR/fip/g12a/diag_lpddr4.fw fip/ + $ cp $UBDIR/fip/g12a/lpddr3_1d.fw fip/ + $ cp $UBDIR/fip/g12a/lpddr4_1d.fw fip/ + $ cp $UBDIR/fip/g12a/lpddr4_2d.fw fip/ + $ cp $UBDIR/fip/g12a/piei.fw fip/ + $ cp $UBDIR/fip/g12a/aml_ddr.fw fip/ + $ cp u-boot.bin fip/bl33.bin + + $ sh fip/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + $ sh fip/blx_fix.sh \ + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + $ $UBDIR/fip/g12b/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \ + --output fip/bl30_new.bin.g12a.enc \ + --level v3 + $ $UBDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \ + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 + $ $UBDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl31.img \ + --output fip/bl31.img.enc \ + --level v3 --type bl31 + $ $UBDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \ + --output fip/bl33.bin.enc \ + --level v3 --type bl33 --compress lz4 + $ $UBDIR/fip/g12b/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \ + --output fip/bl2.n.bin.sig + $ $UBDIR/fip/g12b/aml_encrypt_g12b --bootmk \ + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --ddrfw8 fip/aml_ddr.fw \ + --ddrfw9 fip/lpddr3_1d.fw \ + --level v3 + +Then write the image to SD or eMMC with: + +.. code-block:: bash + + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/bananapi-m2pro.rst b/doc/board/amlogic/bananapi-m2pro.rst new file mode 100644 index 0000000..6c35943 --- /dev/null +++ b/doc/board/amlogic/bananapi-m2pro.rst @@ -0,0 +1,143 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +U-Boot for BananaPi BPI-M2-PRO (S905X3) +======================================= + +BananaPi BPI-M2-PRO is a Single Board Computer manufactured by Sinovoip with the +following specification: + + - Amlogic S905X3 Arm Cortex-A55 quad-core SoC + - 2GB DDR4 SDRAM + - 16GB eMMC + - Gigabit Ethernet + - RTL8821CU USB WiFi (a/b/g/n/ac) + BT 5.0 + - HDMI 2.1 display + - 40-pin GPIO header + - 2x USB 3.0 Host + - 1x DC Jack (power) + - microSD + - UART serial + - Infrared receiver + +Schematics are available from the manufacturer: https://wiki.banana-pi.org/Banana_Pi_BPI-M2_Pro + +U-Boot Compilation +------------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=aarch64-none-elf- + $ make bananapi-m2pro_defconfig + $ make + +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh bananapi-m2pro /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: + +.. code-block:: bash + + $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + $ 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 + + $ DIR=bananapi-m2pro + $ git clone --depth 1 https://github.com/Dangku/amlogic-u-boot.git -b odroidg12-v2015.01-c4-m5 $DIR + + $ cd $DIR + $ make bananapi_m2pro_defconfig + $ make + $ export UBOOTDIR=$PWD + +Go back to the mainline U-Boot source tree then: + +.. code-block:: bash + + $ mkdir fip + + $ wget https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh -O fip/blx_fix.sh + $ cp $UBOOTDIR/build/scp_task/bl301.bin fip/ + $ cp $UBOOTDIR/build/board/bananapi/bananpi_m5/firmware/acs.bin fip/ + $ cp $UBOOTDIR/fip/g12a/bl2.bin fip/ + $ cp $UBOOTDIR/fip/g12a/bl30.bin fip/ + $ cp $UBOOTDIR/fip/g12a/bl31.img fip/ + $ cp $UBOOTDIR/fip/g12a/ddr3_1d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/ddr4_1d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/ddr4_2d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/diag_lpddr4.fw fip/ + $ cp $UBOOTDIR/fip/g12a/lpddr3_1d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/lpddr4_1d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/lpddr4_2d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/piei.fw fip/ + $ cp $UBOOTDIR/fip/g12a/aml_ddr.fw fip/ + $ cp u-boot.bin fip/bl33.bin + + $ sh fip/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + $ sh fip/blx_fix.sh \ + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \ + --output fip/bl30_new.bin.g12a.enc \ + --level v3 + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \ + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \ + --output fip/bl31.img.enc \ + --level v3 --type bl31 + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \ + --output fip/bl33.bin.enc \ + --level v3 --type bl33 --compress lz4 + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \ + --output fip/bl2.n.bin.sig + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bootmk \ + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --ddrfw8 fip/aml_ddr.fw \ + --ddrfw9 fip/lpddr3_1d.fw \ + --level v3 + +Then write the image to SD or eMMC with: + +.. code-block:: bash + + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/bananapi-m2s.rst b/doc/board/amlogic/bananapi-m2s.rst new file mode 100644 index 0000000..4a1be47 --- /dev/null +++ b/doc/board/amlogic/bananapi-m2s.rst @@ -0,0 +1,153 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +U-Boot for BananaPi M2S (A311D & S922X) +======================================= + +BananaPi BPI-M2S ships is a Single Board Computer manufactured by Sinovoip that ships in +two variants with Amlogic S922X or A311D SoC and the following common specification: + +- 16GB eMMC +- HDMI 2.1a video +- 2x 10/100/1000 Base-T Ethernet (1x RTL8211F, 1x RTL811H) +- 2x USB 2.0 ports +- 2x Status LED's (green/blue) +- 1x Power/Reset button +- 1x micro SD card slot +- 40-pin GPIO header +- PWM fan header +- UART header + +The S992X variant has: +- 2GB LPDDR4 RAM + +The A311D variant has: + +- 4GB LPDDR4 RAM +- NPU (5.0 TOPS) +- MIPI DSI header +- MIPI CSI header + +An optional RTL8822CS SDIO WiFi/BT mezzanine is available for both board variants. + +Schematics are available from the manufacturer: https://wiki.banana-pi.org/Banana_Pi_BPI-M2S + +U-Boot Compilation +------------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=aarch64-none-elf- + $ make bananapi-m2s_defconfig + $ make + +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh bananapi-m2s /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: + +.. code-block:: bash + + $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + $ 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 + + $ DIR=bananapi-m2s + $ git clone --depth 1 https://github.com/Dangku/amlogic-u-boot.git -b khadas-g12b-v2015.01-m2s $DIR + + $ cd $DIR + $ make bananapi_m2s_defconfig + $ make + $ export UBDIR=$PWD + +Go back to the mainline U-Boot source tree then: + +.. code-block:: bash + + $ mkdir fip + + $ wget https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh -O fip/blx_fix.sh + $ cp $UBDIR/build/scp_task/bl301.bin fip/ + $ cp $UBDIR/build/board/bananapi/bananpi_m2s/firmware/acs.bin fip/ + $ cp $UBDIR/fip/g12a/bl2.bin fip/ + $ cp $UBDIR/fip/g12a/bl30.bin fip/ + $ cp $UBDIR/fip/g12a/bl31.img fip/ + $ cp $UBDIR/fip/g12a/ddr3_1d.fw fip/ + $ cp $UBDIR/fip/g12a/ddr4_1d.fw fip/ + $ cp $UBDIR/fip/g12a/ddr4_2d.fw fip/ + $ cp $UBDIR/fip/g12a/diag_lpddr4.fw fip/ + $ cp $UBDIR/fip/g12a/lpddr3_1d.fw fip/ + $ cp $UBDIR/fip/g12a/lpddr4_1d.fw fip/ + $ cp $UBDIR/fip/g12a/lpddr4_2d.fw fip/ + $ cp $UBDIR/fip/g12a/piei.fw fip/ + $ cp $UBDIR/fip/g12a/aml_ddr.fw fip/ + $ cp u-boot.bin fip/bl33.bin + + $ sh fip/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + $ sh fip/blx_fix.sh \ + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + $ $UBDIR/fip/g12b/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \ + --output fip/bl30_new.bin.g12a.enc \ + --level v3 + $ $UBDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \ + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 + $ $UBDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl31.img \ + --output fip/bl31.img.enc \ + --level v3 --type bl31 + $ $UBDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \ + --output fip/bl33.bin.enc \ + --level v3 --type bl33 --compress lz4 + $ $UBDIR/fip/g12b/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \ + --output fip/bl2.n.bin.sig + $ $UBDIR/fip/g12b/aml_encrypt_g12b --bootmk \ + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --ddrfw8 fip/aml_ddr.fw \ + --ddrfw9 fip/lpddr3_1d.fw \ + --level v3 + +Then write the image to SD or eMMC with: + +.. code-block:: bash + + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/bananapi-m5.rst b/doc/board/amlogic/bananapi-m5.rst new file mode 100644 index 0000000..009ea0b --- /dev/null +++ b/doc/board/amlogic/bananapi-m5.rst @@ -0,0 +1,142 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +U-Boot for BananaPi BPI-M5 (S905X3) +=================================== + +BananaPi BPI-M5 is a Single Board Computer manufactured by Sinovoip with the following +specification: + + - Amlogic S905X3 Arm Cortex-A55 quad-core SoC + - 4GB DDR4 SDRAM + - 16GB eMMC + - Gigabit Ethernet + - HDMI 2.1 display + - 40-pin GPIO header + - 4x USB 3.0 Host + - 1x USB-C (power) + - microSD + - UART serial + - Infrared receiver + +Schematics are available from the manufacturer: https://wiki.banana-pi.org/Banana_Pi_BPI-M5 + +U-Boot Compilation +------------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=aarch64-none-elf- + $ make bananapi-m5_defconfig + $ make + +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh bananapi-m5 /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: + +.. code-block:: bash + + $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + $ 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 + + $ DIR=bananapi-m5 + $ git clone --depth 1 https://github.com/Dangku/amlogic-u-boot.git -b odroidg12-v2015.01-c4-m5 $DIR + + $ cd $DIR + $ make bananapi_m5_defconfig + $ make + $ export UBOOTDIR=$PWD + +Go back to the mainline U-Boot source tree then: + +.. code-block:: bash + + $ mkdir fip + + $ wget https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh -O fip/blx_fix.sh + $ cp $UBOOTDIR/build/scp_task/bl301.bin fip/ + $ cp $UBOOTDIR/build/board/bananapi/bananpi_m5/firmware/acs.bin fip/ + $ cp $UBOOTDIR/fip/g12a/bl2.bin fip/ + $ cp $UBOOTDIR/fip/g12a/bl30.bin fip/ + $ cp $UBOOTDIR/fip/g12a/bl31.img fip/ + $ cp $UBOOTDIR/fip/g12a/ddr3_1d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/ddr4_1d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/ddr4_2d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/diag_lpddr4.fw fip/ + $ cp $UBOOTDIR/fip/g12a/lpddr3_1d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/lpddr4_1d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/lpddr4_2d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/piei.fw fip/ + $ cp $UBOOTDIR/fip/g12a/aml_ddr.fw fip/ + $ cp u-boot.bin fip/bl33.bin + + $ sh fip/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + $ sh fip/blx_fix.sh \ + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \ + --output fip/bl30_new.bin.g12a.enc \ + --level v3 + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \ + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \ + --output fip/bl31.img.enc \ + --level v3 --type bl31 + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \ + --output fip/bl33.bin.enc \ + --level v3 --type bl33 --compress lz4 + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \ + --output fip/bl2.n.bin.sig + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bootmk \ + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --ddrfw8 fip/aml_ddr.fw \ + --ddrfw9 fip/lpddr3_1d.fw \ + --level v3 + +Then write the image to SD or eMMC with: + +.. code-block:: bash + + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/beelink-gskingx.rst b/doc/board/amlogic/beelink-gskingx.rst new file mode 100644 index 0000000..8a8296e --- /dev/null +++ b/doc/board/amlogic/beelink-gskingx.rst @@ -0,0 +1,122 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +U-Boot for Beelink GS-King-X (S922X) +==================================== + +The Shenzen AZW (Beelink) GS-King-X is based on the Amlogic W400 reference board with an +S922X-H chip and the following specifications: + +- 4GB LPDDR4 RAM +- 64GB eMMC storage +- 10/100/1000 Base-T Ethernet +- AP6356S Wireless (802.11 a/b/g/n/ac, BT 4.1) +- HDMI 2.1 video +- S/PDIF optical output +- 2x ESS9018 audio DACs +- 4x Ricor RT6862 audio amps +- Analogue headphone output +- 1x USB 2.0 OTG port +- 3x USB 3.0 ports +- IR receiver +- 1x micro SD card slot (internal) +- USB SATA controller with 2x 3.5" drive bays +- 1x Power on/off button + +Beelink do not provide public schematics, but have been willing to share them with known +distro developers to assist with development. + +U-Boot Compilation +------------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=aarch64-none-elf- + $ make beelink-gsking-x_defconfig + $ make + +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh beelink-s922x /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- + +Beelink released an Amlogic "SDK" dump in their forums but the U-Boot sources included +result in 2GB RAM detected. The following FIPs were generated with newer sources and +detect 4GB RAM: https://github.com/LibreELEC/amlogic-boot-fip/tree/master/beelink-s922x + +.. code-block:: bash + + $ wget https://github.com/LibreELEC/amlogic-boot-fip/archive/master.zip + $ unzip master.zip + $ export FIPDIR=$PWD/amlogic-boot-fip/beelink-s922x + +Go back to the mainline U-Boot source tree then: + +.. code-block:: bash + + $ mkdir fip + $ cp $FIPDIR/* fip/ + $ cp u-boot.bin fip/bl33.bin + + $ sh fip/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + $ sh fip/blx_fix.sh \ + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + $ fip/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \ + --output fip/bl30_new.bin.g12a.enc \ + --level v3 + $ fip/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \ + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 + $ fip/aml_encrypt_g12b --bl3sig --input fip/bl31.img \ + --output fip/bl31.img.enc \ + --level v3 --type bl31 + $ fip/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \ + --output fip/bl33.bin.enc \ + --level v3 --type bl33 + $ fip/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \ + --output fip/bl2.n.bin.sig + $ fip/aml_encrypt_g12b --bootmk \ + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --ddrfw8 fip/aml_ddr.fw \ + --level v3 + +Then write U-Boot to SD or eMMC with: + +.. code-block:: bash + + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/beelink-gt1-ultimate.rst b/doc/board/amlogic/beelink-gt1-ultimate.rst new file mode 100644 index 0000000..a78a1a2 --- /dev/null +++ b/doc/board/amlogic/beelink-gt1-ultimate.rst @@ -0,0 +1,110 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +U-Boot for Beelink GT1 Ultimate (S912) +====================================== + +Beelink GT1 Ultimate is an Android STB manufactured by Shenzen AZW (Beelink) with the +following specification: + +- 2GB or 3GB DDR3 RAM +- 32GB eMMC +- HDMI 2.1 video +- S/PDIF optical output +- 10/100/1000 Ethernet +- AP6356S Wireless (802.11 a/b/g/n/ac, BT 4.2) +- 3x USB 2.0 ports +- IR receiver +- 1x micro SD card slot +- 1x Power LED (white) +- 1x Reset button (internal) + +The GT1 (non-ultimate) board has QCA9377 WiFi/BT but is otherwise identical and should +be capable of booting images prepared for the Ultimate box (NB: there are known clones +of both boxes which may differ in specifications). + +Beelink do not provide public schematics, but have been willing to share them with known +distro developers on request. + +U-Boot Compilation +------------------ + +.. code-block:: bash + +Â Â Â $ export CROSS_COMPILE=aarch64-none-elf- +Â Â Â $ make beelink-gt1-ultimate_defconfig +Â Â Â $ make + +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + +Â Â Â $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 +Â Â Â $ cd amlogic-boot-fip +Â Â Â $ mkdir my-output-dir +Â Â Â $ ./build-fip.sh beelink-gt1 /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- + +Amlogic does not provide firmware sources or tools needed to create the bootloader image +and Beelink has not publicly shared the U-Boot sources needed to build the FIP binaries +for signing. However you can download them from the amlogic-fip-repo. + +.. code-block:: bash + +Â Â Â $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 +Â Â Â $ cd amlogic-boot-fip/beelink-gt1 +Â Â Â $ export FIPDIR=$PWD + +Go back to the mainline U-Boot source tree then: + +.. code-block:: bash + +Â Â Â $ mkdir fip +Â Â Â $ cp $FIPDIR/bl2.bin fip/ +Â Â Â $ cp $FIPDIR/acs.bin fip/ +Â Â Â $ cp $FIPDIR/bl21.bin fip/ +Â Â Â $ cp $FIPDIR/bl30.bin fip/ +Â Â Â $ cp $FIPDIR/bl301.bin fip/ +Â Â Â $ cp $FIPDIR/bl31.img fip/ +Â Â Â $ cp u-boot.bin fip/bl33.bin + +Â Â Â $ $FIPDIR/blx_fix.sh \ +Â Â Â Â Â Â Â Â Â Â Â Â Â fip/bl30.bin \ +Â Â Â Â Â Â Â Â Â Â Â Â Â fip/zero_tmp \ +Â Â Â Â Â Â Â Â Â Â Â Â Â fip/bl30_zero.bin \ +Â Â Â Â Â Â Â Â Â Â Â Â Â fip/bl301.bin \ +Â Â Â Â Â Â Â Â Â Â Â Â Â fip/bl301_zero.bin \ +Â Â Â Â Â Â Â Â Â Â Â Â Â fip/bl30_new.bin \ +Â Â Â Â Â Â Â Â Â Â Â Â Â bl30 + +Â Â Â $ python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 + +Â Â Â $ $FIPDIR/blx_fix.sh \ +Â Â Â Â Â Â Â Â Â Â Â Â Â fip/bl2_acs.bin \ +Â Â Â Â Â Â Â Â Â Â Â Â Â fip/zero_tmp \ +Â Â Â Â Â Â Â Â Â Â Â Â Â fip/bl2_zero.bin \ +Â Â Â Â Â Â Â Â Â Â Â Â Â fip/bl21.bin \ +Â Â Â Â Â Â Â Â Â Â Â Â Â fip/bl21_zero.bin \ +Â Â Â Â Â Â Â Â Â Â Â Â Â fip/bl2_new.bin \ +Â Â Â Â Â Â Â Â Â Â Â Â Â bl2 + +Â Â Â $ $FIPDIR/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin +Â Â Â $ $FIPDIR/aml_encrypt_gxl --bl3enc --input fip/bl31.img +Â Â Â $ $FIPDIR/aml_encrypt_gxl --bl3enc --input fip/bl33.bin +Â Â Â $ $FIPDIR/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig +Â Â Â $ $FIPDIR/aml_encrypt_gxl --bootmk \ +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â --output fip/u-boot.bin \ +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â --bl2 fip/bl2.n.bin.sig \ +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â --bl30 fip/bl30_new.bin.enc \ +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â --bl31 fip/bl31.img.enc \ +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â --bl33 fip/bl33.bin.enc + +Then write U-Boot to SD or eMMC with: + +.. code-block:: bash + +Â Â Â $ DEV=/dev/boot_device +Â Â Â $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 +Â Â Â $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/beelink-gtking.rst b/doc/board/amlogic/beelink-gtking.rst index 2fb50c5..8171b69 100644 --- a/doc/board/amlogic/beelink-gtking.rst +++ b/doc/board/amlogic/beelink-gtking.rst @@ -1,10 +1,10 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Beelink GT-King -========================== +U-Boot for Beelink GT-King (S922X) +================================== -The Shenzen AZW (Beelink) GT-King is based on the Amlogic W400 reference -board with an S922X-H chip. +The Shenzen AZW (Beelink) GT-King is based on the Amlogic W400 reference board with an +S922X-H chip and the following specifications: - 4GB LPDDR4 RAM - 64GB eMMC storage @@ -18,10 +18,10 @@ board with an S922X-H chip. - IR receiver - 1x micro SD card slot -Beelink do not provide public schematics, but have been willing -to share them with known distro developers on request. +Beelink do not provide public schematics, but have been willing to share them with known +distro developers to assist with development. -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -30,21 +30,22 @@ U-Boot compilation $ make beelink-gtking_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -Amlogic does not provide sources for the firmware and for tools needed -to create the bootloader image. Beelink have provided the Amlogic "SDK" -in their forums, but the u-boot sources included result in 2GB RAM being -detected. The following FIPs were generated with newer private sources -and give correct (4GB) RAM detection: +.. code-block:: bash -https://github.com/LibreELEC/amlogic-boot-fip/tree/master/beelink-s922x + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh beelink-s922x /path/to/u-boot/u-boot.bin my-output-dir -NB: Beelink use a common board config for GT-King, GT-King Pro and the -GS-King-X model, hence the "beelink-s922x" name. +U-Boot Manual Signing +--------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `beelink-s922x` +Beelink released an Amlogic "SDK" dump in their forums, but the U-Boot sources included +result in 2GB RAM detected. The following FIPs were generated with newer sources and +detect 4GB RAM: https://github.com/LibreELEC/amlogic-boot-fip/tree/master/beelink-s922x .. code-block:: bash @@ -61,57 +62,57 @@ Go back to the mainline U-Boot source tree then: $ cp u-boot.bin fip/bl33.bin $ sh fip/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ sh fip/blx_fix.sh \ - fip/bl2.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/acs.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ fip/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \ - --output fip/bl30_new.bin.g12a.enc \ - --level v3 + --output fip/bl30_new.bin.g12a.enc \ + --level v3 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \ - --output fip/bl30_new.bin.enc \ - --level v3 --type bl30 + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl31.img \ - --output fip/bl31.img.enc \ - --level v3 --type bl31 + --output fip/bl31.img.enc \ + --level v3 --type bl31 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \ - --output fip/bl33.bin.enc \ - --level v3 --type bl33 + --output fip/bl33.bin.enc \ + --level v3 --type bl33 $ fip/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \ - --output fip/bl2.n.bin.sig + --output fip/bl2.n.bin.sig $ fip/aml_encrypt_g12b --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc \ - --ddrfw1 fip/ddr4_1d.fw \ - --ddrfw2 fip/ddr4_2d.fw \ - --ddrfw3 fip/ddr3_1d.fw \ - --ddrfw4 fip/piei.fw \ - --ddrfw5 fip/lpddr4_1d.fw \ - --ddrfw6 fip/lpddr4_2d.fw \ - --ddrfw7 fip/diag_lpddr4.fw \ - --ddrfw8 fip/aml_ddr.fw \ - --level v3 - -and then write the image to SD with: + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --ddrfw8 fip/aml_ddr.fw \ + --level v3 + +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/beelink-gtkingpro.rst b/doc/board/amlogic/beelink-gtkingpro.rst index 07bb04b..eb0b7d4 100644 --- a/doc/board/amlogic/beelink-gtkingpro.rst +++ b/doc/board/amlogic/beelink-gtkingpro.rst @@ -1,10 +1,10 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Beelink GT-King Pro -============================== +U-Boot for Beelink GT-King Pro (S922X) +====================================== -The Shenzen AZW (Beelink) GT-King Pro is based on the Amlogic W400 reference -board with an S922X-H chip. +The Shenzen AZW (Beelink) GT-King Pro is based on the Amlogic W400 reference board with +an S922X-H chip and the following specifications: - 4GB LPDDR4 RAM - 64GB eMMC storage @@ -19,10 +19,10 @@ board with an S922X-H chip. - 1x SD card slot - 1x Power on/off button -Beelink do not provide public schematics, but have been willing -to share them with known distro developers on request. +Beelink do not provide public schematics, but have been willing to share them with known +distro developers to assist with development. -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -31,21 +31,22 @@ U-Boot compilation $ make beelink-gtkingpro_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -Amlogic does not provide sources for the firmware and for tools needed -to create the bootloader image. Beelink have provided the Amlogic "SDK" -in their forums, but the u-boot sources included result in 2GB RAM being -detected. The following FIPs were generated with newer private sources -and give correct (4GB) RAM detection: +.. code-block:: bash -https://github.com/LibreELEC/amlogic-boot-fip/tree/master/beelink-s922x + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh beelink-s922x /path/to/u-boot/u-boot.bin my-output-dir -NB: Beelink use a common board config for GT-King, GT-King Pro and the -GS-King-X model, hence the "beelink-s922x" name. +U-Boot Manual Signing +--------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `beelink-s922x` +Beelink released an Amlogic "SDK" dump in their forums, but the U-Boot sources included +result in 2GB RAM detected. The following FIPs were generated with newer sources and +detect 4GB RAM: https://github.com/LibreELEC/amlogic-boot-fip/tree/master/beelink-s922x .. code-block:: bash @@ -62,57 +63,57 @@ Go back to the mainline U-Boot source tree then: $ cp u-boot.bin fip/bl33.bin $ sh fip/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ sh fip/blx_fix.sh \ - fip/bl2.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/acs.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ fip/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \ - --output fip/bl30_new.bin.g12a.enc \ - --level v3 + --output fip/bl30_new.bin.g12a.enc \ + --level v3 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \ - --output fip/bl30_new.bin.enc \ - --level v3 --type bl30 + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl31.img \ - --output fip/bl31.img.enc \ - --level v3 --type bl31 + --output fip/bl31.img.enc \ + --level v3 --type bl31 $ fip/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \ - --output fip/bl33.bin.enc \ - --level v3 --type bl33 + --output fip/bl33.bin.enc \ + --level v3 --type bl33 $ fip/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \ - --output fip/bl2.n.bin.sig + --output fip/bl2.n.bin.sig $ fip/aml_encrypt_g12b --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc \ - --ddrfw1 fip/ddr4_1d.fw \ - --ddrfw2 fip/ddr4_2d.fw \ - --ddrfw3 fip/ddr3_1d.fw \ - --ddrfw4 fip/piei.fw \ - --ddrfw5 fip/lpddr4_1d.fw \ - --ddrfw6 fip/lpddr4_2d.fw \ - --ddrfw7 fip/diag_lpddr4.fw \ - --ddrfw8 fip/aml_ddr.fw \ - --level v3 - -and then write the image to SD with: + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --ddrfw8 fip/aml_ddr.fw \ + --level v3 + +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/boot-flow.rst b/doc/board/amlogic/boot-flow.rst index 2049672..041297c 100644 --- a/doc/board/amlogic/boot-flow.rst +++ b/doc/board/amlogic/boot-flow.rst @@ -3,132 +3,134 @@ Amlogic SoC Boot Flow ===================== -The Amlogic SoCs have a pre-defined boot sequence in the SoC ROM code. Here are -the possible boot sources of different SoC families supported by U-Boot: +Amlogic SoCs follow a pre-defined boot sequence stored in SoC ROM code. The possible boot +sequences of the different SoC families are: -GX* & AXG family +GX* & AXG Family ---------------- -+----------+--------------------+-------+-------+---------------+---------------+ -| | 1 | 2 | 3 | 4 | 5 | -+==========+====================+=======+=======+===============+===============+ -| S905 | POC=0: SPI NOR | eMMC | NAND | SD Card | USB Device | -| S905X | | | | | | -| S905L | | | | | | -| S905W | | | | | | -| S912 | | | | | | -+----------+--------------------+-------+-------+---------------+---------------+ -| S805X | POC=0: SPI NOR | eMMC | NAND | USB Device | - | -| A113D | | | | | | -| A113X | | | | | | -+----------+--------------------+-------+-------+---------------+---------------+ ++----------+-------------------+---------+---------+---------+---------+ +| | 1 | 2 | 3 | 4 | 5 | ++==========+===================+=========+=========+=========+=========+ +| S905 | POC=0: SPI NOR | eMMC | NAND | SD | USB | +| S905D | | | | | | +| S905L | | | | | | +| S905W | | | | | | +| S905X | | | | | | +| S905Y | | | | | | +| S912 | | | | | | ++----------+-------------------+---------+---------+---------+---------+ +| S805X | POC=0: SPI NOR | eMMC | NAND | USB | - | +| A113D | | | | | | +| A113X | | | | | | ++----------+-------------------+---------+---------+---------+---------+ POC pin: `NAND_CLE` -Some boards provide a button to force USB BOOT which disables the eMMC clock signal -to bypass the eMMC stage. Others have removable eMMC modules; removing the eMMC and -SDCard will allow boot from USB. +Some boards provide a button to force USB boot by disabling the eMMC clock signal and +allowing the eMMC step to be bypassed. Others have removable eMMC modules; removing an +eMMC module and SD card will allow boot from USB. -An exception is the lafrite board (aml-s805x-xx) which has no SDCard slot and boots -from SPI. The only ways to boot the lafrite board from USB are: +An exception is the Libre Computer AML-S805X-XX (LaFrite) board which has no SD card +slot and boots from SPI. Booting a LaFrite board from USB requires either: - - Erase the first sectors of SPI NOR flash - - Insert an HDMI boot plug forcing boot over USB + - Erasing the first sectors of SPI NOR flash + - Inserting an HDMI boot plug forcing boot over USB -The VIM1 and initial VIM2 boards provide a test point on the eMMC signals to block -the storage from answering and continue to the next boot step. +The VIM1 and initial VIM2 boards provide a test point on the eMMC signals to block the +storage from answering, allowing boot to continue with the next boot step. -The USB Device boot uses the first USB interface. On some boards this port is only -available on an USB-A type connector and needs an special Type-A to Type-A cable to -communicate with the BootROM. +USB boot uses the first USB interface. On some boards this port is only available on a +USB-A type connector and requires a special Type-A to Type-A cable to communicate with +the BootROM. -G12* & SM1 family +G12* & SM1 Family ----------------- -+-------+-------+-------+---------------+---------------+---------------+---------------+ -| POC0 | POC1 | POC2 | 1 | 2 | 3 | 4 | -+=======+=======+=======+===============+===============+===============+===============+ -| 0 | 0 | 0 | USB Device | SPI NOR | NAND/eMMC | SDCard | -+-------+-------+-------+---------------+---------------+---------------+---------------+ -| 0 | 0 | 1 | USB Device | NAND/eMMC | SDCard | - | -+-------+-------+-------+---------------+---------------+---------------+---------------+ -| 0 | 1 | 0 | SPI NOR | NAND/eMMC | SDCard | USB Device | -+-------+-------+-------+---------------+---------------+---------------+---------------+ -| 0 | 1 | 1 | SPI NAND | NAND/eMMC | USB Device | - | -+-------+-------+-------+---------------+---------------+---------------+---------------+ -| 1 | 0 | 0 | USB Device | SPI NOR | NAND/eMMC | SDCard | -+-------+-------+-------+---------------+---------------+---------------+---------------+ -| 1 | 0 | 1 | USB Device | NAND/eMMC | SDCard | - | -+-------+-------+-------+---------------+---------------+---------------+---------------+ -| 1 | 1 | 0 | SPI NOR | NAND/eMMC | SDCard | USB Device | -+-------+-------+-------+---------------+---------------+---------------+---------------+ -| 1 | 1 | 1 | NAND/eMMC | SDCard | USB Device | - | -+-------+-------+-------+---------------+---------------+---------------+---------------+ - -The last option (1/1/1) is the normal default seen on production devices. ++-------+-------+-------+------------+------------+------------+-----------+ +| POC0 | POC1 | POC2 | 1 | 2 | 3 | 4 | ++=======+=======+=======+============+============+============+===========+ +| 0 | 0 | 0 | USB | SPI-NOR | NAND/eMMC | SD | ++-------+-------+-------+------------+------------+-------------+----------+ +| 0 | 0 | 1 | USB | NAND/eMMC | SD | - | ++-------+-------+-------+------------+------------+------------+-----------+ +| 0 | 1 | 0 | SPI-NOR | NAND/eMMC | SD | USB | ++-------+-------+-------+------------+------------+------------+-----------+ +| 0 | 1 | 1 | SPI-NAND | NAND/eMMC | USB | - | ++-------+-------+-------+------------+------------+------------+-----------+ +| 1 | 0 | 0 | USB | SPI-NOR | NAND/eMMC | SD | ++-------+-------+-------+------------+------------+------------+-----------+ +| 1 | 0 | 1 | USB | NAND/eMMC | SD | - | ++-------+-------+-------+------------+------------+------------+-----------+ +| 1 | 1 | 0 | SPI-NOR | NAND/eMMC | SD | USB | ++-------+-------+-------+------------+------------+------------+-----------+ +| 1 | 1 | 1 | NAND/eMMC | SD | USB | - | ++-------+-------+-------+------------+------------+------------+-----------+ + +The last option (1/1/1) is the normal default seen on production devices: * POC0 pin: `BOOT_4` (0 and all other 1 means SPI NAND boot first) * POC1 pin: `BOOT_5` (0 and all other 1 means USB Device boot first * POC2 pin: `BOOT_6` (0 and all other 1 means SPI NOR boot first) Most boards provide a button to force USB BOOT which lowers `BOOT_5` to 0. Some boards -provide a test point on the eMMC or SPI NOR clock signals to block the storage from -answering and continue to the next boot step. +provide a test point on eMMC or SPI NOR clock signals to block storage from answering +and allowing boot to continue from the next boot step. -The Khadas VIM3/3L boards embed a microcontroller which sets POC signals according -to its configuration or a specific key press sequence to either boot from SPI NOR -or eMMC then SDCard, or boot as an USB Device. +The Khadas VIM3/3L boards embed a microcontroller which sets POC signals according to +its configuration or a specific key press sequence to either boot from SPI NOR or eMMC +then SD card, or boot as a USB device. -The Odroid N2/N2+ has a hardware switch to select between SPI NOR or eMMC boot. +The Odroid N2/N2+ has a hardware switch to select between SPI NOR or eMMC boot. The +Odroid HC4 has a button to disable SPI-NOR allowing boot from SD card. Boot Modes ---------- - * SDCard + * SD -The BootROM fetches the first SDCard sectors in one sequence, then checks the content -of the data. The BootROM expects to find the FIP binary in sector 1, 512 bytes offset -from the start. +The BootROM fetches the first SD card sectors in one sequence then checks the content of +the data. It expects to find the FIP binary in sector 1, 512 bytes offset from the start. * eMMC -The BootROM fetches the first sectors in one sequence, first on the main partition, -and then on the Boot0 followed by Boot1 HW partitions. After each read, the BootROM -checks the data and looks to the next partition if it fails. The BootROM expects to -find the FIP binary in sector 1, 512 bytes offset from the start. +The BootROM fetches the first sectors of the main partition in one sequence then checks +the content of the data. On GXL and newer boards it expects to find the FIP binary in +sector 1, 512 bytes offset from the start. If not found it checks the boot0 partition, +then the boot1 partition. On GXBB it expects to find the FIP binary at an offset that +conflicts with MBR partition tables, but this has been worked around (thus avoiding the +need for a partition scheme that relocates the MBR). For a more detailed explanation +please see: https://github.com/LibreELEC/amlogic-boot-fip/pull/8 - * SPI NOR + * SPI-NOR -The BootROM fetches the first SPI NOR sectors in one sequence, then checks the content -of the data. The BootROM expects to find the FIP binary in sector 1, 512 bytes offset -from the start. +The BootROM fetches the first SPI NOR sectors in one sequence then checks the content of +the data. It expects to find the FIP binary in sector 1, 512 bytes offset from the start. - * NAND & SPI NAND + * NAND & SPI-NAND These modes are rarely used in open platforms and no details are available. - * USB Device + * USB -The BootROM sets the USB Gadget interface to serve a custom USB protocol with the -USB ID 1b8e:c003. The Amlogic `update` utility is designed to use this protocol. It -is also implemented in the Amlogic Vendor U-Boot. +The BootROM supports a custom USB protocol and sets the USB Gadget interface to use the +USB ID 1b8e:c003. The Amlogic `update` utility uses this protocol. It is also supported +in the Amlogic vendor U-Boot sources. -The open-source `pyamlboot` utility https://github.com/superna9999/pyamlboot also -implements this protocol and can load U-Boot in memory in order to start the SoC -without any attached storage or to recover from a failed/incorrect image flash. +The `pyamlboot` utility https://github.com/superna9999/pyamlboot is open-source and also +implements the USB protocol. It can load U-Boot into memory to start the SoC without the +storage being attached, or to recover the device from a failed/incorrect image flash. -HDMI Recovery -------------- +HDMI Recovery Dongle +-------------------- -The BootROM also briefly reads 8 bytes at address I2C 0x52 offset 0xf8 (248) on the -HDMI DDC bus. If the content is `boot@USB` it will force USB boot mode. If the content -is `boot@SDC` it will force SDCard boot mode. +The BootROM also reads 8 bytes at address I2C 0x52 offset 0xf8 (248) on the HDMI DDC bus +during startup. The content `boot@USB` forces USB boot. The content `boot@SDC` forces SD +card boot. The content `boot@SPI` forces SPI-NOT boot. If an SD card or USB device does +not enumerate the BootROM continues with the normal boot sequence. -If USB Device doesn't enumerate or SD Card boot step doesn't work, the BootROM will -continue with the normal boot sequence. +HDMI boot dongles can be created by connecting a 256bytes EEPROM set to answer on address +0x52, with `boot@USB` or `boot@SDC` or `boot@SPI` programmed at offset 0xf8 (248). -Special boot dongles can be built by connecting a 256bytes EEPROM set to answer on -address 0x52, and program `boot@USB` or `boot@SDC` at offset 0xf8 (248). - -Note: If the SoC is booted with USB Device forced at first step, it will keep the boot -order on warm reboot. Only cold reboot (power removed) will reset the boot order. +If the SoC is booted with USB Device forced at first step, it will retain the forced boot +order on warm reboot. Only cold reboot (removing power) will reset the boot order. diff --git a/doc/board/amlogic/index.rst b/doc/board/amlogic/index.rst index f945f67..66b581c 100644 --- a/doc/board/amlogic/index.rst +++ b/doc/board/amlogic/index.rst @@ -10,73 +10,65 @@ An up-do-date matrix is also available on: http://linux-meson.com This matrix concerns the actual source code version. -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| | S905 | S905X | S912 | A113X | S905X2 | S922X | S905X3 | -| | | S805X | S905D | | S905D2 | A311D | S905D3 | -| | | S905W | | | S905Y2 | | | -+===============================+===========+=================+==============+=============+============+=============+==============+ -| Boards | Odroid-C2 | P212 | Khadas VIM2 | S400 | U200 | Odroid-N2 | SEI610 | -| | Nanopi-K2 | Khadas-VIM | Libretech-PC | JetHub J100 | SEI510 | Khadas-VIM3 | Khadas-VIM3L | -| | P200 | LibreTech-CC v1 | WeTek Core2 | | Radxa Zero | GT-King/Pro | Odroid-C4 | -| | P201 | LibreTech-AC v2 | | | | GSKing-X | Odroid-HC4 | -| | | JetHub J80 | | | | Odroid-Go- | BananaPi-M5 | -| | | | | | | Ultra | | -| | | | | | | Odroid-N2L | | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| UART | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| Pinctrl/GPIO | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| Clock Control | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| PWM | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| Reset Control | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| Infrared Decoder | No | No | No | No | No | No | No | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| Ethernet | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| Multi-core | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| Fuse access | **Yes** | **Yes** |**Yes** |**Yes** |**Yes** |**Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| SPI (FC) | **Yes** | **Yes** | **Yes** | **Yes** |**Yes** | **Yes** | No | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| SPI (CC) | No | No | No | No | No | No | No | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| I2C | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| USB | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| USB OTG | No | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| eMMC | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| SDCard | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| NAND | No | No | No | No | No | No | No | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| ADC | **Yes** | **Yes** | **Yes** | **Yes** | No | No | No | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| CVBS Output | **Yes** | **Yes** | **Yes** | *N/A* | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| HDMI Output | **Yes** | **Yes** | **Yes** | *N/A* | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| CEC | No | No | No | *N/A* | No | No | No | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| Thermal Sensor | No | No | No | No | No | No | No | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| LCD/LVDS Output | No | *N/A* | No | No | No | No | No | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| MIPI DSI Output | *N/A* | *N/A* | *N/A* | No | No | No | No | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| SoC (version) information | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| PCIe (+NVMe) | *N/A* | *N/A* | *N/A* | **Yes** | **Yes** | **Yes** | **Yes** | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ -| Watchdog | *N/A* | **Yes** | *N/A* | *N/A* | *N/A* | *N/A* | *N/A* | -+-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| SoCs | S905 | S805X | S912 | A113X | S905X2 | S922X | S905X3 | +| | | S905X | S905D | | S905D2 | A311D | S905D3 | +| | | S905W | | | S905Y2 | | | ++===================+===========+==========+==========+==========+==========+==========+==========+ +| UART | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| Pinctrl/GPIO | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| Clock Control | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| PWM | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| Reset Control | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| Infrared Decoder | No | No | No | No | No | No | No | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| Ethernet | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| Multi-core | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| Fuse access | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| SPI (FC) | **Yes** | **Yes** | **Yes** | **Yes** |**Yes** | **Yes** | No | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| SPI (CC) | No | No | No | No | No | No | No | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| I2C | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| USB | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| USB OTG | No | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| eMMC | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| SDCard | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| NAND | No | No | No | No | No | No | No | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| ADC | **Yes** | **Yes** | **Yes** | **Yes** | No | No | No | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| CVBS Output | **Yes** | **Yes** | **Yes** | *N/A* | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| HDMI Output | **Yes** | **Yes** | **Yes** | *N/A* | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| CEC | No | No | No | *N/A* | No | No | No | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| Thermal Sensor | No | No | No | No | No | No | No | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| LCD/LVDS Output | No | *N/A* | No | No | No | No | No | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| MIPI DSI Output | *N/A* | *N/A* | *N/A* | No | No | No | No | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| SoC Rev/Info | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| PCIe (+NVMe) | *N/A* | *N/A* | *N/A* | **Yes** | **Yes** | **Yes** | **Yes** | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ +| Watchdog | *N/A* | **Yes** | *N/A* | *N/A* | *N/A* | *N/A* | *N/A* | ++-------------------+-----------+----------+----------+----------+----------+----------+----------+ Boot Documentation ------------------ @@ -84,8 +76,8 @@ Boot Documentation .. toctree:: :maxdepth: 1 - pre-generated-fip boot-flow + pre-generated-fip Board Documentation ------------------- @@ -93,19 +85,26 @@ Board Documentation .. toctree:: :maxdepth: 1 + bananapi-cm4io + bananapi-m2pro + bananapi-m2s + bananapi-m5 + beelink-gskingx + beelink-gt1-ultimate beelink-gtking beelink-gtkingpro - jethub-j100 jethub-j80 + jethub-j100 + khadas-vim khadas-vim2 - khadas-vim3l khadas-vim3 - khadas-vim + khadas-vim3l libretech-ac libretech-cc nanopi-k2 odroid-c2 odroid-c4 + odroid-hc4 odroid-n2 odroid-n2l odroid-go-ultra @@ -114,9 +113,12 @@ Board Documentation p212 q200 radxa-zero - s400 + radxa-zero2 sei510 sei610 + s400 u200 wetek-core2 + wetek-hub + wetek-play2 w400 diff --git a/doc/board/amlogic/jethub-j100.rst b/doc/board/amlogic/jethub-j100.rst index dd1ed68..86acdaf 100644 --- a/doc/board/amlogic/jethub-j100.rst +++ b/doc/board/amlogic/jethub-j100.rst @@ -1,11 +1,10 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for JetHub J100 -======================= +U-Boot for JetHub J100 (A113X) +============================== -JetHome Jethub D1 (http://jethome.ru/jethub-d1) is a series of home -automation controller manufactured by JetHome with the following -specifications: +JetHome Jethub D1 (http://jethome.ru/jethub-d1) is a home automation controller device +manufactured by JetHome with the following specifications: - Amlogic A113X (ARM Cortex-A53) quad-core up to 1.5GHz - no video out @@ -22,16 +21,15 @@ specifications: - DC source with a voltage of 9 to 56 V / Passive POE - DIN Rail Mounting case -Basic version also has: +The basic version also has: - - TI CC2538 + CC2592 Zigbee Wireless Module with up to 20dBm output - power and Zigbee 3.0 support. + - TI CC2538 + CC2592 Zigbee Wireless with upto 20dBm output power and Zigbee 3.0 - 1 x 1-Wire - 2 x RS-485 - 4 x dry contact digital GPIO inputs - 3 x relay GPIO outputs -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -40,14 +38,21 @@ U-Boot compilation $ make jethub_j100_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `jethub-j100` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh jethub-j100 /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain binaries -from the git tree published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -55,7 +60,7 @@ from the git tree published by the board vendor: $ cd jethub-u-boot $ export FIPDIR=$PWD -Go back to mainline U-boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -90,27 +95,27 @@ Go back to mainline U-boot source tree then : bl2 $ $FIPDIR/j100/aml_encrypt_axg --bl3sig --input fip/bl30_new.bin \ - --output fip/bl30_new.bin.enc \ - --level v3 --type bl30 + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 $ $FIPDIR/j100/aml_encrypt_axg --bl3sig --input fip/bl31.img \ - --output fip/bl31.img.enc \ - --level v3 --type bl31 + --output fip/bl31.img.enc \ + --level v3 --type bl31 $ $FIPDIR/j100/aml_encrypt_axg --bl3sig --input fip/bl33.bin --compress lz4 \ - --output fip/bl33.bin.enc \ - --level v3 --type bl33 + --output fip/bl33.bin.enc \ + --level v3 --type bl33 $ $FIPDIR/j100/aml_encrypt_axg --bl2sig --input fip/bl2_new.bin \ - --output fip/bl2.n.bin.sig + --output fip/bl2.n.bin.sig $ $FIPDIR/j100/aml_encrypt_axg --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc --level v3 + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc --level v3 -and then write the image to eMMC with: +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_emmc_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/jethub-j80.rst b/doc/board/amlogic/jethub-j80.rst index f669a01..9195df6 100644 --- a/doc/board/amlogic/jethub-j80.rst +++ b/doc/board/amlogic/jethub-j80.rst @@ -1,10 +1,10 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for JetHub J80 -====================== +U-Boot for JetHub J80 (S905W) +============================= -JetHome Jethub H1 (http://jethome.ru/jethub-h1) is a home automation -controller manufactured by JetHome with the following specifications: +JetHome Jethub H1 (http://jethome.ru/jethub-h1) is a home automation controller device +manufactured by JetHome with the following specifications: - Amlogic S905W (ARM Cortex-A53) quad-core up to 1.5GHz - No video out @@ -21,7 +21,7 @@ controller manufactured by JetHome with the following specifications: - DC source 5V microUSB - Square plastic case -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -30,14 +30,21 @@ U-Boot compilation $ make jethub_j80_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `jethub-j80` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh jethub-j80 /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain binaries -from the git tree published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -45,7 +52,7 @@ from the git tree published by the board vendor: $ cd jethub-u-boot $ export FIPDIR=$PWD -Go back to mainline U-Boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -84,16 +91,16 @@ Go back to mainline U-Boot source tree then : $ $FIPDIR/j80/aml_encrypt_gxl --bl3enc --input fip/bl33.bin --compress lz4 $ $FIPDIR/j80/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig $ $FIPDIR/j80/aml_encrypt_gxl --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc -and then write the image to SD/eMMC with: +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/khadas-vim.rst b/doc/board/amlogic/khadas-vim.rst index 04025d7..20370ed 100644 --- a/doc/board/amlogic/khadas-vim.rst +++ b/doc/board/amlogic/khadas-vim.rst @@ -1,24 +1,24 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Khadas VIM -====================== +U-Boot for Khadas VIM (S905X) +============================= -Khadas VIM is an Open Source DIY Box manufactured by Shenzhen Wesion -Technology Co., Ltd with the following specifications: +Khadas VIM is a Single Board Computer manufactured by Shenzhen Wesion Technology Co. Ltd +with the following specifications: - Amlogic S905X ARM Cortex-A53 quad-core SoC @ 1.5GHz - ARM Mali 450 GPU - 2GB DDR3 SDRAM + - 8GB/16GB eMMC - 10/100 Ethernet - HDMI 2.0 4K/60Hz display - 40-pin GPIO header - 2 x USB 2.0 Host, 1 x USB 2.0 Type-C OTG - - 8GB/16GBeMMC - microSD - SDIO Wifi Module, Bluetooth - - Two channels IR receiver + - Two channel IR receiver -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -27,14 +27,21 @@ U-Boot compilation $ make khadas-vim_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `khadas-vim` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh khadas-vim /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -64,40 +71,40 @@ Go back to mainline U-Boot source tree then : $ cp u-boot.bin fip/bl33.bin $ $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 $ $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin $ $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig $ $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc -and then write the image to SD with: +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/khadas-vim2.rst b/doc/board/amlogic/khadas-vim2.rst index 7ac3bdc..58f1870 100644 --- a/doc/board/amlogic/khadas-vim2.rst +++ b/doc/board/amlogic/khadas-vim2.rst @@ -1,25 +1,25 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Khadas VIM2 -======================= +U-Boot for Khadas VIM2 (S912) +============================= -Khadas VIM2 is an Open Source DIY Box manufactured by Shenzhen Wesion -Technology Co., Ltd with the following specifications: +Khadas VIM2 is a Single Board Computer manufactured by Shenzhen Wesion Technology Co. Ltd +with the following specifications: - Amlogic S912 ARM Cortex-A53 octo-core SoC @ 1.5GHz - ARM Mali T860 GPU - - 2/3GB DDR4 SDRAM + - 2GB/3GB DDR4 SDRAM + - 16GB/32GB/64GB eMMC - 10/100/1000 Ethernet - HDMI 2.0 4K/60Hz display - 40-pin GPIO header - 2 x USB 2.0 Host, 1 x USB 2.0 Type-C OTG - - 16GB/32GB/64GB eMMC - 2MB SPI Flash - microSD - SDIO Wifi Module, Bluetooth - Two channels IR receiver -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -28,14 +28,21 @@ U-Boot compilation $ make khadas-vim2_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh khadas-vim2 /path/to/u-boot/u-boot.bin my-output-dir -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `khadas-vim2` +U-Boot Manual Signing +--------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -50,7 +57,7 @@ the git tree published by the board vendor: $ make $ export FIPDIR=$PWD/fip -Go back to mainline U-Boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -65,40 +72,40 @@ Go back to mainline U-Boot source tree then : $ cp u-boot.bin fip/bl33.bin $ $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 $ $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin $ $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig $ $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc -and then write the image to SD with: +Then write U-Boot to SD or eMMC with: .. code-block:: bash $ DEV=/dev/your_sd_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/khadas-vim3.rst b/doc/board/amlogic/khadas-vim3.rst index 73dc32b..4959590 100644 --- a/doc/board/amlogic/khadas-vim3.rst +++ b/doc/board/amlogic/khadas-vim3.rst @@ -1,10 +1,10 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Khadas VIM3 -====================== +U-Boot for Khadas VIM3 (A311D) +============================== -Khadas VIM3 is a single board computer manufactured by Shenzhen Wesion -Technology Co., Ltd. with the following specifications: +Khadas VIM3 is a Single Board Computer manufactured by Shenzhen Wesion Technology Co. Ltd +with the following specifications: - Amlogic A311D Arm Cortex-A53 dual-core + Cortex-A73 quad-core SoC - 4GB LPDDR4 SDRAM @@ -20,32 +20,27 @@ Schematics are available on the manufacturer website. PCIe Setup ---------- -The VIM3 on-board MCU can mux the PCIe/USB3.0 shared differential -lines using a FUSB340TMX USB 3.1 SuperSpeed Data Switch between -an USB3.0 Type A connector and a M.2 Key M slot. -The PHY driving these differential lines is shared between -the USB3.0 controller and the PCIe Controller, thus only -a single controller can use it. -To setup for PCIe, run the following commands from U-Boot: +The on-board MCU can mux the PCIe/USB3.0 shared differential lines using a FUSB340TMX USB +3.1 SuperSpeed Data Switch between a USB3.0 Type-A connector and an M.2 Key M slot. The +PHY driving these differential lines is shared between the USB3.0 controller and the PCIe +Controller, thus only a single controller can use it. + +To setup for PCIe run the following commands from U-Boot then power-cycle the board: .. code-block:: none i2c dev i2c@5000 i2c mw 0x18 0x33 1 -Then power-cycle the board. - -To set back to USB3.0, run the following commands from U-Boot: +To revert to USB3.0 run the following commands from U-Boot then power-cycle the board: .. code-block:: none i2c dev i2c@5000 i2c mw 0x18 0x33 0 -Then power-cycle the board. - -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -54,14 +49,21 @@ U-Boot compilation $ make khadas-vim3_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh khadas-vim3 /path/to/u-boot/u-boot.bin my-output-dir -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `khadas-vim3` +U-Boot Manual Signing +--------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -72,16 +74,14 @@ the git tree published by the board vendor: $ 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 $ DIR=vim3-u-boot - $ git clone --depth 1 \ - https://github.com/khadas/u-boot.git -b khadas-vims-v2015.01 \ - $DIR + $ git clone --depth 1 https://github.com/khadas/u-boot.git -b khadas-vims-v2015.01 $DIR $ cd vim3-u-boot $ make kvim3_defconfig $ make CROSS_COMPILE=aarch64-none-elf- $ export UBOOTDIR=$PWD -Go back to mainline U-Boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -105,58 +105,58 @@ Go back to mainline U-Boot source tree then : $ cp u-boot.bin fip/bl33.bin $ bash fip/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ bash fip/blx_fix.sh \ - fip/bl2.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/acs.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \ - --output fip/bl30_new.bin.g12a.enc \ - --level v3 + --output fip/bl30_new.bin.g12a.enc \ + --level v3 $ $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \ - --output fip/bl30_new.bin.enc \ - --level v3 --type bl30 + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 $ $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl31.img \ - --output fip/bl31.img.enc \ - --level v3 --type bl31 + --output fip/bl31.img.enc \ + --level v3 --type bl31 $ $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \ - --output fip/bl33.bin.enc \ - --level v3 --type bl33 --compress lz4 + --output fip/bl33.bin.enc \ + --level v3 --type bl33 --compress lz4 $ $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \ - --output fip/bl2.n.bin.sig + --output fip/bl2.n.bin.sig $ $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc \ - --ddrfw1 fip/ddr4_1d.fw \ - --ddrfw2 fip/ddr4_2d.fw \ - --ddrfw3 fip/ddr3_1d.fw \ - --ddrfw4 fip/piei.fw \ - --ddrfw5 fip/lpddr4_1d.fw \ - --ddrfw6 fip/lpddr4_2d.fw \ - --ddrfw7 fip/diag_lpddr4.fw \ - --ddrfw8 fip/aml_ddr.fw \ - --ddrfw9 fip/lpddr3_1d.fw \ - --level v3 - -and then write the image to SD with: + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --ddrfw8 fip/aml_ddr.fw \ + --ddrfw9 fip/lpddr3_1d.fw \ + --level v3 + +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/khadas-vim3l.rst b/doc/board/amlogic/khadas-vim3l.rst index 692ab3d..cd21466 100644 --- a/doc/board/amlogic/khadas-vim3l.rst +++ b/doc/board/amlogic/khadas-vim3l.rst @@ -1,10 +1,10 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Khadas VIM3L -======================= +U-Boot for Khadas VIM3L (S905D3) +================================ -Khadas VIM3L is a single board computer manufactured by Shenzhen Wesion -Technology Co., Ltd. with the following specifications: +Khadas VIM3L is a Single Board Computer manufactured by Shenzhen Wesion Technology Co. Ltd +with the following specifications: - Amlogic S905D3 Arm Cortex-A55 quad-core SoC - 2GB LPDDR4 SDRAM @@ -20,32 +20,27 @@ Schematics are available on the manufacturer website. PCIe Setup ---------- -The VIM3 on-board MCU can mux the PCIe/USB3.0 shared differential -lines using a FUSB340TMX USB 3.1 SuperSpeed Data Switch between -an USB3.0 Type A connector and a M.2 Key M slot. -The PHY driving these differential lines is shared between -the USB3.0 controller and the PCIe Controller, thus only -a single controller can use it. -To setup for PCIe, run the following commands from U-Boot: +The on-board MCU can mux the PCIe/USB3.0 shared differential lines using a FUSB340TMX USB +3.1 SuperSpeed Data Switch between a USB3.0 Type-A connector and an M.2 Key-M slot. The +PHY driving these differential lines is shared between the USB3.0 controller and the PCIe +Controller, thus only a single controller can use it. + +To setup for PCIe run the following commands from U-Boot then power-cycle the board: .. code-block:: none i2c dev i2c@5000 i2c mw 0x18 0x33 1 -Then power-cycle the board. - -To set back to USB3.0, run the following commands from U-Boot: +To revert to USB3.0 run the following commands from U-Boot then power-cycle the board: .. code-block:: none i2c dev i2c@5000 i2c mw 0x18 0x33 0 -Then power-cycle the board. - -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -54,14 +49,21 @@ U-Boot compilation $ make khadas-vim3l_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh khadas-vim3l /path/to/u-boot/u-boot.bin my-output-dir -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `khadas-vim3l` +U-Boot Manual Signing +--------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -72,16 +74,14 @@ the git tree published by the board vendor: $ 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 $ DIR=vim3l-u-boot - $ git clone --depth 1 \ - https://github.com/khadas/u-boot.git -b khadas-vims-v2015.01 \ - $DIR + $ git clone --depth 1 https://github.com/khadas/u-boot.git -b khadas-vims-v2015.01 $DIR $ cd vim3l-u-boot $ make kvim3l_defconfig $ make CROSS_COMPILE=aarch64-none-elf- $ export UBOOTDIR=$PWD -Go back to mainline U-Boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -105,58 +105,58 @@ Go back to mainline U-Boot source tree then : $ cp u-boot.bin fip/bl33.bin $ bash fip/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ bash fip/blx_fix.sh \ - fip/bl2.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/acs.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \ - --output fip/bl30_new.bin.g12a.enc \ - --level v3 + --output fip/bl30_new.bin.g12a.enc \ + --level v3 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \ - --output fip/bl30_new.bin.enc \ - --level v3 --type bl30 + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \ - --output fip/bl31.img.enc \ - --level v3 --type bl31 + --output fip/bl31.img.enc \ + --level v3 --type bl31 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \ - --output fip/bl33.bin.enc \ - --level v3 --type bl33 --compress lz4 + --output fip/bl33.bin.enc \ + --level v3 --type bl33 --compress lz4 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \ - --output fip/bl2.n.bin.sig + --output fip/bl2.n.bin.sig $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc \ - --ddrfw1 fip/ddr4_1d.fw \ - --ddrfw2 fip/ddr4_2d.fw \ - --ddrfw3 fip/ddr3_1d.fw \ - --ddrfw4 fip/piei.fw \ - --ddrfw5 fip/lpddr4_1d.fw \ - --ddrfw6 fip/lpddr4_2d.fw \ - --ddrfw7 fip/diag_lpddr4.fw \ - --ddrfw8 fip/aml_ddr.fw \ - --ddrfw9 fip/lpddr3_1d.fw \ - --level v3 - -and then write the image to SD with: + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --ddrfw8 fip/aml_ddr.fw \ + --ddrfw9 fip/lpddr3_1d.fw \ + --level v3 + +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/libretech-ac.rst b/doc/board/amlogic/libretech-ac.rst index 7a915f9..fa151c0 100644 --- a/doc/board/amlogic/libretech-ac.rst +++ b/doc/board/amlogic/libretech-ac.rst @@ -1,9 +1,9 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for LibreTech AC -======================= +U-Boot for LibreTech-AC 'LaFrite' (S805X) +========================================= -LibreTech AC is a single board computer manufactured by Libre Technology +LibreTech-AC aka 'LaFrite' is a Single Board Computer manufactured by Libre Computer with the following specifications: - Amlogic S805X ARM Cortex-A53 quad-core SoC @ 1.2GHz @@ -13,12 +13,13 @@ with the following specifications: - HDMI 2.0 4K/60Hz display - 40-pin GPIO header - 4 x USB 2.0 Host - - eMMC, SPI NOR Flash + - SPI NOR Flash + - Removable eMMC module - Infrared receiver Schematics are available on the manufacturer website. -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -27,14 +28,21 @@ U-Boot compilation $ make libretech-ac_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `lafrite` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh lafrite /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -50,7 +58,7 @@ the git tree published by the board vendor: $ make $ export UBOOTDIR=$PWD -Download the latest Amlogic Buildroot package, and extract it : +Download the latest Amlogic buildroot package and extract it: .. code-block:: bash @@ -58,7 +66,7 @@ Download the latest Amlogic Buildroot package, and extract it : $ tar xfz buildroot_openlinux_kernel_4.9_fbdev_20180418.tar.gz buildroot_openlinux_kernel_4.9_fbdev_20180418/bootloader $ export BRDIR=$PWD/buildroot_openlinux_kernel_4.9_fbdev_20180418 -Go back to mainline U-Boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -73,40 +81,40 @@ Go back to mainline U-Boot source tree then : $ cp u-boot.bin fip/bl33.bin $ sh $UBOOTDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ $BRDIR/bootloader/uboot-repo/fip/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 $ sh $UBOOTDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $BRDIR/bootloader/uboot-repo/fip/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin $ $BRDIR/bootloader/uboot-repo/fip/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img $ $BRDIR/bootloader/uboot-repo/fip/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin $ $BRDIR/bootloader/uboot-repo/fip/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig $ $BRDIR/bootloader/uboot-repo/fip/gxl/aml_encrypt_gxl --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc -and then write the image to SD with: +Then write U-Boot to USB or SPI-NOR with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/libretech-cc.rst b/doc/board/amlogic/libretech-cc.rst index 596ce45..08a84a4 100644 --- a/doc/board/amlogic/libretech-cc.rst +++ b/doc/board/amlogic/libretech-cc.rst @@ -1,12 +1,12 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for LibreTech CCs -======================== +U-Boot for LibreTech CC 'LePotato' (S905X) +========================================== -LibreTech CC is a single board computer manufactured by Libre Technology -with the following specifications: +LibreTech CC is a Single Board Computer manufactured by Libre Computer Technology with +the following specifications: -V1: +v1: - Amlogic S905X ARM Cortex-A53 quad-core SoC @ 1.5GHz - ARM Mali 450 GPU @@ -19,14 +19,14 @@ V1: - Infrared receiver - Jack for CVBS and Audio -V2: +v2: - Added SPI NOR - Removed Jack Schematics are available on the manufacturer website. -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -37,36 +37,21 @@ U-Boot compilation Use libretech-cc_v2_defconfig for v2. -Image creation --------------- - -To boot the system, u-boot must be combined with several earlier stage -bootloaders: - -* bl2.bin: vendor-provided binary blob -* bl21.bin: built from vendor u-boot source -* bl30.bin: vendor-provided binary blob -* bl301.bin: built from vendor u-boot source -* bl31.bin: vendor-provided binary blob -* acs.bin: built from vendor u-boot source - -These binaries and the tools required below have been collected and prebuilt -for convenience at <https://github.com/BayLibre/u-boot/releases/>. These -apply to both v1 and v2. - -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `lepotato` - -Download and extract the libretech-cc release from there, and set FIPDIR to -point to the `fip` subdirectory. +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- .. code-block:: bash - $ export FIPDIR=/path/to/extracted/fip + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh lepotato /path/to/u-boot/u-boot.bin my-output-dir -Alternatively, you can obtain the original vendor u-boot tree which -contains the required blobs and sources, and build yourself. -Note that old compilers are required for this to build. The compilers here -are suggested by Amlogic, and they are 32-bit x86 binaries. +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -81,9 +66,7 @@ are suggested by Amlogic, and they are 32-bit x86 binaries. $ make $ export FIPDIR=$PWD/fip -Once you have the binaries available (either through the prebuilt download, -or having built the vendor u-boot yourself), you can then proceed to glue -everything together. Go back to mainline U-Boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -98,51 +81,40 @@ everything together. Go back to mainline U-Boot source tree then : $ cp u-boot.bin fip/bl33.bin $ $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 $ $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin $ $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig $ $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc -and then write the image to SD with: +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 - -Note that Amlogic provides aml_encrypt_gxl as a 32-bit x86 binary with no -source code. Should you prefer to avoid that, there are open source reverse -engineered versions available: - -1. gxlimg <https://github.com/repk/gxlimg>, which comes with a handy - Makefile that automates the whole process. -2. meson-tools <https://github.com/afaerber/meson-tools> - -However, these community-developed alternatives are not endorsed by or -supported by Amlogic. + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/nanopi-k2.rst b/doc/board/amlogic/nanopi-k2.rst index 76ff874..53a0a41 100644 --- a/doc/board/amlogic/nanopi-k2.rst +++ b/doc/board/amlogic/nanopi-k2.rst @@ -1,10 +1,10 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for NanoPi-K2 -==================== +U-Boot for NanoPi-K2 (S905) +=========================== -NanoPi-K2 is a single board computer manufactured by FriendlyElec -with the following specifications: +NanoPi-K2 is a single board computer manufactured by FriendlyElec with the following +specifications: - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz - ARM Mali 450 GPU @@ -18,7 +18,7 @@ with the following specifications: Schematics are available on the manufacturer website. -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -27,14 +27,21 @@ U-Boot compilation $ make nanopi-k2_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `nanopi-k2` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh nanopi-k2 /path/to/u-boot/u-boot.bin my-output-dir -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -43,7 +50,6 @@ the git tree published by the board vendor: $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz $ 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 - $ git clone https://github.com/BayLibre/u-boot.git -b libretech-cc amlogic-u-boot $ git clone https://github.com/friendlyarm/u-boot.git -b nanopi-k2-v2015.01 amlogic-u-boot $ cd amlogic-u-boot $ sed -i 's/aarch64-linux-gnu-/aarch64-none-elf-/' Makefile @@ -52,7 +58,7 @@ the git tree published by the board vendor: $ make $ export FIPDIR=$PWD/fip -Go back to mainline U-Boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -65,42 +71,52 @@ Go back to mainline U-Boot source tree then : $ cp $FIPDIR/gxb/bl301.bin fip/ $ cp $FIPDIR/gxb/bl31.img fip/ $ cp u-boot.bin fip/bl33.bin + $ wget https://github.com/LibreELEC/amlogic-boot-fip/raw/master/nanopi-k2/bl1.bin.hardkernel fip/bl1.bin.hardkernel + $ chmod +x fip/bl1.bin.hardkernel + $ wget https://github.com/LibreELEC/amlogic-boot-fip/raw/master/nanopi-k2/aml_chksum fip/aml_chksum + $ chmod +x fip/aml_chksum $ $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 - - $ $FIPDIR/fip_create \ - --bl30 fip/bl30_new.bin \ - --bl31 fip/bl31.img \ - --bl33 fip/bl33.bin \ - fip/fip.bin - + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + $ $FIPDIR/fip_create --bl30 fip/bl30_new.bin \ + --bl31 fip/bl31.img \ + --bl33 fip/bl33.bin \ + fip/fip.bin + + $ sed -i 's/\x73\x02\x08\x91/\x1F\x20\x03\xD5/' fip/bl2.bin $ python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 $ $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ cat fip/bl2_new.bin fip/fip.bin > fip/boot_new.bin $ $FIPDIR/gxb/aml_encrypt_gxb --bootsig \ - --input fip/boot_new.bin - --output fip/u-boot.bin + --input fip/boot_new.bin + --output fip/u-boot.bin -and then write the image to SD with: +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device - $ dd if=fip/u-boot.bin of=$DEV conv=fsync,notrunc bs=512 seek=1 + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin of=fip/u-boot.bin.gxbb bs=512 conv=fsync + $ dd if=fip/u-boot.bin of=fip/u-boot.bin.gxbb bs=512 seek=9 skip=8 count=87 conv=fsync,notrunc + $ dd if=/dev/zero of=fip/u-boot.bin.gxbb bs=512 seek=8 count=1 conv=fsync,notrunc + $ dd if=bl1.bin.hardkernel of=fip/u-boot.bin.gxbb bs=512 seek=2 skip=2 count=1 conv=fsync,notrunc + $ ./aml_chksum fip/u-boot.bin.gxbb + $ dd if=fip/u-boot.gxbb of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.gxbb of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/odroid-c2.rst b/doc/board/amlogic/odroid-c2.rst index 8a1be4b..922ab0c 100644 --- a/doc/board/amlogic/odroid-c2.rst +++ b/doc/board/amlogic/odroid-c2.rst @@ -1,12 +1,12 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for ODROID-C2 -==================== +U-Boot for ODROID-C2 (S905) +=========================== -ODROID-C2 is a single board computer manufactured by Hardkernel -Co. Ltd with the following specifications: +ODROID-C2 is a single board computer manufactured by Hardkernel with the following +specifications: - - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 2GHz + - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz - ARM Mali 450 GPU - 2GB DDR3 SDRAM - Gigabit Ethernet @@ -16,9 +16,9 @@ Co. Ltd with the following specifications: - eMMC, microSD - Infrared receiver -Schematics are available on the manufacturer website. +Schematics are available on the manufacturer website: https://wiki.odroid.com -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -27,38 +27,45 @@ U-Boot compilation $ make odroid-c2_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `odroid-c2` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh odroid-c2 /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash $ DIR=odroid-c2 - $ git clone --depth 1 \ - https://github.com/hardkernel/u-boot.git -b odroidc2-v2015.01 \ - $DIR + $ git clone --depth 1 https://github.com/hardkernel/u-boot.git -b odroidc2-v2015.01 $DIR + $ $DIR/fip/fip_create --bl30 $DIR/fip/gxb/bl30.bin \ - --bl301 $DIR/fip/gxb/bl301.bin \ - --bl31 $DIR/fip/gxb/bl31.bin \ - --bl33 u-boot.bin \ - $DIR/fip.bin + --bl301 $DIR/fip/gxb/bl301.bin \ + --bl31 $DIR/fip/gxb/bl31.bin \ + --bl33 u-boot.bin \ + $DIR/fip.bin + $ $DIR/fip/fip_create --dump $DIR/fip.bin $ cat $DIR/fip/gxb/bl2.package $DIR/fip.bin > $DIR/boot_new.bin $ $DIR/fip/gxb/aml_encrypt_gxb --bootsig \ - --input $DIR/boot_new.bin \ - --output $DIR/u-boot.img + --input $DIR/boot_new.bin \ + --output $DIR/u-boot.img $ dd if=$DIR/u-boot.img of=$DIR/u-boot.gxbb bs=512 skip=96 -and then write the image to SD with: +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/your_boot_device $ BL1=$DIR/sd_fuse/bl1.bin.hardkernel $ dd if=$BL1 of=$DEV conv=fsync bs=1 count=442 $ dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1 diff --git a/doc/board/amlogic/odroid-c4.rst b/doc/board/amlogic/odroid-c4.rst index b512c6a..6994b95 100644 --- a/doc/board/amlogic/odroid-c4.rst +++ b/doc/board/amlogic/odroid-c4.rst @@ -1,10 +1,10 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for ODROID-C4 -==================== +U-Boot for ODROID-C4 (S905X3) +============================= -ODROID-C4 is a single board computer manufactured by Hardkernel -Co. Ltd with the following specifications: +ODROID-C4 is a Single Board Computer manufactured by Hardkernel with the following +specifications: - Amlogic S905X3 Arm Cortex-A55 quad-core SoC - 4GB DDR4 SDRAM @@ -17,12 +17,9 @@ Co. Ltd with the following specifications: - UART serial - Infrared receiver -The ODROID-HC4 is a variant with a PCIe-SATA controller, the same commands -applies for HC4. - Schematics are available on the manufacturer website. -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -31,14 +28,21 @@ U-Boot compilation $ make odroid-c4_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh odroid-c4 /path/to/u-boot/u-boot.bin my-output-dir -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `odroid-c4` or `odroid-hc4` +U-Boot Manual Signing +--------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -58,7 +62,7 @@ the git tree published by the board vendor: $ make $ export UBOOTDIR=$PWD -Go back to mainline U-Boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -82,58 +86,58 @@ Go back to mainline U-Boot source tree then : $ cp u-boot.bin fip/bl33.bin $ sh fip/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ sh fip/blx_fix.sh \ - fip/bl2.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/acs.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \ - --output fip/bl30_new.bin.g12a.enc \ - --level v3 + --output fip/bl30_new.bin.g12a.enc \ + --level v3 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \ - --output fip/bl30_new.bin.enc \ - --level v3 --type bl30 + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \ - --output fip/bl31.img.enc \ - --level v3 --type bl31 + --output fip/bl31.img.enc \ + --level v3 --type bl31 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \ - --output fip/bl33.bin.enc \ - --level v3 --type bl33 --compress lz4 + --output fip/bl33.bin.enc \ + --level v3 --type bl33 --compress lz4 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \ - --output fip/bl2.n.bin.sig + --output fip/bl2.n.bin.sig $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc \ - --ddrfw1 fip/ddr4_1d.fw \ - --ddrfw2 fip/ddr4_2d.fw \ - --ddrfw3 fip/ddr3_1d.fw \ - --ddrfw4 fip/piei.fw \ - --ddrfw5 fip/lpddr4_1d.fw \ - --ddrfw6 fip/lpddr4_2d.fw \ - --ddrfw7 fip/diag_lpddr4.fw \ - --ddrfw8 fip/aml_ddr.fw \ - --ddrfw9 fip/lpddr3_1d.fw \ - --level v3 - -and then write the image to SD with: + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --ddrfw8 fip/aml_ddr.fw \ + --ddrfw9 fip/lpddr3_1d.fw \ + --level v3 + +Then write the image to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/odroid-go-ultra.rst b/doc/board/amlogic/odroid-go-ultra.rst index 8df9e0c..caf0e38 100644 --- a/doc/board/amlogic/odroid-go-ultra.rst +++ b/doc/board/amlogic/odroid-go-ultra.rst @@ -1,10 +1,9 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for ODROID-GO-ULTRA -========================== +U-Boot for ODROID-GO-ULTRA (S922X) +================================== -The Odroid Go Ultra is a portable gaming device with the following -characteristics: +The ODROID GO ULTRA is a portable gaming device with the following characteristics: - Amlogic S922X SoC - RK817 & RK818 PMICs @@ -19,7 +18,7 @@ characteristics: - 2x ADC Analog Joysticks - USB-C Port for USB2 Device and Charging -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -28,7 +27,20 @@ U-Boot compilation $ make odroid-go-ultra_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -Pleaser refer to :doc:`pre-generated-fip` with codename `odroid-go-ultra` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh odroid-go-ultra /path/to/u-boot/u-boot.bin my-output-dir + +Then write the image to SD or eMMC with: + +.. code-block:: bash + + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/odroid-hc4.rst b/doc/board/amlogic/odroid-hc4.rst new file mode 100644 index 0000000..1d37be2 --- /dev/null +++ b/doc/board/amlogic/odroid-hc4.rst @@ -0,0 +1,142 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +U-Boot for ODROID-HC4 (S905X3) +============================== + +ODROID-HC4 is a variant of the ODROID-C4 single board computer manufactured by Hardkernel +with the following specification: + + - Amlogic S905X3 Arm Cortex-A55 quad-core SoC + - 4GB DDR4 SDRAM + - 16MB XT25F128B SPI-NOR flash + - Gigabit Ethernet + - HDMI 2.1 display + - 7-pin GPIO header for OLED display and RTC + - 1x USB 2.0 host (micro) + - 2x SATA ports via ASM1061 PCIe to SATA controller + - microSD + - UART serial + - Infrared receiver + +Schematics are available on the manufacturer website. + +U-Boot Compilation +------------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=aarch64-none-elf- + $ make odroid-hc4_defconfig + $ make + +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh odroid-hc4 /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: + +.. code-block:: bash + + $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz + $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz + $ 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 + + $ DIR=odroid-hc4 + $ git clone --depth 1 https://github.com/hardkernel/u-boot.git -b odroidg12-v2015.01 $DIR + + $ cd odroid-hc4 + $ make odroidc4_defconfig + $ make + $ export UBOOTDIR=$PWD + +Go back to mainline U-Boot source tree then: + +.. code-block:: bash + + $ mkdir fip + + $ wget https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh -O fip/blx_fix.sh + $ cp $UBOOTDIR/build/scp_task/bl301.bin fip/ + $ cp $UBOOTDIR/build/board/hardkernel/odroidc4/firmware/acs.bin fip/ + $ cp $UBOOTDIR/fip/g12a/bl2.bin fip/ + $ cp $UBOOTDIR/fip/g12a/bl30.bin fip/ + $ cp $UBOOTDIR/fip/g12a/bl31.img fip/ + $ cp $UBOOTDIR/fip/g12a/ddr3_1d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/ddr4_1d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/ddr4_2d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/diag_lpddr4.fw fip/ + $ cp $UBOOTDIR/fip/g12a/lpddr3_1d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/lpddr4_1d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/lpddr4_2d.fw fip/ + $ cp $UBOOTDIR/fip/g12a/piei.fw fip/ + $ cp $UBOOTDIR/fip/g12a/aml_ddr.fw fip/ + $ cp u-boot.bin fip/bl33.bin + + $ sh fip/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + $ sh fip/blx_fix.sh \ + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \ + --output fip/bl30_new.bin.g12a.enc \ + --level v3 + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \ + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \ + --output fip/bl31.img.enc \ + --level v3 --type bl31 + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \ + --output fip/bl33.bin.enc \ + --level v3 --type bl33 --compress lz4 + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \ + --output fip/bl2.n.bin.sig + $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bootmk \ + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --ddrfw8 fip/aml_ddr.fw \ + --ddrfw9 fip/lpddr3_1d.fw \ + --level v3 + +Then write U-Boot to SD or SPI-NOR with: + +.. code-block:: bash + + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/odroid-n2.rst b/doc/board/amlogic/odroid-n2.rst index 7aad36e..883720f 100644 --- a/doc/board/amlogic/odroid-n2.rst +++ b/doc/board/amlogic/odroid-n2.rst @@ -1,10 +1,10 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for ODROID-N2 -==================== +U-Boot for ODROID-N2/N2+ (S922X) +================================ -ODROID-N2 is a single board computer manufactured by Hardkernel -Co. Ltd with the following specifications: +ODROID-N2 and ODROID-N2+ are a Single Board Computers manufactured by Hardkernel with the +following specifications: - Amlogic S922X ARM Cortex-A53 dual-core + Cortex-A73 quad-core SoC - 4GB DDR4 SDRAM @@ -15,9 +15,13 @@ Co. Ltd with the following specifications: - eMMC, microSD - Infrared receiver -Schematics are available on the manufacturer website. +ODROID-N2+ uses Rev-C silicon allowing higher CPU opp-points. U-Boot contains logic to +read the model detail from SARADC and select the correct device-tree file if FDTDIR is +used instead of an FDT reference to a specfic device-tree. -U-Boot compilation +Schematics are available on the manufacturer website: https://wiki.odroid.com + +U-Boot Compilation ------------------ .. code-block:: bash @@ -26,14 +30,21 @@ U-Boot compilation $ make odroid-n2_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh odroid-n2 /path/to/u-boot/u-boot.bin my-output-dir -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `odroid-n2` or `odroid-n2-plus` +U-Boot Manual Signing +--------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -44,16 +55,14 @@ the git tree published by the board vendor: $ 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 $ DIR=odroid-n2 - $ git clone --depth 1 \ - https://github.com/hardkernel/u-boot.git -b odroidn2-v2015.01 \ - $DIR + $ git clone --depth 1 https://github.com/hardkernel/u-boot.git -b odroidn2-v2015.01 $DIR $ cd odroid-n2 $ make odroidn2_defconfig $ make $ export UBOOTDIR=$PWD - Go back to mainline U-Boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -76,57 +85,57 @@ the git tree published by the board vendor: $ cp u-boot.bin fip/bl33.bin $ sh fip/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ sh fip/blx_fix.sh \ - fip/bl2.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/acs.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \ - --output fip/bl30_new.bin.g12a.enc \ - --level v3 + --output fip/bl30_new.bin.g12a.enc \ + --level v3 $ $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \ - --output fip/bl30_new.bin.enc \ - --level v3 --type bl30 + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 $ $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl31.img \ - --output fip/bl31.img.enc \ - --level v3 --type bl31 + --output fip/bl31.img.enc \ + --level v3 --type bl31 $ $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \ - --output fip/bl33.bin.enc \ - --level v3 --type bl33 --compress lz4 + --output fip/bl33.bin.enc \ + --level v3 --type bl33 --compress lz4 $ $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \ - --output fip/bl2.n.bin.sig + --output fip/bl2.n.bin.sig $ $UBOOTDIR/fip/g12b/aml_encrypt_g12b --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc \ - --ddrfw1 fip/ddr4_1d.fw \ - --ddrfw2 fip/ddr4_2d.fw \ - --ddrfw3 fip/ddr3_1d.fw \ - --ddrfw4 fip/piei.fw \ - --ddrfw5 fip/lpddr4_1d.fw \ - --ddrfw6 fip/lpddr4_2d.fw \ - --ddrfw7 fip/diag_lpddr4.fw \ - --ddrfw8 fip/aml_ddr.fw \ - --level v3 - -and then write the image to SD with: + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --ddrfw8 fip/aml_ddr.fw \ + --level v3 + +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/odroid-n2l.rst b/doc/board/amlogic/odroid-n2l.rst index afd4409..6d58175 100644 --- a/doc/board/amlogic/odroid-n2l.rst +++ b/doc/board/amlogic/odroid-n2l.rst @@ -1,22 +1,23 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for ODROID-N2L -===================== +U-Boot for ODROID-N2L (S922X) +============================= -ODROID-N2L is a single board computer manufactured by Hardkernel -Co. Ltd with the following specifications: +ODROID-N2L is a Single Board Computer manufactured by Hardkernel with the following +specifications: - Amlogic S922X ARM Cortex-A53 dual-core + Cortex-A73 quad-core SoC - 4GB DDR4 SDRAM - HDMI 2.1 4K/60Hz display - 40-pin GPIO header - - 1 x USB 3.0 Host, 1 x USB USB 2.0 Host + - 1x USB 3.0 Host + - 1x USB 2.0 Host - eMMC, microSD - MIPI DSI Port -Schematics are available on the manufacturer website. +Schematics are available on the manufacturer website: https://wiki.odroid.com -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -25,7 +26,20 @@ U-Boot compilation $ make odroid-n2l_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `odroid-n2l` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh odroid-n2l /path/to/u-boot/u-boot.bin my-output-dir + +Then write U-Boot to SD or eMMC with: + +.. code-block:: bash + + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/p200.rst b/doc/board/amlogic/p200.rst index 5e7c6b0..e223897 100644 --- a/doc/board/amlogic/p200.rst +++ b/doc/board/amlogic/p200.rst @@ -1,25 +1,24 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Amlogic P200 -======================= +U-Boot for Amlogic P200 (S905) +============================== -P200 is a reference board manufactured by Amlogic with the following -specifications: +P200 is a reference board manufactured by Amlogic with the following specification: - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz - ARM Mali 450 GPU - 2GB DDR3 SDRAM - Gigabit Ethernet - HDMI 2.0 4K/60Hz display - - 2 x USB 2.0 Host + - 2x USB 2.0 Host - eMMC, microSD - Infrared receiver - SDIO WiFi Module - - CVBS+Stereo Audio Jack + - CVBS + Stereo Audio Jack Schematics are available from Amlogic on demand. -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -28,14 +27,21 @@ U-Boot compilation $ make p200_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `p200` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh p200 /path/to/u-boot/u-boot.bin my-output-dir -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image but sources have been shared by Linux development contractor, Baylibre: .. code-block:: bash @@ -50,7 +56,7 @@ the git tree published by the board vendor: $ make $ export FIPDIR=$PWD/fip -Go back to mainline U-boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -63,37 +69,51 @@ Go back to mainline U-boot source tree then : $ cp $FIPDIR/gxb/bl301.bin fip/ $ cp $FIPDIR/gxb/bl31.img fip/ $ cp u-boot.bin fip/bl33.bin + $ wget https://github.com/LibreELEC/amlogic-boot-fip/raw/master/nanopi-k2/bl1.bin.hardkernel fip/bl1.bin.hardkernel + $ chmod +x fip/bl1.bin.hardkernel + $ wget https://github.com/LibreELEC/amlogic-boot-fip/raw/master/nanopi-k2/aml_chksum fip/aml_chksum + $ chmod +x fip/aml_chksum $ $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 $ $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 - - $ $FIPDIR/fip_create --bl30 fip/bl30_new.bin --bl31 fip/bl31.img --bl33 fip/bl33.bin fip/fip.bin + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + $ $FIPDIR/fip_create --bl30 fip/bl30_new.bin \ + --bl31 fip/bl31.img \ + --bl33 fip/bl33.bin \ + fip/fip.bin $ cat fip/bl2_new.bin fip/fip.bin >fip/boot_new.bin - $ $FIPDIR/gxb/aml_encrypt_gxb --bootsig --input fip/boot_new.bin --output fip/u-boot.bin + $ $FIPDIR/gxb/aml_encrypt_gxb --bootsig \ + --input fip/boot_new.bin \ + --output fip/u-boot.bin and then write the image to SD with: .. code-block:: bash - $ DEV=/dev/your_sd_device - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin of=fip/u-boot.bin.gxbb bs=512 conv=fsync + $ dd if=fip/u-boot.bin of=fip/u-boot.bin.gxbb bs=512 seek=9 skip=8 count=87 conv=fsync,notrunc + $ dd if=/dev/zero of=fip/u-boot.bin.gxbb bs=512 seek=8 count=1 conv=fsync,notrunc + $ dd if=bl1.bin.hardkernel of=fip/u-boot.bin.gxbb bs=512 seek=2 skip=2 count=1 conv=fsync,notrunc + $ ./aml_chksum fip/u-boot.bin.gxbb + $ dd if=fip/u-boot.gxbb of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.gxbb of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/p201.rst b/doc/board/amlogic/p201.rst index 2cd2365..28aae98d 100644 --- a/doc/board/amlogic/p201.rst +++ b/doc/board/amlogic/p201.rst @@ -1,25 +1,24 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Amlogic P201 -======================= +U-Boot for Amlogic P201 (S905) +============================== -P201 is a reference board manufactured by Amlogic with the following -specifications: +P201 is a reference board manufactured by Amlogic with the following specifications: - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz - ARM Mali 450 GPU - 2GB DDR3 SDRAM - 10/100 Ethernet - HDMI 2.0 4K/60Hz display - - 2 x USB 2.0 Host + - 2x USB 2.0 Host - eMMC, microSD - Infrared receiver - SDIO WiFi Module - - CVBS+Stereo Audio Jack + - CVBS + Stereo Audio Jack Schematics are available from Amlogic on demand. -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -28,14 +27,21 @@ U-Boot compilation $ make p201_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `p201` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh p201 /path/to/u-boot/u-boot.bin my-output-dir -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image but sources have been shared by Linux development contractor, Baylibre: .. code-block:: bash @@ -63,37 +69,51 @@ Go back to mainline U-boot source tree then : $ cp $FIPDIR/gxb/bl301.bin fip/ $ cp $FIPDIR/gxb/bl31.img fip/ $ cp u-boot.bin fip/bl33.bin + $ wget https://github.com/LibreELEC/amlogic-boot-fip/raw/master/nanopi-k2/bl1.bin.hardkernel fip/bl1.bin.hardkernel + $ chmod +x fip/bl1.bin.hardkernel + $ wget https://github.com/LibreELEC/amlogic-boot-fip/raw/master/nanopi-k2/aml_chksum fip/aml_chksum + $ chmod +x fip/aml_chksum $ $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 $ $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 - - $ $FIPDIR/fip_create --bl30 fip/bl30_new.bin --bl31 fip/bl31.img --bl33 fip/bl33.bin fip/fip.bin + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + $ $FIPDIR/fip_create --bl30 fip/bl30_new.bin \ + --bl31 fip/bl31.img \ + --bl33 fip/bl33.bin \ + fip/fip.bin $ cat fip/bl2_new.bin fip/fip.bin >fip/boot_new.bin - $ $FIPDIR/gxb/aml_encrypt_gxb --bootsig --input fip/boot_new.bin --output fip/u-boot.bin + $ $FIPDIR/gxb/aml_encrypt_gxb --bootsig \ + --input fip/boot_new.bin \ + --output fip/u-boot.bin -and then write the image to SD with: +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin of=fip/u-boot.bin.gxbb bs=512 conv=fsync + $ dd if=fip/u-boot.bin of=fip/u-boot.bin.gxbb bs=512 seek=9 skip=8 count=87 conv=fsync,notrunc + $ dd if=/dev/zero of=fip/u-boot.bin.gxbb bs=512 seek=8 count=1 conv=fsync,notrunc + $ dd if=bl1.bin.hardkernel of=fip/u-boot.bin.gxbb bs=512 seek=2 skip=2 count=1 conv=fsync,notrunc + $ ./aml_chksum fip/u-boot.bin.gxbb + $ dd if=fip/u-boot.gxbb of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.gxbb of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/pre-generated-fip.rst b/doc/board/amlogic/pre-generated-fip.rst index c63ea61..6a43d77 100644 --- a/doc/board/amlogic/pre-generated-fip.rst +++ b/doc/board/amlogic/pre-generated-fip.rst @@ -1,24 +1,57 @@ .. SPDX-License-Identifier: GPL-2.0+ -Pre-Generated FIP file set -========================== +Pre-Generated FIP File Repo +=========================== -The Amlogic ARMv8 based SoCs uses a vendor variant of the Trusted Firmware-A -boot architecture. +Pre-built Flattened Image Package (FIP) sources and Amlogic signing binaries for many +commercially available boards and some Android STB devices are collected for use with +distro build-systems here: https://github.com/LibreELEC/amlogic-boot-fip -You can find documentation on the Trusted Firmware-A architecture on: https://www.trustedfirmware.org/projects/tf-a/ +Using the pre-built FIP sources to sign U-Boot is simple, e.g. for LePotato: -The Trusted Firmware-A uses the following boot elements (simplified): +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh lepotato /path/to/u-boot/u-boot.bin my-output-dir + +Then write U-Boot to SD or eMMC with: + +.. code-block:: bash + + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 + +Files Included +-------------- + +Amlogic ARMv8 SoCs use a vendor modified variant of the ARM Trusted Firmware-A boot +architecture. See documentation here: https://www.trustedfirmware.org/projects/tf-a/ + +Trusted Firmware-A uses the following boot elements (simplified): + +- BL1: First boot step implemented in ROM on Amlogic SoCs + +- BL2: Second boot step used to initialize the SoC main clocks & DDR interface. BL21 + and ACS board-specific binaries must be "inserted" into the BL2 binary before signing + and packaging in order to be flashed on the platform + +- BL30: Amlogic Secure Co-Processor (SCP) firmware used to handle all system management + operations (DVFS, suspend/resume, ..) + +- BL301: Amlogic Secure Co-Processor (SCP) board-specific firmware "plug-in" to handle + custom DVFS & suspend-resume parameters -- BL1: First boot step, implemented in ROM on Amlogic SoCs -- BL2: Second boot step, used to initialize the SoC main clocks & DDR interface. The BL21 and ACS board-specific binaries are "inserted" in the BL32 binary before signing/packaging in order to be flashed on the platform. -- BL30: Amlogic Secure Co-Processor (SCP) firmware used to handle all the system management operations (DVFS, suspend/resume, ...) -- BL301: Amlogic Secure Co-Processor (SCP) board-specific firmware "plug-in" to handle custom DVFS & suspend-resume parameters - BL31: Initializes the interrupt controller and the system management interface (PSCI) -- BL32 (Optional): Is the Trusted Environment Execution (TEE) Operating System to run secure Trusted Apps, e.g. OP-TEE + +- BL32 (Optional): Is the Trusted Environment Execution (TEE) Operating System used to + run secure Trusted Apps, e.g. OP-TEE + - BL33: Is the last non-secure step, usually U-Boot which loads Linux -Amlogic provides in binary form: +Amlogic sources provide the following binaries: - bl2.bin - bl30.bin @@ -26,10 +59,50 @@ Amlogic provides in binary form: - bl31.img - bl32.bin -And for lastest SoCs, Amlogic also provides the DDR drivers used by the BL2 binary. +For G12A/B and SM1 Amlogic also provides DDR drivers used by the BL2 binary: + +- ddr4_1d.fw +- ddr4_2d.fw +- ddr3_1d.fw +- piei.fw +- lpddr4_1d.fw +- lpddr4_2d.fw +- diag_lpddr4.fw +- aml_ddr.fw + +The following files are generated from the Amlogic U-Boot fork: + +- acs.bin: Contains the PLL & DDR parameters for the board +- bl301.bin: Contains the DVFS & suspend-resume handling code for the board +- bl33.bin: U-boot binary image + +The acs.bin and bl301.bin files use U-Boot GPL-2.0+ headers and U-Boot build system and +are thus considered to be issued from GPL-2.0+ source code. + +Amlogic alo provides pre-compiled x86_64 and Python2 binaries: -The licence of these files wasn't clear until recently, the currently Amlogic distribution licence -is the following: +- aml_encrypt_gxb +- aml_encrypt_gxl +- aml_encrypt_g12a +- aml_encrypt_g12b +- acs_tool.pyc + +The repo replaces the pre-compiled acs_tool.pyc with a Python3 acs_tool.py that can be +used with modern build hosts. + +The repo also provides the following files used with GXBB boards: + +- bl1.bin.hardkernel +- aml_chksum + +The repo also supports the open-source 'gxlimg' signing tool that can be used to sign +U-Boot binaries for GXL/GXM/G12A/G12B/SM1 boards: https://github.com/repk/gxlimg + +Licensing +--------- + +The licence of Amlogic provided binaries was not historically clear but has now been +clarified. The current Amlogic distribution licence is below: .. code-block:: C @@ -56,38 +129,3 @@ is the following: // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The following files are generated from the Amlogic U-Boot fork: - -- acs.bin: contains the PLL & DDR parameters for the board -- bl301.bin: contains the DVFS & suspend-resume handling code for the board -- bl33.bin: U-boot binary image - -The acs.bin & bl301.bin uses the U-Boot GPL-2.0+ headers & build systems, thus those -are considered issued from GPL-2.0+ source code. - -The tools used to sign & package those binary files are delivered in binary format -for Intel x86-64 and Python 2.x only. - -A collection of pre-built with the corresponding Amlogic binaries for the common -commercially available boards were collected in the https://github.com/LibreELEC/amlogic-boot-fip -repository. - -Using this collection for a commercially available board is very easy. - -Here considering the Libre Computer AML-S905X-CC, which codename is `lepotato`: - -.. code-block:: bash - - $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 - $ cd amlogic-boot-fip - $ mkdir my-output-dir - $ ./build-fip.sh lepotato /path/to/u-boot/u-boot.bin my-output-dir - -and then write the image to SD with: - -.. code-block:: bash - - $ DEV=/dev/your_sd_device - $ dd if=my-output-dir/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=my-output-dir/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 diff --git a/doc/board/amlogic/q200.rst b/doc/board/amlogic/q200.rst index 3ac4116..32ea472 100644 --- a/doc/board/amlogic/q200.rst +++ b/doc/board/amlogic/q200.rst @@ -1,24 +1,24 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Amlogic Q200 -======================= +U-Boot for Amlogic Q200 (S912) +============================== -Q200 is a reference board manufactured by Amlogic with the following -specifications: +Q200 is a reference board manufactured by Amlogic with the following specifications: - Amlogic S912 ARM Cortex-A53 octo-core SoC @ 1.5GHz - ARM Mali T860 GPU - 2/3GB DDR4 SDRAM - 10/100/1000 Ethernet - HDMI 2.0 4K/60Hz display - - 2 x USB 2.0 Host, 1 x USB 2.0 Device + - 2x USB 2.0 Host + - 1x USB 2.0 Device - 16GB/32GB/64GB eMMC - 2MB SPI Flash - microSD - SDIO Wifi Module, Bluetooth - IR receiver -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -27,12 +27,21 @@ U-Boot compilation $ make khadas-vim2_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh q200 /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image but sources have been shared by Linux development contractor, Baylibre: .. code-block:: bash @@ -47,7 +56,7 @@ the git tree published by the board vendor: $ make $ export FIPDIR=$PWD/fip -Go back to mainline U-Boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -62,40 +71,40 @@ Go back to mainline U-Boot source tree then : $ cp u-boot.bin fip/bl33.bin $ $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 $ $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin $ $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig $ $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc -and then write the image to SD with: +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/radxa-zero.rst b/doc/board/amlogic/radxa-zero.rst index f5611f5..14ce3cf 100644 --- a/doc/board/amlogic/radxa-zero.rst +++ b/doc/board/amlogic/radxa-zero.rst @@ -1,14 +1,13 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Radxa Zero -===================== +U-Boot for Radxa Zero (S905Y2) +============================== -Radxa Zero is a small form factor SBC based on the Amlogic S905Y2 -chipset that ships in a number of RAM/eMMC configurations: +Radxa Zero is a small form factor SBC based on the Amlogic S905Y2 chipset that ships in +a number of RAM/eMMC configurations: -Boards with 512MB/1GB LPDDR4 RAM have no eMMC storage and BCM43436 -wireless (2.4GHz b/g/n) while 2GB/4GB boards have 8/16/32/64/128GB -eMMC storage and BCM4345 wireless (2.4/5GHz a/b/g/n/ac). +512MB/1GB LPDDR4 RAM boards have no eMMC and BCM43436 wireless (2.4GHz b/g/n) while the +2GB/4GB boards have 8/16/32/64/128GB eMMC and BCM4345 wireless (2.4/5GHz a/b/g/n/ac). - Amlogic S905Y2 quad-core Cortex-A53 - Mali G31-MP2 GPU @@ -18,11 +17,9 @@ eMMC storage and BCM4345 wireless (2.4/5GHz a/b/g/n/ac). - 1x micro SD Card slot - 40 Pin GPIO header -Schematics are available on the manufacturer website: +Schematics are available on the manufacturer website: https://dl.radxa.com/zero/docs/hw -https://dl.radxa.com/zero/docs/hw/RADAX_ZERO_V13_SCH_20210309.pdf - -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -31,14 +28,21 @@ U-Boot compilation $ make radxa-zero_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh radxa-zero /path/to/u-boot/u-boot.bin my-output-dir -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `radxa-zero` +U-Boot Manual Signing +--------------------- -Amlogic does not provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -git trees published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -61,16 +65,16 @@ git trees published by the board vendor: $ cd ../fip/radxa-zero $ make -This will generate: +This will generate the signed U-Boot binaries: .. code-block:: bash $ u-boot.bin u-boot.bin.sd.bin u-boot.bin.usb.bl2 u-boot.bin.usb.tpl -Then write the image to SD with: +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/radxa-zero2.rst b/doc/board/amlogic/radxa-zero2.rst new file mode 100644 index 0000000..dccf592 --- /dev/null +++ b/doc/board/amlogic/radxa-zero2.rst @@ -0,0 +1,80 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +U-Boot for Radxa Zero2 (A311D) +============================== + +Radxa Zero2 is a small form factor SBC based on the Amlogic A311D chipset with the +following specification: + +- Amlogic A311D (Quad A73 + Dual A53) CPU +- 4GB LPDDR4 RAM +- 32/64/128GB eMMC +- Mali G52-MP4 GPU +- HDMI 2.1 output (micro) +- BCM4345 WiFi (2.4/5GHz a/b/g/n/ac) and BT 5.0 +- 1x USB 2.0 port - Type C (OTG) +- 1x USB 3.0 port - Type C (Host) +- 1x micro SD Card slot +- 40 Pin GPIO header + +Schematics are available on request from Radxa. + +U-Boot Compilation +------------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=aarch64-none-elf- + $ make radxa-zero2_defconfig + $ make + +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh radxa-zero2 /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: + +.. code-block:: bash + + $ git clone -b radxa-zero-v2021.07 https://github.com/radxa/u-boot.git + $ git clone https://github.com/radxa/fip.git + + $ sudo apt-get install -y gcc-aarch64-linux-gnu device-tree-compiler libncurses5 libncurses5-dev + $ sudo apt-get install -y bc python dosfstools flex build-essential libssl-dev mtools + + $ wget https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz + $ sudo tar xvf gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz -C /opt + + $ export CROSS_COMPILE=/opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin/aarch64-none-elf- + $ export ARCH=arm + $ cd u-boot + $ make radxa-zero2_defconfig + $ make + + $ cp u-boot.bin ../fip/radxa-zero2/bl33.bin + $ cd ../fip/radxa-zero2 + $ make + +This will generate the signed U-Boot binaries: + +.. code-block:: bash + + $ u-boot.bin u-boot.bin.sd.bin u-boot.bin.usb.bl2 u-boot.bin.usb.tpl + +Then write U-Boot to SD or eMMC with: + +.. code-block:: bash + + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/s400.rst b/doc/board/amlogic/s400.rst index c92817b..59dda82 100644 --- a/doc/board/amlogic/s400.rst +++ b/doc/board/amlogic/s400.rst @@ -1,15 +1,14 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Amlogic S400 -======================= +U-Boot for Amlogic S400 (A113X) +=============================== -S400 is a reference board manufactured by Amlogic with the following -specifications: +S400 is a reference board manufactured by Amlogic with the following specifications: - - Amlogic A113DX ARM Cortex-A53 quad-core SoC @ 1.2GHz + - Amlogic A113X ARM Cortex-A53 quad-core SoC @ 1.2GHz - 1GB DDR4 SDRAM - 10/100 Ethernet - - 2 x USB 2.0 Host + - 2x USB 2.0 Host - eMMC - Infrared receiver - SDIO WiFi Module @@ -19,7 +18,7 @@ specifications: Schematics are available from Amlogic on demand. -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -28,14 +27,21 @@ U-Boot compilation $ make s400_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `s400` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh s400 /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image but sources have been shared by Linux development contractor, Baylibre: .. code-block:: bash @@ -65,47 +71,47 @@ Go back to mainline U-boot source tree then : $ cp u-boot.bin fip/bl33.bin $ $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 $ $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $FIPDIR/axg/aml_encrypt_axg --bl3sig --input fip/bl30_new.bin \ - --output fip/bl30_new.bin.enc \ - --level v3 --type bl30 + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 $ $FIPDIR/axg/aml_encrypt_axg --bl3sig --input fip/bl31.img \ - --output fip/bl31.img.enc \ - --level v3 --type bl31 + --output fip/bl31.img.enc \ + --level v3 --type bl31 $ $FIPDIR/axg/aml_encrypt_axg --bl3sig --input fip/bl33.bin --compress lz4 \ - --output fip/bl33.bin.enc \ - --level v3 --type bl33 + --output fip/bl33.bin.enc \ + --level v3 --type bl33 $ $FIPDIR/axg/aml_encrypt_axg --bl2sig --input fip/bl2_new.bin \ - --output fip/bl2.n.bin.sig + --output fip/bl2.n.bin.sig $ $FIPDIR/axg/aml_encrypt_axg --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc --level v3 + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc --level v3 -and then write the image to SD with: +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/sei510.rst b/doc/board/amlogic/sei510.rst index c55e778..87cb701 100644 --- a/doc/board/amlogic/sei510.rst +++ b/doc/board/amlogic/sei510.rst @@ -1,21 +1,20 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Amlogic SEI510 -========================= +U-Boot for Amlogic SEI510 (S905X2) +================================== -SEI510 is a customer board manufactured by SEI Robotics with the following -specifications: +SEI510 is a customer board manufactured by SEI Robotics with the following specification: - Amlogic S905X2 ARM Cortex-A53 quad-core SoC - 2GB DDR4 SDRAM - 10/100 Ethernet (Internal PHY) - - 1 x USB 3.0 Host + - 1x USB 3.0 Host - eMMC - SDcard - Infrared receiver - SDIO WiFi Module -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -24,14 +23,21 @@ U-Boot compilation $ make sei510_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `sei510` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh sei510 /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -46,7 +52,7 @@ the git tree published by the board vendor: $ make $ export UBOOTDIR=$PWD -Download the latest Amlogic Buildroot package, and extract it : +Download the latest Amlogic Buildroot package and extract it: .. code-block:: bash @@ -55,7 +61,7 @@ Download the latest Amlogic Buildroot package, and extract it : $ export BRDIR=$PWD/buildroot_openlinux_kernel_4.9_fbdev_20180706 $ export FIPDIR=$BRDIR/bootloader/uboot-repo/fip -Go back to mainline U-Boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -77,56 +83,56 @@ Go back to mainline U-Boot source tree then : $ cp u-boot.bin fip/bl33.bin $ sh fip/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ sh fip/blx_fix.sh \ - fip/bl2.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/acs.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $FIPDIR/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \ - --output fip/bl30_new.bin.g12a.enc \ - --level v3 + --output fip/bl30_new.bin.g12a.enc \ + --level v3 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \ - --output fip/bl30_new.bin.enc \ - --level v3 --type bl30 + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \ - --output fip/bl31.img.enc \ - --level v3 --type bl31 + --output fip/bl31.img.enc \ + --level v3 --type bl31 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \ - --output fip/bl33.bin.enc \ - --level v3 --type bl33 + --output fip/bl33.bin.enc \ + --level v3 --type bl33 $ $FIPDIR/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \ - --output fip/bl2.n.bin.sig + --output fip/bl2.n.bin.sig $ $FIPDIR/g12a/aml_encrypt_g12a --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc \ - --ddrfw1 fip/ddr4_1d.fw \ - --ddrfw2 fip/ddr4_2d.fw \ - --ddrfw3 fip/ddr3_1d.fw \ - --ddrfw4 fip/piei.fw \ - --ddrfw5 fip/lpddr4_1d.fw \ - --ddrfw6 fip/lpddr4_2d.fw \ - --ddrfw7 fip/diag_lpddr4.fw \ - --level v3 - -and then write the image to SD with: + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --level v3 + +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/sei610.rst b/doc/board/amlogic/sei610.rst index 2d75449..64f6257 100644 --- a/doc/board/amlogic/sei610.rst +++ b/doc/board/amlogic/sei610.rst @@ -1,23 +1,22 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Amlogic SEI610 -========================= +U-Boot for Amlogic SEI610 (S905X3) +================================== -SEI610 is a customer board manufactured by SEI Robotics with the following -specifications: +SEI610 is a customer board manufactured by SEI Robotics with the following specification: - Amlogic S905X3 ARM Cortex-A55 quad-core SoC - 2GB DDR4 SDRAM - 10/100 Ethernet (Internal PHY) - - 1 x USB 3.0 Host - - 1 x USB Type-C DRD - - 1 x FTDI USB Serial Debug Interface + - 1x USB 3.0 Host + - 1x USB Type-C DRD + - 1x FTDI USB Serial Debug Interface - eMMC - SDcard - Infrared receiver - SDIO WiFi Module -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -26,14 +25,21 @@ U-Boot compilation $ make sei610_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `sei610` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh sei610 /path/to/u-boot/u-boot.bin my-output-dir -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -48,7 +54,7 @@ the git tree published by the board vendor: $ make $ export UBOOTDIR=$PWD -Download the latest Amlogic Buildroot package, and extract it : +Download the latest Amlogic buildroot package and extract it: .. code-block:: bash @@ -57,8 +63,7 @@ Download the latest Amlogic Buildroot package, and extract it : $ export BRDIR=$PWD/buildroot-openlinux-A113-201901 $ export FIPDIR=$BRDIR/bootloader/uboot-repo/fip -Go back to mainline U-Boot source tree then : - +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -80,56 +85,56 @@ Go back to mainline U-Boot source tree then : $ cp u-boot.bin fip/bl33.bin $ sh fip/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ sh fip/blx_fix.sh \ - fip/bl2.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/acs.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $FIPDIR/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \ - --output fip/bl30_new.bin.g12a.enc \ - --level v3 + --output fip/bl30_new.bin.g12a.enc \ + --level v3 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \ - --output fip/bl30_new.bin.enc \ - --level v3 --type bl30 + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \ - --output fip/bl31.img.enc \ - --level v3 --type bl31 + --output fip/bl31.img.enc \ + --level v3 --type bl31 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \ - --output fip/bl33.bin.enc \ - --level v3 --type bl33 + --output fip/bl33.bin.enc \ + --level v3 --type bl33 $ $FIPDIR/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \ - --output fip/bl2.n.bin.sig + --output fip/bl2.n.bin.sig $ $FIPDIR/g12a/aml_encrypt_g12a --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc \ - --ddrfw1 fip/ddr4_1d.fw \ - --ddrfw2 fip/ddr4_2d.fw \ - --ddrfw3 fip/ddr3_1d.fw \ - --ddrfw4 fip/piei.fw \ - --ddrfw5 fip/lpddr4_1d.fw \ - --ddrfw6 fip/lpddr4_2d.fw \ - --ddrfw7 fip/diag_lpddr4.fw \ - --level v3 - -and then write the image to SD with: + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --level v3 + +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/u200.rst b/doc/board/amlogic/u200.rst index 53213fd..8254d4d 100644 --- a/doc/board/amlogic/u200.rst +++ b/doc/board/amlogic/u200.rst @@ -1,15 +1,14 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Amlogic U200 -======================= +U-Boot for Amlogic U200 (S905X2) +================================ -U200 is a reference board manufactured by Amlogic with the following -specifications: +U200 is a reference board manufactured by Amlogic with the following specification: - Amlogic S905D2 ARM Cortex-A53 quad-core SoC - 2GB DDR4 SDRAM - 10/100 Ethernet (Internal PHY) - - 1 x USB 3.0 Host + - 1x USB 3.0 Host - eMMC - SDcard - Infrared receiver @@ -20,7 +19,7 @@ specifications: Schematics are available from Amlogic on demand. -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -29,14 +28,21 @@ U-Boot compilation $ make u200_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `u200` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh u200 /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -51,7 +57,7 @@ the git tree published by the board vendor: $ make $ export UBOOTDIR=$PWD -Download the latest Amlogic Buildroot package, and extract it : +Download the latest Amlogic buildroot package and extract it: .. code-block:: bash @@ -60,7 +66,7 @@ Download the latest Amlogic Buildroot package, and extract it : $ export BRDIR=$PWD/buildroot_openlinux_kernel_4.9_fbdev_20180706 $ export FIPDIR=$BRDIR/bootloader/uboot-repo/fip -Go back to mainline U-Boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -82,56 +88,56 @@ Go back to mainline U-Boot source tree then : $ cp u-boot.bin fip/bl33.bin $ sh fip/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ sh fip/blx_fix.sh \ - fip/bl2.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/acs.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $FIPDIR/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \ - --output fip/bl30_new.bin.g12a.enc \ - --level v3 + --output fip/bl30_new.bin.g12a.enc \ + --level v3 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \ - --output fip/bl30_new.bin.enc \ - --level v3 --type bl30 + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \ - --output fip/bl31.img.enc \ - --level v3 --type bl31 + --output fip/bl31.img.enc \ + --level v3 --type bl31 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \ - --output fip/bl33.bin.enc \ - --level v3 --type bl33 + --output fip/bl33.bin.enc \ + --level v3 --type bl33 $ $FIPDIR/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \ - --output fip/bl2.n.bin.sig + --output fip/bl2.n.bin.sig $ $FIPDIR/g12a/aml_encrypt_g12a --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc \ - --ddrfw1 fip/ddr4_1d.fw \ - --ddrfw2 fip/ddr4_2d.fw \ - --ddrfw3 fip/ddr3_1d.fw \ - --ddrfw4 fip/piei.fw \ - --ddrfw5 fip/lpddr4_1d.fw \ - --ddrfw6 fip/lpddr4_2d.fw \ - --ddrfw7 fip/diag_lpddr4.fw \ - --level v3 - -and then write the image to SD with: + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --level v3 + +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/w400.rst b/doc/board/amlogic/w400.rst index 38dbf52..d2a8107 100644 --- a/doc/board/amlogic/w400.rst +++ b/doc/board/amlogic/w400.rst @@ -1,15 +1,14 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for Amlogic W400 -======================= +U-Boot for Amlogic W400 (S922X) +=============================== -U200 is a reference board manufactured by Amlogic with the following -specifications: +W400 is a reference board manufactured by Amlogic with the following specification: - Amlogic S922X ARM Cortex-A53 dual-core + Cortex-A73 quad-core SoC - 2GB DDR4 SDRAM - 10/100 Ethernet (Internal PHY) - - 1 x USB 3.0 Host + - 1x USB 3.0 Host - eMMC - SDcard - Infrared receiver @@ -20,7 +19,7 @@ specifications: Schematics are available from Amlogic on demand. -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -29,12 +28,21 @@ U-Boot compilation $ make w400_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -Amlogic doesn't provide sources for the firmware and for tools needed -to create the bootloader image, so it is necessary to obtain them from -the git tree published by the board vendor: +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh jethub-j100 /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image so it is necessary to obtain binaries from sources published by the board vendor: .. code-block:: bash @@ -49,7 +57,7 @@ the git tree published by the board vendor: $ make $ export UBOOTDIR=$PWD -Download the latest Amlogic Buildroot package, and extract it : +Download the latest Amlogic buildroot package and extract it: .. code-block:: bash @@ -58,7 +66,7 @@ Download the latest Amlogic Buildroot package, and extract it : $ export BRDIR=$PWD/buildroot_openlinux_kernel_4.9_fbdev_20180706 $ export FIPDIR=$BRDIR/bootloader/uboot-repo/fip -Go back to mainline U-Boot source tree then : +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -81,57 +89,57 @@ Go back to mainline U-Boot source tree then : $ cp u-boot.bin fip/bl33.bin $ sh fip/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 $ sh fip/blx_fix.sh \ - fip/bl2.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/acs.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/acs.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 $ $FIPDIR/g12b/aml_encrypt_g12b --bl30sig --input fip/bl30_new.bin \ - --output fip/bl30_new.bin.g12a.enc \ - --level v3 + --output fip/bl30_new.bin.g12a.enc \ + --level v3 $ $FIPDIR/g12b/aml_encrypt_g12b --bl3sig --input fip/bl30_new.bin.g12a.enc \ - --output fip/bl30_new.bin.enc \ - --level v3 --type bl30 + --output fip/bl30_new.bin.enc \ + --level v3 --type bl30 $ $FIPDIR/g12b/aml_encrypt_g12b --bl3sig --input fip/bl31.img \ - --output fip/bl31.img.enc \ - --level v3 --type bl31 + --output fip/bl31.img.enc \ + --level v3 --type bl31 $ $FIPDIR/g12b/aml_encrypt_g12b --bl3sig --input fip/bl33.bin --compress lz4 \ - --output fip/bl33.bin.enc \ - --level v3 --type bl33 + --output fip/bl33.bin.enc \ + --level v3 --type bl33 $ $FIPDIR/g12b/aml_encrypt_g12b --bl2sig --input fip/bl2_new.bin \ - --output fip/bl2.n.bin.sig + --output fip/bl2.n.bin.sig $ $FIPDIR/g12b/aml_encrypt_g12b --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc \ - --ddrfw1 fip/ddr4_1d.fw \ - --ddrfw2 fip/ddr4_2d.fw \ - --ddrfw3 fip/ddr3_1d.fw \ - --ddrfw4 fip/piei.fw \ - --ddrfw5 fip/lpddr4_1d.fw \ - --ddrfw6 fip/lpddr4_2d.fw \ - --ddrfw7 fip/diag_lpddr4.fw \ - --ddrfw8 fip/aml_ddr.fw \ - --level v3 - -and then write the image to SD with: + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc \ + --ddrfw1 fip/ddr4_1d.fw \ + --ddrfw2 fip/ddr4_2d.fw \ + --ddrfw3 fip/ddr3_1d.fw \ + --ddrfw4 fip/piei.fw \ + --ddrfw5 fip/lpddr4_1d.fw \ + --ddrfw6 fip/lpddr4_2d.fw \ + --ddrfw7 fip/diag_lpddr4.fw \ + --ddrfw8 fip/aml_ddr.fw \ + --level v3 + +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/wetek-core2.rst b/doc/board/amlogic/wetek-core2.rst index 0147d5f..137262e 100644 --- a/doc/board/amlogic/wetek-core2.rst +++ b/doc/board/amlogic/wetek-core2.rst @@ -1,23 +1,24 @@ .. SPDX-License-Identifier: GPL-2.0+ -U-Boot for WeTek Core2 -====================== +U-Boot for WeTek Core2 (S912) +============================= -WeTek Core2 is an Android STB based on the Q200 reference design with -the following specifications: +WeTek Core2 is an Android STB based on the Q200 reference design with the following +specifications: - Amlogic S912 ARM Cortex-A53 octo-core SoC @ 1.5GHz - ARM Mali T820 GPU - 3GB DDR4 SDRAM - 10/100 Realtek RTL8152 Ethernet (internal USB) - HDMI 2.0 4K/60Hz display - - 2x USB 2.0 Host, 1x USB 2.0 OTG (internal) + - 2x USB 2.0 Host + - 1x USB 2.0 OTG (internal) - 32GB eMMC - microSD - SDIO Wifi Module, Bluetooth - Two channel IR receiver -U-Boot compilation +U-Boot Compilation ------------------ .. code-block:: bash @@ -26,15 +27,22 @@ U-Boot compilation $ make wetek-core2_defconfig $ make -Image creation --------------- +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- -For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `wetek-core2` +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh wetek-core2 /path/to/u-boot/u-boot.bin my-output-dir -Amlogic does not provide sources for the firmware or the tools needed -to create the bootloader image, and WeTek has not publicly shared the -precompiled FIP binaries. However the public Khadas VIM2 sources also -work with the Core2 box so we can use the Khadas git tree: +U-Boot Manual Signing +--------------------- + +Amlogic does not provide firmware sources or tools needed to create the bootloader image +and WeTek has not publicly shared the precompiled FIP binaries. However the Khadas VIM2 +sources also work with the Core2 box so we can use the Khadas git tree: .. code-block:: bash @@ -49,7 +57,7 @@ work with the Core2 box so we can use the Khadas git tree: $ make $ export FIPDIR=$PWD/fip -Go back to mainline U-Boot source tree then: +Go back to the mainline U-Boot source tree then: .. code-block:: bash @@ -61,38 +69,42 @@ Go back to mainline U-Boot source tree then: $ cp $FIPDIR/gxl/bl301.bin fip/ $ cp $FIPDIR/gxl/bl31.img fip/ $ cp u-boot.bin fip/bl33.bin + $ $FIPDIR/blx_fix.sh \ - fip/bl30.bin \ - fip/zero_tmp \ - fip/bl30_zero.bin \ - fip/bl301.bin \ - fip/bl301_zero.bin \ - fip/bl30_new.bin \ - bl30 + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + $ python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 + $ $FIPDIR/blx_fix.sh \ - fip/bl2_acs.bin \ - fip/zero_tmp \ - fip/bl2_zero.bin \ - fip/bl21.bin \ - fip/bl21_zero.bin \ - fip/bl2_new.bin \ - bl2 + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin $ $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig $ $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ - --output fip/u-boot.bin \ - --bl2 fip/bl2.n.bin.sig \ - --bl30 fip/bl30_new.bin.enc \ - --bl31 fip/bl31.img.enc \ - --bl33 fip/bl33.bin.enc + --output fip/u-boot.bin \ + --bl2 fip/bl2.n.bin.sig \ + --bl30 fip/bl30_new.bin.enc \ + --bl31 fip/bl31.img.enc \ + --bl33 fip/bl33.bin.enc -then write the image to SD with: +Then write U-Boot to SD or eMMC with: .. code-block:: bash - $ DEV=/dev/your_sd_device + $ DEV=/dev/boot_device $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 - $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444 + $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/wetek-hub.rst b/doc/board/amlogic/wetek-hub.rst new file mode 100644 index 0000000..212f044 --- /dev/null +++ b/doc/board/amlogic/wetek-hub.rst @@ -0,0 +1,111 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +U-Boot for WeTek Hub (S905) +=========================== + +WeTek Hub is a small form-factor Android STB manufactured by WeTek with the following +specification: + + - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz + - ARM Mali 450 GPU + - 1GB DDR3 SDRAM + - 8GB eMMC + - Gigabit Ethernet + - HDMI 2.0 4K/60Hz display + - 1x USB otg + - microSD + - UART jack + - Infrared receiver + +Schematics are not publicly available but have been shared privately to maintainers. + +U-Boot Compilation +------------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=aarch64-none-elf- + $ make wetek-hub_defconfig + $ make + +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh wetek-hub /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image and WeTek has not publicly shared the U-Boot sources needed to build FIP binaries +for signing. However you can download them from the amlogic-fip-repo. + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip/wetek-hub + $ export FIPDIR=$PWD + +Go back to the mainline U-Boot source tree then: + +.. code-block:: bash + + $ mkdir fip + + $ cp $FIPDIR/bl2.bin fip/ + $ cp $FIPDIR/acs.bin fip/ + $ cp $FIPDIR/bl21.bin fip/ + $ cp $FIPDIR/bl30.bin fip/ + $ cp $FIPDIR/bl301.bin fip/ + $ cp $FIPDIR/bl31.img fip/ + $ cp u-boot.bin fip/bl33.bin + + $ $FIPDIR/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + $ $FIPDIR/fip_create --bl30 fip/bl30_new.bin \ + --bl31 fip/bl31.img \ + --bl33 fip/bl33.bin \ + fip/fip.bin + + $ sed -i 's/\x73\x02\x08\x91/\x1F\x20\x03\xD5/' fip/bl2.bin + $ python3 $FIPDIR/acs_tool.py fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 + + $ $FIPDIR/blx_fix.sh \ + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + $ cat fip/bl2_new.bin fip/fip.bin > fip/boot_new.bin + + $ $FIPDIR/aml_encrypt_gxb --bootsig \ + --input fip/boot_new.bin + --output fip/u-boot.bin + +Then write U-Boot to SD or eMMC with: + +.. code-block:: bash + + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin of=fip/u-boot.bin.gxbb bs=512 conv=fsync + $ dd if=fip/u-boot.bin of=fip/u-boot.bin.gxbb bs=512 seek=9 skip=8 count=87 conv=fsync,notrunc + $ dd if=/dev/zero of=fip/u-boot.bin.gxbb bs=512 seek=8 count=1 conv=fsync,notrunc + $ dd if=bl1.bin.hardkernel of=fip/u-boot.bin.gxbb bs=512 seek=2 skip=2 count=1 conv=fsync,notrunc + $ ./aml_chksum fip/u-boot.bin.gxbb + $ dd if=fip/u-boot.gxbb of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.gxbb of=$DEV conv=fsync,notrunc bs=1 count=440 diff --git a/doc/board/amlogic/wetek-play2.rst b/doc/board/amlogic/wetek-play2.rst new file mode 100644 index 0000000..74580b9 --- /dev/null +++ b/doc/board/amlogic/wetek-play2.rst @@ -0,0 +1,116 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +U-Boot for WeTek Play2 (S905) +============================= + +WeTek Play2 is an Android STB manufactured by WeTek with the following specification: + + - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz + - ARM Mali 450 GPU + - 2GB DDR3 SDRAM + - 8GB eMMC + - Gigabit Ethernet + - AP6335 (v1) or AP6255 (v2) WiFi (b/g/n) and BT 4.0 + - HDMI 2.0 4K/60Hz display + - 2x USB 2.0 host + - 1x USB 2.0 otg + - microSD + - UART jack + - Infrared receiver + - Power LED (blue) + - Power button (case, front) + - Reset button (underside) + - DVB Card: DVB-S or DVB-T/C or ATSC + +Schematics are not publicly available but have been shared privately to maintainers. + +U-Boot Compilation +------------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=aarch64-none-elf- + $ make wetek-play2_defconfig + $ make + +U-Boot Signing with Pre-Built FIP repo +-------------------------------------- + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip + $ mkdir my-output-dir + $ ./build-fip.sh wetek-play2 /path/to/u-boot/u-boot.bin my-output-dir + +U-Boot Manual Signing +--------------------- + +Amlogic does not provide sources for the firmware and tools needed to create a bootloader +image and WeTek has not publicly shared the U-Boot sources needed to build FIP binaries +for signing. However you can download them from the amlogic-fip-repo. + +.. code-block:: bash + + $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 + $ cd amlogic-boot-fip/wetek-play2 + $ export FIPDIR=$PWD + +Go back to the mainline U-Boot source tree then: + +.. code-block:: bash + + $ mkdir fip + + $ cp $FIPDIR/bl2.bin fip/ + $ cp $FIPDIR/acs.bin fip/ + $ cp $FIPDIR/bl21.bin fip/ + $ cp $FIPDIR/bl30.bin fip/ + $ cp $FIPDIR/bl301.bin fip/ + $ cp $FIPDIR/bl31.img fip/ + $ cp u-boot.bin fip/bl33.bin + + $ $FIPDIR/blx_fix.sh \ + fip/bl30.bin \ + fip/zero_tmp \ + fip/bl30_zero.bin \ + fip/bl301.bin \ + fip/bl301_zero.bin \ + fip/bl30_new.bin \ + bl30 + + $ $FIPDIR/fip_create --bl30 fip/bl30_new.bin \ + --bl31 fip/bl31.img \ + --bl33 fip/bl33.bin \ + fip/fip.bin + + $ sed -i 's/\x73\x02\x08\x91/\x1F\x20\x03\xD5/' fip/bl2.bin + $ python3 $FIPDIR/acs_tool.py fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 + + $ $FIPDIR/blx_fix.sh \ + fip/bl2_acs.bin \ + fip/zero_tmp \ + fip/bl2_zero.bin \ + fip/bl21.bin \ + fip/bl21_zero.bin \ + fip/bl2_new.bin \ + bl2 + + $ cat fip/bl2_new.bin fip/fip.bin > fip/boot_new.bin + + $ $FIPDIR/aml_encrypt_gxb --bootsig \ + --input fip/boot_new.bin + --output fip/u-boot.bin + +Then write U-Boot to SD or eMMC with: + +.. code-block:: bash + + $ DEV=/dev/boot_device + $ dd if=fip/u-boot.bin of=fip/u-boot.bin.gxbb bs=512 conv=fsync + $ dd if=fip/u-boot.bin of=fip/u-boot.bin.gxbb bs=512 seek=9 skip=8 count=87 conv=fsync,notrunc + $ dd if=/dev/zero of=fip/u-boot.bin.gxbb bs=512 seek=8 count=1 conv=fsync,notrunc + $ dd if=bl1.bin.hardkernel of=fip/u-boot.bin.gxbb bs=512 seek=2 skip=2 count=1 conv=fsync,notrunc + $ ./aml_chksum fip/u-boot.bin.gxbb + $ dd if=fip/u-boot.gxbb of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 + $ dd if=fip/u-boot.gxbb of=$DEV conv=fsync,notrunc bs=1 count=440 |