Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raspberry-pi/5: init #927

Merged
merged 7 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ See code for all available configurations.
| [Purism Librem 5r4](purism/librem/5r4) | `<nixos-hardware/purism/librem/5r4>` |
| [Raspberry Pi 2](raspberry-pi/2) | `<nixos-hardware/raspberry-pi/2>` |
| [Raspberry Pi 4](raspberry-pi/4) | `<nixos-hardware/raspberry-pi/4>` |
| [Raspberry Pi 5](raspberry-pi/5) | `<nixos-hardware/raspberry-pi/5>` |
leo60228 marked this conversation as resolved.
Show resolved Hide resolved
| [Samsung Series 9 NP900X3C](samsung/np900x3c) | `<nixos-hardware/samsung/np900x3c>` |
| [StarFive VisionFive v1](starfive/visionfive/v1) | `<nixos-hardware/starfive/visionfive/v1>` |
| [StarFive VisionFive 2](starfive/visionfive/v2) | `<nixos-hardware/starfive/visionfive/v2>` |
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,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;
Expand Down
34 changes: 34 additions & 0 deletions raspberry-pi/5/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{ lib, pkgs, config, ... }:

{
nixpkgs.overlays = [
(import ./overlay.nix)
];

boot = {
kernelPackages = lib.mkDefault (pkgs.linuxPackagesFor pkgs.linux_rpi5);
leo60228 marked this conversation as resolved.
Show resolved Hide resolved
initrd.availableKernelModules = [
leo60228 marked this conversation as resolved.
Show resolved Hide resolved
"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.";
}
];
}
6 changes: 6 additions & 0 deletions raspberry-pi/5/overlay.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
final: _prev: {
linux_rpi5 = final.linux_rpi4.override {
leo60228 marked this conversation as resolved.
Show resolved Hide resolved
Mic92 marked this conversation as resolved.
Show resolved Hide resolved
rpiVersion = 5;
argsOverride.defconfig = "bcm2712_defconfig";
leo60228 marked this conversation as resolved.
Show resolved Hide resolved
};
}
2 changes: 1 addition & 1 deletion tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down