14 # NOTE: raspberrypifw & raspberryPiWirelessFirmware should be updated with this
15 modDirVersion = "6.6.51";
16 tag = "stable_20241008";
18 lib.overrideDerivation
22 version = "${modDirVersion}-${tag}";
23 inherit modDirVersion;
26 src = fetchFromGitHub {
27 owner = "raspberrypi";
30 hash = "sha256-phCxkuO+jUGZkfzSrBq6yErQeO2Td+inIGHxctXbD5U=";
35 "1" = "bcmrpi_defconfig";
36 "2" = "bcm2709_defconfig";
37 "3" = if stdenv.hostPlatform.isAarch64 then "bcmrpi3_defconfig" else "bcm2709_defconfig";
38 "4" = "bcm2711_defconfig";
40 .${toString rpiVersion};
44 } // (args.features or { });
47 if (rpiVersion < 3) then
49 platforms = with lib.platforms; arm;
54 platforms = with lib.platforms; arm ++ aarch64;
55 hydraPlatforms = [ "aarch64-linux" ];
57 ignoreConfigErrors = true;
59 // (args.argsOverride or { })
63 # The v7 defconfig has this set to '-v7' which screws up our modDirVersion.
64 sed -i $buildRoot/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
65 sed -i $buildRoot/include/config/auto.conf -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
68 # Make copies of the DTBs named after the upstream names so that U-Boot finds them.
69 # This is ugly as heck, but I don't know a better solution so far.
72 dtbDir=${if stdenv.hostPlatform.isAarch64 then "$out/dtbs/broadcom" else "$out/dtbs"}
73 rm $dtbDir/bcm283*.dtb
75 cp -v "$dtbDir/$1" "$dtbDir/$2"
78 + lib.optionalString (lib.elem stdenv.hostPlatform.system [ "armv6l-linux" ]) ''
79 copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero.dtb
80 copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero-w.dtb
81 copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-a.dtb
82 copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b.dtb
83 copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b-rev2.dtb
84 copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-a-plus.dtb
85 copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-b-plus.dtb
86 copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-zero.dtb
87 copyDTB bcm2708-rpi-cm.dtb bcm2835-rpi-cm.dtb
89 + lib.optionalString (lib.elem stdenv.hostPlatform.system [ "armv7l-linux" ]) ''
90 copyDTB bcm2709-rpi-2-b.dtb bcm2836-rpi-2-b.dtb
94 (lib.elem stdenv.hostPlatform.system [
99 copyDTB bcm2710-rpi-zero-2.dtb bcm2837-rpi-zero-2.dtb
100 copyDTB bcm2710-rpi-zero-2-w.dtb bcm2837-rpi-zero-2-w.dtb
101 copyDTB bcm2710-rpi-3-b.dtb bcm2837-rpi-3-b.dtb
102 copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-a-plus.dtb
103 copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-b-plus.dtb
104 copyDTB bcm2710-rpi-cm3.dtb bcm2837-rpi-cm3.dtb
105 copyDTB bcm2711-rpi-4-b.dtb bcm2838-rpi-4-b.dtb