···
# Enable CPU lockup detection
SOFTLOCKUP_DETECTOR = yes;
92
-
HARDLOCKUP_DETECTOR = yes;
92
+
HARDLOCKUP_DETECTOR = lib.mkIf (
93
+
with stdenv.hostPlatform; isPower || isx86 || lib.versionAtLeast version "6.5"
# Enable streaming logs to a remote device over a network
···
# Collect ECC errors and retire pages that fail too often
219
+
RAS_CEC = lib.mkIf stdenv.hostPlatform.isx86 yes;
// lib.optionalAttrs (stdenv.hostPlatform.is32bit) {
# Enable access to the full memory range (aka PAE) on 32-bit architectures
···
437
+
FB_VESA = lib.mkIf stdenv.hostPlatform.isx86 yes;
FRAMEBUFFER_CONSOLE = yes;
FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER = yes;
FRAMEBUFFER_CONSOLE_ROTATION = yes;
···
# compile in DRM so simpledrm can load before initrd if necessary
463
+
AGP = lib.mkIf (with stdenv.hostPlatform; isPower || isx86) yes;
DRM_LEGACY = whenOlder "6.8" no;
···
# Allow specifying custom EDID on the kernel command line
DRM_LOAD_EDID_FIRMWARE = yes;
475
-
VGA_SWITCHEROO = yes; # Hybrid graphics support
476
-
DRM_GMA500 = whenAtLeast "5.12" module;
477
-
DRM_GMA600 = whenOlder "5.13" yes;
478
-
DRM_GMA3600 = whenOlder "5.12" yes;
479
-
DRM_VMWGFX_FBCON = whenOlder "6.1" yes;
477
+
VGA_SWITCHEROO = lib.mkIf stdenv.hostPlatform.isx86 yes; # Hybrid graphics support
478
+
DRM_GMA500 = lib.mkIf stdenv.hostPlatform.isx86 (whenAtLeast "5.12" module);
479
+
DRM_GMA600 = lib.mkIf stdenv.hostPlatform.isx86 (whenOlder "5.13" yes);
480
+
DRM_GMA3600 = lib.mkIf stdenv.hostPlatform.isx86 (whenOlder "5.12" yes);
481
+
DRM_VMWGFX_FBCON = lib.mkIf stdenv.hostPlatform.isx86 (whenOlder "6.1" yes);
# (experimental) amdgpu support for verde and newer chipsets
# (stable) amdgpu support for bonaire and newer chipsets
···
DRM_AMD_DC_DCN1_0 = whenOlder "5.6" yes;
DRM_AMD_DC_DCN2_0 = whenOlder "5.6" yes;
DRM_AMD_DC_DCN2_1 = whenOlder "5.6" yes;
491
-
DRM_AMD_DC_DCN3_0 = whenBetween "5.9" "5.11" yes;
492
-
DRM_AMD_DC_DCN = whenBetween "5.11" "6.4" yes;
493
+
DRM_AMD_DC_DCN3_0 = lib.mkIf (with stdenv.hostPlatform; isx86) (whenBetween "5.9" "5.11" yes);
494
+
DRM_AMD_DC_DCN = lib.mkIf (with stdenv.hostPlatform; isx86 || isPower64) (
495
+
whenBetween "5.11" "6.4" yes
DRM_AMD_DC_FP = whenAtLeast "6.4" yes;
DRM_AMD_DC_HDCP = whenBetween "5.5" "6.4" yes;
DRM_AMD_DC_SI = whenAtLeast "5.10" yes;
···
# Enable AMD secure display when available
501
-
DRM_AMD_SECURE_DISPLAY = whenAtLeast "5.13" yes;
505
+
DRM_AMD_SECURE_DISPLAY = lib.mkIf (
506
+
with stdenv.hostPlatform;
507
+
(lib.versionAtLeast version "5.13" && (isx86 || isPower64))
508
+
|| (lib.versionAtLeast version "6.2" && isAarch64 && !stdenv.cc.isClang)
509
+
|| (lib.versionAtLeast version "6.5" && isLoongarch64 && !stdenv.cc.isClang)
510
+
|| (lib.versionAtLeast version "6.10" && isRiscV64 && !stdenv.cc.isClang)
# Enable AMD image signal processor
DRM_AMD_ISP = whenAtLeast "6.11" yes;
···
828
-
MICROCODE_INTEL = whenOlder "6.6" yes;
829
-
MICROCODE_AMD = whenOlder "6.6" yes;
837
+
MICROCODE = lib.mkIf stdenv.hostPlatform.isx86 yes;
838
+
MICROCODE_INTEL = lib.mkIf stdenv.hostPlatform.isx86 (whenOlder "6.6" yes);
839
+
MICROCODE_AMD = lib.mkIf stdenv.hostPlatform.isx86 (whenOlder "6.6" yes);
# https://lwn.net/Articles/682582/
# https://bugzilla.kernel.org/show_bug.cgi?id=12309#c655
···
890
-
HYPERVISOR_GUEST = yes;
900
+
HYPERVISOR_GUEST = lib.mkIf stdenv.hostPlatform.isx86 yes;
PARAVIRT_SPINLOCKS = option yes;
893
-
KVM_ASYNC_PF = yes;
903
+
KVM_ASYNC_PF = lib.mkIf (with stdenv.hostPlatform; isS390 || isx86) yes;
KVM_GENERIC_DIRTYLOG_READ_PROTECT = yes;
905
+
KVM_GUEST = lib.mkIf (with stdenv.hostPlatform; isPower || isx86) yes;
···
tristate = lib.mkIf (!stdenv.hostPlatform.is64bit) "y";
906
-
VFIO_PCI_VGA = lib.mkIf stdenv.hostPlatform.is64bit yes;
916
+
VFIO_PCI_VGA = lib.mkIf stdenv.hostPlatform.isx86_64 yes;
···
# Allows soft-dirty tracking on pages, used by CRIU.
# See https://docs.kernel.org/admin-guide/mm/soft-dirty.html
1016
-
MEM_SOFT_DIRTY = lib.mkIf (!stdenv.hostPlatform.isx86_32) yes;
1026
+
MEM_SOFT_DIRTY = lib.mkIf (with stdenv.hostPlatform; isS390 || isPower64 || isx86_64) yes;
···
# stdenv.hostPlatform.linux-kernel.target assumes uncompressed on RISC-V.
KERNEL_UNCOMPRESSED = lib.mkIf stdenv.hostPlatform.isRiscV yes;
KERNEL_XZ = lib.mkIf (!stdenv.hostPlatform.isRiscV && !useZstd) yes;
1029
-
KERNEL_ZSTD = lib.mkIf (!stdenv.hostPlatform.isRiscV && useZstd) yes;
1039
+
KERNEL_ZSTD = lib.mkIf (
1040
+
with stdenv.hostPlatform;
1041
+
(isMips || isS390 || isx86 || (lib.versionAtLeast version "6.1" && isAarch64 || isLoongArch64))
HID_BATTERY_STRENGTH = yes;
# enabled by default in x86_64 but not arm64, so we do that here
···
# Allows debugging systems that get stuck during suspend/resume
1073
-
PM_TRACE_RTC = yes;
1087
+
PM_TRACE_RTC = lib.mkIf stdenv.hostPlatform.isx86 yes;
ACCESSIBILITY = yes; # Accessibility support
AUXDISPLAY = yes; # Auxiliary Display support
···
FRONTSWAP = whenOlder "6.6" yes;
FUSION = yes; # Fusion MPT device support
1145
-
IDE = whenOlder "5.14" no; # deprecated IDE support, removed in 5.14
1159
+
IDE = lib.mkIf (with stdenv.hostPlatform; isAarch32 || isM68k || isMips || isPower || isx86) (
1160
+
whenOlder "5.14" no
1161
+
); # deprecated IDE support, removed in 5.14
IDLE_PAGE_TRACKING = yes;
JOYSTICK_XPAD_FF = option yes; # X-Box gamepad rumble support
JOYSTICK_XPAD_LEDS = option yes; # LED Support for Xbox360 controller 'BigX' LED
1151
-
KEYBOARD_APPLESPI = module;
1167
+
KEYBOARD_APPLESPI = lib.mkIf stdenv.hostPlatform.isx86 module;
···
MOUSE_ELAN_I2C_SMBUS = yes;
MOUSE_PS2_ELANTECH = yes; # Elantech PS/2 protocol extension
1187
-
MOUSE_PS2_VMMOUSE = yes;
1188
-
MTRR_SANITIZER = yes;
1203
+
MOUSE_PS2_VMMOUSE = lib.mkIf stdenv.hostPlatform.isx86 yes;
1204
+
MTRR_SANITIZER = lib.mkIf stdenv.hostPlatform.isx86 yes;
NET_FC = yes; # Fibre Channel driver support
# Needed for touchpads to work on some AMD laptops
PINCTRL_AMD = whenAtLeast "5.19" yes;
# GPIO on Intel Bay Trail, for some Chromebook internal eMMC disks
1193
-
PINCTRL_BAYTRAIL = yes;
1209
+
PINCTRL_BAYTRAIL = lib.mkIf stdenv.hostPlatform.isx86 yes;
# GPIO for Braswell and Cherryview devices
# Needs to be built-in to for integrated keyboards to function properly
1196
-
PINCTRL_CHERRYVIEW = yes;
1212
+
PINCTRL_CHERRYVIEW = lib.mkIf stdenv.hostPlatform.isx86 yes;
# 8 is default. Modern gpt tables on eMMC may go far beyond 8.
MMC_BLOCK_MINORS = freeform "32";
···
1225
-
X86_CHECK_BIOS_CORRUPTION = yes;
1241
+
X86_CHECK_BIOS_CORRUPTION = lib.mkIf stdenv.hostPlatform.isx86 yes;
1242
+
X86_MCE = lib.mkIf stdenv.hostPlatform.isx86 yes;
RAS = yes; # Needed for EDAC support
···
1255
-
X86_AMD_PLATFORM_DEVICE = yes;
1256
-
X86_PLATFORM_DRIVERS_DELL = whenAtLeast "5.12" yes;
1257
-
X86_PLATFORM_DRIVERS_HP = whenAtLeast "6.1" yes;
1271
+
X86_AMD_PLATFORM_DEVICE = lib.mkIf stdenv.hostPlatform.isx86 yes;
1272
+
X86_PLATFORM_DRIVERS_DELL = lib.mkIf stdenv.hostPlatform.isx86 (whenAtLeast "5.12" yes);
1273
+
X86_PLATFORM_DRIVERS_HP = lib.mkIf stdenv.hostPlatform.isx86 (whenAtLeast "6.1" yes);
···
1341
-
CROS_EC_LPC = module;
1342
-
CROS_EC_ISHTP = module;
CROS_KBD_LED_BACKLIGHT = module;
TCG_TIS_SPI_CR50 = whenAtLeast "5.5" yes;
···
CP15_BARRIER_EMULATION = lib.mkIf (stdenv.hostPlatform.system == "aarch64-linux") yes;
// lib.optionalAttrs (stdenv.hostPlatform.system == "x86_64-linux") {
1413
+
CROS_EC_LPC = module;
1414
+
CROS_EC_ISHTP = module;
CHROMEOS_LAPTOP = module;
CHROMEOS_PSTORE = module;