linux_rpi3: fix build failure due to wrong Kconfig

Because of NixOS's generate-config.pl tries to answer 'M' to as much
configs as possible, this exposes the wrong Kconfig in the RPi-specific
code which is added in the new kernel tree intended to support RPi 5.

Add kernel patches to fix the Kconfig, which results in the relavant
part being disabled on the RPi 3 build of the kernel.

+27 -1
+27 -1
pkgs/os-specific/linux/kernel/linux-rpi.nix
··· 1 - { stdenv, lib, buildPackages, fetchFromGitHub, perl, buildLinux, rpiVersion, ... } @ args: 1 + { stdenv, lib, buildPackages, fetchFromGitHub, fetchpatch, perl, buildLinux, rpiVersion, ... } @ args: 2 2 3 3 let 4 4 # NOTE: raspberrypifw & raspberryPiWirelessFirmware should be updated with this ··· 26 26 features = { 27 27 efiBootStub = false; 28 28 } // (args.features or {}); 29 + 30 + kernelPatches = (args.kernelPatches or []) ++ [ 31 + # Fix "WARNING: unmet direct dependencies detected for MFD_RP1", and 32 + # subsequent build failure. 33 + # https://github.com/NixOS/nixpkgs/pull/268280#issuecomment-1911839809 34 + # https://github.com/raspberrypi/linux/pull/5900 35 + { 36 + name = "drm-rp1-depends-on-instead-of-select-MFD_RP1.patch"; 37 + patch = fetchpatch { 38 + url = "https://github.com/peat-psuwit/rpi-linux/commit/6de0bb51929cd3ad4fa27b2a421a2af12e6468f5.patch"; 39 + hash = "sha256-9pHcbgWTiztu48SBaLPVroUnxnXMKeCGt5vEo9V8WGw="; 40 + }; 41 + } 42 + 43 + # Fix `ERROR: modpost: missing MODULE_LICENSE() in <...>/bcm2712-iommu.o` 44 + # by preventing such code from being built as module. 45 + # https://github.com/NixOS/nixpkgs/pull/284035#issuecomment-1913015802 46 + # https://github.com/raspberrypi/linux/pull/5910 47 + { 48 + name = "iommu-bcm2712-don-t-allow-building-as-module.patch"; 49 + patch = fetchpatch { 50 + url = "https://github.com/peat-psuwit/rpi-linux/commit/693a5e69bddbcbe1d1b796ebc7581c3597685b1b.patch"; 51 + hash = "sha256-8BYYQDM5By8cTk48ASYKJhGVQnZBIK4PXtV70UtfS+A="; 52 + }; 53 + } 54 + ]; 29 55 30 56 extraMeta = if (rpiVersion < 3) then { 31 57 platforms = with lib.platforms; arm;