diff options
author | Domen Kožar <domen@dev.si> | 2021-05-07 22:01:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-07 22:01:09 +0200 |
commit | 8ecb0344a05cec625f9ea790c2ed8a383d0277f9 (patch) | |
tree | 736ab70a803002df114886bfb01f6ec15d66b6b2 | |
parent | 31e67e824d731853a75d40e6c150f25916552d86 (diff) | |
parent | 1cb977c8588c9aa1bf30fe7fa154b5fcc763471f (diff) |
Merge pull request #121720 from samueldr/feature/arm-stage-1-modules
installer images: Add available modules to stage-1 on ARM platforms
-rw-r--r-- | nixos/modules/installer/sd-card/sd-image-aarch64.nix | 7 | ||||
-rw-r--r-- | nixos/modules/installer/sd-card/sd-image.nix | 1 | ||||
-rw-r--r-- | nixos/modules/profiles/all-hardware.nix | 57 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/common-config.nix | 10 |
4 files changed, 66 insertions, 9 deletions
diff --git a/nixos/modules/installer/sd-card/sd-image-aarch64.nix b/nixos/modules/installer/sd-card/sd-image-aarch64.nix index 96ebb7537da32..165e2aac27b49 100644 --- a/nixos/modules/installer/sd-card/sd-image-aarch64.nix +++ b/nixos/modules/installer/sd-card/sd-image-aarch64.nix @@ -18,13 +18,6 @@ # - ttyAMA0: for QEMU's -machine virt boot.kernelParams = ["console=ttyS0,115200n8" "console=ttyAMA0,115200n8" "console=tty0"]; - boot.initrd.availableKernelModules = [ - # Allows early (earlier) modesetting for the Raspberry Pi - "vc4" "bcm2835_dma" "i2c_bcm2835" - # Allows early (earlier) modesetting for Allwinner SoCs - "sun4i_drm" "sun8i_drm_hdmi" "sun8i_mixer" - ]; - sdImage = { populateFirmwareCommands = let configTxt = pkgs.writeText "config.txt" '' diff --git a/nixos/modules/installer/sd-card/sd-image.nix b/nixos/modules/installer/sd-card/sd-image.nix index 45c8c67169b82..d0fe79903d345 100644 --- a/nixos/modules/installer/sd-card/sd-image.nix +++ b/nixos/modules/installer/sd-card/sd-image.nix @@ -29,6 +29,7 @@ in imports = [ (mkRemovedOptionModule [ "sdImage" "bootPartitionID" ] "The FAT partition for SD image now only holds the Raspberry Pi firmware files. Use firmwarePartitionID to configure that partition's ID.") (mkRemovedOptionModule [ "sdImage" "bootSize" ] "The boot files for SD image have been moved to the main ext4 partition. The FAT partition now only holds the Raspberry Pi firmware files. Changing its size may not be required.") + ../../profiles/all-hardware.nix ]; options.sdImage = { diff --git a/nixos/modules/profiles/all-hardware.nix b/nixos/modules/profiles/all-hardware.nix index d460c52dbefd4..c7a13974a5161 100644 --- a/nixos/modules/profiles/all-hardware.nix +++ b/nixos/modules/profiles/all-hardware.nix @@ -46,11 +46,66 @@ in # VMware support. "mptspi" "vmxnet3" "vsock" ] ++ lib.optional platform.isx86 "vmw_balloon" - ++ lib.optionals (!platform.isAarch64) [ # not sure where else they're missing + ++ lib.optionals (!platform.isAarch64 && !platform.isAarch32) [ # not sure where else they're missing "vmw_vmci" "vmwgfx" "vmw_vsock_vmci_transport" # Hyper-V support. "hv_storvsc" + ] ++ lib.optionals (pkgs.stdenv.isAarch32 || pkgs.stdenv.isAarch64) [ + # Most of the following falls into two categories: + # - early KMS / early display + # - early storage (e.g. USB) support + + # Allows using framebuffer configured by the initial boot firmware + "simplefb" + + # Allwinner support + + # Required for early KMS + "sun4i-drm" + "sun8i-mixer" # Audio, but required for kms + + # PWM for the backlight + "pwm-sun4i" + + # Broadcom + + "vc4" + ] ++ lib.optionals pkgs.stdenv.isAarch64 [ + # Most of the following falls into two categories: + # - early KMS / early display + # - early storage (e.g. USB) support + + # Broadcom + + "pcie-brcmstb" + + # Rockchip + "dw-hdmi" + "dw-mipi-dsi" + "rockchipdrm" + "rockchip-rga" + "phy-rockchip-pcie" + "pcie-rockchip-host" + + # Misc. uncategorized hardware + + # Used for some platform's integrated displays + "panel-simple" + "pwm-bl" + + # Power supply drivers, some platforms need them for USB + "axp20x-ac-power" + "axp20x-battery" + "pinctrl-axp209" + "mp8859" + + # USB drivers + "xhci-pci-renesas" + + # Misc "weak" dependencies + "analogix-dp" + "analogix-anx6345" # For DP or eDP (e.g. integrated display) ]; # Include lots of firmware. diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index 5cece836b73e7..776a422df735b 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -859,7 +859,7 @@ let # Bump the maximum number of CPUs to support systems like EC2 x1.* # instances and Xeon Phi. NR_CPUS = freeform "384"; - } // optionalAttrs (stdenv.hostPlatform.system == "aarch64-linux") { + } // optionalAttrs (stdenv.hostPlatform.system == "armv7l-linux" || stdenv.hostPlatform.system == "aarch64-linux") { # Enables support for the Allwinner Display Engine 2.0 SUN8I_DE2_CCU = whenAtLeast "4.13" yes; @@ -871,6 +871,14 @@ let # The kernel command line will override a platform-specific configuration from its device tree. # https://github.com/torvalds/linux/blob/856deb866d16e29bd65952e0289066f6078af773/kernel/dma/contiguous.c#L35-L44 CMA_SIZE_MBYTES = freeform "32"; + + # Many ARM SBCs hand off a pre-configured framebuffer. + # This always can can be replaced by the actual native driver. + # Keeping it a built-in ensures it will be used if possible. + FB_SIMPLE = yes; + + } // optionalAttrs (stdenv.hostPlatform.system == "armv7l-linux") { + ARM_LPAE = yes; }; }; in |