From e85479a413c52a84358b43e62560dad9a1c70d93 Mon Sep 17 00:00:00 2001 From: Tomasz Kontusz Date: Sat, 23 Apr 2022 01:46:11 +0200 Subject: [PATCH 01/29] maintainers: remove ktosiek --- maintainers/maintainer-list.nix | 6 ------ pkgs/development/tools/misc/d-feet/default.nix | 1 - pkgs/tools/networking/sstp/default.nix | 1 - 3 files changed, 8 deletions(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index b20b473dc679..5d498497e68f 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -6834,12 +6834,6 @@ githubId = 99639; name = "Pawel Kruszewski"; }; - ktosiek = { - email = "tomasz.kontusz@gmail.com"; - github = "ktosiek"; - githubId = 278013; - name = "Tomasz Kontusz"; - }; kubukoz = { email = "kubukoz@gmail.com"; github = "kubukoz"; diff --git a/pkgs/development/tools/misc/d-feet/default.nix b/pkgs/development/tools/misc/d-feet/default.nix index a394ee615773..1c6de2149f76 100644 --- a/pkgs/development/tools/misc/d-feet/default.nix +++ b/pkgs/development/tools/misc/d-feet/default.nix @@ -89,6 +89,5 @@ python3.pkgs.buildPythonApplication rec { homepage = "https://wiki.gnome.org/Apps/DFeet"; platforms = platforms.linux; license = licenses.gpl2; - maintainers = with maintainers; [ ktosiek ]; }; } diff --git a/pkgs/tools/networking/sstp/default.nix b/pkgs/tools/networking/sstp/default.nix index 65449c203e1d..8ddb27238bc1 100644 --- a/pkgs/tools/networking/sstp/default.nix +++ b/pkgs/tools/networking/sstp/default.nix @@ -28,7 +28,6 @@ stdenv.mkDerivation rec { description = "SSTP client for Linux"; homepage = "http://sstp-client.sourceforge.net/"; platforms = platforms.linux; - maintainers = with maintainers; [ ktosiek ]; license = licenses.gpl2Plus; }; } From 77a189e066a839b1c8bb7cb8c125d434d15854ac Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 23 Apr 2022 18:49:59 +0100 Subject: [PATCH 02/29] systemd: disable EFI stripping In Issue #169693 we found out that systemd-bootaa64.efi does not have required `#### LoaderInfo: systemd-boot 250.4 ####` marking. It is destroyed by `nixpkgs`'s `_doStrip` hook (part of `fixupOutputHooks`). It makes sense as PE32+ is a bit different from ELF where `.sdmagic` section is inserted. The change avoids stripping EFI files altogether by moving them out of default strip directories of _doStrip for the time while `fixupPhase` is running. Closes: https://github.com/NixOS/nixpkgs/issues/169693 --- pkgs/os-specific/linux/systemd/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index e130abbf27ff..a32083850b57 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -666,6 +666,18 @@ stdenv.mkDerivation { rm -rf $out/share/doc ''; + # Avoid *.EFI binary stripping. At least on aarch64-linux strip + # removes too much from PE32+ files: + # https://github.com/NixOS/nixpkgs/issues/169693 + # The hack is to move EFI file out of lib/ before doStrip + # run and return it after doStrip run. + preFixup = lib.optionalString withEfi '' + mv $out/lib/systemd/boot/efi $out/dont-strip-me + ''; + postFixup = lib.optionalString withEfi '' + mv $out/dont-strip-me $out/lib/systemd/boot/efi + ''; + passthru = { # The interface version prevents NixOS from switching to an # incompatible systemd at runtime. (Switching across reboots is From 3babd3777302bb680baa0b157e3abfda1134ca68 Mon Sep 17 00:00:00 2001 From: Zane van Iperen Date: Wed, 27 Apr 2022 00:14:59 +1000 Subject: [PATCH 03/29] protolint: init at 0.37.1 --- pkgs/development/tools/protolint/default.nix | 39 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/tools/protolint/default.nix diff --git a/pkgs/development/tools/protolint/default.nix b/pkgs/development/tools/protolint/default.nix new file mode 100644 index 000000000000..dee2f9c28f5c --- /dev/null +++ b/pkgs/development/tools/protolint/default.nix @@ -0,0 +1,39 @@ +{ lib, buildGoModule, fetchFromGitHub }: +buildGoModule rec { + pname = "protolint"; + version = "0.37.1"; + + src = fetchFromGitHub { + owner = "yoheimuta"; + repo = pname; + rev = "6aa30515838cc0adf7c76a9461f52bdc713f2e9f"; + sha256 = "sha256-oKGA5FZpT3E5G7oREGAojdu4Xn8JPd7IYwfueK9QA34="; + }; + + vendorSha256 = "sha256-iLQwx3B5n21ZXefWiGBBL9roa9LIFByzB8KXLywhvKs="; + + # Something about the way we run tests causes issues. It doesn't happen + # when using "go test" directly: + # === RUN TestEnumFieldNamesPrefixRule_Apply_fix/no_fix_for_a_correct_proto + # util_test.go:35: open : no such file or directory + # === RUN TestEnumFieldNamesPrefixRule_Apply_fix/fix_for_an_incorrect_proto + # util_test.go:35: open : no such file or directory + excludedPackages = [ "internal" ]; + + ldflags = let + rev = builtins.substring 0 7 src.rev; + in [ + "-X github.com/yoheimuta/protolint/internal/cmd.version=${version}" + "-X github.com/yoheimuta/protolint/internal/cmd.revision=${rev}" + "-X github.com/yoheimuta/protolint/internal/cmd/protocgenprotolint.version=${version}" + "-X github.com/yoheimuta/protolint/internal/cmd/protocgenprotolint.revision=${rev}" + ]; + + meta = with lib; { + description = "A pluggable linter and fixer to enforce Protocol Buffer style and conventions"; + homepage = "https://github.com/yoheimuta/protolint"; + license = licenses.mit; + platforms = platforms.all; + maintainers = [ maintainers.zane ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d57f89d88814..f192ce8298e4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -409,6 +409,8 @@ with pkgs; protoc-gen-validate = callPackage ../development/tools/protoc-gen-validate { }; + protolint = callPackage ../development/tools/protolint { }; + ptags = callPackage ../development/tools/misc/ptags { }; ptouch-print = callPackage ../misc/ptouch-print { }; From f21b16cdd9d2d96c0b9690635a92e37833bb9835 Mon Sep 17 00:00:00 2001 From: Kiskae Date: Tue, 26 Apr 2022 18:52:04 +0200 Subject: [PATCH 04/29] =?UTF-8?q?nvidia=5Fx11:=20510.60.02=20=E2=86=92=205?= =?UTF-8?q?10.68.02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contains a fix for NvFBC and new versions of vulkan-loader --- pkgs/os-specific/linux/nvidia-x11/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index 100ca403f621..5bbd12ef00a9 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -19,9 +19,9 @@ rec { # Policy: use the highest stable version as the default (on our master). stable = if stdenv.hostPlatform.system == "x86_64-linux" then generic { - version = "510.60.02"; - sha256_64bit = "sha256-qADfwFSQeP2Mbo5ngO+47uh4cuYFXH9fOGpHaM4H4AM="; - settingsSha256 = "sha256-Voa1JZ2qqJ1t+bfwKh/mssEi/hjzLTPwef2XG/gAC+0="; + version = "510.68.02"; + sha256_64bit = "sha256-vSw0SskrL8ErBgQ1kKT+jU6wzLdNDEk1LwBM8tKZ9MU="; + settingsSha256 = "sha256-4TBA/ITpaaBiVDkpj7/Iydei1knRPpruPL4fRrqFAmU="; persistencedSha256 = "sha256-THgK2GpRcttqSN2WxcuJu5My++Q+Y34jG8hm7daxhAQ="; } else legacy_390; From 2d4e01f8b7aa68fc40af0eb5c3ca0e2d9b64113e Mon Sep 17 00:00:00 2001 From: Kiskae Date: Tue, 26 Apr 2022 23:00:25 +0200 Subject: [PATCH 05/29] actually update nvidia-persistenced as well --- pkgs/os-specific/linux/nvidia-x11/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index 5bbd12ef00a9..996db7480554 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -22,7 +22,7 @@ rec { version = "510.68.02"; sha256_64bit = "sha256-vSw0SskrL8ErBgQ1kKT+jU6wzLdNDEk1LwBM8tKZ9MU="; settingsSha256 = "sha256-4TBA/ITpaaBiVDkpj7/Iydei1knRPpruPL4fRrqFAmU="; - persistencedSha256 = "sha256-THgK2GpRcttqSN2WxcuJu5My++Q+Y34jG8hm7daxhAQ="; + persistencedSha256 = "sha256-Q1Rk6dAK4pnm6yDK4kmj5Vg4GRbi034C96ypywHYB2I="; } else legacy_390; From d1fef1e7c370a39b639836726e956574d4092793 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Mon, 25 Apr 2022 19:13:37 -0700 Subject: [PATCH 06/29] sd-image-aarch64: add support for the RaspberryPi CM4 --- .../modules/installer/sd-card/sd-image-aarch64.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nixos/modules/installer/sd-card/sd-image-aarch64.nix b/nixos/modules/installer/sd-card/sd-image-aarch64.nix index 321793882f4c..2289d7af2d3d 100644 --- a/nixos/modules/installer/sd-card/sd-image-aarch64.nix +++ b/nixos/modules/installer/sd-card/sd-image-aarch64.nix @@ -39,6 +39,17 @@ # Supported in newer board revisions arm_boost=1 + [cm4] + kernel=u-boot-rpi4.bin + enable_gic=1 + armstub=armstub8-gic.bin + disable_overscan=1 + + # 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 +76,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/ + + # Add cm4 specific files + cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/bcm2711-rpi-cm4.dtb firmware/ ''; populateRootCommands = '' mkdir -p ./files/boot From faf42ffbd07f0c877258c8b519c7e973949f89c7 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Mon, 25 Apr 2022 21:33:22 -0700 Subject: [PATCH 07/29] ubootRaspberryCM4_64bit: init --- nixos/modules/installer/sd-card/sd-image-aarch64.nix | 3 ++- pkgs/misc/uboot/default.nix | 9 +++++++++ pkgs/top-level/all-packages.nix | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/nixos/modules/installer/sd-card/sd-image-aarch64.nix b/nixos/modules/installer/sd-card/sd-image-aarch64.nix index 2289d7af2d3d..1aca8c7e8ecf 100644 --- a/nixos/modules/installer/sd-card/sd-image-aarch64.nix +++ b/nixos/modules/installer/sd-card/sd-image-aarch64.nix @@ -40,7 +40,7 @@ arm_boost=1 [cm4] - kernel=u-boot-rpi4.bin + kernel=u-boot-rpi-cm4.bin enable_gic=1 armstub=armstub8-gic.bin disable_overscan=1 @@ -78,6 +78,7 @@ cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/bcm2711-rpi-4-b.dtb firmware/ # Add cm4 specific files + cp ${pkgs.ubootRaspberryPiCM4_64bit}/u-boot.bin firmware/u-boot-rpi-cm4.bin cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/bcm2711-rpi-cm4.dtb firmware/ ''; populateRootCommands = '' diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 986494e599d1..067d9bbbb5b1 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -437,6 +437,15 @@ in { filesToInstall = ["u-boot.bin"]; }; + ubootRaspberryPiCM4_64bit = buildUBoot { + defconfig = "rpi_4_defconfig"; + extraMeta.platforms = ["aarch64-linux"]; + filesToInstall = ["u-boot.bin"]; + extraConfig = '' + CONFIG_USB_XHCI_BRCM=y + ''; + }; + ubootRaspberryPiZero = buildUBoot { defconfig = "rpi_0_w_defconfig"; extraMeta.platforms = ["armv6l-linux"]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3706cc3dc3fb..51539924db14 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23775,6 +23775,7 @@ with pkgs; ubootRaspberryPi3_64bit ubootRaspberryPi4_32bit ubootRaspberryPi4_64bit + ubootRaspberryPiCM4_64bit ubootRaspberryPiZero ubootRock64 ubootRockPi4 From f6f41cf740527b804abb8ae30f69a2fb534c35f3 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Mon, 25 Apr 2022 19:19:21 -0700 Subject: [PATCH 08/29] uboot: 2021.10 -> 2022.01 --- pkgs/misc/uboot/default.nix | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 067d9bbbb5b1..7e2cfbf9ad67 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,6 +67,7 @@ let p.setuptools # for pkg_resources ])) swig + which # for scripts/dtc-version.sh ]; depsBuildBuild = [ buildPackages.stdenv.cc ]; @@ -373,14 +375,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 +395,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 { From d094a3e175fb3e1593adcda6a4e973946785dd13 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Mon, 25 Apr 2022 22:40:33 -0700 Subject: [PATCH 09/29] uboot: enable parallel building again --- pkgs/misc/uboot/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 7e2cfbf9ad67..5e0a451f89ee 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -73,6 +73,8 @@ let hardeningDisable = [ "all" ]; + enableParallelBuilding = true; + makeFlags = [ "DTC=dtc" "CROSS_COMPILE=${stdenv.cc.targetPrefix}" @@ -104,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; { From ca0c9279ab2471bd8bf67681fb57fe33adbccb27 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Mon, 25 Apr 2022 22:40:50 -0700 Subject: [PATCH 10/29] ubootRaspberryCM4_64bit: enable USB and NVME --- pkgs/misc/uboot/default.nix | 13 ++++++ .../0003-rpi-add-NVMe-to-boot-order.patch | 44 +++++++++++++++++++ ...ke-driver-compatible-with-downstream.patch | 33 ++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 pkgs/misc/uboot/rpi-cm4/0003-rpi-add-NVMe-to-boot-order.patch create mode 100644 pkgs/misc/uboot/rpi-cm4/0005-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 5e0a451f89ee..70fb54d4078e 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -419,8 +419,21 @@ in { extraMeta.platforms = ["aarch64-linux"]; filesToInstall = ["u-boot.bin"]; extraConfig = '' + CONFIG_CMD_NVME=y + CONFIG_NVME=y + CONFIG_NVME_PCI=y + CONFIG_USB_STORAGE=y + CONFIG_USB_FUNCTION_MASS_STORAGE=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_EHCI_GENERIC=y + CONFIG_USB_OHCI_HCD=y + CONFIG_USB_XHCI_BRCM=y ''; + extraPatches = [ + ./rpi-cm4/0003-rpi-add-NVMe-to-boot-order.patch + ./rpi-cm4/0005-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch + ]; }; ubootRaspberryPiZero = buildUBoot { diff --git a/pkgs/misc/uboot/rpi-cm4/0003-rpi-add-NVMe-to-boot-order.patch b/pkgs/misc/uboot/rpi-cm4/0003-rpi-add-NVMe-to-boot-order.patch new file mode 100644 index 000000000000..f5e9462e89b5 --- /dev/null +++ b/pkgs/misc/uboot/rpi-cm4/0003-rpi-add-NVMe-to-boot-order.patch @@ -0,0 +1,44 @@ +From ae45864457182fcaa67911e1e3d8db242dff3646 Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> +References: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> +From: Stefan Agner +Date: Tue, 29 Dec 2020 23:34:52 +0100 +Subject: [PATCH 3/5] rpi: add NVMe to boot order + +The Compute Module 4 I/O Board can support a NVMe. Add NVMe to the boot +order. + +Signed-off-by: Stefan Agner +--- + include/configs/rpi.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/include/configs/rpi.h b/include/configs/rpi.h +index 4c5c1ac31f..e24c94c7d2 100644 +--- a/include/configs/rpi.h ++++ b/include/configs/rpi.h +@@ -143,6 +143,12 @@ + #define BOOT_TARGET_MMC(func) + #endif + ++#if CONFIG_IS_ENABLED(CMD_NVME) ++ #define BOOT_TARGET_NVME(func) func(NVME, nvme, 0) ++#else ++ #define BOOT_TARGET_NVME(func) ++#endif ++ + #if CONFIG_IS_ENABLED(CMD_USB) + #define BOOT_TARGET_USB(func) func(USB, usb, 0) + #else +@@ -163,6 +169,7 @@ + + #define BOOT_TARGET_DEVICES(func) \ + BOOT_TARGET_MMC(func) \ ++ BOOT_TARGET_NVME(func) \ + BOOT_TARGET_USB(func) \ + BOOT_TARGET_PXE(func) \ + BOOT_TARGET_DHCP(func) +-- +2.35.1 + diff --git a/pkgs/misc/uboot/rpi-cm4/0005-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch b/pkgs/misc/uboot/rpi-cm4/0005-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch new file mode 100644 index 000000000000..bf2d8475dc01 --- /dev/null +++ b/pkgs/misc/uboot/rpi-cm4/0005-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch @@ -0,0 +1,33 @@ +From b00922ee48987ef91f0ca2aa3a66ad22c6c83d57 Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> +References: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> +From: Stefan Agner +Date: Thu, 7 Oct 2021 12:02:39 +0200 +Subject: [PATCH 5/5] usb: xhci-brcm: Make driver compatible with downstream + device tree + +The downstream device tree uses just "generic-xhci" as compatible +string. Use this string to make U-Boot work with the downstream Kernel. + +Signed-off-by: Stefan Agner +--- + drivers/usb/host/xhci-brcm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/host/xhci-brcm.c b/drivers/usb/host/xhci-brcm.c +index fe17924028..0c6938187b 100644 +--- a/drivers/usb/host/xhci-brcm.c ++++ b/drivers/usb/host/xhci-brcm.c +@@ -82,7 +82,7 @@ static int xhci_brcm_deregister(struct udevice *dev) + } + + static const struct udevice_id xhci_brcm_ids[] = { +- { .compatible = "brcm,generic-xhci" }, ++ { .compatible = "generic-xhci" }, + { } + }; + +-- +2.35.1 + From 323f123f6afee22cc0c642988a12285ba0f11b3a Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Tue, 26 Apr 2022 13:04:46 -0700 Subject: [PATCH 11/29] ubootRaspberryCM4_64bit: add all NVME patches --- pkgs/misc/uboot/default.nix | 7 + ...cm283x-don-t-explicitly-disable-init.patch | 54 ++++ ...cm283x-allow-to-spawn-any-PL011-UART.patch | 68 +++++ ...prove-readability-of-nvme_setup_prps.patch | 51 ++++ ...ect-the-prps-per-page-calculation-me.patch | 44 +++ ...se-pointer-for-CPU-addressed-buffers.patch | 263 ++++++++++++++++++ ...irtual-addresses-into-the-bus-s-addr.patch | 198 +++++++++++++ 7 files changed, 685 insertions(+) create mode 100644 pkgs/misc/uboot/rpi-cm4/0001-drivers-bcm283x-don-t-explicitly-disable-init.patch create mode 100644 pkgs/misc/uboot/rpi-cm4/0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch create mode 100644 pkgs/misc/uboot/rpi-cm4/0003-nvme-improve-readability-of-nvme_setup_prps.patch create mode 100644 pkgs/misc/uboot/rpi-cm4/0004-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch create mode 100644 pkgs/misc/uboot/rpi-cm4/0004-nvme-Use-pointer-for-CPU-addressed-buffers.patch create mode 100644 pkgs/misc/uboot/rpi-cm4/0005-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 70fb54d4078e..d231dcef8979 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -432,7 +432,14 @@ in { ''; extraPatches = [ ./rpi-cm4/0003-rpi-add-NVMe-to-boot-order.patch + ./rpi-cm4/0004-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch ./rpi-cm4/0005-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch + + ./rpi-cm4/0001-drivers-bcm283x-don-t-explicitly-disable-init.patch + ./rpi-cm4/0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch + ./rpi-cm4/0003-nvme-improve-readability-of-nvme_setup_prps.patch + ./rpi-cm4/0004-nvme-Use-pointer-for-CPU-addressed-buffers.patch + ./rpi-cm4/0005-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch ]; }; diff --git a/pkgs/misc/uboot/rpi-cm4/0001-drivers-bcm283x-don-t-explicitly-disable-init.patch b/pkgs/misc/uboot/rpi-cm4/0001-drivers-bcm283x-don-t-explicitly-disable-init.patch new file mode 100644 index 000000000000..59e7234dde9f --- /dev/null +++ b/pkgs/misc/uboot/rpi-cm4/0001-drivers-bcm283x-don-t-explicitly-disable-init.patch @@ -0,0 +1,54 @@ +From 78704bc154d695ee16fdf8396f4d60b740190014 Mon Sep 17 00:00:00 2001 +Message-Id: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +From: Stefan Agner +Date: Thu, 14 Apr 2022 12:15:26 +0200 +Subject: [PATCH 1/5] drivers: bcm283x: don't explicitly disable init + +It seems that the reason why init doesn't succeed is the lack of clock +support in U-Boot. Setting the default clock of 48MHz for the PL011 +UARTs makes reinitialization work consistently. + +Note that for the first UART the "skip-init" is anyways set in the +device tree. This will only affect probing of UARTs not enabled by +firmware. + +Signed-off-by: Stefan Agner +--- + drivers/serial/serial_bcm283x_pl011.c | 6 ------ + include/configs/rpi.h | 3 +++ + 2 files changed, 3 insertions(+), 6 deletions(-) + +diff --git a/drivers/serial/serial_bcm283x_pl011.c b/drivers/serial/serial_bcm283x_pl011.c +index 2d2e970316..182274036c 100644 +--- a/drivers/serial/serial_bcm283x_pl011.c ++++ b/drivers/serial/serial_bcm283x_pl011.c +@@ -51,12 +51,6 @@ static int bcm283x_pl011_serial_probe(struct udevice *dev) + if (ret) + return ret; + +- /* +- * TODO: Reinitialization doesn't always work for now, just skip +- * init always - we know we're already initialized +- */ +- plat->skip_init = true; +- + return pl01x_serial_probe(dev); + } + +diff --git a/include/configs/rpi.h b/include/configs/rpi.h +index e24c94c7d2..98ba4dc052 100644 +--- a/include/configs/rpi.h ++++ b/include/configs/rpi.h +@@ -40,6 +40,9 @@ + #define CONFIG_SYS_BOOTM_LEN SZ_64M + #endif + ++/* Define PL011 default clock */ ++#define CONFIG_PL011_CLOCK 48000000 ++ + /* Devices */ + /* GPIO */ + #define CONFIG_BCM2835_GPIO +-- +2.36.0 + diff --git a/pkgs/misc/uboot/rpi-cm4/0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch b/pkgs/misc/uboot/rpi-cm4/0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch new file mode 100644 index 000000000000..7ce52e15c573 --- /dev/null +++ b/pkgs/misc/uboot/rpi-cm4/0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch @@ -0,0 +1,68 @@ +From c2447aa922068cebd9bbaac45acae3d853abf687 Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +References: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +From: Stefan Agner +Date: Thu, 14 Apr 2022 12:18:41 +0200 +Subject: [PATCH 2/5] drivers: bcm283x: allow to spawn any PL011 UART + +The current code checks pinmux for the first PL011 only. Raspberry Pi 4 +has multiple PL011 UARTs. This code prevents probing of other UARTs in +case the first PL011 UART is not active. + +Furthermore, U-Boot supports pinmuxing, hence the pins should be muxed +at this point anyway. Drop the check entirly. + +This allows to use other UARTs as stdout paths (e.g. stdout-path = +"serial5:115200n8"). + +Signed-off-by: Stefan Agner +--- + drivers/serial/serial_bcm283x_pl011.c | 27 --------------------------- + 1 file changed, 27 deletions(-) + +diff --git a/drivers/serial/serial_bcm283x_pl011.c b/drivers/serial/serial_bcm283x_pl011.c +index 182274036c..98628e1ca4 100644 +--- a/drivers/serial/serial_bcm283x_pl011.c ++++ b/drivers/serial/serial_bcm283x_pl011.c +@@ -11,37 +11,10 @@ + #include + #include "serial_pl01x_internal.h" + +-/* +- * Check if this serial device is muxed +- * +- * The serial device will only work properly if it has been muxed to the serial +- * pins by firmware. Check whether that happened here. +- * +- * @return true if serial device is muxed, false if not +- */ +-static bool bcm283x_is_serial_muxed(void) +-{ +- int serial_gpio = 15; +- struct udevice *dev; +- +- if (uclass_first_device(UCLASS_PINCTRL, &dev) || !dev) +- return false; +- +- if (pinctrl_get_gpio_mux(dev, 0, serial_gpio) != BCM2835_GPIO_ALT0) +- return false; +- +- return true; +-} +- + static int bcm283x_pl011_serial_probe(struct udevice *dev) + { +- struct pl01x_serial_plat *plat = dev_get_plat(dev); + int ret; + +- /* Don't spawn the device if it's not muxed */ +- if (!bcm283x_is_serial_muxed()) +- return -ENODEV; +- + /* + * Read the ofdata here rather than in an of_to_plat() method + * since we need the soc simple-bus to be probed so that the 'ranges' +-- +2.36.0 + diff --git a/pkgs/misc/uboot/rpi-cm4/0003-nvme-improve-readability-of-nvme_setup_prps.patch b/pkgs/misc/uboot/rpi-cm4/0003-nvme-improve-readability-of-nvme_setup_prps.patch new file mode 100644 index 000000000000..1ca9d0c1253f --- /dev/null +++ b/pkgs/misc/uboot/rpi-cm4/0003-nvme-improve-readability-of-nvme_setup_prps.patch @@ -0,0 +1,51 @@ +From 78924e9cf8c4af0baafcb2e7224bf04ad65276de Mon Sep 17 00:00:00 2001 +Message-Id: <78924e9cf8c4af0baafcb2e7224bf04ad65276de.1650924333.git.stefan@agner.ch> +In-Reply-To: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +References: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +From: Stefan Agner +Date: Thu, 23 Sep 2021 23:52:44 +0200 +Subject: [PATCH 3/5] nvme: improve readability of nvme_setup_prps() + +Improve readability by introducing consts, reuse consts where +appropriate and adding variables with discriptive name. + +Signed-off-by: Stefan Agner +--- + drivers/nvme/nvme.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c +index 3bda491e12..1601651449 100644 +--- a/drivers/nvme/nvme.c ++++ b/drivers/nvme/nvme.c +@@ -76,12 +76,12 @@ static int nvme_wait_ready(struct nvme_dev *dev, bool enabled) + static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + int total_len, u64 dma_addr) + { +- u32 page_size = dev->page_size; ++ const u32 page_size = dev->page_size; ++ const u32 prps_per_page = (page_size >> 3) - 1; + int offset = dma_addr & (page_size - 1); + u64 *prp_pool; + int length = total_len; + int i, nprps; +- u32 prps_per_page = (page_size >> 3) - 1; + u32 num_pages; + + length -= (page_size - offset); +@@ -119,9 +119,9 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + prp_pool = dev->prp_pool; + i = 0; + while (nprps) { +- if (i == ((page_size >> 3) - 1)) { +- *(prp_pool + i) = cpu_to_le64((ulong)prp_pool + +- page_size); ++ if (i == prps_per_page) { ++ u64 next_prp_list = (u64)prp_pool + page_size; ++ *(prp_pool + i) = cpu_to_le64(next_prp_list); + i = 0; + prp_pool += page_size; + } +-- +2.36.0 + diff --git a/pkgs/misc/uboot/rpi-cm4/0004-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch b/pkgs/misc/uboot/rpi-cm4/0004-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch new file mode 100644 index 000000000000..2bd7d9e868f0 --- /dev/null +++ b/pkgs/misc/uboot/rpi-cm4/0004-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch @@ -0,0 +1,44 @@ +From 3a13ff4eb509e8e80a52ae45c9a5573e745803c3 Mon Sep 17 00:00:00 2001 +Message-Id: <3a13ff4eb509e8e80a52ae45c9a5573e745803c3.1645627172.git.stefan@agner.ch> +In-Reply-To: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> +References: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> +From: Stefan Agner +Date: Thu, 23 Sep 2021 23:43:31 +0200 +Subject: [PATCH 4/5] Revert "nvme: Correct the prps per page calculation + method" + +This reverts commit 859b33c948945f7904f60a2c12a3792d356d51ad. + +If there is more than one PRP List the last entry is a pointer to +the next list. From the NVM Express specification: + +"The last entry within a memory page, as indicated by the memory page +size in the CC.MPS field, shall be a PRP List pointer if there is more +than a single memory page of data to be transferred." + +For the purpose of calculating the number of pages required for PRP +lists we should always assume that the last entry is required for +the next PRP list. + +Signed-off-by: Stefan Agner +Cc: Wesley Sheng +--- + drivers/nvme/nvme.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c +index 3c529a2fce..3bda491e12 100644 +--- a/drivers/nvme/nvme.c ++++ b/drivers/nvme/nvme.c +@@ -81,7 +81,7 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + u64 *prp_pool; + int length = total_len; + int i, nprps; +- u32 prps_per_page = page_size >> 3; ++ u32 prps_per_page = (page_size >> 3) - 1; + u32 num_pages; + + length -= (page_size - offset); +-- +2.35.1 + diff --git a/pkgs/misc/uboot/rpi-cm4/0004-nvme-Use-pointer-for-CPU-addressed-buffers.patch b/pkgs/misc/uboot/rpi-cm4/0004-nvme-Use-pointer-for-CPU-addressed-buffers.patch new file mode 100644 index 000000000000..1a25f4ce1b3a --- /dev/null +++ b/pkgs/misc/uboot/rpi-cm4/0004-nvme-Use-pointer-for-CPU-addressed-buffers.patch @@ -0,0 +1,263 @@ +From e040d976ecbdd8071bbcb73d78e17ababa88c51f Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +References: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +From: Stefan Agner +Date: Thu, 23 Sep 2021 23:58:35 +0200 +Subject: [PATCH 4/5] nvme: Use pointer for CPU addressed buffers + +Pass buffers which use CPU addressing as void pointers. This aligns with +DMA APIs which use void pointers as argument. It will avoid unnecessary +type casts when adding support bus address translations. + +Signed-off-by: Stefan Agner +--- + drivers/nvme/nvme.c | 50 ++++++++++++++++++++-------------------- + drivers/nvme/nvme_show.c | 4 ++-- + include/nvme.h | 12 +++++----- + 3 files changed, 33 insertions(+), 33 deletions(-) + +diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c +index 1601651449..6ab94ada7e 100644 +--- a/drivers/nvme/nvme.c ++++ b/drivers/nvme/nvme.c +@@ -74,11 +74,11 @@ static int nvme_wait_ready(struct nvme_dev *dev, bool enabled) + } + + static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, +- int total_len, u64 dma_addr) ++ int total_len, void *buffer) + { + const u32 page_size = dev->page_size; + const u32 prps_per_page = (page_size >> 3) - 1; +- int offset = dma_addr & (page_size - 1); ++ int offset = (uintptr_t)buffer & (page_size - 1); + u64 *prp_pool; + int length = total_len; + int i, nprps; +@@ -92,10 +92,10 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + } + + if (length) +- dma_addr += (page_size - offset); ++ buffer += (page_size - offset); + + if (length <= page_size) { +- *prp2 = dma_addr; ++ *prp2 = (u64)buffer; + return 0; + } + +@@ -125,11 +125,11 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + i = 0; + prp_pool += page_size; + } +- *(prp_pool + i++) = cpu_to_le64(dma_addr); +- dma_addr += page_size; ++ *(prp_pool + i++) = cpu_to_le64((u64)buffer); ++ buffer += page_size; + nprps--; + } +- *prp2 = (ulong)dev->prp_pool; ++ *prp2 = (u64)dev->prp_pool; + + flush_dcache_range((ulong)dev->prp_pool, (ulong)dev->prp_pool + + dev->prp_entry_num * sizeof(u64)); +@@ -450,42 +450,42 @@ static int nvme_alloc_sq(struct nvme_dev *dev, u16 qid, + } + + int nvme_identify(struct nvme_dev *dev, unsigned nsid, +- unsigned cns, dma_addr_t dma_addr) ++ unsigned int cns, void *buffer) + { + struct nvme_command c; + u32 page_size = dev->page_size; +- int offset = dma_addr & (page_size - 1); ++ int offset = (uintptr_t)buffer & (page_size - 1); + int length = sizeof(struct nvme_id_ctrl); + int ret; + + memset(&c, 0, sizeof(c)); + c.identify.opcode = nvme_admin_identify; + c.identify.nsid = cpu_to_le32(nsid); +- c.identify.prp1 = cpu_to_le64(dma_addr); ++ c.identify.prp1 = cpu_to_le64((u64)buffer); + + length -= (page_size - offset); + if (length <= 0) { + c.identify.prp2 = 0; + } else { +- dma_addr += (page_size - offset); +- c.identify.prp2 = cpu_to_le64(dma_addr); ++ buffer += (page_size - offset); ++ c.identify.prp2 = cpu_to_le64((u64)buffer); + } + + c.identify.cns = cpu_to_le32(cns); + +- invalidate_dcache_range(dma_addr, +- dma_addr + sizeof(struct nvme_id_ctrl)); ++ invalidate_dcache_range((uintptr_t)buffer, ++ (uintptr_t)buffer + sizeof(struct nvme_id_ctrl)); + + ret = nvme_submit_admin_cmd(dev, &c, NULL); + if (!ret) +- invalidate_dcache_range(dma_addr, +- dma_addr + sizeof(struct nvme_id_ctrl)); ++ invalidate_dcache_range((uintptr_t)buffer, ++ (uintptr_t)buffer + sizeof(struct nvme_id_ctrl)); + + return ret; + } + + int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, +- dma_addr_t dma_addr, u32 *result) ++ void *buffer, u32 *result) + { + struct nvme_command c; + int ret; +@@ -493,7 +493,7 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, + memset(&c, 0, sizeof(c)); + c.features.opcode = nvme_admin_get_features; + c.features.nsid = cpu_to_le32(nsid); +- c.features.prp1 = cpu_to_le64(dma_addr); ++ c.features.prp1 = cpu_to_le64((u64)buffer); + c.features.fid = cpu_to_le32(fid); + + ret = nvme_submit_admin_cmd(dev, &c, result); +@@ -513,13 +513,13 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, + } + + int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11, +- dma_addr_t dma_addr, u32 *result) ++ void *buffer, u32 *result) + { + struct nvme_command c; + + memset(&c, 0, sizeof(c)); + c.features.opcode = nvme_admin_set_features; +- c.features.prp1 = cpu_to_le64(dma_addr); ++ c.features.prp1 = cpu_to_le64((u64)buffer); + c.features.fid = cpu_to_le32(fid); + c.features.dword11 = cpu_to_le32(dword11); + +@@ -570,7 +570,7 @@ static int nvme_set_queue_count(struct nvme_dev *dev, int count) + u32 q_count = (count - 1) | ((count - 1) << 16); + + status = nvme_set_features(dev, NVME_FEAT_NUM_QUEUES, +- q_count, 0, &result); ++ q_count, NULL, &result); + + if (status < 0) + return status; +@@ -622,7 +622,7 @@ static int nvme_get_info_from_identify(struct nvme_dev *dev) + if (!ctrl) + return -ENOMEM; + +- ret = nvme_identify(dev, 0, 1, (dma_addr_t)(long)ctrl); ++ ret = nvme_identify(dev, 0, 1, ctrl); + if (ret) { + free(ctrl); + return -EIO; +@@ -708,7 +708,7 @@ static int nvme_blk_probe(struct udevice *udev) + ns->dev = ndev; + /* extract the namespace id from the block device name */ + ns->ns_id = trailing_strtol(udev->name); +- if (nvme_identify(ndev, ns->ns_id, 0, (dma_addr_t)(long)id)) { ++ if (nvme_identify(ndev, ns->ns_id, 0, id)) { + free(id); + return -EIO; + } +@@ -743,7 +743,7 @@ static ulong nvme_blk_rw(struct udevice *udev, lbaint_t blknr, + u64 prp2; + u64 total_len = blkcnt << desc->log2blksz; + u64 temp_len = total_len; +- uintptr_t temp_buffer = (uintptr_t)buffer; ++ void *temp_buffer = buffer; + + u64 slba = blknr; + u16 lbas = 1 << (dev->max_transfer_shift - ns->lba_shift); +@@ -890,7 +890,7 @@ static int nvme_probe(struct udevice *udev) + char name[20]; + + memset(id, 0, sizeof(*id)); +- if (nvme_identify(ndev, i, 0, (dma_addr_t)(long)id)) { ++ if (nvme_identify(ndev, i, 0, id)) { + ret = -EIO; + goto free_id; + } +diff --git a/drivers/nvme/nvme_show.c b/drivers/nvme/nvme_show.c +index 15e459da1a..c30adfada5 100644 +--- a/drivers/nvme/nvme_show.c ++++ b/drivers/nvme/nvme_show.c +@@ -111,14 +111,14 @@ int nvme_print_info(struct udevice *udev) + ALLOC_CACHE_ALIGN_BUFFER(char, buf_ctrl, sizeof(struct nvme_id_ctrl)); + struct nvme_id_ctrl *ctrl = (struct nvme_id_ctrl *)buf_ctrl; + +- if (nvme_identify(dev, 0, 1, (dma_addr_t)(long)ctrl)) ++ if (nvme_identify(dev, 0, 1, ctrl)) + return -EIO; + + print_optional_admin_cmd(le16_to_cpu(ctrl->oacs), ns->devnum); + print_optional_nvm_cmd(le16_to_cpu(ctrl->oncs), ns->devnum); + print_format_nvme_attributes(ctrl->fna, ns->devnum); + +- if (nvme_identify(dev, ns->ns_id, 0, (dma_addr_t)(long)id)) ++ if (nvme_identify(dev, ns->ns_id, 0, id)) + return -EIO; + + print_formats(id, ns); +diff --git a/include/nvme.h b/include/nvme.h +index 2cdf8ce320..8ff823cd81 100644 +--- a/include/nvme.h ++++ b/include/nvme.h +@@ -18,12 +18,12 @@ struct nvme_dev; + * @dev: NVMe controller device + * @nsid: 0 for controller, namespace id for namespace to identify + * @cns: 1 for controller, 0 for namespace +- * @dma_addr: dma buffer address to store the identify result ++ * @buffer: dma buffer address to store the identify result + * @return: 0 on success, -ETIMEDOUT on command execution timeout, + * -EIO on command execution fails + */ + int nvme_identify(struct nvme_dev *dev, unsigned nsid, +- unsigned cns, dma_addr_t dma_addr); ++ unsigned int cns, void *buffer); + + /** + * nvme_get_features - retrieve the attributes of the feature specified +@@ -33,13 +33,13 @@ int nvme_identify(struct nvme_dev *dev, unsigned nsid, + * @dev: NVMe controller device + * @fid: feature id to provide data + * @nsid: namespace id the command applies to +- * @dma_addr: data structure used as part of the specified feature ++ * @buffer: data structure used as part of the specified feature + * @result: command-specific result in the completion queue entry + * @return: 0 on success, -ETIMEDOUT on command execution timeout, + * -EIO on command execution fails + */ + int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, +- dma_addr_t dma_addr, u32 *result); ++ void *buffer, u32 *result); + + /** + * nvme_set_features - specify the attributes of the feature indicated +@@ -49,13 +49,13 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, + * @dev: NVMe controller device + * @fid: feature id to provide data + * @dword11: command-specific input parameter +- * @dma_addr: data structure used as part of the specified feature ++ * @buffer: data structure used as part of the specified feature + * @result: command-specific result in the completion queue entry + * @return: 0 on success, -ETIMEDOUT on command execution timeout, + * -EIO on command execution fails + */ + int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11, +- dma_addr_t dma_addr, u32 *result); ++ void *buffer, u32 *result); + + /** + * nvme_scan_namespace - scan all namespaces attached to NVMe controllers +-- +2.36.0 + diff --git a/pkgs/misc/uboot/rpi-cm4/0005-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch b/pkgs/misc/uboot/rpi-cm4/0005-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch new file mode 100644 index 000000000000..cf25242c6caf --- /dev/null +++ b/pkgs/misc/uboot/rpi-cm4/0005-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch @@ -0,0 +1,198 @@ +From c4736c35141e519d15430660e17c274e142e886d Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +References: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +From: Stefan Agner +Date: Fri, 24 Sep 2021 00:27:39 +0200 +Subject: [PATCH 5/5] nvme: translate virtual addresses into the bus's address + space + +So far we've been content with passing physical/CPU addresses when +configuring memory addresses into NVMe controllers, but not all +platforms have buses with transparent mappings. Specifically the +Raspberry Pi 4 might introduce an offset to memory accesses incoming +from its PCIe port. + +Introduce nvme_virt_to_bus() and nvme_bus_to_virt() to cater with these +limitations, and make sure we don't break non DM users. +For devices where PCIe's view of host memory doesn't match the memory +as seen by the CPU. + +A similar change has been introduced for XHCI controller with +commit 1a474559d90a ("xhci: translate virtual addresses into the bus's +address space"). + +Signed-off-by: Stefan Agner +--- + drivers/nvme/nvme.c | 32 ++++++++++++++++++-------------- + drivers/nvme/nvme.h | 15 +++++++++++++++ + 2 files changed, 33 insertions(+), 14 deletions(-) + +diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c +index 6ab94ada7e..dd190bd654 100644 +--- a/drivers/nvme/nvme.c ++++ b/drivers/nvme/nvme.c +@@ -95,7 +95,7 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + buffer += (page_size - offset); + + if (length <= page_size) { +- *prp2 = (u64)buffer; ++ *prp2 = nvme_virt_to_bus(dev, buffer); + return 0; + } + +@@ -120,16 +120,16 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + i = 0; + while (nprps) { + if (i == prps_per_page) { +- u64 next_prp_list = (u64)prp_pool + page_size; +- *(prp_pool + i) = cpu_to_le64(next_prp_list); ++ u64 next = nvme_virt_to_bus(dev, prp_pool + page_size); ++ *(prp_pool + i) = cpu_to_le64(next); + i = 0; + prp_pool += page_size; + } +- *(prp_pool + i++) = cpu_to_le64((u64)buffer); ++ *(prp_pool + i++) = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); + buffer += page_size; + nprps--; + } +- *prp2 = (u64)dev->prp_pool; ++ *prp2 = nvme_virt_to_bus(dev, dev->prp_pool); + + flush_dcache_range((ulong)dev->prp_pool, (ulong)dev->prp_pool + + dev->prp_entry_num * sizeof(u64)); +@@ -356,6 +356,7 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev) + int result; + u32 aqa; + u64 cap = dev->cap; ++ u64 dma_addr; + struct nvme_queue *nvmeq; + /* most architectures use 4KB as the page size */ + unsigned page_shift = 12; +@@ -396,8 +397,10 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev) + dev->ctrl_config |= NVME_CC_IOSQES | NVME_CC_IOCQES; + + writel(aqa, &dev->bar->aqa); +- nvme_writeq((ulong)nvmeq->sq_cmds, &dev->bar->asq); +- nvme_writeq((ulong)nvmeq->cqes, &dev->bar->acq); ++ dma_addr = nvme_virt_to_bus(dev, nvmeq->sq_cmds); ++ nvme_writeq(dma_addr, &dev->bar->asq); ++ dma_addr = nvme_virt_to_bus(dev, nvmeq->cqes); ++ nvme_writeq(dma_addr, &dev->bar->acq); + + result = nvme_enable_ctrl(dev); + if (result) +@@ -423,7 +426,7 @@ static int nvme_alloc_cq(struct nvme_dev *dev, u16 qid, + + memset(&c, 0, sizeof(c)); + c.create_cq.opcode = nvme_admin_create_cq; +- c.create_cq.prp1 = cpu_to_le64((ulong)nvmeq->cqes); ++ c.create_cq.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, nvmeq->cqes)); + c.create_cq.cqid = cpu_to_le16(qid); + c.create_cq.qsize = cpu_to_le16(nvmeq->q_depth - 1); + c.create_cq.cq_flags = cpu_to_le16(flags); +@@ -440,7 +443,7 @@ static int nvme_alloc_sq(struct nvme_dev *dev, u16 qid, + + memset(&c, 0, sizeof(c)); + c.create_sq.opcode = nvme_admin_create_sq; +- c.create_sq.prp1 = cpu_to_le64((ulong)nvmeq->sq_cmds); ++ c.create_sq.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, nvmeq->sq_cmds)); + c.create_sq.sqid = cpu_to_le16(qid); + c.create_sq.qsize = cpu_to_le16(nvmeq->q_depth - 1); + c.create_sq.sq_flags = cpu_to_le16(flags); +@@ -461,14 +464,14 @@ int nvme_identify(struct nvme_dev *dev, unsigned nsid, + memset(&c, 0, sizeof(c)); + c.identify.opcode = nvme_admin_identify; + c.identify.nsid = cpu_to_le32(nsid); +- c.identify.prp1 = cpu_to_le64((u64)buffer); ++ c.identify.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); + + length -= (page_size - offset); + if (length <= 0) { + c.identify.prp2 = 0; + } else { + buffer += (page_size - offset); +- c.identify.prp2 = cpu_to_le64((u64)buffer); ++ c.identify.prp2 = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); + } + + c.identify.cns = cpu_to_le32(cns); +@@ -493,7 +496,7 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, + memset(&c, 0, sizeof(c)); + c.features.opcode = nvme_admin_get_features; + c.features.nsid = cpu_to_le32(nsid); +- c.features.prp1 = cpu_to_le64((u64)buffer); ++ c.features.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); + c.features.fid = cpu_to_le32(fid); + + ret = nvme_submit_admin_cmd(dev, &c, result); +@@ -519,7 +522,7 @@ int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11, + + memset(&c, 0, sizeof(c)); + c.features.opcode = nvme_admin_set_features; +- c.features.prp1 = cpu_to_le64((u64)buffer); ++ c.features.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); + c.features.fid = cpu_to_le32(fid); + c.features.dword11 = cpu_to_le32(dword11); + +@@ -776,7 +779,7 @@ static ulong nvme_blk_rw(struct udevice *udev, lbaint_t blknr, + c.rw.slba = cpu_to_le64(slba); + slba += lbas; + c.rw.length = cpu_to_le16(lbas - 1); +- c.rw.prp1 = cpu_to_le64(temp_buffer); ++ c.rw.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, temp_buffer)); + c.rw.prp2 = cpu_to_le64(prp2); + status = nvme_submit_sync_cmd(dev->queues[NVME_IO_Q], + &c, NULL, IO_TIMEOUT); +@@ -835,6 +838,7 @@ static int nvme_probe(struct udevice *udev) + struct nvme_id_ns *id; + + ndev->instance = trailing_strtol(udev->name); ++ ndev->dev = udev->parent; + + INIT_LIST_HEAD(&ndev->namespaces); + ndev->bar = dm_pci_map_bar(udev, PCI_BASE_ADDRESS_0, +diff --git a/drivers/nvme/nvme.h b/drivers/nvme/nvme.h +index c6aae4da5d..31e6899bca 100644 +--- a/drivers/nvme/nvme.h ++++ b/drivers/nvme/nvme.h +@@ -7,8 +7,15 @@ + #ifndef __DRIVER_NVME_H__ + #define __DRIVER_NVME_H__ + ++#include + #include + ++#if CONFIG_IS_ENABLED(DM_USB) ++#define nvme_to_dev(_dev) _dev->dev ++#else ++#define nvme_to_dev(_dev) NULL ++#endif ++ + struct nvme_id_power_state { + __le16 max_power; /* centiwatts */ + __u8 rsvd2; +@@ -596,6 +603,9 @@ enum { + + /* Represents an NVM Express device. Each nvme_dev is a PCI function. */ + struct nvme_dev { ++#if CONFIG_IS_ENABLED(DM_USB) ++ struct udevice *dev; ++#endif + struct list_head node; + struct nvme_queue **queues; + u32 __iomem *dbs; +@@ -635,4 +645,9 @@ struct nvme_ns { + u8 flbas; + }; + ++static inline dma_addr_t nvme_virt_to_bus(struct nvme_dev *dev, void *addr) ++{ ++ return dev_phys_to_bus(nvme_to_dev(dev), virt_to_phys(addr)); ++} ++ + #endif /* __DRIVER_NVME_H__ */ +-- +2.36.0 + From dcfaae66794be7ff958efe6460eee5f8438a7f45 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Tue, 26 Apr 2022 13:12:44 -0700 Subject: [PATCH 12/29] nixos/modules/profiles/all-hardware: add nvme to initrd modules --- nixos/modules/profiles/all-hardware.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/modules/profiles/all-hardware.nix b/nixos/modules/profiles/all-hardware.nix index 25f68123a1da..8347453d403b 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" From d2f1613f15d68eadfd882a68f2ac42e02d945214 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 27 Apr 2022 00:27:26 +0200 Subject: [PATCH 13/29] python39Packages.pylast: 4.5.0 -> 5.0.0 python39Packages.pylast: 4.5.0 -> 5.0.0 --- pkgs/development/python-modules/pylast/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/pylast/default.nix b/pkgs/development/python-modules/pylast/default.nix index 257cb72b3ec1..1a101310d405 100644 --- a/pkgs/development/python-modules/pylast/default.nix +++ b/pkgs/development/python-modules/pylast/default.nix @@ -1,8 +1,8 @@ { lib , buildPythonPackage -, certifi , fetchPypi , flaky +, httpx , importlib-metadata , pytestCheckHook , pythonOlder @@ -11,14 +11,14 @@ buildPythonPackage rec { pname = "pylast"; - version = "4.5.0"; + version = "5.0.0"; format = "setuptools"; - disabled = pythonOlder "3.6"; + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-YoALculx2trEDD1vU4xhiCGdb1OFPdxI1p2fwlZZAY8="; + hash = "sha256-UBi2bCtGMtcavYEDtz5m5N0UxmCaj3un5aomxzbfLfg="; }; nativeBuildInputs = [ @@ -26,7 +26,7 @@ buildPythonPackage rec { ]; propagatedBuildInputs = [ - certifi + httpx ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; From c425aa4989502c9dcafdd570ad1dbe89a2976587 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 25 Apr 2022 05:16:22 +0000 Subject: [PATCH 14/29] cargo-make: 0.35.10 -> 0.35.11 --- pkgs/development/tools/rust/cargo-make/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/rust/cargo-make/default.nix b/pkgs/development/tools/rust/cargo-make/default.nix index 2e2ff56fd050..46738f7cf45e 100644 --- a/pkgs/development/tools/rust/cargo-make/default.nix +++ b/pkgs/development/tools/rust/cargo-make/default.nix @@ -13,11 +13,11 @@ rustPlatform.buildRustPackage rec { pname = "cargo-make"; - version = "0.35.10"; + version = "0.35.11"; src = fetchCrate { inherit pname version; - sha256 = "sha256-l34sThvzhAW8VfxVuv+UGVil7yOvsOiWSqr/N91V8C8="; + sha256 = "sha256-NzhEXt0z+0/6F3pgGmQwjnexBA2icWV3dCifZ8BxnOQ="; }; nativeBuildInputs = [ pkg-config ]; @@ -25,7 +25,7 @@ rustPlatform.buildRustPackage rec { buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security SystemConfiguration libiconv ]; - cargoSha256 = "sha256-974Gqtv+g32iHrIqIzqwBsE8frzmjF0Ma/hSMGzMaGs="; + cargoSha256 = "sha256-+FGl0JhaRu+KLQJGAcMXv9vP6pmRzdTDtNA3h6A1jcY="; # Some tests fail because they need network access. # However, Travis ensures a proper build. From d9e593ed5889f3906dc72811c45bf684be8865cf Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 25 Apr 2022 13:04:22 +0000 Subject: [PATCH 15/29] git-cliff: 0.6.1 -> 0.7.0 --- .../version-management/git-and-tools/git-cliff/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/version-management/git-and-tools/git-cliff/default.nix b/pkgs/applications/version-management/git-and-tools/git-cliff/default.nix index c9bf60a1eb93..ced8244256a6 100644 --- a/pkgs/applications/version-management/git-and-tools/git-cliff/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git-cliff/default.nix @@ -2,16 +2,16 @@ rustPlatform.buildRustPackage rec { pname = "git-cliff"; - version = "0.6.1"; + version = "0.7.0"; src = fetchFromGitHub { owner = "orhun"; repo = "git-cliff"; rev = "v${version}"; - sha256 = "sha256-CJ/2Cv/XoLq9U7u5mexH8iCCHbGtV6xohP3FapqO3+g="; + sha256 = "sha256-wVHL2+didmiN7UlEeIuSr+8LhkFKCOD3of4rKVg1i1o="; }; - cargoSha256 = "sha256-pYStKDgvvV/Z96TAonpDW7DIs1YSO6gAoiUCieVa9QY="; + cargoSha256 = "sha256-5jhloUnaGXXDu2LCO86SMJo8ETIxLAivv3hx9gEqtJ4="; # attempts to run the program on .git in src which is not deterministic doCheck = false; From aca45f8c678deaa35dc407586e91d302d36dc74d Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Tue, 26 Apr 2022 14:48:09 -0700 Subject: [PATCH 16/29] raspberrypiWirelessFirmware: fix install --- .../firmware/raspberrypi-wireless/default.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix b/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix index 72ae31c4b2dc..c9192744a46a 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"; From b30105b7c28b6510980101e8266b2268b1e2313f Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Tue, 26 Apr 2022 15:25:56 -0700 Subject: [PATCH 17/29] ubootRaspberryCM4_64bit: merge with ubootRaspberryPi4_64bit --- nixos/modules/installer/sd-card/sd-image-aarch64.nix | 5 +---- pkgs/misc/uboot/default.nix | 6 ------ pkgs/top-level/all-packages.nix | 1 - 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/nixos/modules/installer/sd-card/sd-image-aarch64.nix b/nixos/modules/installer/sd-card/sd-image-aarch64.nix index 1aca8c7e8ecf..7825a47814c3 100644 --- a/nixos/modules/installer/sd-card/sd-image-aarch64.nix +++ b/nixos/modules/installer/sd-card/sd-image-aarch64.nix @@ -40,7 +40,7 @@ arm_boost=1 [cm4] - kernel=u-boot-rpi-cm4.bin + kernel=u-boot-rpi4.bin enable_gic=1 armstub=armstub8-gic.bin disable_overscan=1 @@ -76,9 +76,6 @@ 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/ - - # Add cm4 specific files - cp ${pkgs.ubootRaspberryPiCM4_64bit}/u-boot.bin firmware/u-boot-rpi-cm4.bin cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/bcm2711-rpi-cm4.dtb firmware/ ''; populateRootCommands = '' diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index d231dcef8979..92b03e7d863b 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -412,12 +412,6 @@ in { defconfig = "rpi_4_defconfig"; extraMeta.platforms = ["aarch64-linux"]; filesToInstall = ["u-boot.bin"]; - }; - - ubootRaspberryPiCM4_64bit = buildUBoot { - defconfig = "rpi_4_defconfig"; - extraMeta.platforms = ["aarch64-linux"]; - filesToInstall = ["u-boot.bin"]; extraConfig = '' CONFIG_CMD_NVME=y CONFIG_NVME=y diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 51539924db14..3706cc3dc3fb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23775,7 +23775,6 @@ with pkgs; ubootRaspberryPi3_64bit ubootRaspberryPi4_32bit ubootRaspberryPi4_64bit - ubootRaspberryPiCM4_64bit ubootRaspberryPiZero ubootRock64 ubootRockPi4 From 11c1152e0f4f35e22249bc8d02e1d30e29b53032 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Tue, 26 Apr 2022 15:26:14 -0700 Subject: [PATCH 18/29] sd-image-aarch64: add dtbs for rpi-400 and cm4s --- nixos/modules/installer/sd-card/sd-image-aarch64.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/installer/sd-card/sd-image-aarch64.nix b/nixos/modules/installer/sd-card/sd-image-aarch64.nix index 7825a47814c3..dde98396d876 100644 --- a/nixos/modules/installer/sd-card/sd-image-aarch64.nix +++ b/nixos/modules/installer/sd-card/sd-image-aarch64.nix @@ -76,7 +76,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 From cff95d119343fe2808516a0f8f86c8ba0963b29c Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Tue, 26 Apr 2022 15:56:41 -0700 Subject: [PATCH 19/29] ubootRaspberryPi4_64bit: add patch for USB stall with non-MSD USB devices --- pkgs/misc/uboot/default.nix | 1 + ...usb-xhci-reset-endpoint-on-USB-stall.patch | 87 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 pkgs/misc/uboot/rpi-cm4/0002-usb-xhci-reset-endpoint-on-USB-stall.patch diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 92b03e7d863b..abcf0e027617 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -425,6 +425,7 @@ in { CONFIG_USB_XHCI_BRCM=y ''; extraPatches = [ + ./rpi-cm4/0002-usb-xhci-reset-endpoint-on-USB-stall.patch ./rpi-cm4/0003-rpi-add-NVMe-to-boot-order.patch ./rpi-cm4/0004-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch ./rpi-cm4/0005-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch diff --git a/pkgs/misc/uboot/rpi-cm4/0002-usb-xhci-reset-endpoint-on-USB-stall.patch b/pkgs/misc/uboot/rpi-cm4/0002-usb-xhci-reset-endpoint-on-USB-stall.patch new file mode 100644 index 000000000000..52124de7da14 --- /dev/null +++ b/pkgs/misc/uboot/rpi-cm4/0002-usb-xhci-reset-endpoint-on-USB-stall.patch @@ -0,0 +1,87 @@ +From c942eb452c1c31fe6259178b6e9fea5456d7fb9c Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> +References: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> +From: Stefan Agner +Date: Mon, 27 Sep 2021 12:28:04 +0200 +Subject: [PATCH 2/5] usb: xhci: reset endpoint on USB stall + +There are devices which cause a USB stall when trying to read strings. +Specifically Arduino Mega R3 stalls when trying to read the product +string. + +The stall currently remains unhandled, and subsequent retries submit new +transfers on a stopped endpoint which ultimately cause a crash in +abort_td(): +WARN halted endpoint, queueing URB anyway. +XHCI control transfer timed out, aborting... +Unexpected XHCI event TRB, skipping... (3affe040 00000000 13000000 02008401) +BUG at drivers/usb/host/xhci-ring.c:505/abort_td()! +BUG! +resetting ... + +Linux seems to be able to recover from the stall by issuing a +TRB_RESET_EP command. + +Introduce reset_ep() which issues a TRB_RESET_EP followed by setting the +transfer ring dequeue pointer via TRB_SET_DEQ. This allows to properly +recover from a USB stall error and continue communicating with the USB +device. + +Signed-off-by: Stefan Agner +--- + drivers/usb/host/xhci-ring.c | 31 +++++++++++++++++++++++++++++++ + 1 file changed, 31 insertions(+) + +diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c +index 35bd5cd29e..430823cb9d 100644 +--- a/drivers/usb/host/xhci-ring.c ++++ b/drivers/usb/host/xhci-ring.c +@@ -481,6 +481,33 @@ union xhci_trb *xhci_wait_for_event(struct xhci_ctrl *ctrl, trb_type expected) + BUG(); + } + ++/* ++ * Issue reset endpoint command for an endpoint. This is required to recover ++ * a halted endpoint (e.g. due to a stall error). ++ */ ++static void reset_ep(struct usb_device *udev, int ep_index) ++{ ++ struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); ++ struct xhci_ring *ring = ctrl->devs[udev->slot_id]->eps[ep_index].ring; ++ union xhci_trb *event; ++ u32 field; ++ ++ printf("Resetting EP...\n"); ++ xhci_queue_command(ctrl, NULL, udev->slot_id, ep_index, TRB_RESET_EP); ++ event = xhci_wait_for_event(ctrl, TRB_COMPLETION); ++ field = le32_to_cpu(event->trans_event.flags); ++ BUG_ON(TRB_TO_SLOT_ID(field) != udev->slot_id); ++ xhci_acknowledge_event(ctrl); ++ ++ xhci_queue_command(ctrl, (void *)((uintptr_t)ring->enqueue | ++ ring->cycle_state), udev->slot_id, ep_index, TRB_SET_DEQ); ++ event = xhci_wait_for_event(ctrl, TRB_COMPLETION); ++ BUG_ON(TRB_TO_SLOT_ID(le32_to_cpu(event->event_cmd.flags)) ++ != udev->slot_id || GET_COMP_CODE(le32_to_cpu( ++ event->event_cmd.status)) != COMP_SUCCESS); ++ xhci_acknowledge_event(ctrl); ++} ++ + /* + * Stops transfer processing for an endpoint and throws away all unprocessed + * TRBs by setting the xHC's dequeue pointer to our enqueue pointer. The next +@@ -928,6 +955,10 @@ int xhci_ctrl_tx(struct usb_device *udev, unsigned long pipe, + + record_transfer_result(udev, event, length); + xhci_acknowledge_event(ctrl); ++ if (udev->status == USB_ST_STALLED) { ++ reset_ep(udev, ep_index); ++ return -EPIPE; ++ } + + /* Invalidate buffer to make it available to usb-core */ + if (length > 0) +-- +2.35.1 + From 77bb75d6a24e28d2b1f3be54c4194b22b63d054f Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Tue, 26 Apr 2022 17:12:52 -0700 Subject: [PATCH 20/29] ubootRaspberryPi4_64bit: rebase patch series --- pkgs/misc/uboot/default.nix | 18 ++-- ... => 0001-rpi-add-NVMe-to-boot-order.patch} | 9 +- ...ct-the-prps-per-page-calculation-me.patch} | 9 +- ...usb-xhci-reset-endpoint-on-USB-stall.patch | 87 ------------------- ...e-driver-compatible-with-downstream.patch} | 9 +- ...m283x-don-t-explicitly-disable-init.patch} | 7 +- ...m283x-allow-to-spawn-any-PL011-UART.patch} | 9 +- ...rove-readability-of-nvme_setup_prps.patch} | 9 +- ...e-pointer-for-CPU-addressed-buffers.patch} | 9 +- ...rtual-addresses-into-the-bus-s-addr.patch} | 9 +- 10 files changed, 32 insertions(+), 143 deletions(-) rename pkgs/misc/uboot/rpi-cm4/{0003-rpi-add-NVMe-to-boot-order.patch => 0001-rpi-add-NVMe-to-boot-order.patch} (70%) rename pkgs/misc/uboot/rpi-cm4/{0004-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch => 0002-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch} (75%) delete mode 100644 pkgs/misc/uboot/rpi-cm4/0002-usb-xhci-reset-endpoint-on-USB-stall.patch rename pkgs/misc/uboot/rpi-cm4/{0005-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch => 0003-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch} (66%) rename pkgs/misc/uboot/rpi-cm4/{0001-drivers-bcm283x-don-t-explicitly-disable-init.patch => 0004-drivers-bcm283x-don-t-explicitly-disable-init.patch} (87%) rename pkgs/misc/uboot/rpi-cm4/{0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch => 0005-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch} (82%) rename pkgs/misc/uboot/rpi-cm4/{0003-nvme-improve-readability-of-nvme_setup_prps.patch => 0006-nvme-improve-readability-of-nvme_setup_prps.patch} (78%) rename pkgs/misc/uboot/rpi-cm4/{0004-nvme-Use-pointer-for-CPU-addressed-buffers.patch => 0007-nvme-Use-pointer-for-CPU-addressed-buffers.patch} (95%) rename pkgs/misc/uboot/rpi-cm4/{0005-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch => 0008-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch} (94%) diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index abcf0e027617..23a79329b911 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -425,16 +425,14 @@ in { CONFIG_USB_XHCI_BRCM=y ''; extraPatches = [ - ./rpi-cm4/0002-usb-xhci-reset-endpoint-on-USB-stall.patch - ./rpi-cm4/0003-rpi-add-NVMe-to-boot-order.patch - ./rpi-cm4/0004-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch - ./rpi-cm4/0005-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch - - ./rpi-cm4/0001-drivers-bcm283x-don-t-explicitly-disable-init.patch - ./rpi-cm4/0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch - ./rpi-cm4/0003-nvme-improve-readability-of-nvme_setup_prps.patch - ./rpi-cm4/0004-nvme-Use-pointer-for-CPU-addressed-buffers.patch - ./rpi-cm4/0005-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch + ./rpi-cm4/0001-rpi-add-NVMe-to-boot-order.patch + ./rpi-cm4/0002-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch + ./rpi-cm4/0003-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch + ./rpi-cm4/0004-drivers-bcm283x-don-t-explicitly-disable-init.patch + ./rpi-cm4/0005-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch + ./rpi-cm4/0006-nvme-improve-readability-of-nvme_setup_prps.patch + ./rpi-cm4/0007-nvme-Use-pointer-for-CPU-addressed-buffers.patch + ./rpi-cm4/0008-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch ]; }; diff --git a/pkgs/misc/uboot/rpi-cm4/0003-rpi-add-NVMe-to-boot-order.patch b/pkgs/misc/uboot/rpi-cm4/0001-rpi-add-NVMe-to-boot-order.patch similarity index 70% rename from pkgs/misc/uboot/rpi-cm4/0003-rpi-add-NVMe-to-boot-order.patch rename to pkgs/misc/uboot/rpi-cm4/0001-rpi-add-NVMe-to-boot-order.patch index f5e9462e89b5..34a0add42afc 100644 --- a/pkgs/misc/uboot/rpi-cm4/0003-rpi-add-NVMe-to-boot-order.patch +++ b/pkgs/misc/uboot/rpi-cm4/0001-rpi-add-NVMe-to-boot-order.patch @@ -1,10 +1,7 @@ -From ae45864457182fcaa67911e1e3d8db242dff3646 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> -References: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> +From d39555653d3d67cc2e5873180a48fc1582cbb534 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 29 Dec 2020 23:34:52 +0100 -Subject: [PATCH 3/5] rpi: add NVMe to boot order +Subject: [PATCH 1/8] rpi: add NVMe to boot order The Compute Module 4 I/O Board can support a NVMe. Add NVMe to the boot order. @@ -40,5 +37,5 @@ index 4c5c1ac31f..e24c94c7d2 100644 BOOT_TARGET_PXE(func) \ BOOT_TARGET_DHCP(func) -- -2.35.1 +2.35.3 diff --git a/pkgs/misc/uboot/rpi-cm4/0004-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch b/pkgs/misc/uboot/rpi-cm4/0002-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch similarity index 75% rename from pkgs/misc/uboot/rpi-cm4/0004-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch rename to pkgs/misc/uboot/rpi-cm4/0002-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch index 2bd7d9e868f0..26899a46df18 100644 --- a/pkgs/misc/uboot/rpi-cm4/0004-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch +++ b/pkgs/misc/uboot/rpi-cm4/0002-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch @@ -1,10 +1,7 @@ -From 3a13ff4eb509e8e80a52ae45c9a5573e745803c3 Mon Sep 17 00:00:00 2001 -Message-Id: <3a13ff4eb509e8e80a52ae45c9a5573e745803c3.1645627172.git.stefan@agner.ch> -In-Reply-To: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> -References: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> +From 88e6bbedcc9c95db7de9a537a617520c60e4e86d Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 23 Sep 2021 23:43:31 +0200 -Subject: [PATCH 4/5] Revert "nvme: Correct the prps per page calculation +Subject: [PATCH 2/8] Revert "nvme: Correct the prps per page calculation method" This reverts commit 859b33c948945f7904f60a2c12a3792d356d51ad. @@ -40,5 +37,5 @@ index 3c529a2fce..3bda491e12 100644 length -= (page_size - offset); -- -2.35.1 +2.35.3 diff --git a/pkgs/misc/uboot/rpi-cm4/0002-usb-xhci-reset-endpoint-on-USB-stall.patch b/pkgs/misc/uboot/rpi-cm4/0002-usb-xhci-reset-endpoint-on-USB-stall.patch deleted file mode 100644 index 52124de7da14..000000000000 --- a/pkgs/misc/uboot/rpi-cm4/0002-usb-xhci-reset-endpoint-on-USB-stall.patch +++ /dev/null @@ -1,87 +0,0 @@ -From c942eb452c1c31fe6259178b6e9fea5456d7fb9c Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> -References: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> -From: Stefan Agner -Date: Mon, 27 Sep 2021 12:28:04 +0200 -Subject: [PATCH 2/5] usb: xhci: reset endpoint on USB stall - -There are devices which cause a USB stall when trying to read strings. -Specifically Arduino Mega R3 stalls when trying to read the product -string. - -The stall currently remains unhandled, and subsequent retries submit new -transfers on a stopped endpoint which ultimately cause a crash in -abort_td(): -WARN halted endpoint, queueing URB anyway. -XHCI control transfer timed out, aborting... -Unexpected XHCI event TRB, skipping... (3affe040 00000000 13000000 02008401) -BUG at drivers/usb/host/xhci-ring.c:505/abort_td()! -BUG! -resetting ... - -Linux seems to be able to recover from the stall by issuing a -TRB_RESET_EP command. - -Introduce reset_ep() which issues a TRB_RESET_EP followed by setting the -transfer ring dequeue pointer via TRB_SET_DEQ. This allows to properly -recover from a USB stall error and continue communicating with the USB -device. - -Signed-off-by: Stefan Agner ---- - drivers/usb/host/xhci-ring.c | 31 +++++++++++++++++++++++++++++++ - 1 file changed, 31 insertions(+) - -diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c -index 35bd5cd29e..430823cb9d 100644 ---- a/drivers/usb/host/xhci-ring.c -+++ b/drivers/usb/host/xhci-ring.c -@@ -481,6 +481,33 @@ union xhci_trb *xhci_wait_for_event(struct xhci_ctrl *ctrl, trb_type expected) - BUG(); - } - -+/* -+ * Issue reset endpoint command for an endpoint. This is required to recover -+ * a halted endpoint (e.g. due to a stall error). -+ */ -+static void reset_ep(struct usb_device *udev, int ep_index) -+{ -+ struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); -+ struct xhci_ring *ring = ctrl->devs[udev->slot_id]->eps[ep_index].ring; -+ union xhci_trb *event; -+ u32 field; -+ -+ printf("Resetting EP...\n"); -+ xhci_queue_command(ctrl, NULL, udev->slot_id, ep_index, TRB_RESET_EP); -+ event = xhci_wait_for_event(ctrl, TRB_COMPLETION); -+ field = le32_to_cpu(event->trans_event.flags); -+ BUG_ON(TRB_TO_SLOT_ID(field) != udev->slot_id); -+ xhci_acknowledge_event(ctrl); -+ -+ xhci_queue_command(ctrl, (void *)((uintptr_t)ring->enqueue | -+ ring->cycle_state), udev->slot_id, ep_index, TRB_SET_DEQ); -+ event = xhci_wait_for_event(ctrl, TRB_COMPLETION); -+ BUG_ON(TRB_TO_SLOT_ID(le32_to_cpu(event->event_cmd.flags)) -+ != udev->slot_id || GET_COMP_CODE(le32_to_cpu( -+ event->event_cmd.status)) != COMP_SUCCESS); -+ xhci_acknowledge_event(ctrl); -+} -+ - /* - * Stops transfer processing for an endpoint and throws away all unprocessed - * TRBs by setting the xHC's dequeue pointer to our enqueue pointer. The next -@@ -928,6 +955,10 @@ int xhci_ctrl_tx(struct usb_device *udev, unsigned long pipe, - - record_transfer_result(udev, event, length); - xhci_acknowledge_event(ctrl); -+ if (udev->status == USB_ST_STALLED) { -+ reset_ep(udev, ep_index); -+ return -EPIPE; -+ } - - /* Invalidate buffer to make it available to usb-core */ - if (length > 0) --- -2.35.1 - diff --git a/pkgs/misc/uboot/rpi-cm4/0005-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch b/pkgs/misc/uboot/rpi-cm4/0003-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch similarity index 66% rename from pkgs/misc/uboot/rpi-cm4/0005-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch rename to pkgs/misc/uboot/rpi-cm4/0003-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch index bf2d8475dc01..b3fb1b51be49 100644 --- a/pkgs/misc/uboot/rpi-cm4/0005-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch +++ b/pkgs/misc/uboot/rpi-cm4/0003-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch @@ -1,10 +1,7 @@ -From b00922ee48987ef91f0ca2aa3a66ad22c6c83d57 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> -References: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch> +From bcc994f717e3835c66e5ff85d78f314a427312fa Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 7 Oct 2021 12:02:39 +0200 -Subject: [PATCH 5/5] usb: xhci-brcm: Make driver compatible with downstream +Subject: [PATCH 3/8] usb: xhci-brcm: Make driver compatible with downstream device tree The downstream device tree uses just "generic-xhci" as compatible @@ -29,5 +26,5 @@ index fe17924028..0c6938187b 100644 }; -- -2.35.1 +2.35.3 diff --git a/pkgs/misc/uboot/rpi-cm4/0001-drivers-bcm283x-don-t-explicitly-disable-init.patch b/pkgs/misc/uboot/rpi-cm4/0004-drivers-bcm283x-don-t-explicitly-disable-init.patch similarity index 87% rename from pkgs/misc/uboot/rpi-cm4/0001-drivers-bcm283x-don-t-explicitly-disable-init.patch rename to pkgs/misc/uboot/rpi-cm4/0004-drivers-bcm283x-don-t-explicitly-disable-init.patch index 59e7234dde9f..630da9725e10 100644 --- a/pkgs/misc/uboot/rpi-cm4/0001-drivers-bcm283x-don-t-explicitly-disable-init.patch +++ b/pkgs/misc/uboot/rpi-cm4/0004-drivers-bcm283x-don-t-explicitly-disable-init.patch @@ -1,8 +1,7 @@ -From 78704bc154d695ee16fdf8396f4d60b740190014 Mon Sep 17 00:00:00 2001 -Message-Id: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +From dcb1d1594345d89733559ed2ce19f5cfcf352512 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 14 Apr 2022 12:15:26 +0200 -Subject: [PATCH 1/5] drivers: bcm283x: don't explicitly disable init +Subject: [PATCH 4/8] drivers: bcm283x: don't explicitly disable init It seems that the reason why init doesn't succeed is the lack of clock support in U-Boot. Setting the default clock of 48MHz for the PL011 @@ -50,5 +49,5 @@ index e24c94c7d2..98ba4dc052 100644 /* GPIO */ #define CONFIG_BCM2835_GPIO -- -2.36.0 +2.35.3 diff --git a/pkgs/misc/uboot/rpi-cm4/0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch b/pkgs/misc/uboot/rpi-cm4/0005-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch similarity index 82% rename from pkgs/misc/uboot/rpi-cm4/0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch rename to pkgs/misc/uboot/rpi-cm4/0005-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch index 7ce52e15c573..bee1422e0e06 100644 --- a/pkgs/misc/uboot/rpi-cm4/0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch +++ b/pkgs/misc/uboot/rpi-cm4/0005-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch @@ -1,10 +1,7 @@ -From c2447aa922068cebd9bbaac45acae3d853abf687 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> -References: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +From f014611eb8b2ff2b46c9065ee354ca872a019273 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 14 Apr 2022 12:18:41 +0200 -Subject: [PATCH 2/5] drivers: bcm283x: allow to spawn any PL011 UART +Subject: [PATCH 5/8] drivers: bcm283x: allow to spawn any PL011 UART The current code checks pinmux for the first PL011 only. Raspberry Pi 4 has multiple PL011 UARTs. This code prevents probing of other UARTs in @@ -64,5 +61,5 @@ index 182274036c..98628e1ca4 100644 * Read the ofdata here rather than in an of_to_plat() method * since we need the soc simple-bus to be probed so that the 'ranges' -- -2.36.0 +2.35.3 diff --git a/pkgs/misc/uboot/rpi-cm4/0003-nvme-improve-readability-of-nvme_setup_prps.patch b/pkgs/misc/uboot/rpi-cm4/0006-nvme-improve-readability-of-nvme_setup_prps.patch similarity index 78% rename from pkgs/misc/uboot/rpi-cm4/0003-nvme-improve-readability-of-nvme_setup_prps.patch rename to pkgs/misc/uboot/rpi-cm4/0006-nvme-improve-readability-of-nvme_setup_prps.patch index 1ca9d0c1253f..3ac635933f17 100644 --- a/pkgs/misc/uboot/rpi-cm4/0003-nvme-improve-readability-of-nvme_setup_prps.patch +++ b/pkgs/misc/uboot/rpi-cm4/0006-nvme-improve-readability-of-nvme_setup_prps.patch @@ -1,10 +1,7 @@ -From 78924e9cf8c4af0baafcb2e7224bf04ad65276de Mon Sep 17 00:00:00 2001 -Message-Id: <78924e9cf8c4af0baafcb2e7224bf04ad65276de.1650924333.git.stefan@agner.ch> -In-Reply-To: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> -References: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +From 313fb277fae1c8687e93772663e37108363e9e7d Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 23 Sep 2021 23:52:44 +0200 -Subject: [PATCH 3/5] nvme: improve readability of nvme_setup_prps() +Subject: [PATCH 6/8] nvme: improve readability of nvme_setup_prps() Improve readability by introducing consts, reuse consts where appropriate and adding variables with discriptive name. @@ -47,5 +44,5 @@ index 3bda491e12..1601651449 100644 prp_pool += page_size; } -- -2.36.0 +2.35.3 diff --git a/pkgs/misc/uboot/rpi-cm4/0004-nvme-Use-pointer-for-CPU-addressed-buffers.patch b/pkgs/misc/uboot/rpi-cm4/0007-nvme-Use-pointer-for-CPU-addressed-buffers.patch similarity index 95% rename from pkgs/misc/uboot/rpi-cm4/0004-nvme-Use-pointer-for-CPU-addressed-buffers.patch rename to pkgs/misc/uboot/rpi-cm4/0007-nvme-Use-pointer-for-CPU-addressed-buffers.patch index 1a25f4ce1b3a..5b97f4717908 100644 --- a/pkgs/misc/uboot/rpi-cm4/0004-nvme-Use-pointer-for-CPU-addressed-buffers.patch +++ b/pkgs/misc/uboot/rpi-cm4/0007-nvme-Use-pointer-for-CPU-addressed-buffers.patch @@ -1,10 +1,7 @@ -From e040d976ecbdd8071bbcb73d78e17ababa88c51f Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> -References: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +From fa2fff362077ed6939659b9d5a42ae38cb2c9e24 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 23 Sep 2021 23:58:35 +0200 -Subject: [PATCH 4/5] nvme: Use pointer for CPU addressed buffers +Subject: [PATCH 7/8] nvme: Use pointer for CPU addressed buffers Pass buffers which use CPU addressing as void pointers. This aligns with DMA APIs which use void pointers as argument. It will avoid unnecessary @@ -259,5 +256,5 @@ index 2cdf8ce320..8ff823cd81 100644 /** * nvme_scan_namespace - scan all namespaces attached to NVMe controllers -- -2.36.0 +2.35.3 diff --git a/pkgs/misc/uboot/rpi-cm4/0005-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch b/pkgs/misc/uboot/rpi-cm4/0008-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch similarity index 94% rename from pkgs/misc/uboot/rpi-cm4/0005-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch rename to pkgs/misc/uboot/rpi-cm4/0008-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch index cf25242c6caf..fcb9c5311780 100644 --- a/pkgs/misc/uboot/rpi-cm4/0005-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch +++ b/pkgs/misc/uboot/rpi-cm4/0008-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch @@ -1,10 +1,7 @@ -From c4736c35141e519d15430660e17c274e142e886d Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> -References: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch> +From e3c3029de7f7e60e9f0aedd99a8eaf76ed7214ea Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Fri, 24 Sep 2021 00:27:39 +0200 -Subject: [PATCH 5/5] nvme: translate virtual addresses into the bus's address +Subject: [PATCH 8/8] nvme: translate virtual addresses into the bus's address space So far we've been content with passing physical/CPU addresses when @@ -194,5 +191,5 @@ index c6aae4da5d..31e6899bca 100644 + #endif /* __DRIVER_NVME_H__ */ -- -2.36.0 +2.35.3 From 21b28447eb5b32dbca7cfd51acf716bf41eb732c Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Tue, 26 Apr 2022 18:27:37 -0700 Subject: [PATCH 21/29] uboot: add node on where rpi-cm4 patches come from --- pkgs/misc/uboot/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 23a79329b911..8b4e59b65ee4 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -424,6 +424,9 @@ in { CONFIG_USB_XHCI_BRCM=y ''; + # These were taken from: + # https://github.com/home-assistant/operating-system/tree/dev/buildroot-external/board/raspberrypi/patches/uboot + # https://github.com/home-assistant/operating-system/tree/dev/buildroot-external/board/raspberrypi/yellow/patches/uboot extraPatches = [ ./rpi-cm4/0001-rpi-add-NVMe-to-boot-order.patch ./rpi-cm4/0002-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch From 059427718385d23e125ddfbb630eda0d6fbc4178 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Tue, 26 Apr 2022 19:09:06 -0700 Subject: [PATCH 22/29] ubootRaspberryPi4_64bit: remove NVMe support patches --- pkgs/misc/uboot/default.nix | 25 -- .../0001-rpi-add-NVMe-to-boot-order.patch | 41 --- ...ect-the-prps-per-page-calculation-me.patch | 41 --- ...ke-driver-compatible-with-downstream.patch | 30 -- ...cm283x-don-t-explicitly-disable-init.patch | 53 ---- ...cm283x-allow-to-spawn-any-PL011-UART.patch | 65 ----- ...prove-readability-of-nvme_setup_prps.patch | 48 ---- ...se-pointer-for-CPU-addressed-buffers.patch | 260 ------------------ ...irtual-addresses-into-the-bus-s-addr.patch | 195 ------------- 9 files changed, 758 deletions(-) delete mode 100644 pkgs/misc/uboot/rpi-cm4/0001-rpi-add-NVMe-to-boot-order.patch delete mode 100644 pkgs/misc/uboot/rpi-cm4/0002-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch delete mode 100644 pkgs/misc/uboot/rpi-cm4/0003-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch delete mode 100644 pkgs/misc/uboot/rpi-cm4/0004-drivers-bcm283x-don-t-explicitly-disable-init.patch delete mode 100644 pkgs/misc/uboot/rpi-cm4/0005-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch delete mode 100644 pkgs/misc/uboot/rpi-cm4/0006-nvme-improve-readability-of-nvme_setup_prps.patch delete mode 100644 pkgs/misc/uboot/rpi-cm4/0007-nvme-Use-pointer-for-CPU-addressed-buffers.patch delete mode 100644 pkgs/misc/uboot/rpi-cm4/0008-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 8b4e59b65ee4..d6e5e8a7bcb0 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -412,31 +412,6 @@ in { defconfig = "rpi_4_defconfig"; extraMeta.platforms = ["aarch64-linux"]; filesToInstall = ["u-boot.bin"]; - extraConfig = '' - CONFIG_CMD_NVME=y - CONFIG_NVME=y - CONFIG_NVME_PCI=y - CONFIG_USB_STORAGE=y - CONFIG_USB_FUNCTION_MASS_STORAGE=y - CONFIG_USB_EHCI_HCD=y - CONFIG_USB_EHCI_GENERIC=y - CONFIG_USB_OHCI_HCD=y - - CONFIG_USB_XHCI_BRCM=y - ''; - # These were taken from: - # https://github.com/home-assistant/operating-system/tree/dev/buildroot-external/board/raspberrypi/patches/uboot - # https://github.com/home-assistant/operating-system/tree/dev/buildroot-external/board/raspberrypi/yellow/patches/uboot - extraPatches = [ - ./rpi-cm4/0001-rpi-add-NVMe-to-boot-order.patch - ./rpi-cm4/0002-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch - ./rpi-cm4/0003-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch - ./rpi-cm4/0004-drivers-bcm283x-don-t-explicitly-disable-init.patch - ./rpi-cm4/0005-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch - ./rpi-cm4/0006-nvme-improve-readability-of-nvme_setup_prps.patch - ./rpi-cm4/0007-nvme-Use-pointer-for-CPU-addressed-buffers.patch - ./rpi-cm4/0008-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch - ]; }; ubootRaspberryPiZero = buildUBoot { diff --git a/pkgs/misc/uboot/rpi-cm4/0001-rpi-add-NVMe-to-boot-order.patch b/pkgs/misc/uboot/rpi-cm4/0001-rpi-add-NVMe-to-boot-order.patch deleted file mode 100644 index 34a0add42afc..000000000000 --- a/pkgs/misc/uboot/rpi-cm4/0001-rpi-add-NVMe-to-boot-order.patch +++ /dev/null @@ -1,41 +0,0 @@ -From d39555653d3d67cc2e5873180a48fc1582cbb534 Mon Sep 17 00:00:00 2001 -From: Stefan Agner -Date: Tue, 29 Dec 2020 23:34:52 +0100 -Subject: [PATCH 1/8] rpi: add NVMe to boot order - -The Compute Module 4 I/O Board can support a NVMe. Add NVMe to the boot -order. - -Signed-off-by: Stefan Agner ---- - include/configs/rpi.h | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/include/configs/rpi.h b/include/configs/rpi.h -index 4c5c1ac31f..e24c94c7d2 100644 ---- a/include/configs/rpi.h -+++ b/include/configs/rpi.h -@@ -143,6 +143,12 @@ - #define BOOT_TARGET_MMC(func) - #endif - -+#if CONFIG_IS_ENABLED(CMD_NVME) -+ #define BOOT_TARGET_NVME(func) func(NVME, nvme, 0) -+#else -+ #define BOOT_TARGET_NVME(func) -+#endif -+ - #if CONFIG_IS_ENABLED(CMD_USB) - #define BOOT_TARGET_USB(func) func(USB, usb, 0) - #else -@@ -163,6 +169,7 @@ - - #define BOOT_TARGET_DEVICES(func) \ - BOOT_TARGET_MMC(func) \ -+ BOOT_TARGET_NVME(func) \ - BOOT_TARGET_USB(func) \ - BOOT_TARGET_PXE(func) \ - BOOT_TARGET_DHCP(func) --- -2.35.3 - diff --git a/pkgs/misc/uboot/rpi-cm4/0002-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch b/pkgs/misc/uboot/rpi-cm4/0002-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch deleted file mode 100644 index 26899a46df18..000000000000 --- a/pkgs/misc/uboot/rpi-cm4/0002-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 88e6bbedcc9c95db7de9a537a617520c60e4e86d Mon Sep 17 00:00:00 2001 -From: Stefan Agner -Date: Thu, 23 Sep 2021 23:43:31 +0200 -Subject: [PATCH 2/8] Revert "nvme: Correct the prps per page calculation - method" - -This reverts commit 859b33c948945f7904f60a2c12a3792d356d51ad. - -If there is more than one PRP List the last entry is a pointer to -the next list. From the NVM Express specification: - -"The last entry within a memory page, as indicated by the memory page -size in the CC.MPS field, shall be a PRP List pointer if there is more -than a single memory page of data to be transferred." - -For the purpose of calculating the number of pages required for PRP -lists we should always assume that the last entry is required for -the next PRP list. - -Signed-off-by: Stefan Agner -Cc: Wesley Sheng ---- - drivers/nvme/nvme.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c -index 3c529a2fce..3bda491e12 100644 ---- a/drivers/nvme/nvme.c -+++ b/drivers/nvme/nvme.c -@@ -81,7 +81,7 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, - u64 *prp_pool; - int length = total_len; - int i, nprps; -- u32 prps_per_page = page_size >> 3; -+ u32 prps_per_page = (page_size >> 3) - 1; - u32 num_pages; - - length -= (page_size - offset); --- -2.35.3 - diff --git a/pkgs/misc/uboot/rpi-cm4/0003-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch b/pkgs/misc/uboot/rpi-cm4/0003-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch deleted file mode 100644 index b3fb1b51be49..000000000000 --- a/pkgs/misc/uboot/rpi-cm4/0003-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch +++ /dev/null @@ -1,30 +0,0 @@ -From bcc994f717e3835c66e5ff85d78f314a427312fa Mon Sep 17 00:00:00 2001 -From: Stefan Agner -Date: Thu, 7 Oct 2021 12:02:39 +0200 -Subject: [PATCH 3/8] usb: xhci-brcm: Make driver compatible with downstream - device tree - -The downstream device tree uses just "generic-xhci" as compatible -string. Use this string to make U-Boot work with the downstream Kernel. - -Signed-off-by: Stefan Agner ---- - drivers/usb/host/xhci-brcm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/usb/host/xhci-brcm.c b/drivers/usb/host/xhci-brcm.c -index fe17924028..0c6938187b 100644 ---- a/drivers/usb/host/xhci-brcm.c -+++ b/drivers/usb/host/xhci-brcm.c -@@ -82,7 +82,7 @@ static int xhci_brcm_deregister(struct udevice *dev) - } - - static const struct udevice_id xhci_brcm_ids[] = { -- { .compatible = "brcm,generic-xhci" }, -+ { .compatible = "generic-xhci" }, - { } - }; - --- -2.35.3 - diff --git a/pkgs/misc/uboot/rpi-cm4/0004-drivers-bcm283x-don-t-explicitly-disable-init.patch b/pkgs/misc/uboot/rpi-cm4/0004-drivers-bcm283x-don-t-explicitly-disable-init.patch deleted file mode 100644 index 630da9725e10..000000000000 --- a/pkgs/misc/uboot/rpi-cm4/0004-drivers-bcm283x-don-t-explicitly-disable-init.patch +++ /dev/null @@ -1,53 +0,0 @@ -From dcb1d1594345d89733559ed2ce19f5cfcf352512 Mon Sep 17 00:00:00 2001 -From: Stefan Agner -Date: Thu, 14 Apr 2022 12:15:26 +0200 -Subject: [PATCH 4/8] drivers: bcm283x: don't explicitly disable init - -It seems that the reason why init doesn't succeed is the lack of clock -support in U-Boot. Setting the default clock of 48MHz for the PL011 -UARTs makes reinitialization work consistently. - -Note that for the first UART the "skip-init" is anyways set in the -device tree. This will only affect probing of UARTs not enabled by -firmware. - -Signed-off-by: Stefan Agner ---- - drivers/serial/serial_bcm283x_pl011.c | 6 ------ - include/configs/rpi.h | 3 +++ - 2 files changed, 3 insertions(+), 6 deletions(-) - -diff --git a/drivers/serial/serial_bcm283x_pl011.c b/drivers/serial/serial_bcm283x_pl011.c -index 2d2e970316..182274036c 100644 ---- a/drivers/serial/serial_bcm283x_pl011.c -+++ b/drivers/serial/serial_bcm283x_pl011.c -@@ -51,12 +51,6 @@ static int bcm283x_pl011_serial_probe(struct udevice *dev) - if (ret) - return ret; - -- /* -- * TODO: Reinitialization doesn't always work for now, just skip -- * init always - we know we're already initialized -- */ -- plat->skip_init = true; -- - return pl01x_serial_probe(dev); - } - -diff --git a/include/configs/rpi.h b/include/configs/rpi.h -index e24c94c7d2..98ba4dc052 100644 ---- a/include/configs/rpi.h -+++ b/include/configs/rpi.h -@@ -40,6 +40,9 @@ - #define CONFIG_SYS_BOOTM_LEN SZ_64M - #endif - -+/* Define PL011 default clock */ -+#define CONFIG_PL011_CLOCK 48000000 -+ - /* Devices */ - /* GPIO */ - #define CONFIG_BCM2835_GPIO --- -2.35.3 - diff --git a/pkgs/misc/uboot/rpi-cm4/0005-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch b/pkgs/misc/uboot/rpi-cm4/0005-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch deleted file mode 100644 index bee1422e0e06..000000000000 --- a/pkgs/misc/uboot/rpi-cm4/0005-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch +++ /dev/null @@ -1,65 +0,0 @@ -From f014611eb8b2ff2b46c9065ee354ca872a019273 Mon Sep 17 00:00:00 2001 -From: Stefan Agner -Date: Thu, 14 Apr 2022 12:18:41 +0200 -Subject: [PATCH 5/8] drivers: bcm283x: allow to spawn any PL011 UART - -The current code checks pinmux for the first PL011 only. Raspberry Pi 4 -has multiple PL011 UARTs. This code prevents probing of other UARTs in -case the first PL011 UART is not active. - -Furthermore, U-Boot supports pinmuxing, hence the pins should be muxed -at this point anyway. Drop the check entirly. - -This allows to use other UARTs as stdout paths (e.g. stdout-path = -"serial5:115200n8"). - -Signed-off-by: Stefan Agner ---- - drivers/serial/serial_bcm283x_pl011.c | 27 --------------------------- - 1 file changed, 27 deletions(-) - -diff --git a/drivers/serial/serial_bcm283x_pl011.c b/drivers/serial/serial_bcm283x_pl011.c -index 182274036c..98628e1ca4 100644 ---- a/drivers/serial/serial_bcm283x_pl011.c -+++ b/drivers/serial/serial_bcm283x_pl011.c -@@ -11,37 +11,10 @@ - #include - #include "serial_pl01x_internal.h" - --/* -- * Check if this serial device is muxed -- * -- * The serial device will only work properly if it has been muxed to the serial -- * pins by firmware. Check whether that happened here. -- * -- * @return true if serial device is muxed, false if not -- */ --static bool bcm283x_is_serial_muxed(void) --{ -- int serial_gpio = 15; -- struct udevice *dev; -- -- if (uclass_first_device(UCLASS_PINCTRL, &dev) || !dev) -- return false; -- -- if (pinctrl_get_gpio_mux(dev, 0, serial_gpio) != BCM2835_GPIO_ALT0) -- return false; -- -- return true; --} -- - static int bcm283x_pl011_serial_probe(struct udevice *dev) - { -- struct pl01x_serial_plat *plat = dev_get_plat(dev); - int ret; - -- /* Don't spawn the device if it's not muxed */ -- if (!bcm283x_is_serial_muxed()) -- return -ENODEV; -- - /* - * Read the ofdata here rather than in an of_to_plat() method - * since we need the soc simple-bus to be probed so that the 'ranges' --- -2.35.3 - diff --git a/pkgs/misc/uboot/rpi-cm4/0006-nvme-improve-readability-of-nvme_setup_prps.patch b/pkgs/misc/uboot/rpi-cm4/0006-nvme-improve-readability-of-nvme_setup_prps.patch deleted file mode 100644 index 3ac635933f17..000000000000 --- a/pkgs/misc/uboot/rpi-cm4/0006-nvme-improve-readability-of-nvme_setup_prps.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 313fb277fae1c8687e93772663e37108363e9e7d Mon Sep 17 00:00:00 2001 -From: Stefan Agner -Date: Thu, 23 Sep 2021 23:52:44 +0200 -Subject: [PATCH 6/8] nvme: improve readability of nvme_setup_prps() - -Improve readability by introducing consts, reuse consts where -appropriate and adding variables with discriptive name. - -Signed-off-by: Stefan Agner ---- - drivers/nvme/nvme.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c -index 3bda491e12..1601651449 100644 ---- a/drivers/nvme/nvme.c -+++ b/drivers/nvme/nvme.c -@@ -76,12 +76,12 @@ static int nvme_wait_ready(struct nvme_dev *dev, bool enabled) - static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, - int total_len, u64 dma_addr) - { -- u32 page_size = dev->page_size; -+ const u32 page_size = dev->page_size; -+ const u32 prps_per_page = (page_size >> 3) - 1; - int offset = dma_addr & (page_size - 1); - u64 *prp_pool; - int length = total_len; - int i, nprps; -- u32 prps_per_page = (page_size >> 3) - 1; - u32 num_pages; - - length -= (page_size - offset); -@@ -119,9 +119,9 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, - prp_pool = dev->prp_pool; - i = 0; - while (nprps) { -- if (i == ((page_size >> 3) - 1)) { -- *(prp_pool + i) = cpu_to_le64((ulong)prp_pool + -- page_size); -+ if (i == prps_per_page) { -+ u64 next_prp_list = (u64)prp_pool + page_size; -+ *(prp_pool + i) = cpu_to_le64(next_prp_list); - i = 0; - prp_pool += page_size; - } --- -2.35.3 - diff --git a/pkgs/misc/uboot/rpi-cm4/0007-nvme-Use-pointer-for-CPU-addressed-buffers.patch b/pkgs/misc/uboot/rpi-cm4/0007-nvme-Use-pointer-for-CPU-addressed-buffers.patch deleted file mode 100644 index 5b97f4717908..000000000000 --- a/pkgs/misc/uboot/rpi-cm4/0007-nvme-Use-pointer-for-CPU-addressed-buffers.patch +++ /dev/null @@ -1,260 +0,0 @@ -From fa2fff362077ed6939659b9d5a42ae38cb2c9e24 Mon Sep 17 00:00:00 2001 -From: Stefan Agner -Date: Thu, 23 Sep 2021 23:58:35 +0200 -Subject: [PATCH 7/8] nvme: Use pointer for CPU addressed buffers - -Pass buffers which use CPU addressing as void pointers. This aligns with -DMA APIs which use void pointers as argument. It will avoid unnecessary -type casts when adding support bus address translations. - -Signed-off-by: Stefan Agner ---- - drivers/nvme/nvme.c | 50 ++++++++++++++++++++-------------------- - drivers/nvme/nvme_show.c | 4 ++-- - include/nvme.h | 12 +++++----- - 3 files changed, 33 insertions(+), 33 deletions(-) - -diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c -index 1601651449..6ab94ada7e 100644 ---- a/drivers/nvme/nvme.c -+++ b/drivers/nvme/nvme.c -@@ -74,11 +74,11 @@ static int nvme_wait_ready(struct nvme_dev *dev, bool enabled) - } - - static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, -- int total_len, u64 dma_addr) -+ int total_len, void *buffer) - { - const u32 page_size = dev->page_size; - const u32 prps_per_page = (page_size >> 3) - 1; -- int offset = dma_addr & (page_size - 1); -+ int offset = (uintptr_t)buffer & (page_size - 1); - u64 *prp_pool; - int length = total_len; - int i, nprps; -@@ -92,10 +92,10 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, - } - - if (length) -- dma_addr += (page_size - offset); -+ buffer += (page_size - offset); - - if (length <= page_size) { -- *prp2 = dma_addr; -+ *prp2 = (u64)buffer; - return 0; - } - -@@ -125,11 +125,11 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, - i = 0; - prp_pool += page_size; - } -- *(prp_pool + i++) = cpu_to_le64(dma_addr); -- dma_addr += page_size; -+ *(prp_pool + i++) = cpu_to_le64((u64)buffer); -+ buffer += page_size; - nprps--; - } -- *prp2 = (ulong)dev->prp_pool; -+ *prp2 = (u64)dev->prp_pool; - - flush_dcache_range((ulong)dev->prp_pool, (ulong)dev->prp_pool + - dev->prp_entry_num * sizeof(u64)); -@@ -450,42 +450,42 @@ static int nvme_alloc_sq(struct nvme_dev *dev, u16 qid, - } - - int nvme_identify(struct nvme_dev *dev, unsigned nsid, -- unsigned cns, dma_addr_t dma_addr) -+ unsigned int cns, void *buffer) - { - struct nvme_command c; - u32 page_size = dev->page_size; -- int offset = dma_addr & (page_size - 1); -+ int offset = (uintptr_t)buffer & (page_size - 1); - int length = sizeof(struct nvme_id_ctrl); - int ret; - - memset(&c, 0, sizeof(c)); - c.identify.opcode = nvme_admin_identify; - c.identify.nsid = cpu_to_le32(nsid); -- c.identify.prp1 = cpu_to_le64(dma_addr); -+ c.identify.prp1 = cpu_to_le64((u64)buffer); - - length -= (page_size - offset); - if (length <= 0) { - c.identify.prp2 = 0; - } else { -- dma_addr += (page_size - offset); -- c.identify.prp2 = cpu_to_le64(dma_addr); -+ buffer += (page_size - offset); -+ c.identify.prp2 = cpu_to_le64((u64)buffer); - } - - c.identify.cns = cpu_to_le32(cns); - -- invalidate_dcache_range(dma_addr, -- dma_addr + sizeof(struct nvme_id_ctrl)); -+ invalidate_dcache_range((uintptr_t)buffer, -+ (uintptr_t)buffer + sizeof(struct nvme_id_ctrl)); - - ret = nvme_submit_admin_cmd(dev, &c, NULL); - if (!ret) -- invalidate_dcache_range(dma_addr, -- dma_addr + sizeof(struct nvme_id_ctrl)); -+ invalidate_dcache_range((uintptr_t)buffer, -+ (uintptr_t)buffer + sizeof(struct nvme_id_ctrl)); - - return ret; - } - - int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, -- dma_addr_t dma_addr, u32 *result) -+ void *buffer, u32 *result) - { - struct nvme_command c; - int ret; -@@ -493,7 +493,7 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, - memset(&c, 0, sizeof(c)); - c.features.opcode = nvme_admin_get_features; - c.features.nsid = cpu_to_le32(nsid); -- c.features.prp1 = cpu_to_le64(dma_addr); -+ c.features.prp1 = cpu_to_le64((u64)buffer); - c.features.fid = cpu_to_le32(fid); - - ret = nvme_submit_admin_cmd(dev, &c, result); -@@ -513,13 +513,13 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, - } - - int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11, -- dma_addr_t dma_addr, u32 *result) -+ void *buffer, u32 *result) - { - struct nvme_command c; - - memset(&c, 0, sizeof(c)); - c.features.opcode = nvme_admin_set_features; -- c.features.prp1 = cpu_to_le64(dma_addr); -+ c.features.prp1 = cpu_to_le64((u64)buffer); - c.features.fid = cpu_to_le32(fid); - c.features.dword11 = cpu_to_le32(dword11); - -@@ -570,7 +570,7 @@ static int nvme_set_queue_count(struct nvme_dev *dev, int count) - u32 q_count = (count - 1) | ((count - 1) << 16); - - status = nvme_set_features(dev, NVME_FEAT_NUM_QUEUES, -- q_count, 0, &result); -+ q_count, NULL, &result); - - if (status < 0) - return status; -@@ -622,7 +622,7 @@ static int nvme_get_info_from_identify(struct nvme_dev *dev) - if (!ctrl) - return -ENOMEM; - -- ret = nvme_identify(dev, 0, 1, (dma_addr_t)(long)ctrl); -+ ret = nvme_identify(dev, 0, 1, ctrl); - if (ret) { - free(ctrl); - return -EIO; -@@ -708,7 +708,7 @@ static int nvme_blk_probe(struct udevice *udev) - ns->dev = ndev; - /* extract the namespace id from the block device name */ - ns->ns_id = trailing_strtol(udev->name); -- if (nvme_identify(ndev, ns->ns_id, 0, (dma_addr_t)(long)id)) { -+ if (nvme_identify(ndev, ns->ns_id, 0, id)) { - free(id); - return -EIO; - } -@@ -743,7 +743,7 @@ static ulong nvme_blk_rw(struct udevice *udev, lbaint_t blknr, - u64 prp2; - u64 total_len = blkcnt << desc->log2blksz; - u64 temp_len = total_len; -- uintptr_t temp_buffer = (uintptr_t)buffer; -+ void *temp_buffer = buffer; - - u64 slba = blknr; - u16 lbas = 1 << (dev->max_transfer_shift - ns->lba_shift); -@@ -890,7 +890,7 @@ static int nvme_probe(struct udevice *udev) - char name[20]; - - memset(id, 0, sizeof(*id)); -- if (nvme_identify(ndev, i, 0, (dma_addr_t)(long)id)) { -+ if (nvme_identify(ndev, i, 0, id)) { - ret = -EIO; - goto free_id; - } -diff --git a/drivers/nvme/nvme_show.c b/drivers/nvme/nvme_show.c -index 15e459da1a..c30adfada5 100644 ---- a/drivers/nvme/nvme_show.c -+++ b/drivers/nvme/nvme_show.c -@@ -111,14 +111,14 @@ int nvme_print_info(struct udevice *udev) - ALLOC_CACHE_ALIGN_BUFFER(char, buf_ctrl, sizeof(struct nvme_id_ctrl)); - struct nvme_id_ctrl *ctrl = (struct nvme_id_ctrl *)buf_ctrl; - -- if (nvme_identify(dev, 0, 1, (dma_addr_t)(long)ctrl)) -+ if (nvme_identify(dev, 0, 1, ctrl)) - return -EIO; - - print_optional_admin_cmd(le16_to_cpu(ctrl->oacs), ns->devnum); - print_optional_nvm_cmd(le16_to_cpu(ctrl->oncs), ns->devnum); - print_format_nvme_attributes(ctrl->fna, ns->devnum); - -- if (nvme_identify(dev, ns->ns_id, 0, (dma_addr_t)(long)id)) -+ if (nvme_identify(dev, ns->ns_id, 0, id)) - return -EIO; - - print_formats(id, ns); -diff --git a/include/nvme.h b/include/nvme.h -index 2cdf8ce320..8ff823cd81 100644 ---- a/include/nvme.h -+++ b/include/nvme.h -@@ -18,12 +18,12 @@ struct nvme_dev; - * @dev: NVMe controller device - * @nsid: 0 for controller, namespace id for namespace to identify - * @cns: 1 for controller, 0 for namespace -- * @dma_addr: dma buffer address to store the identify result -+ * @buffer: dma buffer address to store the identify result - * @return: 0 on success, -ETIMEDOUT on command execution timeout, - * -EIO on command execution fails - */ - int nvme_identify(struct nvme_dev *dev, unsigned nsid, -- unsigned cns, dma_addr_t dma_addr); -+ unsigned int cns, void *buffer); - - /** - * nvme_get_features - retrieve the attributes of the feature specified -@@ -33,13 +33,13 @@ int nvme_identify(struct nvme_dev *dev, unsigned nsid, - * @dev: NVMe controller device - * @fid: feature id to provide data - * @nsid: namespace id the command applies to -- * @dma_addr: data structure used as part of the specified feature -+ * @buffer: data structure used as part of the specified feature - * @result: command-specific result in the completion queue entry - * @return: 0 on success, -ETIMEDOUT on command execution timeout, - * -EIO on command execution fails - */ - int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, -- dma_addr_t dma_addr, u32 *result); -+ void *buffer, u32 *result); - - /** - * nvme_set_features - specify the attributes of the feature indicated -@@ -49,13 +49,13 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, - * @dev: NVMe controller device - * @fid: feature id to provide data - * @dword11: command-specific input parameter -- * @dma_addr: data structure used as part of the specified feature -+ * @buffer: data structure used as part of the specified feature - * @result: command-specific result in the completion queue entry - * @return: 0 on success, -ETIMEDOUT on command execution timeout, - * -EIO on command execution fails - */ - int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11, -- dma_addr_t dma_addr, u32 *result); -+ void *buffer, u32 *result); - - /** - * nvme_scan_namespace - scan all namespaces attached to NVMe controllers --- -2.35.3 - diff --git a/pkgs/misc/uboot/rpi-cm4/0008-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch b/pkgs/misc/uboot/rpi-cm4/0008-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch deleted file mode 100644 index fcb9c5311780..000000000000 --- a/pkgs/misc/uboot/rpi-cm4/0008-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch +++ /dev/null @@ -1,195 +0,0 @@ -From e3c3029de7f7e60e9f0aedd99a8eaf76ed7214ea Mon Sep 17 00:00:00 2001 -From: Stefan Agner -Date: Fri, 24 Sep 2021 00:27:39 +0200 -Subject: [PATCH 8/8] nvme: translate virtual addresses into the bus's address - space - -So far we've been content with passing physical/CPU addresses when -configuring memory addresses into NVMe controllers, but not all -platforms have buses with transparent mappings. Specifically the -Raspberry Pi 4 might introduce an offset to memory accesses incoming -from its PCIe port. - -Introduce nvme_virt_to_bus() and nvme_bus_to_virt() to cater with these -limitations, and make sure we don't break non DM users. -For devices where PCIe's view of host memory doesn't match the memory -as seen by the CPU. - -A similar change has been introduced for XHCI controller with -commit 1a474559d90a ("xhci: translate virtual addresses into the bus's -address space"). - -Signed-off-by: Stefan Agner ---- - drivers/nvme/nvme.c | 32 ++++++++++++++++++-------------- - drivers/nvme/nvme.h | 15 +++++++++++++++ - 2 files changed, 33 insertions(+), 14 deletions(-) - -diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c -index 6ab94ada7e..dd190bd654 100644 ---- a/drivers/nvme/nvme.c -+++ b/drivers/nvme/nvme.c -@@ -95,7 +95,7 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, - buffer += (page_size - offset); - - if (length <= page_size) { -- *prp2 = (u64)buffer; -+ *prp2 = nvme_virt_to_bus(dev, buffer); - return 0; - } - -@@ -120,16 +120,16 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, - i = 0; - while (nprps) { - if (i == prps_per_page) { -- u64 next_prp_list = (u64)prp_pool + page_size; -- *(prp_pool + i) = cpu_to_le64(next_prp_list); -+ u64 next = nvme_virt_to_bus(dev, prp_pool + page_size); -+ *(prp_pool + i) = cpu_to_le64(next); - i = 0; - prp_pool += page_size; - } -- *(prp_pool + i++) = cpu_to_le64((u64)buffer); -+ *(prp_pool + i++) = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); - buffer += page_size; - nprps--; - } -- *prp2 = (u64)dev->prp_pool; -+ *prp2 = nvme_virt_to_bus(dev, dev->prp_pool); - - flush_dcache_range((ulong)dev->prp_pool, (ulong)dev->prp_pool + - dev->prp_entry_num * sizeof(u64)); -@@ -356,6 +356,7 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev) - int result; - u32 aqa; - u64 cap = dev->cap; -+ u64 dma_addr; - struct nvme_queue *nvmeq; - /* most architectures use 4KB as the page size */ - unsigned page_shift = 12; -@@ -396,8 +397,10 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev) - dev->ctrl_config |= NVME_CC_IOSQES | NVME_CC_IOCQES; - - writel(aqa, &dev->bar->aqa); -- nvme_writeq((ulong)nvmeq->sq_cmds, &dev->bar->asq); -- nvme_writeq((ulong)nvmeq->cqes, &dev->bar->acq); -+ dma_addr = nvme_virt_to_bus(dev, nvmeq->sq_cmds); -+ nvme_writeq(dma_addr, &dev->bar->asq); -+ dma_addr = nvme_virt_to_bus(dev, nvmeq->cqes); -+ nvme_writeq(dma_addr, &dev->bar->acq); - - result = nvme_enable_ctrl(dev); - if (result) -@@ -423,7 +426,7 @@ static int nvme_alloc_cq(struct nvme_dev *dev, u16 qid, - - memset(&c, 0, sizeof(c)); - c.create_cq.opcode = nvme_admin_create_cq; -- c.create_cq.prp1 = cpu_to_le64((ulong)nvmeq->cqes); -+ c.create_cq.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, nvmeq->cqes)); - c.create_cq.cqid = cpu_to_le16(qid); - c.create_cq.qsize = cpu_to_le16(nvmeq->q_depth - 1); - c.create_cq.cq_flags = cpu_to_le16(flags); -@@ -440,7 +443,7 @@ static int nvme_alloc_sq(struct nvme_dev *dev, u16 qid, - - memset(&c, 0, sizeof(c)); - c.create_sq.opcode = nvme_admin_create_sq; -- c.create_sq.prp1 = cpu_to_le64((ulong)nvmeq->sq_cmds); -+ c.create_sq.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, nvmeq->sq_cmds)); - c.create_sq.sqid = cpu_to_le16(qid); - c.create_sq.qsize = cpu_to_le16(nvmeq->q_depth - 1); - c.create_sq.sq_flags = cpu_to_le16(flags); -@@ -461,14 +464,14 @@ int nvme_identify(struct nvme_dev *dev, unsigned nsid, - memset(&c, 0, sizeof(c)); - c.identify.opcode = nvme_admin_identify; - c.identify.nsid = cpu_to_le32(nsid); -- c.identify.prp1 = cpu_to_le64((u64)buffer); -+ c.identify.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); - - length -= (page_size - offset); - if (length <= 0) { - c.identify.prp2 = 0; - } else { - buffer += (page_size - offset); -- c.identify.prp2 = cpu_to_le64((u64)buffer); -+ c.identify.prp2 = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); - } - - c.identify.cns = cpu_to_le32(cns); -@@ -493,7 +496,7 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, - memset(&c, 0, sizeof(c)); - c.features.opcode = nvme_admin_get_features; - c.features.nsid = cpu_to_le32(nsid); -- c.features.prp1 = cpu_to_le64((u64)buffer); -+ c.features.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); - c.features.fid = cpu_to_le32(fid); - - ret = nvme_submit_admin_cmd(dev, &c, result); -@@ -519,7 +522,7 @@ int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11, - - memset(&c, 0, sizeof(c)); - c.features.opcode = nvme_admin_set_features; -- c.features.prp1 = cpu_to_le64((u64)buffer); -+ c.features.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); - c.features.fid = cpu_to_le32(fid); - c.features.dword11 = cpu_to_le32(dword11); - -@@ -776,7 +779,7 @@ static ulong nvme_blk_rw(struct udevice *udev, lbaint_t blknr, - c.rw.slba = cpu_to_le64(slba); - slba += lbas; - c.rw.length = cpu_to_le16(lbas - 1); -- c.rw.prp1 = cpu_to_le64(temp_buffer); -+ c.rw.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, temp_buffer)); - c.rw.prp2 = cpu_to_le64(prp2); - status = nvme_submit_sync_cmd(dev->queues[NVME_IO_Q], - &c, NULL, IO_TIMEOUT); -@@ -835,6 +838,7 @@ static int nvme_probe(struct udevice *udev) - struct nvme_id_ns *id; - - ndev->instance = trailing_strtol(udev->name); -+ ndev->dev = udev->parent; - - INIT_LIST_HEAD(&ndev->namespaces); - ndev->bar = dm_pci_map_bar(udev, PCI_BASE_ADDRESS_0, -diff --git a/drivers/nvme/nvme.h b/drivers/nvme/nvme.h -index c6aae4da5d..31e6899bca 100644 ---- a/drivers/nvme/nvme.h -+++ b/drivers/nvme/nvme.h -@@ -7,8 +7,15 @@ - #ifndef __DRIVER_NVME_H__ - #define __DRIVER_NVME_H__ - -+#include - #include - -+#if CONFIG_IS_ENABLED(DM_USB) -+#define nvme_to_dev(_dev) _dev->dev -+#else -+#define nvme_to_dev(_dev) NULL -+#endif -+ - struct nvme_id_power_state { - __le16 max_power; /* centiwatts */ - __u8 rsvd2; -@@ -596,6 +603,9 @@ enum { - - /* Represents an NVM Express device. Each nvme_dev is a PCI function. */ - struct nvme_dev { -+#if CONFIG_IS_ENABLED(DM_USB) -+ struct udevice *dev; -+#endif - struct list_head node; - struct nvme_queue **queues; - u32 __iomem *dbs; -@@ -635,4 +645,9 @@ struct nvme_ns { - u8 flbas; - }; - -+static inline dma_addr_t nvme_virt_to_bus(struct nvme_dev *dev, void *addr) -+{ -+ return dev_phys_to_bus(nvme_to_dev(dev), virt_to_phys(addr)); -+} -+ - #endif /* __DRIVER_NVME_H__ */ --- -2.35.3 - From 1976ab0a528e082512cc5048970b7a9e691fb177 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Wed, 27 Apr 2022 10:45:38 +0800 Subject: [PATCH 23/29] dfeet: add teams.gnome.members to maintainers --- pkgs/development/tools/misc/d-feet/default.nix | 1 + pkgs/tools/networking/sstp/default.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/pkgs/development/tools/misc/d-feet/default.nix b/pkgs/development/tools/misc/d-feet/default.nix index 1c6de2149f76..d105dd61665b 100644 --- a/pkgs/development/tools/misc/d-feet/default.nix +++ b/pkgs/development/tools/misc/d-feet/default.nix @@ -89,5 +89,6 @@ python3.pkgs.buildPythonApplication rec { homepage = "https://wiki.gnome.org/Apps/DFeet"; platforms = platforms.linux; license = licenses.gpl2; + maintainers = teams.gnome.members; }; } diff --git a/pkgs/tools/networking/sstp/default.nix b/pkgs/tools/networking/sstp/default.nix index 8ddb27238bc1..77f86458ad15 100644 --- a/pkgs/tools/networking/sstp/default.nix +++ b/pkgs/tools/networking/sstp/default.nix @@ -28,6 +28,7 @@ stdenv.mkDerivation rec { description = "SSTP client for Linux"; homepage = "http://sstp-client.sourceforge.net/"; platforms = platforms.linux; + maintainers = with maintainers; [ ]; license = licenses.gpl2Plus; }; } From 80d4480778f581d5b73e4464eeb08ae0974e72c2 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Tue, 26 Apr 2022 20:23:50 -0700 Subject: [PATCH 24/29] sd-image-aarch64: deduplicate cm4 section --- nixos/modules/installer/sd-card/sd-image-aarch64.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/nixos/modules/installer/sd-card/sd-image-aarch64.nix b/nixos/modules/installer/sd-card/sd-image-aarch64.nix index dde98396d876..cf01005fdc8a 100644 --- a/nixos/modules/installer/sd-card/sd-image-aarch64.nix +++ b/nixos/modules/installer/sd-card/sd-image-aarch64.nix @@ -40,11 +40,6 @@ arm_boost=1 [cm4] - kernel=u-boot-rpi4.bin - enable_gic=1 - armstub=armstub8-gic.bin - disable_overscan=1 - # 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. From 8dd84e8e7125f3644f3b3a82fdeb8c2c795b09dd Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 27 Apr 2022 03:31:49 +0000 Subject: [PATCH 25/29] gnome.ghex: 42.1 -> 42.2 --- pkgs/desktops/gnome/apps/ghex/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/gnome/apps/ghex/default.nix b/pkgs/desktops/gnome/apps/ghex/default.nix index 3cbc2b2cfddf..5a0722af21ce 100644 --- a/pkgs/desktops/gnome/apps/ghex/default.nix +++ b/pkgs/desktops/gnome/apps/ghex/default.nix @@ -20,13 +20,13 @@ stdenv.mkDerivation rec { pname = "ghex"; - version = "42.1"; + version = "42.2"; outputs = [ "out" "dev" "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/ghex/${lib.versions.major version}/${pname}-${version}.tar.xz"; - sha256 = "8QMj08MvvRqDFU+/0qJ+yj7pDZwbJSNfGxX+3l+xE6M="; + sha256 = "Rd6Oa4ofMd5amRC+GMB/CaMo2HU434BAOuxa+IF8ljE="; }; nativeBuildInputs = [ From 4a0b1df9fc1d367de3652857567cfbc056f38de1 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 27 Apr 2022 03:38:10 +0000 Subject: [PATCH 26/29] gnome.gnome-calendar: 42.0 -> 42.1 --- pkgs/desktops/gnome/apps/gnome-calendar/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/gnome/apps/gnome-calendar/default.nix b/pkgs/desktops/gnome/apps/gnome-calendar/default.nix index 10267a6c8701..058984ca7472 100644 --- a/pkgs/desktops/gnome/apps/gnome-calendar/default.nix +++ b/pkgs/desktops/gnome/apps/gnome-calendar/default.nix @@ -22,11 +22,11 @@ stdenv.mkDerivation rec { pname = "gnome-calendar"; - version = "42.0"; + version = "42.1"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.major version}/${pname}-${version}.tar.xz"; - sha256 = "tj9z9VAy/BOQRC+UzfazyrnJHHdN3S5cYez+ydLF6ao="; + sha256 = "0SKBy78a+GxyN1/mrZNG7Q4sLziKHq6FjOzmQGCm66g="; }; nativeBuildInputs = [ From 5ad3773d7f8eaac650aa1883f29671b517e235f2 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 27 Apr 2022 03:50:08 +0000 Subject: [PATCH 27/29] gnome.gnome-remote-desktop: 42.1 -> 42.1.1 --- pkgs/desktops/gnome/core/gnome-remote-desktop/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/gnome/core/gnome-remote-desktop/default.nix b/pkgs/desktops/gnome/core/gnome-remote-desktop/default.nix index 3d2ad08fc6d9..03788d943781 100644 --- a/pkgs/desktops/gnome/core/gnome-remote-desktop/default.nix +++ b/pkgs/desktops/gnome/core/gnome-remote-desktop/default.nix @@ -28,11 +28,11 @@ stdenv.mkDerivation rec { pname = "gnome-remote-desktop"; - version = "42.1"; + version = "42.1.1"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.major version}/${pname}-${version}.tar.xz"; - hash = "sha256-ATHuOY32n2tOZ9YU1pElatZJgihCRXQU64iaI7/rmfo="; + hash = "sha256-pEZqYsL+7GLn9XLwkpxY24iyXWCVuv5LFZHpnPqaDuY="; }; nativeBuildInputs = [ From 22bb11f3016d86bfd0cf6db992343a25559e358b Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 27 Apr 2022 03:59:12 +0000 Subject: [PATCH 28/29] gnome.gnome-software: 42.0 -> 42.1 --- pkgs/desktops/gnome/core/gnome-software/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/gnome/core/gnome-software/default.nix b/pkgs/desktops/gnome/core/gnome-software/default.nix index e89f616680c7..2dc810ee0502 100644 --- a/pkgs/desktops/gnome/core/gnome-software/default.nix +++ b/pkgs/desktops/gnome/core/gnome-software/default.nix @@ -42,11 +42,11 @@ in stdenv.mkDerivation rec { pname = "gnome-software"; - version = "42.0"; + version = "42.1"; src = fetchurl { url = "mirror://gnome/sources/gnome-software/${lib.versions.major version}/${pname}-${version}.tar.xz"; - sha256 = "QsaF4u95li6zCo6VjHA8mh899zFQQiOgYos7Yk733B4="; + sha256 = "MtAFaYoAuK5er5Hk5/hlnvQwCnmPyuaiK3TC1/z2pIY="; }; patches = [ From 85919894405c54467e978a7e580f85f48f939ef7 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 27 Apr 2022 04:11:36 +0000 Subject: [PATCH 29/29] gnome.zenity: 3.42.0 -> 3.42.1 --- pkgs/desktops/gnome/core/zenity/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/gnome/core/zenity/default.nix b/pkgs/desktops/gnome/core/zenity/default.nix index bca93ca7bc56..8429282ab365 100644 --- a/pkgs/desktops/gnome/core/zenity/default.nix +++ b/pkgs/desktops/gnome/core/zenity/default.nix @@ -15,11 +15,11 @@ stdenv.mkDerivation rec { pname = "zenity"; - version = "3.42.0"; + version = "3.42.1"; src = fetchurl { url = "mirror://gnome/sources/zenity/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "wkx/5rtDFjztit8jLVg7LgE9O6bCjetfz4B5hePete8="; + sha256 = "oI4MjmJmFe4sI/90Yo66b4tIaHXdVDccp+LXYFtyqHw="; }; nativeBuildInputs = [