Skip to contentSkip to conversation

phy: rcar: Add R-Car Gen3 PHY driver

PATCH New Marek Vasut 3 participants 6 messages Oct 2, 2018 – Mar 8, 2019

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

PATCH 1/2 phy: rcar: Add R-Car Gen3 PHY driver

Add a PHY driver for the R-Car Gen3 which allows configuring USB OTG PHY on Gen3 into host mode and toggles VBUS in case a dedicated regulator is present.

Cc Nobuhiro Iwamatsu <[email protected]>
---
 drivers/phy/Kconfig         |   8 ++
 drivers/phy/Makefile        |   1 +
 drivers/phy/phy-rcar-gen3.c | 161 ++++++++++++++++++++++++++++++++++++
 3 files changed, 170 insertions(+)
 create mode 100644 drivers/phy/phy-rcar-gen3.c
drivers/phy/Kconfig +8 -0
index bcc8e22795..14d82b93ed 100644
@@ -118,6 +118,14 @@ config PHY_RCAR_GEN2
 	  PHY connected to USBHS module, PCI EHCI module and USB3.0 module and
 	  allows configuring the module multiplexing.
 
+config PHY_RCAR_GEN3
+	tristate "Renesas R-Car Gen3 USB PHY"
+	depends on PHY && RCAR_GEN3 && CLK && DM_REGULATOR
+	default y if RCAR_GEN3
+	help
+	  Support for the Renesas R-Car Gen3 USB PHY. This driver operates the
+	  PHY connected to EHCI USB module and controls USB OTG operation.
+
 config PHY_STM32_USBPHYC
 	tristate "STMicroelectronics STM32 SoC USB HS PHY driver"
 	depends on PHY && ARCH_STM32MP
drivers/phy/Makefile +1 -0
index 1e1e4ca11e..8030d599e7 100644
@@ -13,6 +13,7 @@ obj-$(CONFIG_PHY_SANDBOX) += sandbox-phy.o
 obj-$(CONFIG_$(SPL_)PIPE3_PHY) += ti-pipe3-phy.o
 obj-$(CONFIG_STI_USB_PHY) += sti_usb_phy.o
 obj-$(CONFIG_PHY_RCAR_GEN2) += phy-rcar-gen2.o
+obj-$(CONFIG_PHY_RCAR_GEN3) += phy-rcar-gen3.o
 obj-$(CONFIG_PHY_STM32_USBPHYC) += phy-stm32-usbphyc.o
 obj-$(CONFIG_MESON_GXL_USB_PHY) += meson-gxl-usb2.o meson-gxl-usb3.o
 obj-$(CONFIG_MSM8916_USB_PHY) += msm8916-usbh-phy.o
drivers/phy/phy-rcar-gen3.c new file +161 -0

161 lines not on this page · raw message

Signature · 1 line
2.18.0
#1 lore raw

PATCH 2/2 ARM: rmobile: Enable PHY framework on Gen3

Enable PHY framework on Gen3, this is required for USB EHCI PHY support.

Cc Nobuhiro Iwamatsu <[email protected]>
---
 arch/arm/mach-rmobile/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-rmobile/Kconfig +1 -0
index fc4b3c3219..ac08d6eb12 100644
@@ -11,6 +11,7 @@ config RCAR_32
 config RCAR_GEN3
 	bool "Renesas ARM SoCs R-Car Gen3 (64bit)"
 	select ARM64
+	select PHY
 
 endchoice
 
Signature · 1 line
2.18.0
#2 lore raw

PATCH 1/2 phy: rcar: Add R-Car Gen3 PHY driver

In reply to Marek Vasut

Hello Marek cc: Shimoda-san, Morimoto-san,

Is there any USB gadget/peripheral R-Car3 U-Boot driver WIP on your side? We have something in the official release which looks like a chopped version of linux usbhs [1], but I believe it has to be converted to DM to become mainline-grade.
Is there an easier (relatively clean) way to have U-Boot fastboot support on R-Car3?

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/renesas_usbhs

Thanks and best regards,
Eugeniu.

#3 lore raw

PATCH 1/2 phy: rcar: Add R-Car Gen3 PHY driver

Quoted 1 line · Eugeniu Rosca

Hello Marek cc: Shimoda-san, Morimoto-san,

Hi,

Quoted 1 line

Is there any USB gadget/peripheral R-Car3 U-Boot driver WIP on your side?

Yes, I'm working on a driver, for next release.

Quoted 7 lines

We have something in the official release which looks like a chopped version of linux usbhs [1], but I believe it has to be converted to DM to become mainline-grade.
Is there an easier (relatively clean) way to have U-Boot fastboot support on R-Car3?

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/renesas_usbhs

I have the horrible driver that's in the android bsp ported over to the current release, but cleaning it up and converting it over to DM is a huge undertaking, so please give me some time to finish it.

I can share the preliminary version with you, but it isn't pretty.

Signature · 2 lines
Best regards,
Marek Vasut
#4 lore raw

PATCH 1/2 phy: rcar: Add R-Car Gen3 PHY driver

Hello Marek,

Quoted 8 lines · Marek Vasut
Quoted 1 line · Eugeniu Rosca

Hello Marek cc: Shimoda-san, Morimoto-san,

Hi,

Quoted 1 line

Is there any USB gadget/peripheral R-Car3 U-Boot driver WIP on your side?

Yes, I'm working on a driver, for next release.

Sounds great!

Quoted 6 lines
Quoted 6 lines

We have something in the official release which looks like a chopped version of linux usbhs [1], but I believe it has to be converted to DM to become mainline-grade.
Is there an easier (relatively clean) way to have U-Boot fastboot support on R-Car3?

Quoted 7 lines
Quoted 1 line

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/renesas_usbhs

I have the horrible driver that's in the android bsp ported over to the current release, but cleaning it up and converting it over to DM is a huge undertaking, so please give me some time to finish it.

I can share the preliminary version with you, but it isn't pretty.

I think for the time being will will stick to the Renesas-delivered driver, but we are eager to review and test your future proposals, so please keep the ADIT guys in the loop. Many thanks for your dedication in supporting the R-Car platform.

Quoted 4 lines
Signature · 3 lines
-- 
Best regards,
Marek Vasut

Best regards,
Eugeniu.

#5 lore raw

PATCH 1/2 phy: rcar: Add R-Car Gen3 PHY driver

Quoted 1 line · Eugeniu Rosca

Hello Marek,

Hi,

Quoted 24 lines · Marek Vasut
Quoted 8 lines · Eugeniu Rosca
Quoted 1 line

Hello Marek cc: Shimoda-san, Morimoto-san,

Hi,

Quoted 1 line

Is there any USB gadget/peripheral R-Car3 U-Boot driver WIP on your side?

Yes, I'm working on a driver, for next release.

Sounds great!

Quoted 12 lines
Quoted 7 lines

We have something in the official release which looks like a chopped version of linux usbhs [1], but I believe it has to be converted to DM to become mainline-grade.
Is there an easier (relatively clean) way to have U-Boot fastboot support on R-Car3?

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/renesas_usbhs

I have the horrible driver that's in the android bsp ported over to the current release, but cleaning it up and converting it over to DM is a huge undertaking, so please give me some time to finish it.

Quoted 6 lines
Quoted 1 line

I can share the preliminary version with you, but it isn't pretty.

I think for the time being will will stick to the Renesas-delivered driver, but we are eager to review and test your future proposals, so please keep the ADIT guys in the loop. Many thanks for your dedication in supporting the R-Car platform.

You're welcome.

Please let me know if something is broken and send patches. Thank you for your testing :)

Signature · 2 lines
Best regards,
Marek Vasut