Christian Hewitt | 9cb6581 | 2021-09-15 01:46:59 +0000 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
Christian Hewitt | d02a47f | 2023-03-20 11:45:59 +0000 | [diff] [blame^] | 3 | U-Boot for Radxa Zero (S905Y2) |
| 4 | ============================== |
Christian Hewitt | 9cb6581 | 2021-09-15 01:46:59 +0000 | [diff] [blame] | 5 | |
Christian Hewitt | d02a47f | 2023-03-20 11:45:59 +0000 | [diff] [blame^] | 6 | Radxa Zero is a small form factor SBC based on the Amlogic S905Y2 chipset that ships in |
| 7 | a number of RAM/eMMC configurations: |
Christian Hewitt | 9cb6581 | 2021-09-15 01:46:59 +0000 | [diff] [blame] | 8 | |
Christian Hewitt | d02a47f | 2023-03-20 11:45:59 +0000 | [diff] [blame^] | 9 | 512MB/1GB LPDDR4 RAM boards have no eMMC and BCM43436 wireless (2.4GHz b/g/n) while the |
| 10 | 2GB/4GB boards have 8/16/32/64/128GB eMMC and BCM4345 wireless (2.4/5GHz a/b/g/n/ac). |
Christian Hewitt | 9cb6581 | 2021-09-15 01:46:59 +0000 | [diff] [blame] | 11 | |
| 12 | - Amlogic S905Y2 quad-core Cortex-A53 |
| 13 | - Mali G31-MP2 GPU |
| 14 | - HDMI 2.1 output (micro) |
| 15 | - 1x USB 2.0 port - Type C (OTG) |
| 16 | - 1x USB 3.0 port - Type C (Host) |
| 17 | - 1x micro SD Card slot |
| 18 | - 40 Pin GPIO header |
| 19 | |
Christian Hewitt | d02a47f | 2023-03-20 11:45:59 +0000 | [diff] [blame^] | 20 | Schematics are available on the manufacturer website: https://dl.radxa.com/zero/docs/hw |
Christian Hewitt | 9cb6581 | 2021-09-15 01:46:59 +0000 | [diff] [blame] | 21 | |
Christian Hewitt | d02a47f | 2023-03-20 11:45:59 +0000 | [diff] [blame^] | 22 | U-Boot Compilation |
Christian Hewitt | 9cb6581 | 2021-09-15 01:46:59 +0000 | [diff] [blame] | 23 | ------------------ |
| 24 | |
| 25 | .. code-block:: bash |
| 26 | |
| 27 | $ export CROSS_COMPILE=aarch64-none-elf- |
| 28 | $ make radxa-zero_defconfig |
| 29 | $ make |
| 30 | |
Christian Hewitt | d02a47f | 2023-03-20 11:45:59 +0000 | [diff] [blame^] | 31 | U-Boot Signing with Pre-Built FIP repo |
| 32 | -------------------------------------- |
| 33 | |
| 34 | .. code-block:: bash |
| 35 | |
| 36 | $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 |
| 37 | $ cd amlogic-boot-fip |
| 38 | $ mkdir my-output-dir |
| 39 | $ ./build-fip.sh radxa-zero /path/to/u-boot/u-boot.bin my-output-dir |
Christian Hewitt | 9cb6581 | 2021-09-15 01:46:59 +0000 | [diff] [blame] | 40 | |
Christian Hewitt | d02a47f | 2023-03-20 11:45:59 +0000 | [diff] [blame^] | 41 | U-Boot Manual Signing |
| 42 | --------------------- |
Neil Armstrong | 2ea9868 | 2022-03-02 10:42:22 +0100 | [diff] [blame] | 43 | |
Christian Hewitt | d02a47f | 2023-03-20 11:45:59 +0000 | [diff] [blame^] | 44 | Amlogic does not provide sources for the firmware and tools needed to create a bootloader |
| 45 | image so it is necessary to obtain binaries from sources published by the board vendor: |
Christian Hewitt | 9cb6581 | 2021-09-15 01:46:59 +0000 | [diff] [blame] | 46 | |
| 47 | .. code-block:: bash |
| 48 | |
| 49 | $ git clone -b radxa-zero-v2021.07 https://github.com/radxa/u-boot.git |
| 50 | $ git clone https://github.com/radxa/fip.git |
| 51 | |
| 52 | $ sudo apt-get install -y gcc-aarch64-linux-gnu device-tree-compiler libncurses5 libncurses5-dev |
| 53 | $ sudo apt-get install -y bc python dosfstools flex build-essential libssl-dev mtools |
| 54 | |
| 55 | $ 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 |
| 56 | $ sudo tar xvf gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz -C /opt |
| 57 | |
| 58 | $ export CROSS_COMPILE=/opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin/aarch64-none-elf- |
| 59 | $ export ARCH=arm |
| 60 | $ cd u-boot |
| 61 | $ make radxa-zero_defconfig |
| 62 | $ make |
| 63 | |
| 64 | $ cp u-boot.bin ../fip/radxa-zero/bl33.bin |
| 65 | $ cd ../fip/radxa-zero |
| 66 | $ make |
| 67 | |
Christian Hewitt | d02a47f | 2023-03-20 11:45:59 +0000 | [diff] [blame^] | 68 | This will generate the signed U-Boot binaries: |
Christian Hewitt | 9cb6581 | 2021-09-15 01:46:59 +0000 | [diff] [blame] | 69 | |
| 70 | .. code-block:: bash |
| 71 | |
| 72 | $ u-boot.bin u-boot.bin.sd.bin u-boot.bin.usb.bl2 u-boot.bin.usb.tpl |
| 73 | |
Christian Hewitt | d02a47f | 2023-03-20 11:45:59 +0000 | [diff] [blame^] | 74 | Then write U-Boot to SD or eMMC with: |
Christian Hewitt | 9cb6581 | 2021-09-15 01:46:59 +0000 | [diff] [blame] | 75 | |
| 76 | .. code-block:: bash |
| 77 | |
Christian Hewitt | d02a47f | 2023-03-20 11:45:59 +0000 | [diff] [blame^] | 78 | $ DEV=/dev/boot_device |
Christian Hewitt | 9cb6581 | 2021-09-15 01:46:59 +0000 | [diff] [blame] | 79 | $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 |
Christian Hewitt | d02a47f | 2023-03-20 11:45:59 +0000 | [diff] [blame^] | 80 | $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 |