Skip to contentSkip to conversation

Patches to add support for Rockchip usb PHYs.

PATCH Superseded Yunzhi Li 2 participants 5 messages Dec 9, 2014 – Dec 10, 2014

Subsystems (2)

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Yunzhi Li

author
#0 lore raw

v4 cover Patches to add support for Rockchip usb PHYs.

Patches to add support for Rockchip usb phys.Add a new Rockchip usb phy driver and modify dwc2 controller driver to make dwc2 platform devices support a generic PHY framework driver. This patch set has been tested on my rk3288-evb and power off the usb phys would reduce about 60mW power budget in total during sustem suspend.

Changes in v4:
- Get number of PHYs from device tree.
- Model each PHY as subnode of the phy provider node.
- Updata description for phy device tree subnode.
- Add phy subnodes.

Changes in v3:
- Use BIT macro instead of bit shift ops.
- Rename the config entry to PHY_ROCKCHIP_USB.

Yunzhi Li (5):
phy: add a driver for the Rockchip SoC internal USB2.0 PHY
Documentation: bindings: add doc for the Rockchip usb PHY
usb: dwc2: add generic PHY framework support for dwc2 usb controler
platform driver.
ARM: dts: add rk3288 usb PHY
ARM: dts: Enable usb PHY on rk3288-evb board

 .../devicetree/bindings/phy/rockchip-usb-phy.txt   |  32 ++++
 arch/arm/boot/dts/rk3288-evb.dtsi                  |   4 +
 arch/arm/boot/dts/rk3288.dtsi                      |  27 +++
 drivers/phy/Kconfig                                |   7 +
 drivers/phy/Makefile                               |   1 +
 drivers/phy/phy-rockchip-usb.c                     | 211 +++++++++++++++++++++
 drivers/usb/dwc2/gadget.c                          |  33 ++--
 drivers/usb/dwc2/platform.c                        |  36 +++-
 8 files changed, 328 insertions(+), 23 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/rockchip-usb-phy.txt
 create mode 100644 drivers/phy/phy-rockchip-usb.c
Signature · 1 line
2.0.0
author
#1 lore raw

PATCH v4 1/5 phy: add a driver for the Rockchip SoC internal USB2.0 PHY

This patch to add a generic PHY driver for ROCKCHIP usb PHYs, currently this driver can support RK3288. The RK3288 SoC have three independent USB PHY IPs which are all configured through a set of registers located in the GRF (general register files) module.

---

Changes in v4:
- Get number of PHYs from device tree.
- Model each PHY as subnode of the phy provider node.

Changes in v3:
- Use BIT macro instead of bit shift ops.
- Rename the config entry to PHY_ROCKCHIP_USB.

 drivers/phy/Kconfig            |   7 ++
 drivers/phy/Makefile           |   1 +
 drivers/phy/phy-rockchip-usb.c | 211 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 219 insertions(+)
 create mode 100644 drivers/phy/phy-rockchip-usb.c
drivers/phy/Kconfig +7 -0
index ccad880..8a39d2a 100644
@@ -239,6 +239,13 @@ config PHY_QCOM_IPQ806X_SATA
 	depends on OF
 	select GENERIC_PHY
 
+config PHY_ROCKCHIP_USB2
+	tristate "Rockchip USB2 PHY Driver"
+	depends on ARCH_ROCKCHIP && OF
+	select GENERIC_PHY
+	help
+	  Enable this to support the Rockchip USB 2.0 PHY.
+
 config PHY_ST_SPEAR1310_MIPHY
 	tristate "ST SPEAR1310-MIPHY driver"
 	select GENERIC_PHY
drivers/phy/Makefile +1 -0
index aa74f96..8a13f72 100644
@@ -28,6 +28,7 @@ phy-exynos-usb2-$(CONFIG_PHY_EXYNOS5250_USB2)	+= phy-exynos5250-usb2.o
 phy-exynos-usb2-$(CONFIG_PHY_S5PV210_USB2)	+= phy-s5pv210-usb2.o
 obj-$(CONFIG_PHY_EXYNOS5_USBDRD)	+= phy-exynos5-usbdrd.o
 obj-$(CONFIG_PHY_QCOM_APQ8064_SATA)	+= phy-qcom-apq8064-sata.o
+obj-$(CONFIG_PHY_ROCKCHIP_USB2) += phy-rockchip-usb.o
 obj-$(CONFIG_PHY_QCOM_IPQ806X_SATA)	+= phy-qcom-ipq806x-sata.o
 obj-$(CONFIG_PHY_ST_SPEAR1310_MIPHY)	+= phy-spear1310-miphy.o
 obj-$(CONFIG_PHY_ST_SPEAR1340_MIPHY)	+= phy-spear1340-miphy.o
drivers/phy/phy-rockchip-usb.c new file +211 -0

211 lines not on this page · raw message

Signature · 1 line
2.0.0
#2 lore raw

Re: [PATCH v4 1/5] phy: add a driver for the Rockchip SoC internal USB2.0 PHY

Hi,

2014-12-09 3:43 GMT+01:00 Yunzhi Li <[email protected]>:

Quoted 3 lines

Changes in v3:
- Use BIT macro instead of bit shift ops.
- Rename the config entry to PHY_ROCKCHIP_USB.

Contradiction between this , [1] and [2]

Quoted 12 lines
 drivers/phy/Kconfig            |   7 ++
 drivers/phy/Makefile           |   1 +
 drivers/phy/phy-rockchip-usb.c | 211 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 219 insertions(+)
 create mode 100644 drivers/phy/phy-rockchip-usb.c
drivers/phy/Kconfig +0 -0
index ccad880..8a39d2a 100644

drivers/phy/Kconfig config PHY_QCOM_IPQ806X_SATA · line 248

Quoted 10 lines
drivers/phy/Kconfig +7 -0
@@ -239,6 +239,13 @@ config PHY_QCOM_IPQ806X_SATA
        depends on OF
        select GENERIC_PHY
 
+config PHY_ROCKCHIP_USB2
+       tristate "Rockchip USB2 PHY Driver"
+       depends on ARCH_ROCKCHIP && OF
+       select GENERIC_PHY
+       help
+         Enable this to support the Rockchip USB 2.0 PHY.
+

1. The config entry ends by "USB2". Explain that your driver is for usb 2.0 in the description is enough, imho.

drivers/phy/Makefile phy-exynos-usb2-$(CONFIG_PHY_EXYNOS5250_USB2) += phy-exynos5250-usb2.o · line 31

Quoted 12 lines
drivers/phy/Kconfig +0 -0
 config PHY_ST_SPEAR1310_MIPHY
        tristate "ST SPEAR1310-MIPHY driver"
        select GENERIC_PHY
drivers/phy/Makefile +1 -0
index aa74f96..8a13f72 100644
@@ -28,6 +28,7 @@ phy-exynos-usb2-$(CONFIG_PHY_EXYNOS5250_USB2) += phy-exynos5250-usb2.o
 phy-exynos-usb2-$(CONFIG_PHY_S5PV210_USB2)     += phy-s5pv210-usb2.o
 obj-$(CONFIG_PHY_EXYNOS5_USBDRD)       += phy-exynos5-usbdrd.o
 obj-$(CONFIG_PHY_QCOM_APQ8064_SATA)    += phy-qcom-apq8064-sata.o
+obj-$(CONFIG_PHY_ROCKCHIP_USB2) += phy-rockchip-usb.o

2. and... this :)

Romain

author
#3 lore raw

Re: [PATCH v4 1/5] phy: add a driver for the Rockchip SoC internal USB2.0 PHY

Hi Romain:

Quoted 31 lines · Romain Perier

Hi,

2014-12-09 3:43 GMT+01:00 Yunzhi Li <[email protected]>:

Quoted 3 lines

Changes in v3:
- Use BIT macro instead of bit shift ops.
- Rename the config entry to PHY_ROCKCHIP_USB.

Contradiction between this , [1] and [2]

Quoted 11 lines
  drivers/phy/Kconfig            |   7 ++
  drivers/phy/Makefile           |   1 +
  drivers/phy/phy-rockchip-usb.c | 211 +++++++++++++++++++++++++++++++++++++++++
  3 files changed, 219 insertions(+)

create mode 100644 drivers/phy/phy-rockchip-usb.c

drivers/phy/Kconfig +0 -0
index ccad880..8a39d2a 100644

drivers/phy/Kconfig config PHY_QCOM_IPQ806X_SATA · line 248

Quoted 10 lines
drivers/phy/Kconfig +7 -0
@@ -239,6 +239,13 @@ config PHY_QCOM_IPQ806X_SATA
         depends on OF
         select GENERIC_PHY
 
+config PHY_ROCKCHIP_USB2
+       tristate "Rockchip USB2 PHY Driver"
+       depends on ARCH_ROCKCHIP && OF
+       select GENERIC_PHY
+       help
+         Enable this to support the Rockchip USB 2.0 PHY.
+

1. The config entry ends by "USB2". Explain that your driver is for usb 2.0 in the description is enough, imho.

Quoted 13 lines

drivers/phy/Makefile phy-exynos-usb2-$(CONFIG_PHY_EXYNOS5250_USB2) += phy-exynos5250-usb2.o · line 31

Quoted 12 lines
drivers/phy/Kconfig +0 -0
  config PHY_ST_SPEAR1310_MIPHY
         tristate "ST SPEAR1310-MIPHY driver"
         select GENERIC_PHY
drivers/phy/Makefile +1 -0
index aa74f96..8a13f72 100644
@@ -28,6 +28,7 @@ phy-exynos-usb2-$(CONFIG_PHY_EXYNOS5250_USB2) += phy-exynos5250-usb2.o
  phy-exynos-usb2-$(CONFIG_PHY_S5PV210_USB2)     += phy-s5pv210-usb2.o
  obj-$(CONFIG_PHY_EXYNOS5_USBDRD)       += phy-exynos5-usbdrd.o
  obj-$(CONFIG_PHY_QCOM_APQ8064_SATA)    += phy-qcom-apq8064-sata.o
+obj-$(CONFIG_PHY_ROCKCHIP_USB2) += phy-rockchip-usb.o

2. and... this :)

So,do you mean that I should rename the C source file as phy-rockchip-usb2.c ?

Quoted 3 lines

Romain

#4 lore raw

Re: [PATCH v4 1/5] phy: add a driver for the Rockchip SoC internal USB2.0 PHY

Hi,

Quoted 2 lines

So,do you mean that I should rename the C source file as phy-rockchip-usb2.c ?

what I mean is that you can simply rename the kconfig entry to PHY_ROCKCHIP_USB. If you explain that it is for usb 2.0 in the description (as it is already the case),
it is enough, no needs to put USB2 in the kconfig entry name :)

Have a nice evening,
Romain