12 Kernel config notes for distros
Zzy Wysm edited this page 2024-10-08 16:18:58 +00:00

Your kernel configuration will need to include the Asahi-specific drivers. As of linux-asahi-6.11.2-1, this list is:

CONFIG_ARCH_APPLE=y
CONFIG_ARM64_MEMORY_MODEL_CONTROL=y
CONFIG_APPLE_AIC=y
CONFIG_APPLE_WATCHDOG=y
CONFIG_APPLE_DART=y
CONFIG_APPLE_SART=y
CONFIG_APPLE_PLATFORMS=y
CONFIG_APPLE_MAILBOX=y
CONFIG_APPLE_RTKIT=y
CONFIG_APPLE_RTKIT_HELPER=y
CONFIG_APPLE_SMC=y
CONFIG_APPLE_SMC_RTKIT=y
CONFIG_APPLE_PMGR_PWRSTATE=y
CONFIG_APPLE_PMGR_MISC=y
CONFIG_I2C_APPLE=y
CONFIG_NVME_APPLE=y
CONFIG_PCIE_APPLE=y
CONFIG_PINCTRL_APPLE_GPIO=y
CONFIG_PWM_APPLE=y
CONFIG_SPI_APPLE=y
CONFIG_SPMI_APPLE=y
CONFIG_GPIO_MACSMC=y
CONFIG_SENSORS_MACSMC=m
CONFIG_ARM_APPLE_SOC_CPUFREQ=y
CONFIG_APPLE_ADMAC=y
CONFIG_APPLE_M1_CPU_PMU=y
CONFIG_COMMON_CLK_APPLE_NCO=y
CONFIG_ARM_APPLE_CPUIDLE=y
CONFIG_TOUCHSCREEN_APPLE_Z2=m
CONFIG_INPUT_MACSMC_HID=y
CONFIG_POWER_RESET_MACSMC=y
CONFIG_CHARGER_MACSMC=y
CONFIG_MFD_APPLE_SPMI_PMU=y
CONFIG_VIDEO_APPLE_ISP=m
CONFIG_DRM_ASAHI=y
CONFIG_DRM_ADP=m
CONFIG_DRM_APPLE=m
CONFIG_DRM_APPLE_AUDIO=y
CONFIG_APPLE_SIO=m
CONFIG_SND_SOC_APPLE_MACAUDIO=m
CONFIG_SND_SOC_APPLE_MCA=m
CONFIG_SND_SOC_CS42L84=m
CONFIG_SPI_HID_APPLE_OF=y
CONFIG_HID_DOCKCHANNEL=m
CONFIG_BT_HCIBCM4377=m
CONFIG_RTC_DRV_MACSMC=y
CONFIG_APPLE_DOCKCHANNEL=y
CONFIG_PHY_APPLE_ATC=m
CONFIG_PHY_APPLE_DPTX=m
CONFIG_NVMEM_SPMI_MFD=y
CONFIG_MUX_APPLE_DPXBAR=m
CONFIG_NVMEM_APPLE_EFUSES=y

(Distros intending to support other platforms with their 16k arm64 kernel besides Apple Silicon will be inclined to build as many of these drivers as modules as they can. This is fine, though from a reliability standpoint building NVME_APPLE and SPI_HID_APPLE_OF in-kernel has worked much better for me.)

(Also note that the configuration options above do not match the standard dracut configuration provided by asahi-scripts.) It looks like a recent change to asahi-scripts makes your choices of modules much less important: 4acd310cd8

You should also double-check that you have the following configuration options set:

CONFIG_RUST=y
# CONFIG_GCC_PLUGINS is not set
CONFIG_ARM64_16K_PAGES=y
# CONFIG_RUST_DEBUG_ASSERTIONS is not set
CONFIG_RUST_OVERFLOW_CHECKS=y
# CONFIG_RUST_BUILD_ASSERT_ALLOW is not set
CONFIG_UCLAMP_TASK=y
CONFIG_UCLAMP_TASK_GROUP=y
CONFIG_SUSPEND=y
# CONFIG_HIBERNATION is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
CONFIG_ENERGY_MODEL=y
CONFIG_SERIAL_SAMSUNG=y
CONFIG_SERIAL_SAMSUNG_CONSOLE=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y
# CONFIG_DRM_ASAHI_DEBUG_ALLOCATOR is not set
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_DRM_SCHED=y
# CONFIG_DRM_VGEM is not set
CONFIG_DRM_GEM_SHMEM_HELPER=y
CONFIG_SND_SOC_CS42L83=m
CONFIG_SND_SOC_TAS2764=m
CONFIG_SND_SOC_TAS2770=m
CONFIG_HID_BATTERY_STRENGTH=y
CONFIG_HID_APPLE=m
CONFIG_HID_MAGICMOUSE=m
CONFIG_MOUSE_APPLETOUCH=m
CONFIG_INPUT_LEDS=y
CONFIG_LEDS_PWM=y
CONFIG_USB_XHCI_HCD=m
CONFIG_USB_XHCI_PCI_RENESAS=y
CONFIG_USB_XHCI_PCI_ASMEDIA=y
CONFIG_USB_DWC3=m
CONFIG_USB_DWC3_DUAL_ROLE=y
CONFIG_TYPEC_TPS6598X=m
CONFIG_MMC_SDHCI=m
CONFIG_MMC_SDHCI_PCI=m
CONFIG_MMC_CQHCI=m
CONFIG_NET_VENDOR_AQUANTIA=y
CONFIG_AQTION=m
CONFIG_NET_VENDOR_BROADCOM=y
CONFIG_TIGON3=m
CONFIG_BT=m
CONFIG_BT_BREDR=y
CONFIG_BT_RFCOMM=m
CONFIG_BT_BNEP=m
CONFIG_BT_HIDP=m
CONFIG_BT_LE=y
CONFIG_BT_HCIUART_BCM=y
CONFIG_CFG80211=m
CONFIG_WLAN_VENDOR_BROADCOM=y
CONFIG_BRCMFMAC=m
CONFIG_BRCMFMAC_PROTO_BCDC=y
CONFIG_BRCMFMAC_PROTO_MSGBUF=y
CONFIG_BRCMFMAC_USB=y
CONFIG_BRCMFMAC_PCIE=y
CONFIG_APPLE_MFI_FASTCHARGE=m

Warning: if this is your first time modifying a kernel configuration, please do take the advice at the top of the file about not hand-editing the file seriously. Do NOT just copy the fragments in this wiki into your config and try to build the kernel; this is likely to result in an inconsistent config and a failed build. Instead, use the make menuconfig or make xconfig system to modify your kernel configuration.

For a reference kernel configuration, see here.