From 3e6bae2fa43d4d12ebd15e9f38a984e06643f7d7 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 23 Nov 2025 00:18:54 +0100 Subject: [PATCH 1/5] lib/systems/platforms: Add ppc64 --- lib/systems/platforms.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix index 9c9010b9fb46..225ad16bfdc4 100644 --- a/lib/systems/platforms.nix +++ b/lib/systems/platforms.nix @@ -22,6 +22,10 @@ rec { linux-kernel.autoModules = false; }; + ## + ## POWER + ## + powernv = { linux-kernel = { name = "PowerNV"; @@ -42,6 +46,16 @@ rec { }; }; + ppc64 = { + linux-kernel = { + name = "powerpc64"; + + baseConfig = "ppc64_defconfig"; + target = "vmlinux"; + autoModules = true; + }; + }; + ## ## ARM ## @@ -628,8 +642,8 @@ rec { else if platform.parsed.cpu == lib.systems.parse.cpuTypes.mipsel then (import ./examples.nix { inherit lib; }).mipsel-linux-gnu - else if platform.parsed.cpu == lib.systems.parse.cpuTypes.powerpc64le then - powernv + else if platform.isPower64 then + if platform.isLittleEndian then powernv else ppc64 else if platform.isLoongArch64 then loongarch64-multiplatform From 0427dabcb175ebad5d02abe461a1efe7d120da22 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Wed, 10 Dec 2025 08:13:18 +0100 Subject: [PATCH 2/5] linux/common-config: Add settings for 64-bit POWER --- pkgs/os-specific/linux/kernel/common-config.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index cfbe9dac4eb4..1626f9f29d09 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -986,6 +986,9 @@ let XEN_PVHVM = option yes; XEN_SAVE_RESTORE = option yes; + # Disabled by default on POWER + VIRTIO_MENU = yes; + # Enable device detection on virtio-mmio hypervisors VIRTIO_MMIO_CMDLINE_DEVICES = yes; @@ -1433,6 +1436,10 @@ let # Enable coreboot firmware drivers. # While these are called CONFIG_GOOGLE_*, they apply to coreboot systems in general. GOOGLE_FIRMWARE = yes; + + # Disabled by default on POWER + ATA_BMDMA = yes; + ATA_SFF = yes; } // lib.optionalAttrs @@ -1548,6 +1555,11 @@ let # Enable Intel Turbo Boost Max 3.0 INTEL_TURBO_MAX_3 = yes; + } + // lib.optionalAttrs (stdenv.hostPlatform.isPower64) { + # avoid driver/FS trouble arising from unusual page size + PPC_64K_PAGES = no; + PPC_4K_PAGES = yes; }; accel = { From 99bf69cd043d30c8a913827a013f689a95d68763 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 23 Nov 2025 00:21:17 +0100 Subject: [PATCH 3/5] linux: Strip vmlinux in out output when present Because it isn't stripped by default, and is outside of the list of paths that we strip automatically. dev output is expected to have an unstripped vmlinux, so stripping this one should be fine. --- pkgs/os-specific/linux/kernel/build.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/os-specific/linux/kernel/build.nix b/pkgs/os-specific/linux/kernel/build.nix index b52959f681a2..90aa0c0b00c1 100644 --- a/pkgs/os-specific/linux/kernel/build.nix +++ b/pkgs/os-specific/linux/kernel/build.nix @@ -504,6 +504,12 @@ lib.makeOverridable ( export HOME=${installkernel} ''; + preFixup = '' + if [ -z "''${dontStrip-}" -a -e $out/vmlinux ]; then + strip -v -S -p $out/vmlinux + fi + ''; + requiredSystemFeatures = [ "big-parallel" ]; passthru = rec { From 2a6945e55370a8673e67e8a0221826503e282c31 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Wed, 7 Jan 2026 15:10:10 +0100 Subject: [PATCH 4/5] lib/systems/platforms: Drop powernv extraConfig Settings are covered by ppc64 changes in common-config. --- lib/systems/platforms.nix | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix index 225ad16bfdc4..81baea4fdb76 100644 --- a/lib/systems/platforms.nix +++ b/lib/systems/platforms.nix @@ -33,16 +33,6 @@ rec { baseConfig = "powernv_defconfig"; target = "vmlinux"; autoModules = true; - # avoid driver/FS trouble arising from unusual page size - extraConfig = '' - PPC_64K_PAGES n - PPC_4K_PAGES y - IPV6 y - - ATA_BMDMA y - ATA_SFF y - VIRTIO_MENU y - ''; }; }; From 34b0a86bb23ff15fce8aea172b47293bd65e02e4 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Mon, 2 Feb 2026 12:52:31 +0100 Subject: [PATCH 5/5] linux: Build-in i2c-powermac on ppc64 systems https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=713943 --- pkgs/os-specific/linux/kernel/common-config.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index 1626f9f29d09..0a1400a18a30 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -1560,6 +1560,15 @@ let # avoid driver/FS trouble arising from unusual page size PPC_64K_PAGES = no; PPC_4K_PAGES = yes; + + # Does not get auto-loaded on relevant systems, makes fans stuck at max speed. + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=713943 (2014 :<) + # > This module ought to be auto-loaded where it's needed, but somehow that + # > has broken. I asked Benjamin Herrenschmidt (upstream powerpc maintainer + # > and the last person to touch it) and he was aware of this but hadn't got + # > round to working out why. The workaround is to build it in[…]. + # > (It won't do any harm on non-Mac systems.) + I2C_POWERMAC = yes; }; accel = {