Unverified Commit 11a47157 authored by Alyssa Ross's avatar Alyssa Ross Committed by GitHub
Browse files

linux_5_4.configfile: fix build for aarch64 (#375078)

parents ff62d36f a7dee2ba
Loading
Loading
Loading
Loading
+50 −9
Original line number Diff line number Diff line
@@ -319,6 +319,7 @@ let
      IPV6_SEG6_LWTUNNEL = yes;
      IPV6_SEG6_HMAC = yes;
      IPV6_SEG6_BPF = yes;
      NET_CLS_ACT = yes;
      NET_CLS_BPF = module;
      NET_ACT_BPF = module;
      NET_SCHED = yes;
@@ -486,7 +487,15 @@ let

    video =
      let
        whenHasDevicePrivate = lib.mkIf (!stdenv.hostPlatform.isx86_32);
        whenHasDevicePrivate = lib.mkIf (
          with stdenv.hostPlatform;
          isLoongArch64
          || isPower64
          || isS390x
          || isx86_64
          || (lib.versionAtLeast version "5.7" && isAarch64)
          || (lib.versionAtLeast version "6.11" && isRiscV64)
        );
      in
      {
        # compile in DRM so simpledrm can load before initrd if necessary
@@ -520,9 +529,9 @@ let
        DRM_DP_AUX_CHARDEV = whenOlder "6.10" yes;
        DRM_DISPLAY_DP_AUX_CHARDEV = whenAtLeast "6.10" yes;
        # amdgpu display core (DC) support
        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;
        DRM_AMD_DC_DCN1_0 = lib.mkIf stdenv.hostPlatform.isx86 (whenOlder "5.6" yes);
        DRM_AMD_DC_DCN2_0 = lib.mkIf stdenv.hostPlatform.isx86 (whenOlder "5.6" yes);
        DRM_AMD_DC_DCN2_1 = lib.mkIf stdenv.hostPlatform.isx86 (whenOlder "5.6" yes);
        DRM_AMD_DC_DCN3_0 = lib.mkIf (with stdenv.hostPlatform; isx86) (whenBetween "5.9" "5.11" yes);
        DRM_AMD_DC_DCN = lib.mkIf (with stdenv.hostPlatform; isx86 || isPower64) (
          whenBetween "5.11" "6.4" yes
@@ -800,7 +809,10 @@ let

      SECURITY_DMESG_RESTRICT = yes;

      RANDOM_TRUST_CPU = whenOlder "6.2" yes; # allow RDRAND to seed the RNG
      RANDOM_TRUST_CPU = lib.mkIf (
        with stdenv.hostPlatform;
        isPower64 || isS390 || isx86 || (lib.versionAtLeast version "5.6" && isAarch64)
      ) (whenOlder "6.2" yes); # allow RDRAND to seed the RNG
      RANDOM_TRUST_BOOTLOADER = whenOlder "6.2" yes; # allow the bootloader to seed the RNG

      MODULE_SIG = no; # r13y, generates a random key during build and bakes it in
@@ -1073,7 +1085,11 @@ let
      {
        # 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;

        KERNEL_XZ = lib.mkIf (
          with stdenv.hostPlatform; (isAarch32 || isMips || isPower || isS390 || isx86) && !useZstd
        ) yes;

        KERNEL_ZSTD = lib.mkIf (
          with stdenv.hostPlatform;
          (isMips || isS390 || isx86 || (lib.versionAtLeast version "6.1" && isAarch64 || isLoongArch64))
@@ -1241,7 +1257,15 @@ let
        NVME_TARGET_AUTH = whenAtLeast "6.0" yes;
        NVME_TARGET_TCP_TLS = whenAtLeast "6.7" yes;

        PCI_P2PDMA = lib.mkIf (stdenv.hostPlatform.is64bit) yes;
        PCI_P2PDMA = lib.mkIf (
          with stdenv.hostPlatform;
          isLoongArch64
          || isPower64
          || isS390x
          || isx86_64
          || (lib.versionAtLeast version "5.7" && isAarch64)
          || (lib.versionAtLeast version "6.11" && isRiscV64)
        ) yes;

        PSI = yes;

@@ -1308,7 +1332,15 @@ let

        # Enable AMD's ROCm GPU compute stack
        HSA_AMD = lib.mkIf stdenv.hostPlatform.is64bit (yes);
        ZONE_DEVICE = lib.mkIf stdenv.hostPlatform.is64bit (yes);
        ZONE_DEVICE = lib.mkIf (
          with stdenv.hostPlatform;
          isLoongArch64
          || isPower64
          || isS390x
          || isx86_64
          || (lib.versionAtLeast version "5.7" && isAarch64)
          || (lib.versionAtLeast version "6.11" && isRiscV64)
        ) yes;
        HMM_MIRROR = yes;
        DRM_AMDGPU_USERPTR = yes;

@@ -1385,7 +1417,15 @@ let
            MEMORY_HOTPLUG = yes;
            MEMORY_HOTPLUG_DEFAULT_ONLINE = whenOlder "6.14" yes;
            MHP_DEFAULT_ONLINE_TYPE_ONLINE_AUTO = whenAtLeast "6.14" yes;
            MEMORY_HOTREMOVE = yes;
            MEMORY_HOTREMOVE = lib.mkIf (
              with stdenv.hostPlatform;
              isLoongArch64
              || isPower
              || isS390
              || isx86
              || (lib.versionAtLeast version "5.7" && isAarch64)
              || (lib.versionAtLeast version "6.11" && isRiscV)
            ) yes;
            HOTPLUG_CPU = yes;
            MIGRATION = yes;
            SPARSEMEM = yes;
@@ -1404,6 +1444,7 @@ let
            CROS_EC_I2C = module;
            CROS_EC_SPI = module;
            CROS_KBD_LED_BACKLIGHT = module;
            MFD_CROS_EC = whenOlder "5.10" module;
            TCG_TIS_SPI_CR50 = whenAtLeast "5.5" yes;
          }
      //