diff --git a/README.md b/README.md index 5ac2a8240..6698010cc 100644 --- a/README.md +++ b/README.md @@ -281,6 +281,7 @@ See code for all available configurations. | [Purism Librem 5r4](purism/librem/5r4) | `` | | [Raspberry Pi 2](raspberry-pi/2) | `` | | [Raspberry Pi 4](raspberry-pi/4) | `` | +| [Raspberry Pi 5](raspberry-pi/5) | `` | | [Samsung Series 9 NP900X3C](samsung/np900x3c) | `` | | [StarFive VisionFive v1](starfive/visionfive/v1) | `` | | [StarFive VisionFive 2](starfive/visionfive/v2) | `` | diff --git a/flake.nix b/flake.nix index 8ac61b3f6..416d4c6cc 100644 --- a/flake.nix +++ b/flake.nix @@ -220,6 +220,7 @@ purism-librem-5r4 = import ./purism/librem/5r4; raspberry-pi-2 = import ./raspberry-pi/2; raspberry-pi-4 = import ./raspberry-pi/4; + raspberry-pi-5 = import ./raspberry-pi/5; kobol-helios4 = import ./kobol/helios4; samsung-np900x3c = import ./samsung/np900x3c; starfive-visionfive-v1 = import ./starfive/visionfive/v1; diff --git a/raspberry-pi/5/default.nix b/raspberry-pi/5/default.nix new file mode 100644 index 000000000..aba0178fe --- /dev/null +++ b/raspberry-pi/5/default.nix @@ -0,0 +1,35 @@ +{ lib, pkgs, config, ... }: +let + linux_rpi5 = pkgs.linux_rpi4.override { + rpiVersion = 5; + argsOverride.defconfig = "bcm2712_defconfig"; + }; +in +{ + boot = { + kernelPackages = lib.mkDefault (pkgs.linuxPackagesFor linux_rpi5); + initrd.availableKernelModules = [ + "nvme" + "usbhid" + "usb_storage" + ]; + }; + + # Needed for Xorg to start (https://github.com/raspberrypi-ui/gldriver-test/blob/master/usr/lib/systemd/scripts/rp1_test.sh) + # This won't work for displays connected to the RP1 (DPI/composite/MIPI DSI), since I don't have one to test. + services.xserver.extraConfig = '' + Section "OutputClass" + Identifier "vc4" + MatchDriver "vc4" + Driver "modesetting" + Option "PrimaryGPU" "true" + EndSection + ''; + + assertions = [ + { + assertion = (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.1.54"); + message = "The Raspberry Pi 5 requires a newer kernel version (>=6.1.54). Please upgrade nixpkgs for this system."; + } + ]; +} diff --git a/tests/run.py b/tests/run.py index 8ad602562..07a86c02b 100755 --- a/tests/run.py +++ b/tests/run.py @@ -81,7 +81,7 @@ def write_eval_test(f: IO[str], profiles: list[str]) -> None: continue system = "x86_64-linux" - if "raspberry-pi/4" == profile: + if "raspberry-pi/4" == profile or "raspberry-pi/5" == profile: system = "aarch64-linux" f.write(