Merge pull request #121720 from samueldr/feature/arm-stage-1-modules

installer images: Add available modules to stage-1 on ARM platforms
This commit is contained in:
Domen Kožar 2021-05-07 22:01:09 +02:00 committed by GitHub
commit 8ecb0344a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 66 additions and 9 deletions

View file

@ -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" ''

View file

@ -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 = {

View file

@ -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.

View file

@ -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