From 1e853c8d2d895987d5ebdafcb1fe135e839cadf2 Mon Sep 17 00:00:00 2001 From: leo60228 Date: Thu, 4 Nov 2021 14:48:45 -0400 Subject: [PATCH 01/10] libraspberrypi: unstable-2021-06-23 -> unstable-2021-10-25 --- pkgs/development/libraries/libraspberrypi/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/libraspberrypi/default.nix b/pkgs/development/libraries/libraspberrypi/default.nix index a0b959d178f1f..2a5b75a7b906b 100644 --- a/pkgs/development/libraries/libraspberrypi/default.nix +++ b/pkgs/development/libraries/libraspberrypi/default.nix @@ -7,13 +7,13 @@ stdenv.mkDerivation rec { pname = "libraspberrypi"; - version = "unstable-2021-06-23"; + version = "unstable-2021-10-25"; src = fetchFromGitHub { owner = "raspberrypi"; repo = "userland"; - rev = "97bc8180ad682b004ea224d1db7b8e108eda4397"; - sha256 = "0cnjc7w8ynayj90vlpl13xzm9izd8m5b4cvrq52si9vc6wlm4in5"; + rev = "0093675e4aa6e152a3ffc318b51a124e96eb287b"; + sha256 = "qpooQy9k2UZ94KaqlFwurV+tt0GrBSRffGdlvMcn1XU="; }; patches = [ From 40d136278235bca9bc61995caa36c4ab5289194b Mon Sep 17 00:00:00 2001 From: leo60228 Date: Thu, 4 Nov 2021 15:01:01 -0400 Subject: [PATCH 02/10] linux_rpi: 5.10.52-1.20210805 -> 5.10.92-1.20220118 Co-authored-by: Zhaofeng Li --- pkgs/os-specific/linux/kernel/linux-rpi.nix | 10 ++++++---- pkgs/top-level/aliases.nix | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-rpi.nix b/pkgs/os-specific/linux/kernel/linux-rpi.nix index 17d24c187d5a6..99b966ac5cdea 100644 --- a/pkgs/os-specific/linux/kernel/linux-rpi.nix +++ b/pkgs/os-specific/linux/kernel/linux-rpi.nix @@ -2,8 +2,9 @@ let # NOTE: raspberrypifw & raspberryPiWirelessFirmware should be updated with this - modDirVersion = "5.10.52"; - tag = "1.20210805"; + modDirVersion = "5.10.92"; + tag = "1.20220118"; + rev = "650082a559a570d6c9d2739ecc62843d6f951059"; in lib.overrideDerivation (buildLinux (args // { version = "${modDirVersion}-${tag}"; @@ -12,8 +13,8 @@ lib.overrideDerivation (buildLinux (args // { src = fetchFromGitHub { owner = "raspberrypi"; repo = "linux"; - rev = tag; - sha256 = "1j71xblflslfi4c3zx2srw6fahnhp3bjx4yjfqrp39kzaa41ij0b"; + inherit rev; + sha256 = "sha256-OSDx9dzqm8JnLUvdiv1aKqhRz80uWqfjXLd7m6ycXME="; }; defconfig = { @@ -75,6 +76,7 @@ lib.overrideDerivation (buildLinux (args // { '' + lib.optionalString (lib.elem stdenv.hostPlatform.system ["armv7l-linux"]) '' copyDTB bcm2709-rpi-2-b.dtb bcm2836-rpi-2-b.dtb '' + lib.optionalString (lib.elem stdenv.hostPlatform.system ["armv7l-linux" "aarch64-linux"]) '' + copyDTB bcm2710-rpi-zero-2.dtb bcm2837-rpi-zero-2.dtb copyDTB bcm2710-rpi-3-b.dtb bcm2837-rpi-3-b.dtb copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-a-plus.dtb copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-b-plus.dtb diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 82cc419298bf6..ea742671b849e 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -625,6 +625,7 @@ mapAliases ({ linuxPackages_5_4 = linuxKernel.packages.linux_5_4; linuxPackages_hardkernel_4_14 = linuxKernel.packages.hardkernel_4_14; linuxPackages_rpi0 = linuxKernel.packages.linux_rpi1; + linuxPackages_rpi02w = linuxKernel.packages.linux_rpi3; linuxPackages_rpi1 = linuxKernel.packages.linux_rpi1; linuxPackages_rpi2 = linuxKernel.packages.linux_rpi2; linuxPackages_rpi3 = linuxKernel.packages.linux_rpi3; @@ -641,6 +642,7 @@ mapAliases ({ linux_5_4 = linuxKernel.kernels.linux_5_4; linux_mptcp_95 = linuxKernel.kernels.linux_mptcp_95; linux_rpi0 = linuxKernel.kernels.linux_rpi1; + linux_rpi02w = linuxKernel.kernels.linux_rpi3; linux_rpi1 = linuxKernel.kernels.linux_rpi1; linux_rpi2 = linuxKernel.kernels.linux_rpi2; linux_rpi3 = linuxKernel.kernels.linux_rpi3; From 2164279a0465bd4960bb38fa7888bd882549454c Mon Sep 17 00:00:00 2001 From: leo60228 Date: Thu, 4 Nov 2021 15:24:02 -0400 Subject: [PATCH 03/10] raspberrypifw: 1.20210805 -> 1.20211118 Co-authored-by: Zhaofeng Li --- pkgs/os-specific/linux/firmware/raspberrypi/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/firmware/raspberrypi/default.nix b/pkgs/os-specific/linux/firmware/raspberrypi/default.nix index 29c1859121e0b..0959419b636e1 100644 --- a/pkgs/os-specific/linux/firmware/raspberrypi/default.nix +++ b/pkgs/os-specific/linux/firmware/raspberrypi/default.nix @@ -3,13 +3,13 @@ stdenvNoCC.mkDerivation rec { # NOTE: this should be updated with linux_rpi pname = "raspberrypi-firmware"; - version = "1.20210805"; + version = "1.20220118"; src = fetchFromGitHub { owner = "raspberrypi"; repo = "firmware"; rev = version; - sha256 = "1nndhjv4il42yw3pq8ni3r4nlp1m0r229fadrf4f9v51mgcg11i1"; + sha256 = "sha256-q8xlDnnvkaQ2R/KH2Ojd11IAP1sWjoyAJZiVdAfYKkQ="; }; installPhase = '' From 10afc59e3a50731b390bc03220b71c5ddc6e9c9a Mon Sep 17 00:00:00 2001 From: leo60228 Date: Thu, 4 Nov 2021 15:27:12 -0400 Subject: [PATCH 04/10] raspberrypi-armstubs: 2021-07-05 -> 2021-11-01 --- pkgs/os-specific/linux/firmware/raspberrypi/armstubs.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/firmware/raspberrypi/armstubs.nix b/pkgs/os-specific/linux/firmware/raspberrypi/armstubs.nix index 9934f51487d12..7143d0b55a271 100644 --- a/pkgs/os-specific/linux/firmware/raspberrypi/armstubs.nix +++ b/pkgs/os-specific/linux/firmware/raspberrypi/armstubs.nix @@ -5,13 +5,13 @@ let in stdenv.mkDerivation { pname = "raspberrypi-armstubs"; - version = "2021-07-05"; + version = "2021-11-01"; src = fetchFromGitHub { owner = "raspberrypi"; repo = "tools"; - rev = "2e59fc67d465510179155973d2b959e50a440e47"; - sha256 = "1ysdl4qldy6ldf8cm1igxjisi14xl3s2pi6cnqzpxb38sgihb1vy"; + rev = "13474ee775d0c5ec8a7da4fb0a9fa84187abfc87"; + sha256 = "s/RPMIpQSznoQfchAP9gpO7I2uuTsOV0Ep4vVz7i2o4="; }; NIX_CFLAGS_COMPILE = [ From 7851f68a6802ca1158fb63ae3214997238fc17d8 Mon Sep 17 00:00:00 2001 From: leo60228 Date: Thu, 4 Nov 2021 15:36:11 -0400 Subject: [PATCH 05/10] raspberrypi-wireless-firmware: 2021-06-28 -> 2021-11-02 --- .../linux/firmware/raspberrypi-wireless/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix b/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix index ba8df751511fb..4ade35845ecbf 100644 --- a/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix +++ b/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation { pname = "raspberrypi-wireless-firmware"; - version = "2021-06-28"; + version = "2021-11-02"; srcs = [ (fetchFromGitHub { @@ -16,8 +16,8 @@ stdenv.mkDerivation { name = "firmware-nonfree"; owner = "RPi-Distro"; repo = "firmware-nonfree"; - rev = "00de3194a96397c913786945ac0af1fd6fbec45b"; - sha256 = "1xnr364dkiq6gmr21lcrj23hwc0g9y5qad8dm2maij647bgzp07r"; + rev = "54ffdd6e2ea6055d46656b78e148fe7def3ec9d8"; + sha256 = "4WTrs/tUyOugufRrrh0qsEmhPclQD64ypYysxsnOyS8="; }) ]; @@ -32,7 +32,8 @@ stdenv.mkDerivation { mkdir -p "$out/lib/firmware/brcm" # Wifi firmware - for filename in firmware-nonfree/brcm/brcmfmac434??-sdio.*; do + shopt -s extglob + for filename in firmware-nonfree/brcm/brcmfmac434??{,s}-sdio.*; do cp "$filename" "$out/lib/firmware/brcm" done @@ -43,7 +44,7 @@ stdenv.mkDerivation { outputHashMode = "recursive"; outputHashAlgo = "sha256"; - outputHash = "0a54gyrq6jfxxvimaa4yjfiyfwf7wv58v0a32l74yrzyarr3ldby"; + outputHash = "l+7VOq7CV5QA8/FWjMBGDcxq8Qe7NFf6E2Y42htZEgE="; meta = with lib; { description = "Firmware for builtin Wifi/Bluetooth devices in the Raspberry Pi 3+ and Zero W"; From d57972961cb454a66ffbc26a44860b57e78efbf1 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Thu, 30 Dec 2021 19:30:21 -0800 Subject: [PATCH 06/10] ubootRaspberryPi3_{32,64}bit: Add patch to load correct DT for Pi Zero 2 W --- pkgs/misc/uboot/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index e287066ddb9cb..5d7a344088ef5 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -395,12 +395,28 @@ in { defconfig = "rpi_3_32b_defconfig"; extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot.bin"]; + extraPatches = [ + # Remove when updating to 2022.01 + # https://patchwork.ozlabs.org/project/uboot/list/?series=273129&archive=both&state=* + (fetchpatch { + url = "https://patchwork.ozlabs.org/series/273129/mbox/"; + sha256 = "sha256-/Gu7RNvBNYCGqdFRzQ11qPDDxgGVpwKYYw1CpumIGfU="; + }) + ]; }; ubootRaspberryPi3_64bit = buildUBoot { defconfig = "rpi_3_defconfig"; extraMeta.platforms = ["aarch64-linux"]; filesToInstall = ["u-boot.bin"]; + extraPatches = [ + # Remove when updating to 2022.01 + # https://patchwork.ozlabs.org/project/uboot/list/?series=273129&archive=both&state=* + (fetchpatch { + url = "https://patchwork.ozlabs.org/series/273129/mbox/"; + sha256 = "sha256-/Gu7RNvBNYCGqdFRzQ11qPDDxgGVpwKYYw1CpumIGfU="; + }) + ]; }; ubootRaspberryPi4_32bit = buildUBoot { From 963f011f16315e44a141724df09a94378aac8291 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Thu, 30 Dec 2021 19:30:21 -0800 Subject: [PATCH 07/10] sd-image-aarch64.nix: Add config for Pi Zero 2 W --- nixos/modules/installer/sd-card/sd-image-aarch64.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/modules/installer/sd-card/sd-image-aarch64.nix b/nixos/modules/installer/sd-card/sd-image-aarch64.nix index 165e2aac27b49..36fe2be7ae6bb 100644 --- a/nixos/modules/installer/sd-card/sd-image-aarch64.nix +++ b/nixos/modules/installer/sd-card/sd-image-aarch64.nix @@ -24,6 +24,9 @@ [pi3] kernel=u-boot-rpi3.bin + [pi02] + kernel=u-boot-rpi3.bin + [pi4] kernel=u-boot-rpi4.bin enable_gic=1 From 51b7e23e8fcea6768ad80faefc02c60b209e71ee Mon Sep 17 00:00:00 2001 From: Cole Mickens Date: Mon, 24 Jan 2022 16:46:49 -0800 Subject: [PATCH 08/10] raspberrypi-fw: use fetchurl to avoid darwin issue Co-authored-by: Zhaofeng Li --- .../linux/firmware/raspberrypi/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/os-specific/linux/firmware/raspberrypi/default.nix b/pkgs/os-specific/linux/firmware/raspberrypi/default.nix index 0959419b636e1..7f0eef05dc4ee 100644 --- a/pkgs/os-specific/linux/firmware/raspberrypi/default.nix +++ b/pkgs/os-specific/linux/firmware/raspberrypi/default.nix @@ -1,20 +1,20 @@ -{ lib, stdenvNoCC, fetchFromGitHub }: +{ lib, stdenvNoCC, fetchurl, unzip }: stdenvNoCC.mkDerivation rec { # NOTE: this should be updated with linux_rpi pname = "raspberrypi-firmware"; version = "1.20220118"; - src = fetchFromGitHub { - owner = "raspberrypi"; - repo = "firmware"; - rev = version; - sha256 = "sha256-q8xlDnnvkaQ2R/KH2Ojd11IAP1sWjoyAJZiVdAfYKkQ="; + src = fetchurl { + url = "https://github.com/raspberrypi/firmware/archive/${version}.zip"; + sha256 = "sha256-98rbwKIuB7vb4MWbFCr7TYsvJB0HzPdH8Tw0+bktK/M="; }; + nativeBuildInputs = [ unzip ]; + installPhase = '' - mkdir -p $out/share/raspberrypi/boot - cp -R boot/* $out/share/raspberrypi/boot + mkdir -p $out/share/raspberrypi/ + mv boot "$out/share/raspberrypi/" ''; dontConfigure = true; From 57272bebeef8ce0ccbb8909c9443445d3ab70316 Mon Sep 17 00:00:00 2001 From: Cole Mickens Date: Sun, 9 Jan 2022 18:22:56 -0800 Subject: [PATCH 09/10] raspberrypi-eeprom: 2021.04.29 -> 2021.12.02 --- .../linux/raspberrypi-eeprom/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/linux/raspberrypi-eeprom/default.nix b/pkgs/os-specific/linux/raspberrypi-eeprom/default.nix index 32378e451e8a6..c68d40583968e 100644 --- a/pkgs/os-specific/linux/raspberrypi-eeprom/default.nix +++ b/pkgs/os-specific/linux/raspberrypi-eeprom/default.nix @@ -3,13 +3,18 @@ }: stdenvNoCC.mkDerivation rec { pname = "raspberrypi-eeprom"; - version = "2021.04.29-138a1"; + version = "2021.12.02"; + # From 3fdf703f3f7bbe57eacceada3b558031229a34b0 Mon Sep 17 00:00:00 2001 + # From: Peter Harper + # Date: Mon, 13 Dec 2021 11:56:11 +0000 + # Subject: [PATCH] 2021-12-02: Promote the 2021-12-02 beta release to LATEST/STABLE + commit = "3fdf703f3f7bbe57eacceada3b558031229a34b0"; src = fetchFromGitHub { owner = "raspberrypi"; repo = "rpi-eeprom"; - rev = "v${version}"; - sha256 = "sha256-nzAMPa4gqCAcROFa7z34IoMA3aoMHX9fYCsPFde9dac="; + rev = commit; + sha256 = "sha256-JTL2ziOkT0tnOrOS08ttNtxj3qegsacP73xZBVur7xM="; }; buildInputs = [ python3 ]; @@ -26,7 +31,7 @@ stdenvNoCC.mkDerivation rec { installPhase = '' mkdir -p $out/bin $out/share/rpi-eeprom - cp rpi-eeprom-config rpi-eeprom-update $out/bin + cp rpi-eeprom-config rpi-eeprom-update rpi-eeprom-digest $out/bin cp -r firmware/{beta,critical,old,stable} $out/share/rpi-eeprom cp -P firmware/default firmware/latest $out/share/rpi-eeprom ''; From 1781d283f3a24ef32d0d65d54197e7cc061ff55b Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Mon, 24 Jan 2022 16:57:55 -0800 Subject: [PATCH 10/10] sd-image-aarch64: Enable arm_boost for Pi 4 This is effective on the Pi 400 and on newer board revisions of the Pi 4B. From the official documentation: > New Raspberry Pi OS images from Bullseye onwards come with > this setting by default. --- nixos/modules/installer/sd-card/sd-image-aarch64.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/modules/installer/sd-card/sd-image-aarch64.nix b/nixos/modules/installer/sd-card/sd-image-aarch64.nix index 36fe2be7ae6bb..321793882f4cb 100644 --- a/nixos/modules/installer/sd-card/sd-image-aarch64.nix +++ b/nixos/modules/installer/sd-card/sd-image-aarch64.nix @@ -36,6 +36,9 @@ # what the pi3 firmware does by default. disable_overscan=1 + # Supported in newer board revisions + arm_boost=1 + [all] # Boot in 64-bit mode. arm_64bit=1