Commit 570d6ea
committed
✨ feat(rpi): extend Pi support to Raspberry Pi 5 (BCM2712)
Wires up the rpi5 build target on top of the board-aware Pi
infrastructure. Pi-5-only logic in modules/rpi.nix (firmware-
partition contents, [pi5] config.txt block, NixOS-built kernel
as gzipped kernel_2712.img, NixOS-built initrd, explicit
toplevel cmdline) is reachable via stereos.rpi.series = "rpi5",
which the rpi5MixtapeSpecs set inline.
Why a NixOS-built kernel as kernel_2712.img instead of
raspberrypifw's prebuilt:
• The firmware-shipped kernel_2712.img is a different version
(e.g. 6.12.25-v8-16k+ in fw 1.20250430) than the kernel
nixos-hardware configures (linux-rpi 6.12.75-1+rpt1). Booting
the firmware kernel makes /lib/modules/<our-version>/ unusable
— modprobe fails for everything kernel-module-dependent.
• nixpkgs at our pinned rev has no ubootRaspberryPi5_64bit, so
the standard sd-image-aarch64 U-Boot+extlinux flow is
unavailable on Pi 5. We replace the prebuilt kernel directly
and write our own cmdline.txt.
• Pi 5 EEPROM detects the gzip magic on kernel_2712.img and
decompresses on load; linuxPackages_rpi5 only installs the
raw Image, so we gzip it during firmware-partition population.
D0 vs C1 silicon: the EEPROM auto-selects bcm2712d0-rpi-5-b.dtb
on D0 boards when both DTBs *and* overlays/bcm2712d0.dtbo are
present. Ship only the C1 dtb and a 2 GB / rev-1.1 board panics
during pinctrl-bcm2712 probe with an Asynchronous SError. We ship
the full bcm2712 dtb glob and the entire overlays/ tree.
GPIO 14/15 UART: enable_uart=1 by itself does not pinmux the
RP1's UART0 to the GPIO header on Pi 5. The dtoverlay=uart0-pi5
overlay does that routing; the device enumerates as ttyAMA0,
matching Pi 4's name (ttyAMA10 on Pi 5 is the dedicated
debug-header UART, not GPIO 14/15).
nixos-hardware pin: pinned to f1b7ff92cdd1 — the last commit
before nixos-hardware#1841 replaced the rpi-kernel postConfigure
sed with `LOCALVERSION = freeform ""`, which round-trips through
nixpkgs' kernel-config emitter as the literal two characters `""`
and breaks the modDirVersion sanity check. Tracked in
nixos-hardware#1859, fix in #1860 unmerged as of 2026-05.
Pi-5-only artifacts:
• flake.nix nixos-hardware flake input
• modules/rpi5-kernel-overlay.nix
overlay defaulting makeModulesClosure to
allowMissing=true; needed because all-
hardware.nix lists modules that the
rpi-vendor 6.12.x kernel builds as =y
(dw_hdmi, …) so they're not present as
.ko files in /lib/modules and modprobe
errors during the modules-shrunk step.
Pattern from nvmd/nixos-raspberrypi.
• flake/images.nix rpi5MixtapeSpecs (sets series + imports
nixos-hardware module + the kernel-
overlay), rpi5Pkgs.
• Makefile build-rpi5 / flash-rpi5 targets.1 parent 1fc9933 commit 570d6ea
5 files changed
Lines changed: 110 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
54 | 64 | | |
55 | 65 | | |
56 | 66 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
8 | 21 | | |
9 | 22 | | |
10 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
48 | 72 | | |
49 | 73 | | |
50 | 74 | | |
| |||
115 | 139 | | |
116 | 140 | | |
117 | 141 | | |
| 142 | + | |
118 | 143 | | |
119 | | - | |
| 144 | + | |
120 | 145 | | |
121 | 146 | | |
122 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
0 commit comments