Enable drivers for hardware present on Apple Silicon machines.
The power domain and interrupt driver should be built-it since these are
critical for the system to boot, the rest can be build as modules.
Previously, many of these drivers were accidentally configured as y
such that this actually decreases the size of the kernel image:
vmlinux 163628520 -> 163330632 (-297888)
Image 48388608 -> 48384512 (- 4096)
Signed-off-by: Sven Peter <sven@kernel.org>
---
arch/arm64/configs/defconfig | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 897fc686e6a91b79770639d3eb15beb3ee48ef77..8ebebfc2fa1293bd16332858d6e6694e1a6f3088 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -97,6 +97,7 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
CONFIG_CPUFREQ_DT=y
CONFIG_ACPI_CPPC_CPUFREQ=m
CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM=m
+CONFIG_ARM_APPLE_SOC_CPUFREQ=m
CONFIG_ARM_ARMADA_37XX_CPUFREQ=y
CONFIG_ARM_SCPI_CPUFREQ=y
CONFIG_ARM_IMX_CPUFREQ_DT=m
@@ -218,6 +219,7 @@ CONFIG_HOTPLUG_PCI_ACPI=y
CONFIG_PCI_AARDVARK=y
CONFIG_PCIE_ALTERA=y
CONFIG_PCIE_ALTERA_MSI=y
+CONFIG_PCIE_APPLE=m
CONFIG_PCIE_BRCMSTB=m
CONFIG_PCI_HOST_THUNDER_PEM=y
CONFIG_PCI_HOST_THUNDER_ECAM=y
@@ -294,6 +296,7 @@ CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=m
CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_NVME=m
+CONFIG_NVME_APPLE=m
CONFIG_QCOM_COINCELL=m
CONFIG_QCOM_FASTRPC=m
CONFIG_SRAM=y
@@ -454,6 +457,7 @@ CONFIG_KEYBOARD_CROS_EC=y
CONFIG_KEYBOARD_MTK_PMIC=m
CONFIG_MOUSE_ELAN_I2C=m
CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_APPLE_Z2=m
CONFIG_TOUCHSCREEN_ATMEL_MXT=m
CONFIG_TOUCHSCREEN_GOODIX=m
CONFIG_TOUCHSCREEN_GOODIX_BERLIN_SPI=m
@@ -538,6 +542,7 @@ CONFIG_I2C_MT65XX=y
CONFIG_I2C_MV64XXX=y
CONFIG_I2C_OMAP=y
CONFIG_I2C_OWL=y
+CONFIG_I2C_APPLE=m
CONFIG_I2C_PXA=y
CONFIG_I2C_QCOM_CCI=m
CONFIG_I2C_QCOM_GENI=m
@@ -552,6 +557,7 @@ CONFIG_I2C_UNIPHIER_F=y
CONFIG_I2C_RCAR=y
CONFIG_I2C_CROS_EC_TUNNEL=y
CONFIG_SPI=y
+CONFIG_SPI_APPLE=m
CONFIG_SPI_ARMADA_3700=y
CONFIG_SPI_BCM2835=m
CONFIG_SPI_BCM2835AUX=m
@@ -586,7 +592,9 @@ CONFIG_SPI_TEGRA210_QUAD=m
CONFIG_SPI_TEGRA114=m
CONFIG_SPI_SPIDEV=m
CONFIG_SPMI=y
+CONFIG_SPMI_APPLE=m
CONFIG_SPMI_MTK_PMIF=m
+CONFIG_PINCTRL_APPLE_GPIO=m
CONFIG_PINCTRL_DA9062=m
CONFIG_PINCTRL_MAX77620=y
CONFIG_PINCTRL_RK805=m
@@ -757,6 +765,7 @@ CONFIG_RENESAS_RZG2LWDT=y
CONFIG_RENESAS_RZV2HWDT=y
CONFIG_UNIPHIER_WATCHDOG=y
CONFIG_PM8916_WATCHDOG=m
+CONFIG_APPLE_WATCHDOG=m
CONFIG_BCM2835_WDT=y
CONFIG_BCM7038_WDT=m
CONFIG_MFD_ADP5585=m
@@ -983,6 +992,7 @@ CONFIG_SND_ALOOP=m
CONFIG_SND_HDA_TEGRA=m
CONFIG_SND_HDA_CODEC_HDMI=m
CONFIG_SND_SOC=y
+CONFIG_SND_SOC_APPLE_MCA=m
CONFIG_SND_BCM2835_SOC_I2S=m
CONFIG_SND_SOC_FSL_ASRC=m
CONFIG_SND_SOC_FSL_MICFIL=m
@@ -1266,6 +1276,7 @@ CONFIG_RTC_DRV_XGENE=y
CONFIG_RTC_DRV_TI_K3=m
CONFIG_RTC_DRV_RENESAS_RTCA3=m
CONFIG_DMADEVICES=y
+CONFIG_APPLE_ADMAC=m
CONFIG_DMA_BCM2835=y
CONFIG_DMA_SUN6I=m
CONFIG_FSL_EDMA=y
@@ -1310,6 +1321,7 @@ CONFIG_CROS_EC_RPMSG=m
CONFIG_CROS_EC_SPI=y
CONFIG_CROS_KBD_LED_BACKLIGHT=m
CONFIG_CROS_EC_CHARDEV=m
+CONFIG_COMMON_CLK_APPLE_NCO=m
CONFIG_COMMON_CLK_RK808=y
CONFIG_COMMON_CLK_SCMI=y
CONFIG_COMMON_CLK_SCPI=y
@@ -1451,6 +1463,7 @@ CONFIG_ARM_SMMU=y
CONFIG_ARM_SMMU_V3=y
CONFIG_MTK_IOMMU=y
CONFIG_QCOM_IOMMU=y
+CONFIG_APPLE_DART=m
CONFIG_REMOTEPROC=y
CONFIG_IMX_REMOTEPROC=y
CONFIG_MTK_SCP=m
@@ -1470,6 +1483,9 @@ CONFIG_RPMSG_QCOM_SMD=y
CONFIG_RPMSG_VIRTIO=y
CONFIG_SOUNDWIRE=m
CONFIG_SOUNDWIRE_QCOM=m
+CONFIG_APPLE_MAILBOX=m
+CONFIG_APPLE_RTKIT=m
+CONFIG_APPLE_SART=m
CONFIG_FSL_DPAA=y
CONFIG_FSL_MC_DPIO=y
CONFIG_FSL_RCPM=y
@@ -1504,6 +1520,7 @@ CONFIG_ARCH_TEGRA_194_SOC=y
CONFIG_ARCH_TEGRA_234_SOC=y
CONFIG_TI_PRUSS=m
CONFIG_OWL_PM_DOMAINS=y
+CONFIG_APPLE_PMGR_PWRSTATE=y
CONFIG_RASPBERRYPI_POWER=y
CONFIG_IMX_SCU_PD=y
CONFIG_QCOM_CPR=y
@@ -1567,6 +1584,7 @@ CONFIG_QCOM_PDC=y
CONFIG_QCOM_MPM=y
CONFIG_TI_SCI_INTR_IRQCHIP=y
CONFIG_TI_SCI_INTA_IRQCHIP=y
+CONFIG_APPLE_AIC=y
CONFIG_RESET_GPIO=m
CONFIG_RESET_IMX7=y
CONFIG_RESET_QCOM_AOSS=y
@@ -1640,6 +1658,7 @@ CONFIG_ARM_CORESIGHT_PMU_ARCH_SYSTEM_PMU=m
CONFIG_NVIDIA_CORESIGHT_PMU_ARCH_SYSTEM_PMU=m
CONFIG_MESON_DDR_PMU=m
CONFIG_NVMEM_LAYOUT_SL28_VPD=m
+CONFIG_NVMEM_APPLE_EFUSES=m
CONFIG_NVMEM_IMX_OCOTP=y
CONFIG_NVMEM_IMX_OCOTP_ELE=m
CONFIG_NVMEM_IMX_OCOTP_SCU=y
--
2.34.1
On 2025-06-12 10:11 pm, Sven Peter wrote: > Enable drivers for hardware present on Apple Silicon machines. > The power domain and interrupt driver should be built-it since these are > critical for the system to boot, the rest can be build as modules. Nit: I'd be tempted to put this patch first, just in case anyone bisecting with "make defconfig" in their process lands in the middle and suddenly loses some drivers (although arguably them going from "=y" to "=m" could still be a surprise, but at least a bit less so). [...] > @@ -1504,6 +1520,7 @@ CONFIG_ARCH_TEGRA_194_SOC=y > CONFIG_ARCH_TEGRA_234_SOC=y > CONFIG_TI_PRUSS=m > CONFIG_OWL_PM_DOMAINS=y > +CONFIG_APPLE_PMGR_PWRSTATE=y If this is critical for any Apple platform to work then it would probably make sense to explicitly select it from ARCH_APPLE, as is done for APPLE_AIC... > CONFIG_RASPBERRYPI_POWER=y > CONFIG_IMX_SCU_PD=y > CONFIG_QCOM_CPR=y > @@ -1567,6 +1584,7 @@ CONFIG_QCOM_PDC=y > CONFIG_QCOM_MPM=y > CONFIG_TI_SCI_INTR_IRQCHIP=y > CONFIG_TI_SCI_INTA_IRQCHIP=y > +CONFIG_APPLE_AIC=y ...which I think means this would already be redundant. Thanks, Robin. > CONFIG_RESET_GPIO=m > CONFIG_RESET_IMX7=y > CONFIG_RESET_QCOM_AOSS=y > @@ -1640,6 +1658,7 @@ CONFIG_ARM_CORESIGHT_PMU_ARCH_SYSTEM_PMU=m > CONFIG_NVIDIA_CORESIGHT_PMU_ARCH_SYSTEM_PMU=m > CONFIG_MESON_DDR_PMU=m > CONFIG_NVMEM_LAYOUT_SL28_VPD=m > +CONFIG_NVMEM_APPLE_EFUSES=m > CONFIG_NVMEM_IMX_OCOTP=y > CONFIG_NVMEM_IMX_OCOTP_ELE=m > CONFIG_NVMEM_IMX_OCOTP_SCU=y >
On 13.06.25 18:50, Robin Murphy wrote: > On 2025-06-12 10:11 pm, Sven Peter wrote: >> Enable drivers for hardware present on Apple Silicon machines. >> The power domain and interrupt driver should be built-it since these are >> critical for the system to boot, the rest can be build as modules. > > Nit: I'd be tempted to put this patch first, just in case anyone > bisecting with "make defconfig" in their process lands in the middle and > suddenly loses some drivers (although arguably them going from "=y" to > "=m" could still be a surprise, but at least a bit less so). Ah, that's a good point that I hadn't even thought about. Now that most of these have already been merged into different trees that ship has sailed though. > > [...] >> @@ -1504,6 +1520,7 @@ CONFIG_ARCH_TEGRA_194_SOC=y >> CONFIG_ARCH_TEGRA_234_SOC=y >> CONFIG_TI_PRUSS=m >> CONFIG_OWL_PM_DOMAINS=y >> +CONFIG_APPLE_PMGR_PWRSTATE=y > > If this is critical for any Apple platform to work then it would > probably make sense to explicitly select it from ARCH_APPLE, as is done > for APPLE_AIC... Documentation/kbuild/kconfig-language.rst: select should be used with care. select will force a symbol to a value without visiting the dependencies. By abusing select you are able to select a symbol FOO even if FOO depends on BAR that is not set. In general use select only for non-visible symbols (no prompts anywhere) and for symbols with no dependencies. That will limit the usefulness but on the other hand avoid the illegal configurations all over. That's probably fine for APPLE_AIC which only depends on ARM64 (and ARCH_APPLE) which is guaranteed to be set when ARCH_APPLE is set anyway. APPLE_PMGR_PWRSTATE also has an additional dependency on PM so it should probably remain in defconfig and not use select. >> CONFIG_RASPBERRYPI_POWER=y >> CONFIG_IMX_SCU_PD=y >> CONFIG_QCOM_CPR=y >> @@ -1567,6 +1584,7 @@ CONFIG_QCOM_PDC=y >> CONFIG_QCOM_MPM=y >> CONFIG_TI_SCI_INTR_IRQCHIP=y >> CONFIG_TI_SCI_INTA_IRQCHIP=y >> +CONFIG_APPLE_AIC=y > > ...which I think means this would already be redundant. Yup, this can be dropped. Thanks, Sven
On 2025-06-21 5:01 pm, Sven Peter wrote: > On 13.06.25 18:50, Robin Murphy wrote: >> On 2025-06-12 10:11 pm, Sven Peter wrote: >>> Enable drivers for hardware present on Apple Silicon machines. >>> The power domain and interrupt driver should be built-it since these are >>> critical for the system to boot, the rest can be build as modules. >> >> Nit: I'd be tempted to put this patch first, just in case anyone >> bisecting with "make defconfig" in their process lands in the middle >> and suddenly loses some drivers (although arguably them going from >> "=y" to "=m" could still be a surprise, but at least a bit less so). > > Ah, that's a good point that I hadn't even thought about. > Now that most of these have already been merged into different trees > that ship has sailed though. Yeah, like I say it's only minor and rather contrived anyway. Not a big worry. >> [...] >>> @@ -1504,6 +1520,7 @@ CONFIG_ARCH_TEGRA_194_SOC=y >>> CONFIG_ARCH_TEGRA_234_SOC=y >>> CONFIG_TI_PRUSS=m >>> CONFIG_OWL_PM_DOMAINS=y >>> +CONFIG_APPLE_PMGR_PWRSTATE=y >> >> If this is critical for any Apple platform to work then it would >> probably make sense to explicitly select it from ARCH_APPLE, as is >> done for APPLE_AIC... > > > Documentation/kbuild/kconfig-language.rst: > > select should be used with care. select will force a symbol to a value > without visiting the dependencies. By abusing select you are able to > select a symbol FOO even if FOO depends on BAR that is not set. In > general use select only for non-visible symbols (no prompts anywhere) > and for symbols with no dependencies. That will limit the usefulness > but on the other hand avoid the illegal configurations all over. > > > That's probably fine for APPLE_AIC which only depends on ARM64 (and > ARCH_APPLE) which is guaranteed to be set when ARCH_APPLE is set anyway. > APPLE_PMGR_PWRSTATE also has an additional dependency on PM so it should > probably remain in defconfig and not use select. Sorry if the implication wasn't clear, but I did mean "select it" in the sense of "select it and all of its necessary dependencies in a manner that works correctly". The same argument applies all the way down - if a !PM config will not be able to boot on ARCH_APPLE platforms due to forcibly deselecting APPLE_PMGR_PWRSTATE, then there is little point in permitting that combination. Which of course the user would already have to disable at least ARCH_MXC, ARCH_ROCKCHIP, ARCH_TEGRA and ARCH_VEXPRESS to achieve in the first place ;) Thanks, Robin.
Sven Peter 於 2025/6/13 清晨5:11 寫道: > Enable drivers for hardware present on Apple Silicon machines. > The power domain and interrupt driver should be built-it since these are > critical for the system to boot, the rest can be build as modules. > > Previously, many of these drivers were accidentally configured as y > such that this actually decreases the size of the kernel image: > > vmlinux 163628520 -> 163330632 (-297888) > Image 48388608 -> 48384512 (- 4096) > > Signed-off-by: Sven Peter <sven@kernel.org> [...] I think you missed these drivers (all of which should be m): BACKLIGHT_APPLE_DWI DRM_PANEL_SUMMIT DRM_ADP NVMEM_APPLE_SPMI Nick Chan
© 2016 - 2025 Red Hat, Inc.