diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix index c0b893fdf361..d34eed4c38b9 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"; @@ -29,16 +33,16 @@ 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 - ''; + ppc64 = { + linux-kernel = { + name = "powerpc64"; + + baseConfig = "ppc64_defconfig"; + target = "vmlinux"; + autoModules = true; }; }; @@ -625,8 +629,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 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 { diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index 5962bb521893..361defaffb4b 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -988,6 +988,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; @@ -1435,6 +1438,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 @@ -1550,6 +1557,20 @@ 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; + + # 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 = {