Skip to content

Commit 82150bb

Browse files
svenpeter42jannau
authored andcommitted
usb: dwc3: Add Apple Silicon DWC3 glue layer driver
The dwc3 controller present on Apple Silicon SoCs like the M1 requires a specific order of operations synchronized between its PHY and its Type-C controller. Specifically, the PHY first has to go through initial bringup (which requires knowledge of the lane mode and orientation) before dwc3 itself can be brought up and can then finalize the PHY configuration. Additionally, dwc3 has to be teared down and re-initialized whenever the cable is changed due to hardware quirks that prevent a new device from being recognized and due to the PHY being unable to switch lane mode or orientation while dwc3 is up and running. These controllers also have a Apple-specific MMIO region after the common dwc3 region where some controls have to be updated. PHY bringup and shutdown also requires SUSPHY to be enabled for the ports to work correctly. In the future, this driver will also gain support for USB3-via-USB4 tunneling which will require additional tweaks. Add a glue driver that takes of all of these constraints. Reviewed-by: Neal Gompa <neal@gompa.dev> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Signed-off-by: Sven Peter <sven@kernel.org> Link: https://patch.msgid.link/20251015-b4-aplpe-dwc3-v2-5-cbd65a2d511a@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9b2b156 commit 82150bb

4 files changed

Lines changed: 502 additions & 0 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,6 +2467,7 @@ F: drivers/pwm/pwm-apple.c
24672467
F: drivers/soc/apple/*
24682468
F: drivers/spi/spi-apple.c
24692469
F: drivers/spmi/spmi-apple-controller.c
2470+
F: drivers/usb/dwc3/dwc3-apple.c
24702471
F: drivers/video/backlight/apple_dwi_bl.c
24712472
F: drivers/watchdog/apple_wdt.c
24722473
F: include/dt-bindings/interrupt-controller/apple-aic.h

drivers/usb/dwc3/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,15 @@ config USB_DWC3_GENERIC_PLAT
200200
the dwc3 child node in the device tree.
201201
Say 'Y' or 'M' here if your platform integrates DWC3 in a similar way.
202202

203+
config USB_DWC3_APPLE
204+
tristate "Apple Silicon DWC3 Platform Driver"
205+
depends on OF && ARCH_APPLE
206+
default USB_DWC3
207+
select USB_ROLE_SWITCH
208+
help
209+
Support Apple Silicon SoCs with DesignWare Core USB3 IP.
210+
The DesignWare Core USB3 IP has to be used in dual-role
211+
mode on these machines.
212+
Say 'Y' or 'M' if you have such device.
213+
203214
endif

drivers/usb/dwc3/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ endif
4343
##
4444

4545
obj-$(CONFIG_USB_DWC3_AM62) += dwc3-am62.o
46+
obj-$(CONFIG_USB_DWC3_APPLE) += dwc3-apple.o
4647
obj-$(CONFIG_USB_DWC3_OMAP) += dwc3-omap.o
4748
obj-$(CONFIG_USB_DWC3_EXYNOS) += dwc3-exynos.o
4849
obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o

0 commit comments

Comments
 (0)