schneid-l / u-boot-orangepi5

U-Boot builds for Orange Pi 5 (and variants)
GNU General Public License v2.0
21 stars 3 forks source link
orangepi orangepi5 orangepi5b orangepi5plus u-boot uboot

U-Boot build for Orange Pi 5

This repo provides pre-built SPI flash U-Boot v2024.10 binaries for the Orange Pi 5 (and variants) board.

Supported boards

Pre-built binaries

This U-Boot build uses pre-built TPL binaries provided by Rockchip from rkbin repo.

This U-Boot build also uses patches provided by Armbian to support the rk3588 SoC.

Known issues

Don't hesitate to open a Github issue if you encounter any other issue.

Install

This repo only provides a version made to be flashed on the SPI flash of the Orange Pi 5 as its the recommended way to boot the board.

To do this you will need an official distribution provided by Orange Pi (or Armbian) booted from an SD card.

Once booted, download your board specific U-Boot binary from the releases section:

# Orange Pi 5 (and Orange Pi 5B)
wget https://github.com/schneid-l/u-boot-orangepi5/releases/download/latest/u-boot-v2024.10-orangepi5-spi.bin

# Orange Pi 5 Plus
wget https://github.com/schneid-l/u-boot-orangepi5/releases/download/latest/u-boot-v2024.10-orangepi5-plus-spi.bin

We will assume that the SPI flash chip is /dev/mtdblock0 (you can check this by using lsblk).

Reset the SPI flash:

devicesize=$(blockdev --getsz /dev/mtdblock0)
dd if=/dev/zero of=/dev/mtdblock0 bs=1M count=$devicesize status=progress && sync

Flash the U-Boot binary:

# Orange Pi 5 (and Orange Pi 5B)
dd if=u-boot-v2024.10-orangepi5-spi.bin of=/dev/mtdblock0 bs=1M status=progress && sync

# Orange Pi 5 Plus
dd if=u-boot-v2024.10-orangepi5-plus-spi.bin of=/dev/mtdblock0 bs=1M status=progress && sync

Reboot the board, et voilà!

Build

Build is done using a Docker container to ensure reproducibility.

To build the U-Boot binary, you will need to have Docker installed on your machine.

Clone this repo:

git clone https://github.com/schneid-l/u-boot-orangepi5.git
cd orangepi5-u-boot

Build the U-Boot binary with Docker:

# Orange Pi 5 (and Orange Pi 5B)
docker build --platform="linux/arm64" --output type=local,dest=. . --build-arg DEFCONFIG=orangepi-5-rk3588s

# Orange Pi 5 Plus
docker build --platform="linux/arm64" --output type=local,dest=. . --build-arg DEFCONFIG=orangepi-5-plus-rk3588

The U-Boot binary will be available in the current directory.

Available build args:

As this image uses the rkbin provided BL31 and TPL binaries for rk3588, this build environment could be used to build U-Boot for any rk3588 board by passing the correct DEFCONFIG argument.

License

The U-Boot source code is licensed under the GPL-2.0 license. So this repo too.