From 40a9f0ed77b720db44b49c6dbc049d0920952d91 Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Fri, 12 May 2023 17:57:39 +0200 Subject: [PATCH] raspberry-pi."4": add assertion and update some source comments Signed-off-by: Florian Brandes --- raspberry-pi/4/backlight.nix | 3 ++- raspberry-pi/4/default.nix | 10 +++++++++- raspberry-pi/4/modesetting.nix | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/raspberry-pi/4/backlight.nix b/raspberry-pi/4/backlight.nix index f871421..31c0e90 100644 --- a/raspberry-pi/4/backlight.nix +++ b/raspberry-pi/4/backlight.nix @@ -16,8 +16,9 @@ in hardware.deviceTree = { overlays = [ # This overlay was originally taken from: - # https://github.com/raspberrypi/linux/blob/rpi-5.15.y/arch/arm/boot/dts/overlays/rpi-backlight-overlay.dts + # https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/rpi-backlight-overlay.dts # The only modification made was to change the compatible field to bcm2711 + # this is the same as for the 5.15.y kernel { name = "rpi-backlight-overlay"; dtsText = '' diff --git a/raspberry-pi/4/default.nix b/raspberry-pi/4/default.nix index 6101698..acbfcf0 100644 --- a/raspberry-pi/4/default.nix +++ b/raspberry-pi/4/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: +{ lib, pkgs, config, ... }: { imports = [ @@ -34,6 +34,14 @@ hardware.deviceTree.filter = "bcm2711-rpi-*.dtb"; + + assertions = [ + { + assertion = (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.1"); + message = "This version of raspberry pi 4 dts overlays requires a newer kernel version (>=6.1). Please upgrade nixpkgs for this system."; + } + ]; + # Required for the Wireless firmware hardware.enableRedistributableFirmware = true; } diff --git a/raspberry-pi/4/modesetting.nix b/raspberry-pi/4/modesetting.nix index b1f734b..b74e686 100644 --- a/raspberry-pi/4/modesetting.nix +++ b/raspberry-pi/4/modesetting.nix @@ -31,7 +31,7 @@ in hardware.deviceTree = { overlays = [ # Equivalent to: - # https://github.com/raspberrypi/linux/blob/rpi-5.10.y/arch/arm/boot/dts/overlays/cma-overlay.dts + # https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/cma-overlay.dts { name = "rpi4-cma-overlay"; dtsText = '' @@ -52,7 +52,7 @@ in ''; } # Equivalent to: - # https://github.com/raspberrypi/linux/blob/rpi-5.10.y/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts + # https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts { name = "rpi4-vc4-fkms-v3d-overlay"; dtsText = ''