diff --git a/nixos/modules/installer/sd-card/sd-image-aarch64.nix b/nixos/modules/installer/sd-card/sd-image-aarch64.nix index 321793882f4cb..cf01005fdc8a9 100644 --- a/nixos/modules/installer/sd-card/sd-image-aarch64.nix +++ b/nixos/modules/installer/sd-card/sd-image-aarch64.nix @@ -39,6 +39,12 @@ # Supported in newer board revisions arm_boost=1 + [cm4] + # Enable host mode on the 2711 built-in XHCI USB controller. + # This line should be removed if the legacy DWC2 controller is required + # (e.g. for USB device mode) or if USB support is not required. + otg_mode=1 + [all] # Boot in 64-bit mode. arm_64bit=1 @@ -65,6 +71,9 @@ cp ${pkgs.ubootRaspberryPi4_64bit}/u-boot.bin firmware/u-boot-rpi4.bin cp ${pkgs.raspberrypi-armstubs}/armstub8-gic.bin firmware/armstub8-gic.bin cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/bcm2711-rpi-4-b.dtb firmware/ + cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/bcm2711-rpi-400.dtb firmware/ + cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/bcm2711-rpi-cm4.dtb firmware/ + cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/bcm2711-rpi-cm4s.dtb firmware/ ''; populateRootCommands = '' mkdir -p ./files/boot diff --git a/nixos/modules/profiles/all-hardware.nix b/nixos/modules/profiles/all-hardware.nix index 25f68123a1da9..8347453d403b4 100644 --- a/nixos/modules/profiles/all-hardware.nix +++ b/nixos/modules/profiles/all-hardware.nix @@ -40,6 +40,9 @@ in # SD cards. "sdhci_pci" + # NVMe drives + "nvme" + # Firewire support. Not tested. "ohci1394" "sbp2" diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 986494e599d17..d6e5e8a7bcb0a 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -10,6 +10,7 @@ , openssl , swig , meson-tools +, which , armTrustedFirmwareAllwinner , armTrustedFirmwareAllwinnerH616 , armTrustedFirmwareRK3328 @@ -19,10 +20,10 @@ }: let - defaultVersion = "2021.10"; + defaultVersion = "2022.01"; defaultSrc = fetchurl { url = "ftp://ftp.denx.de/pub/u-boot/u-boot-${defaultVersion}.tar.bz2"; - sha256 = "1m0bvwv8r62s4wk4w3cmvs888dhv9gnfa98dczr4drk2jbhj7ryd"; + hash = "sha256-gbRUMifbIowD+KG/XdvIE7C7j2VVzkYGTvchpvxoBBM="; }; buildUBoot = { version ? null @@ -66,11 +67,14 @@ let p.setuptools # for pkg_resources ])) swig + which # for scripts/dtc-version.sh ]; depsBuildBuild = [ buildPackages.stdenv.cc ]; hardeningDisable = [ "all" ]; + enableParallelBuilding = true; + makeFlags = [ "DTC=dtc" "CROSS_COMPILE=${stdenv.cc.targetPrefix}" @@ -102,9 +106,6 @@ let runHook postInstall ''; - # make[2]: *** No rule to make target 'lib/efi_loader/helloworld.efi', needed by '__build'. Stop. - enableParallelBuilding = false; - dontStrip = true; meta = with lib; { @@ -373,14 +374,6 @@ in { CONFIG_USB_EHCI_GENERIC=y CONFIG_USB_XHCI_HCD=y ''; - extraPatches = [ - # https://patchwork.ozlabs.org/project/uboot/list/?series=268007&state=%2A&archive=both - # Remove when upgrading to 2022.01 - (fetchpatch { - url = "https://patchwork.ozlabs.org/series/268007/mbox/"; - sha256 = "sha256-xn4Q959dgoB63zlmJepI41AXAf1kCycIGcmu4IIVjmE="; - }) - ]; extraMeta.platforms = [ "i686-linux" "x86_64-linux" ]; filesToInstall = [ "u-boot.rom" ]; }; @@ -401,28 +394,12 @@ 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 { diff --git a/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix b/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix index 72ae31c4b2dc6..c9192744a46a0 100644 --- a/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix +++ b/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix @@ -32,20 +32,19 @@ stdenv.mkDerivation { mkdir -p "$out/lib/firmware/brcm" # Wifi firmware - shopt -s extglob - for filename in firmware-nonfree/brcm/brcmfmac434??{,s}-sdio.*; do - cp "$filename" "$out/lib/firmware/brcm" - done + cp -rv "$NIX_BUILD_TOP/firmware-nonfree/debian/config/brcm80211/." "$out/lib/firmware/" # Bluetooth firmware - cp bluez-firmware/broadcom/*.hcd "$out/lib/firmware/brcm" + cp -rv "$NIX_BUILD_TOP/bluez-firmware/broadcom/." "$out/lib/firmware/brcm" + + # CM4 symlink must be added since it's missing from upstream + pushd $out/lib/firmware/brcm &>/dev/null + ln -s "./brcmfmac43455-sdio.txt" "$out/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt" + popd &>/dev/null + runHook postInstall ''; - outputHashMode = "recursive"; - outputHashAlgo = "sha256"; - outputHash = "sha256-Fw8EC1jzszWg9rNH01oaOIHnSYDuF6ov6ulmIAPuNz4="; - meta = with lib; { description = "Firmware for builtin Wifi/Bluetooth devices in the Raspberry Pi 3+ and Zero W"; homepage = "https://github.com/RPi-Distro/firmware-nonfree";