[PATCH 0/7] Apple PCIe/XHCI support

Mark Kettenis kettenis at openbsd.org
Tue Jan 17 23:03:57 CET 2023


This series adds support for the PCIe controller found on Apple M1 and
M2 machines and enables support for PCIe XHCI controllers.  This makes
the type-A USB ports on the M1 Mac mini work.  Since the use of Apples
DART IOMMU is mandatory (these PCIe DARTs don't support bypass mode),
this adds DMA mapping operations to the IOMMU uclass and implements
them for the Apple DART.  It modifies the XHCI driver code to go map
DMA buffers through the IOMMU if there is one.  Since the M1 Mac mini
now has two types of XHCI controllers with different number of ports
(2 for the DWC3 controllers, 8 for the Fresco Logic PCIe controller)
this uncovered an issue in with the way the hub descriptor is
implemented in the XHCI driver.


Mark Kettenis (7):
  iommu: Add DMA mapping operations
  iommu: apple: Implement DMA mapping operations for Apple DART
  usb: xhci: Implement DMA mapping
  iommu: Implement mapping IOMMUs for PCI devices
  pci: Add Apple PCIe controller driver
  arm: apple: Enable PCIe USB controller
  usb: xhci: Fix root hub descriptor

 MAINTAINERS                  |   1 +
 arch/arm/Kconfig             |   2 +
 configs/apple_m1_defconfig   |   1 +
 drivers/iommu/apple_dart.c   | 311 ++++++++++++++++++++++++++----
 drivers/iommu/iommu-uclass.c |  93 +++++++++
 drivers/pci/Kconfig          |   9 +
 drivers/pci/Makefile         |   1 +
 drivers/pci/pcie_apple.c     | 354 +++++++++++++++++++++++++++++++++++
 drivers/usb/host/xhci-mem.c  |  84 ++++++---
 drivers/usb/host/xhci-ring.c |  76 +++++---
 drivers/usb/host/xhci.c      |  25 +--
 include/dm/device.h          |   3 +
 include/iommu.h              |  24 +++
 include/usb/xhci.h           |  28 ++-
 14 files changed, 904 insertions(+), 108 deletions(-)
 create mode 100644 drivers/pci/pcie_apple.c

-- 
2.39.0



More information about the U-Boot mailing list