Skip to content

raspberry-pi/5: add U-Boot packages and an installer#1773

Open
fkokosinski wants to merge 2 commits intoNixOS:masterfrom
fkokosinski:rpi5
Open

raspberry-pi/5: add U-Boot packages and an installer#1773
fkokosinski wants to merge 2 commits intoNixOS:masterfrom
fkokosinski:rpi5

Conversation

@fkokosinski
Copy link

@fkokosinski fkokosinski commented Feb 21, 2026

Description of changes

This PR provides an overlay for Raspberry Pi 5 U-Boot packages. Two U-Boot packages are provided: rev 1.0 and rev 1.1 compatible ones. Additionally, extlinux is made default in the Raspberry Pi 5 profile.

This PR provides an installer as well for the board. The options.hardware.rpiRevision option is provided to choose between Raspberry Pi 5 board revisions. This in turn chooses the correct U-Boot package from the overlay.

Things done
  • Tested the changes in your own NixOS Configuration
  • Tested the changes end-to-end by using your fork of nixos-hardware and
    importing it via <nixos-hardware> or Flake input

This patch adds an overlay for U-Boot packages. A patch is provided
for rev 1.1 boards, which seem to have the d0 stepping of the BCM2712
SoC. As of date, U-Boot does not set the correct `fdtfile` environment
variable for them; the patch rectifies that.

Additionally, this patch sets GRUB as disabled by default, and selects
extlinux instead.

Signed-off-by: Filip Kokosiński <filip.kokosinski@gmail.com>
This patch provides an installer for Raspberry Pi 5 boards. An option is
provided to choose between rev 1.0 and rev 1.1 boards. The installer
selects the U-Boot package based on that option.

Signed-off-by: Filip Kokosiński <filip.kokosinski@gmail.com>
@fkokosinski fkokosinski marked this pull request as ready for review February 21, 2026 13:09
@fkokosinski
Copy link
Author

@Cryolitia @Mic92 @concatime - pinging you since you seem to be active w/r to RPi support. I'd appreciate if you could take a look at this PR and review the changes. Thanks!

defconfig = "rpi_arm64_defconfig";
# Mote: this patch can be removed once U-Boot starts setting
# `fdtfile=bcm2712d0-rpi-5.dtb` automatically for rev1.1 boards
patches = [ ./uboot-rpi5-bcm2712d0.patch ];
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's something that I'm actually trying to fix with this series: https://lore.kernel.org/u-boot/20260216184452.18732-1-filip.kokosinski@gmail.com/.

But they are still under review & testing, so I didn't want to straight up include them here.

Copy link
Contributor

@concatime concatime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been quite some time since I used the sd-image installer, but can't we instead upstream the changes to nixpkgs's nixos/modules/installer/sd-card/sd-image-aarch64.nix?

Comment on lines +2 to +6
ubootRaspberryPi5_rev1_0 = final.buildUBoot {
defconfig = "rpi_arm64_defconfig";
extraMeta.platforms = [ "aarch64-linux" ];
filesToInstall = [ "u-boot.bin" ];
};
Copy link
Contributor

@concatime concatime Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be upstreamed to nixpkgs after this block. It should probably be renamed to ubootRaspberryPiAarch64 like ubootQemuAarch64. WDYT?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea - it looks like doing that in nixpkgs is fine as long as we use upstream sources, which we do.

Upstreaming this in NixOS/nixpkgs#493816.

@Cryolitia
Copy link
Member

My Raspberry Pi 5 is destroyed and fixing, I can test it later when I get it.

@fkokosinski
Copy link
Author

My Raspberry Pi 5 is destroyed and fixing, I can test it later when I get it.

That would be much appreciated. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants