Skip to content

Commit

Permalink
PCI: apple: Add driver for the Apple M1
Browse files Browse the repository at this point in the history
Add a driver for the PCIe controller found in Apple system-on-chips,
particularly the Apple M1. This driver exposes the internal bus used for
the USB type-A ports, Ethernet, Wi-Fi, and Bluetooth. This patch brings
up the USB type-A ports and Ethernet. Bringing up the radios requires
interfacing with the System Management Coprocessor via Apple's
mailboxes, so that's left to a future patch.

In this state, the driver consists of two major parts: hardware
initialization and MSI handling. The hardware initialization is derived
from Mark Kettenis's U-Boot patches which in turn is derived from
Corellium's patches for the hardware. The rest of the driver is derived
from Marc Zyngier's driver for the hardware.

Co-developed-by: Stan Skowronek <stan@corellium.com>
Signed-off-by: Stan Skowronek <stan@corellium.com>
Co-developed-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
  • Loading branch information
alyssarosenzweig authored and intel-lab-lkp committed Aug 15, 2021
1 parent 549d13d commit 1e2d479
Show file tree
Hide file tree
Showing 4 changed files with 481 additions and 0 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS
Expand Up @@ -1274,6 +1274,7 @@ M: Alyssa Rosenzweig <alyssa@rosenzweig.io>
L: linux-pci@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/pci/apple,pcie.yaml
F: drivers/pci/controller/pcie-apple.c

APPLE SMC DRIVER
M: Henrik Rydberg <rydberg@bitmath.org>
Expand Down
13 changes: 13 additions & 0 deletions drivers/pci/controller/Kconfig
Expand Up @@ -312,6 +312,19 @@ config PCIE_HISI_ERR
Say Y here if you want error handling support
for the PCIe controller's errors on HiSilicon HIP SoCs

config PCIE_APPLE
tristate "Apple PCIe controller"
depends on ARCH_APPLE || COMPILE_TEST
depends on OF
depends on PCI_MSI_IRQ_DOMAIN
depends on GPIOLIB
help
Say Y here if you want to enable PCIe controller support on Apple
system-on-chips, like the Apple M1. This is required for the USB
type-A ports, Ethernet, Wi-Fi, and Bluetooth.

If unsure, say Y if you have an Apple Silicon system.

source "drivers/pci/controller/dwc/Kconfig"
source "drivers/pci/controller/mobiveil/Kconfig"
source "drivers/pci/controller/cadence/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/pci/controller/Makefile
Expand Up @@ -37,6 +37,7 @@ obj-$(CONFIG_VMD) += vmd.o
obj-$(CONFIG_PCIE_BRCMSTB) += pcie-brcmstb.o
obj-$(CONFIG_PCI_LOONGSON) += pci-loongson.o
obj-$(CONFIG_PCIE_HISI_ERR) += pcie-hisi-error.o
obj-$(CONFIG_PCIE_APPLE) += pcie-apple.o
# pcie-hisi.o quirks are needed even without CONFIG_PCIE_DW
obj-y += dwc/
obj-y += mobiveil/
Expand Down

0 comments on commit 1e2d479

Please sign in to comment.