blob: 14ce3cfd492391d021b97736aefb8316758ef8e8 [file] [log] [blame]
Christian Hewitt9cb65812021-09-15 01:46:59 +00001.. SPDX-License-Identifier: GPL-2.0+
2
Christian Hewittd02a47f2023-03-20 11:45:59 +00003U-Boot for Radxa Zero (S905Y2)
4==============================
Christian Hewitt9cb65812021-09-15 01:46:59 +00005
Christian Hewittd02a47f2023-03-20 11:45:59 +00006Radxa Zero is a small form factor SBC based on the Amlogic S905Y2 chipset that ships in
7a number of RAM/eMMC configurations:
Christian Hewitt9cb65812021-09-15 01:46:59 +00008
Christian Hewittd02a47f2023-03-20 11:45:59 +00009512MB/1GB LPDDR4 RAM boards have no eMMC and BCM43436 wireless (2.4GHz b/g/n) while the
102GB/4GB boards have 8/16/32/64/128GB eMMC and BCM4345 wireless (2.4/5GHz a/b/g/n/ac).
Christian Hewitt9cb65812021-09-15 01:46:59 +000011
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 Hewittd02a47f2023-03-20 11:45:59 +000020Schematics are available on the manufacturer website: https://dl.radxa.com/zero/docs/hw
Christian Hewitt9cb65812021-09-15 01:46:59 +000021
Christian Hewittd02a47f2023-03-20 11:45:59 +000022U-Boot Compilation
Christian Hewitt9cb65812021-09-15 01:46:59 +000023------------------
24
25.. code-block:: bash
26
27 $ export CROSS_COMPILE=aarch64-none-elf-
28 $ make radxa-zero_defconfig
29 $ make
30
Christian Hewittd02a47f2023-03-20 11:45:59 +000031U-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 Hewitt9cb65812021-09-15 01:46:59 +000040
Christian Hewittd02a47f2023-03-20 11:45:59 +000041U-Boot Manual Signing
42---------------------
Neil Armstrong2ea98682022-03-02 10:42:22 +010043
Christian Hewittd02a47f2023-03-20 11:45:59 +000044Amlogic does not provide sources for the firmware and tools needed to create a bootloader
45image so it is necessary to obtain binaries from sources published by the board vendor:
Christian Hewitt9cb65812021-09-15 01:46:59 +000046
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 Hewittd02a47f2023-03-20 11:45:59 +000068This will generate the signed U-Boot binaries:
Christian Hewitt9cb65812021-09-15 01:46:59 +000069
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 Hewittd02a47f2023-03-20 11:45:59 +000074Then write U-Boot to SD or eMMC with:
Christian Hewitt9cb65812021-09-15 01:46:59 +000075
76.. code-block:: bash
77
Christian Hewittd02a47f2023-03-20 11:45:59 +000078 $ DEV=/dev/boot_device
Christian Hewitt9cb65812021-09-15 01:46:59 +000079 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
Christian Hewittd02a47f2023-03-20 11:45:59 +000080 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440