Skip to contentSkip to conversation

phy: Add support for the Apple Type-C PHY

PATCH In review Mark Kettenis 2 participants 2 messages Jul 14, 2023 – Aug 15, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: Add support for the Apple Type-C PHY

This is merely a dummy driver that makes sure the DWC3 XHCI driver finds its reset and PHY controllers. We rely on iBoot to set up the PHY for us.

---
 MAINTAINERS                 |  1 +
 arch/arm/Kconfig            |  1 +
 configs/apple_m1_defconfig  |  1 +
 drivers/phy/Kconfig         | 10 +++++++
 drivers/phy/Makefile        |  1 +
 drivers/phy/phy-apple-atc.c | 56 +++++++++++++++++++++++++++++++++++++
 6 files changed, 70 insertions(+)
 create mode 100644 drivers/phy/phy-apple-atc.c
MAINTAINERS +1 -0
index 2477923a52..ebe7305395 100644
@@ -123,6 +123,7 @@ F:	configs/apple_m1_defconfig
 F:	drivers/iommu/apple_dart.c
 F:	drivers/nvme/nvme_apple.c
 F:	drivers/pci/pcie_apple.c
+F:	drivers/phy/phy-apple-atc.c
 F:	drivers/pinctrl/pinctrl-apple.c
 F:	drivers/watchdog/apple_wdt.c
 F:	include/configs/apple.h
arch/arm/Kconfig +1 -0
index 99264a6478..bcfce8ed86 100644
@@ -1011,6 +1011,7 @@ config ARCH_APPLE
 	select OF_BOARD_SETUP
 	select OF_CONTROL
 	select PCI
+	select PHY
 	select PINCTRL
 	select POSITION_INDEPENDENT
 	select POWER_DOMAIN
configs/apple_m1_defconfig +1 -0
index 755560971e..d58a9030db 100644
@@ -16,6 +16,7 @@ CONFIG_NVME_APPLE=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_PCI=y
+CONFIG_USB_DWC3=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_NO_FB_CLEAR=y
drivers/phy/Kconfig +10 -0
index 7a2d54f71d..8ac5769ed9 100644
@@ -70,6 +70,16 @@ config AB8500_USB_PHY
 	help
 	  Support for the USB OTG PHY in ST-Ericsson AB8500.
 
+config APPLE_ATCPHY
+       bool "Apple Type-C PHY Driver"
+       depends on PHY && ARCH_APPLE
+       default y
+       help
+         Support for the Apple Type-C PHY.
+
+	 This is a dummy driver since the PHY is initialized
+	 sufficiently by previous stage firmware.
+
 config BCM6318_USBH_PHY
 	bool "BCM6318 USBH PHY support"
 	depends on PHY && ARCH_BMIPS
drivers/phy/Makefile +1 -0
index aca365d219..5d4de86e71 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_$(SPL_)PHY) += phy-uclass.o
 obj-$(CONFIG_$(SPL_)NOP_PHY) += nop-phy.o
 obj-$(CONFIG_MIPI_DPHY_HELPERS) += phy-core-mipi-dphy.o
 obj-$(CONFIG_AB8500_USB_PHY) += phy-ab8500-usb.o
+obj-$(CONFIG_APPLE_ATCPHY) += phy-apple-atc.o
 obj-$(CONFIG_BCM6318_USBH_PHY) += bcm6318-usbh-phy.o
 obj-$(CONFIG_BCM6348_USBH_PHY) += bcm6348-usbh-phy.o
 obj-$(CONFIG_BCM6358_USBH_PHY) += bcm6358-usbh-phy.o
drivers/phy/phy-apple-atc.c new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
2.41.0
#1 lore raw
Quoted 5 lines · Mark Kettenis

This is merely a dummy driver that makes sure the DWC3 XHCI driver finds its reset and PHY controllers. We rely on iBoot to set up the PHY for us.

Applied to u-boot/next, thanks!

Signature · 1 line
Tom