NixOS on ARM/Radxa ROCK5 Model B: Difference between revisions
imported>Jakubgs Updating with info about EDK2 UEFI firmware. |
m update link to spl helper |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 31: | Line 31: | ||
* '''NET''': 2.5 Gigabit Ethernet | * '''NET''': 2.5 Gigabit Ethernet | ||
* '''USB''': 2x USB 3.1 Type-A, 2x USB 2.0 Type-A | * '''USB''': 2x USB 3.1 Type-A, 2x USB 2.0 Type-A | ||
* '''PCIe''': | * '''PCIe''': M.2 Key E connector with PCIe 2.1 x1, M.2 Key M connector with PCIe 3.0 x4 | ||
== Status == | == Status == | ||
Line 37: | Line 37: | ||
Support of this system is YMMV (your mileage may vary), and depends on vendor-provided BSP (Board Support Package) based components. | Support of this system is YMMV (your mileage may vary), and depends on vendor-provided BSP (Board Support Package) based components. | ||
Two kinds of bootloaders are available in different variants: | |||
* U-Boot | |||
** [https://github.com/u-boot/u-boot/ Mainline] - Supports all storage boot options, including NVMe | |||
** [https://dl.radxa.com/rock5/sw/images/loader/rock-5b/ Vendor] - Works well for eMMC and SD card boot, not for NVMe. | |||
** [https://github.com/samueldr/Tow-Boot/tree/wip/rock5-vendor Not-TowBoot] - Supports eMMC and SD card, NVMe sometimes. | |||
*** Vendor U-Boot built using the TowBoot build infrastructure | |||
* EDK2/TianoCore | |||
** [https://github.com/edk2-porting/edk2-rk3588 EDK2 UEFI Firmware] - Supports all storage boot options, including NVMe. | |||
The official hardware documentation can be found [https://wiki.radxa.com/Rock5/hardware/5b on the Radxa wiki]. | The official hardware documentation can be found [https://wiki.radxa.com/Rock5/hardware/5b on the Radxa wiki]. | ||
Line 57: | Line 62: | ||
=== Community UEFI Firmware === | === Community UEFI Firmware === | ||
The best available bootloader is [ | The best available bootloader is [https://github.com/edk2-porting/edk2-rk3588 EDK2 UEFI firmware for Rockchip RK3588 platforms]. The [https://github.com/edk2-porting/edk2-rk3588/releases/tag/v0.9.1 v0.9.1] release is confirmed working. | ||
In order to flash this bootloader we'll need to download two files: | In order to flash this bootloader we'll need to download two files: | ||
* [https://dl.radxa.com/rock5/sw/images/loader/rock-5b/release/rk3588_spl_loader_v1. | * [https://dl.radxa.com/rock5/sw/images/loader/rock-5b/release/rk3588_spl_loader_v1.15.113.bin <tt>rk3588_spl_loader_v1.15.113.bin</tt>] - SPI bootloader image. | ||
* [https://github.com/edk2-porting/edk2-rk3588/releases/download/v0.9.1/rock-5b_UEFI_Release_v0.9.1.img <tt>rock-5b_UEFI_Release_v0.9.1.img</tt>] - UEFI bootloader image. | * [https://github.com/edk2-porting/edk2-rk3588/releases/download/v0.9.1/rock-5b_UEFI_Release_v0.9.1.img <tt>rock-5b_UEFI_Release_v0.9.1.img</tt>] - UEFI bootloader image. | ||
Line 138: | Line 143: | ||
sudo nixos-rebuild switch --flake github:jonahbron/config/aciceri-rebooted-into-this#rock5b | sudo nixos-rebuild switch --flake github:jonahbron/config/aciceri-rebooted-into-this#rock5b | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Latest revision as of 15:09, 25 May 2024
Radxa ROCK 5B | |
---|---|
Manufacturer | Radxa |
Architecture | AArch64 |
Bootloader | Vendor BSP |
Boot order | SPI NOR Flash, eMMC, SD |
Maintainer | jakubgs |
The Radxa ROCK 5B is a Single-Board Computer with a Rockchip RK3588 SoC.
- CPU: ARM Cortex-A76 and Cortex-A55
- GPU: Mali-G610 MP4
- RAM: 4GB/8GB/16GB LPDDR4X at 2133MHz
- MMC: eMMC Connector for up to 512GB
- NET: 2.5 Gigabit Ethernet
- USB: 2x USB 3.1 Type-A, 2x USB 2.0 Type-A
- PCIe: M.2 Key E connector with PCIe 2.1 x1, M.2 Key M connector with PCIe 3.0 x4
Status
Support of this system is YMMV (your mileage may vary), and depends on vendor-provided BSP (Board Support Package) based components.
Two kinds of bootloaders are available in different variants:
- U-Boot
- Mainline - Supports all storage boot options, including NVMe
- Vendor - Works well for eMMC and SD card boot, not for NVMe.
- Not-TowBoot - Supports eMMC and SD card, NVMe sometimes.
- Vendor U-Boot built using the TowBoot build infrastructure
- EDK2/TianoCore
- EDK2 UEFI Firmware - Supports all storage boot options, including NVMe.
The official hardware documentation can be found on the Radxa wiki.
Bootloader Firmware
Vendor U-Boot Firmware
Booting the system with the vendor-provided platform firmware may not work due to a known issue in older U-Boot.
If using the vendor-provided platform firmware is desired, renaming the kernel derivation to a shorter name should allow boot to succeed.
Community UEFI Firmware
The best available bootloader is EDK2 UEFI firmware for Rockchip RK3588 platforms. The v0.9.1 release is confirmed working.
In order to flash this bootloader we'll need to download two files:
- rk3588_spl_loader_v1.15.113.bin - SPI bootloader image.
- rock-5b_UEFI_Release_v0.9.1.img - UEFI bootloader image.
Then use the rkdeveloptool tool in version 1.32 or higher as described in SPI flashing documentation:
> nix-shell -p rkdeveloptool
[nix-shell:~/rk3588]$ rkdeveloptool --version
rkdeveloptool ver 1.32
[nix-shell:~/rk3588]$ sudo rkdeveloptool db rk3588_spl_loader_v1.08.111.bin
Downloading bootloader succeeded.
[nix-shell:~/rk3588]$ sudo rkdeveloptool wl 0 rock-5b_UEFI_Release_v0.9.1.img
Write LBA from file (100%)
[nix-shell:~/rk3588]$ sudo rkdeveloptool rb
Now the device has a graphical bootloader available when pressing Escape at boot time:
Community U-Boot Firmware
A WIP tree to build U-Boot using the infrastructure for Tow-Boot is available. (The end-result is not a proper Tow-Boot build.)
This uses a fork with some fixes, so that an installation on the SPI Flash will work, and allow OS booting from NVMe, eMMC or SD. NVMe support may be YMMV depending on the specific hardware.
The board-specific README has further notes.
Using from shared storage (SD, eMMC) or from SPI should work, and both are as supported.
To build:
nix-build -A radxa-rock5b
The SD or eMMC shared storage image can be flashed as usual:
dd if=shared.disk-image.img of=/dev/XXX bs=1M oflag=direct,sync status=progress
The SPI image cannot be installed using the usual installer. For now you should follow the vendor instructions to write the binaries/Tow-Boot.spi.bin
file to SPI. In other words using rkdeveloptool
for the installation, or any other way to write to SPI flash.
System configuration
A working bootloader configuration looks like this:
boot.loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
grub.enable = false;
};
The current NixOS 23.05 release with 6.1 Linux kernel detects NVMe but not the eMMC.
@aciceri's flake
Nix flake for building OS image: https://github.com/aciceri/rock5b-nixos
Flash result to a new second legacy bootable ext4 partition on the installation media
Boot into system:
sudo nixos-rebuild switch --flake github:jonahbron/config/aciceri-rebooted-into-this#rock5b