Re: [PATCH v16 5/7] spi: pxa2xx: disable DMA for Apple MacBook8,1
From: Lukas Wunner
Date: Sun Jul 26 2026 - 12:21:03 EST
On Sun, Jul 26, 2026 at 11:41:39PM +0800, Shih-Yuan Lee (FourDollars) wrote:
> Direct MMIO inspection of the LPSS DMA controller (PCI device 00:15.0)
> on physical MacBook8,1 hardware reveals that Apple's EFI firmware
> leaves the functional reset register (LPSS_PRIV_RESETS at BAR0 +
> 0x204) permanently set to 0x00000000 (held in reset).
>
> Since the LPSS DMA controller is held in reset (0x0) by EFI firmware
> and the SPI peripheral relies on the dedicated OOB GpioInt() line for
> PIO transfers, forcing PIO mode via the DMI quirk in spi-pxa2xx-pci.c
> accurately reflects how EFI configures the hardware, allowing the
> driver to operate reliably out-of-the-box without system hangs.
The OOB GpioInt() and the DMA controller are two different things:
The former allows the peripheral to signal that a key has been pressed etc,
whereas the latter allows feeding the FIFOs of the SPI host controller
without CPU involvement (or with *less* CPU involvement, the CPU is still
needed to configure the DMA engine for a transfer).
I'm not sure why Apple chose to keep the DMA controller in reset,
but have you explored enabling it on boot? If this can only be performed
before EFI hands over control to the OS, then it could be done in the
EFI stub, see setup_quirks() in drivers/firmware/efi/libstub/x86-stub.c.
Or maybe it can be done at runtime after the kernel has assumed control,
I'm not sure.
Thanks,
Lukas