Skip to contentSkip to conversation

add usb support for hi6220

PATCH RESEND Superseded Zhangfei Gao 5 participants 14 messages Feb 10, 2015 – Feb 23, 2015

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover add usb support for hi6220

v3:
fix typo and add -EPROBE_DEFER of regulator, pointed by Peter

v2:
address comments from Sergei and Peter
add hi6220_phy_setup(false) code

v1:
hi6220 usb controller is inherited from dwc2
add phy accordingly
support otg gadget/host

Zhangfei Gao (4):
Documentation: dt-bindings: add dt binding info for hi6220 dwc2
Documentation: dt-bindings: add dt binding info for hi6220
usb: dwc2: platform: add hi6220 support
usb: phy: add phy-hi6220-usb

 Documentation/devicetree/bindings/usb/dwc2.txt     |   1 +
 .../devicetree/bindings/usb/hi6220-usb.txt         |  49 ++++
 drivers/usb/dwc2/platform.c                        |  30 ++
 drivers/usb/phy/Kconfig                            |   9 +
 drivers/usb/phy/Makefile                           |   1 +
 drivers/usb/phy/phy-hi6220-usb.c                   | 306 +++++++++++++++++++++
 6 files changed, 396 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/hi6220-usb.txt
 create mode 100644 drivers/usb/phy/phy-hi6220-usb.c
Signature · 1 line
1.9.1
#1 lore raw

PATCH RESEND v3 1/4 Documentation: dt-bindings: add dt binding info for hi6220 dwc2

Add necessary dwc2 binding documentation for Hisilicon soc: hi6220

---
 Documentation/devicetree/bindings/usb/dwc2.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/usb/dwc2.txt +1 -0
index fd132cb..2213682 100644
@@ -4,6 +4,7 @@ Platform DesignWare HS OTG USB 2.0 controller
 Required properties:
 - compatible : One of:
   - brcm,bcm2835-usb: The DWC2 USB controller instance in the BCM2835 SoC.
+  - hisilicon,hi6220-usb: The DWC2 USB controller instance in the hi6220 SoC.
   - rockchip,rk3066-usb: The DWC2 USB controller instance in the rk3066 Soc;
   - "rockchip,rk3188-usb", "rockchip,rk3066-usb", "snps,dwc2": for rk3188 Soc;
   - "rockchip,rk3288-usb", "rockchip,rk3066-usb", "snps,dwc2": for rk3288 Soc;
Signature · 1 line
1.9.1
#2 lore raw

PATCH RESEND v3 2/4 Documentation: dt-bindings: add dt binding info for hi6220

In reply to Zhangfei Gao
---
 .../devicetree/bindings/usb/hi6220-usb.txt         | 49 ++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/hi6220-usb.txt
Documentation/devicetree/bindings/usb/hi6220-usb.txt new file +49 -0
new file mode 100644
index 0000000..b8278de
@@ -0,0 +1,49 @@
+Hisilicon hi6220 SoC USB controller
+-----------------------------
+
+usb controller is inherited from dwc2, refer dwc2.txt
+-----
+
+Required properties:
+- compatible: "hisilicon,hi6220-usb"
+Refer to dwc2.txt for dwc2 usb properties
+
+
+PHY:
+-----
+
+Required properties:
+- compatible: "hisilicon,hi6220-usb-phy"
+- vcc-supply: phandle to the regulator that provides power to the PHY.
+- clocks: phandle and clock specifier of the PHY clock.
+- hisilicon,peripheral-syscon: phandle of syscon used to control peripheral.
+- hisilicon,gpio-vbus: gpio of detecting vbus.
+- hisilicon,gpio-id: gpio of detecting id.
+
+Example:
+
+	peripheral_ctrl: syscon at f7030000 {
+	        compatible = "syscon";
+	        reg = <0x0 0xf7030000 0x0 0x1000>;
+	};
+
+	usb2_phy: usbphy {
+		compatible = "hisilicon,hi6220-usb-phy";
+		vcc-supply = <&fixed_5v_hub>;
+		hisilicon,gpio-vbus = <&gpio2 6 0>;
+		hisilicon,gpio-id = <&gpio2 5 0>;
+		hisilicon,peripheral-syscon = <&peripheral_ctrl>;
+		clocks = <&clock_sys HI6220_USBOTG_HCLK>;
+	};
+
+	usb: usb at f72c0000 {
+		compatible = "hisilicon,hi6220-usb";
+		reg = <0x0 0xf72c0000 0x0 0x40000>;
+		phys = <&usb2_phy>;
+		dr_mode = "otg";
+		g-use-dma;
+		g-rx-fifo-size = <512>;
+		g-np-tx-fifo-size = <128>;
+		g-tx-fifo-size = <128>;
+		interrupts = <0 77 0x4>;
+	};
Signature · 1 line
1.9.1
#3 lore raw

PATCH RESEND v3 2/4 Documentation: dt-bindings: add dt binding info for hi6220

Hello.

Quoted 14 lines · Zhangfei Gao
---
  .../devicetree/bindings/usb/hi6220-usb.txt         | 49 ++++++++++++++++++++++
  1 file changed, 49 insertions(+)

create mode 100644 Documentation/devicetree/bindings/usb/hi6220-usb.txt

Documentation/devicetree/bindings/usb/hi6220-usb.txt new file +2 -0
new file mode 100644
index 0000000..b8278de
@@ -0,0 +1,49 @@
+Hisilicon hi6220 SoC USB controller
+-----------------------------

[...]

Documentation/devicetree/bindings/usb/hi6220-usb.txt line 21

Quoted 10 lines
Documentation/devicetree/bindings/usb/hi6220-usb.txt new file +10 -0
+PHY:
+-----
+
+Required properties:
+- compatible: "hisilicon,hi6220-usb-phy"
+- vcc-supply: phandle to the regulator that provides power to the PHY.
+- clocks: phandle and clock specifier of the PHY clock.
+- hisilicon,peripheral-syscon: phandle of syscon used to control peripheral.
+- hisilicon,gpio-vbus: gpio of detecting vbus.
+- hisilicon,gpio-id: gpio of detecting id.

Actually, GPIO bindings say that GPIO properties should be named
"[<name>-]gpios".

Documentation/devicetree/bindings/usb/hi6220-usb.txt line 30

Quoted 9 lines
Documentation/devicetree/bindings/usb/hi6220-usb.txt new file +9 -0
+
+Example:
+
+	peripheral_ctrl: syscon at f7030000 {
+	        compatible = "syscon";
+	        reg = <0x0 0xf7030000 0x0 0x1000>;
+	};
+
+	usb2_phy: usbphy {

Please name it "usb-phy" as it better resembles "ethernet-phy"
standardized by ePAPR.

[...]

WBR, Sergei

#4 lore raw

PATCH RESEND v3 3/4 usb: dwc2: platform: add hi6220 support

In reply to Zhangfei Gao
---
 drivers/usb/dwc2/platform.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
drivers/usb/dwc2/platform.c +30 -0
index ae095f0..f7c67db 100644
@@ -50,6 +50,35 @@
 
 static const char dwc2_driver_name[] = "dwc2";
 
+static const struct dwc2_core_params params_hi6220 = {
+	.otg_cap			= 2,	/* No HNP/SRP capable */
+	.otg_ver			= 0,	/* 1.3 */
+	.dma_enable			= 1,
+	.dma_desc_enable		= 0,
+	.speed				= 0,	/* High Speed */
+	.enable_dynamic_fifo		= 1,
+	.en_multiple_tx_fifo		= 1,
+	.host_rx_fifo_size		= 512,
+	.host_nperio_tx_fifo_size	= 512,
+	.host_perio_tx_fifo_size	= 512,
+	.max_transfer_size		= 65535,
+	.max_packet_count		= 511,
+	.host_channels			= 16,
+	.phy_type			= 1,	/* UTMI */
+	.phy_utmi_width			= 8,
+	.phy_ulpi_ddr			= 0,	/* Single */
+	.phy_ulpi_ext_vbus		= 0,
+	.i2c_enable			= 0,
+	.ulpi_fs_ls			= 0,
+	.host_support_fs_ls_low_power	= 0,
+	.host_ls_low_power_phy_clk	= 0,	/* 48 MHz */
+	.ts_dline			= 0,
+	.reload_ctl			= 0,
+	.ahbcfg				= GAHBCFG_HBSTLEN_INCR16 <<
+					  GAHBCFG_HBSTLEN_SHIFT,
+	.uframe_sched			= 0,
+};
+
 static const struct dwc2_core_params params_bcm2835 = {
 	.otg_cap			= 0,	/* HNP/SRP capable */
 	.otg_ver			= 0,	/* 1.3 */
@@ -129,6 +158,7 @@ static int dwc2_driver_remove(struct platform_device *dev)
 
 static const struct of_device_id dwc2_of_match_table[] = {
 	{ .compatible = "brcm,bcm2835-usb", .data = &params_bcm2835 },
+	{ .compatible = "hisilicon,hi6220-usb", .data = &params_hi6220 },
 	{ .compatible = "rockchip,rk3066-usb", .data = &params_rk3066 },
 	{ .compatible = "snps,dwc2", .data = NULL },
 	{ .compatible = "samsung,s3c6400-hsotg", .data = NULL},
Signature · 1 line
1.9.1
#5 lore raw

PATCH RESEND v3 4/4 usb: phy: add phy-hi6220-usb

In reply to Zhangfei Gao

Add usb phy controller for hi6220 platform

---
 drivers/usb/phy/Kconfig          |   9 ++
 drivers/usb/phy/Makefile         |   1 +
 drivers/usb/phy/phy-hi6220-usb.c | 306 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 316 insertions(+)
 create mode 100644 drivers/usb/phy/phy-hi6220-usb.c
drivers/usb/phy/Kconfig +9 -0
index c6d0c8e..405a3d0 100644
@@ -173,6 +173,15 @@ config USB_MXS_PHY
 
 	  MXS Phy is used by some of the i.MX SoCs, for example imx23/28/6x.
 
+config USB_HI6220_PHY
+	tristate "hi6220 USB PHY support"
+	select USB_PHY
+	select MFD_SYSCON
+	help
+	  Enable this to support the HISILICON HI6220 USB PHY.
+
+	  To compile this driver as a module, choose M here.
+
 config USB_RCAR_PHY
 	tristate "Renesas R-Car USB PHY support"
 	depends on USB || USB_GADGET
drivers/usb/phy/Makefile +1 -0
index 75f2bba..00172d3 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_SAMSUNG_USBPHY)		+= phy-samsung-usb.o
 obj-$(CONFIG_TWL6030_USB)		+= phy-twl6030-usb.o
 obj-$(CONFIG_USB_EHCI_TEGRA)		+= phy-tegra-usb.o
 obj-$(CONFIG_USB_GPIO_VBUS)		+= phy-gpio-vbus-usb.o
+obj-$(CONFIG_USB_HI6220_PHY)		+= phy-hi6220-usb.o
 obj-$(CONFIG_USB_ISP1301)		+= phy-isp1301.o
 obj-$(CONFIG_USB_MSM_OTG)		+= phy-msm-usb.o
 obj-$(CONFIG_USB_MV_OTG)		+= phy-mv-usb.o
drivers/usb/phy/phy-hi6220-usb.c new file +306 -0

306 lines not on this page · raw message

Signature · 1 line
1.9.1
#6 lore raw

PATCH RESEND v3 4/4 usb: phy: add phy-hi6220-usb

Quoted 35 lines · Zhangfei Gao

Add usb phy controller for hi6220 platform

---
 drivers/usb/phy/Kconfig          |   9 ++
 drivers/usb/phy/Makefile         |   1 +
 drivers/usb/phy/phy-hi6220-usb.c | 306 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 316 insertions(+)
 create mode 100644 drivers/usb/phy/phy-hi6220-usb.c
drivers/usb/phy/Kconfig +9 -0
index c6d0c8e..405a3d0 100644
@@ -173,6 +173,15 @@ config USB_MXS_PHY
 
 	  MXS Phy is used by some of the i.MX SoCs, for example imx23/28/6x.
 
+config USB_HI6220_PHY
+	tristate "hi6220 USB PHY support"
+	select USB_PHY
+	select MFD_SYSCON
+	help
+	  Enable this to support the HISILICON HI6220 USB PHY.
+
+	  To compile this driver as a module, choose M here.
+
 config USB_RCAR_PHY
 	tristate "Renesas R-Car USB PHY support"
 	depends on USB || USB_GADGET
drivers/usb/phy/Makefile +0 -0
index 75f2bba..00172d3 100644

drivers/usb/phy/Makefile obj-$(CONFIG_SAMSUNG_USBPHY) += phy-samsung-usb.o · line 21

Quoted 4 lines
drivers/usb/phy/Makefile +1 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_SAMSUNG_USBPHY)		+= phy-samsung-usb.o
 obj-$(CONFIG_TWL6030_USB)		+= phy-twl6030-usb.o
 obj-$(CONFIG_USB_EHCI_TEGRA)		+= phy-tegra-usb.o
 obj-$(CONFIG_USB_GPIO_VBUS)		+= phy-gpio-vbus-usb.o
+obj-$(CONFIG_USB_HI6220_PHY)		+= phy-hi6220-usb.o

new drivers only on drivers/phy/, sorry.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150210/f92cd345/attachment.sig>
author
#7 lore raw

PATCH RESEND v3 4/4 usb: phy: add phy-hi6220-usb

Quoted 34 lines · Felipe Balbi
Quoted 33 lines · Zhangfei Gao

Add usb phy controller for hi6220 platform

---
  drivers/usb/phy/Kconfig          |   9 ++
  drivers/usb/phy/Makefile         |   1 +
  drivers/usb/phy/phy-hi6220-usb.c | 306 +++++++++++++++++++++++++++++++++++++++
  3 files changed, 316 insertions(+)

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

drivers/usb/phy/Kconfig +9 -0
index c6d0c8e..405a3d0 100644
@@ -173,6 +173,15 @@ config USB_MXS_PHY
 
  	  MXS Phy is used by some of the i.MX SoCs, for example imx23/28/6x.
 
+config USB_HI6220_PHY
+	tristate "hi6220 USB PHY support"
+	select USB_PHY
+	select MFD_SYSCON
+	help
+	  Enable this to support the HISILICON HI6220 USB PHY.
+
+	  To compile this driver as a module, choose M here.
+
  config USB_RCAR_PHY
  	tristate "Renesas R-Car USB PHY support"
  	depends on USB || USB_GADGET
drivers/usb/phy/Makefile +0 -1
index 75f2bba..00172d3 100644
--- a/drivers/usb/phy/Makefile
Quoted 9 lines

drivers/usb/phy/Makefile obj-$(CONFIG_SAMSUNG_USBPHY) += phy-samsung-usb.o · line 21

Quoted 6 lines

+++ b/drivers/usb/phy/Makefile

drivers/usb/phy/Makefile +1 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_SAMSUNG_USBPHY)		+= phy-samsung-usb.o
  obj-$(CONFIG_TWL6030_USB)		+= phy-twl6030-usb.o
  obj-$(CONFIG_USB_EHCI_TEGRA)		+= phy-tegra-usb.o
  obj-$(CONFIG_USB_GPIO_VBUS)		+= phy-gpio-vbus-usb.o
+obj-$(CONFIG_USB_HI6220_PHY)		+= phy-hi6220-usb.o

new drivers only on drivers/phy/, sorry.

OK, thanks for the info, I don't know this at all. So even usb phy should be put under drivers/phy/.

Will change that.

Thanks Felipe

#8 lore raw

PATCH RESEND v3 4/4 usb: phy: add phy-hi6220-usb

Quoted 46 lines · zhangfei
Quoted 34 lines · Felipe Balbi
Quoted 33 lines · Zhangfei Gao

Add usb phy controller for hi6220 platform

---
 drivers/usb/phy/Kconfig          |   9 ++
 drivers/usb/phy/Makefile         |   1 +
 drivers/usb/phy/phy-hi6220-usb.c | 306 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 316 insertions(+)
 create mode 100644 drivers/usb/phy/phy-hi6220-usb.c
drivers/usb/phy/Kconfig +9 -0
index c6d0c8e..405a3d0 100644
@@ -173,6 +173,15 @@ config USB_MXS_PHY
 
 	  MXS Phy is used by some of the i.MX SoCs, for example imx23/28/6x.
 
+config USB_HI6220_PHY
+	tristate "hi6220 USB PHY support"
+	select USB_PHY
+	select MFD_SYSCON
+	help
+	  Enable this to support the HISILICON HI6220 USB PHY.
+
+	  To compile this driver as a module, choose M here.
+
 config USB_RCAR_PHY
 	tristate "Renesas R-Car USB PHY support"
 	depends on USB || USB_GADGET
drivers/usb/phy/Makefile +0 -1
index 75f2bba..00172d3 100644
--- a/drivers/usb/phy/Makefile
Quoted 9 lines

drivers/usb/phy/Makefile obj-$(CONFIG_SAMSUNG_USBPHY) += phy-samsung-usb.o · line 21

Quoted 6 lines

+++ b/drivers/usb/phy/Makefile

drivers/usb/phy/Makefile +1 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_SAMSUNG_USBPHY)		+= phy-samsung-usb.o
 obj-$(CONFIG_TWL6030_USB)		+= phy-twl6030-usb.o
 obj-$(CONFIG_USB_EHCI_TEGRA)		+= phy-tegra-usb.o
 obj-$(CONFIG_USB_GPIO_VBUS)		+= phy-gpio-vbus-usb.o
+obj-$(CONFIG_USB_HI6220_PHY)		+= phy-hi6220-usb.o

new drivers only on drivers/phy/, sorry.

Quoted 4 lines

OK, thanks for the info, I don't know this at all. So even usb phy should be put under drivers/phy/.

Will change that.

yes, thank you

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150223/8e2917cc/attachment-0001.sig>
#9 lore raw

PATCH RESEND v3 4/4 usb: phy: add phy-hi6220-usb

In reply to Felipe Balbi
Quoted 36 lines

drivers/usb/phy/Makefile obj-$(CONFIG_SAMSUNG_USBPHY) += phy-

Quoted 35 lines
---
 drivers/usb/phy/Kconfig          |   9 ++
 drivers/usb/phy/Makefile         |   1 +
 drivers/usb/phy/phy-hi6220-usb.c | 306
+++++++++++++++++++++++++++++++++++++++
 3 files changed, 316 insertions(+)
 create mode 100644 drivers/usb/phy/phy-hi6220-usb.c
drivers/usb/phy/Kconfig index renamed from drivers/usb/phy/Kconfig +0 -0

c6d0c8e..405a3d0 100644

drivers/usb/phy/Kconfig +9 -0
@@ -173,6 +173,15 @@ config USB_MXS_PHY
 
 	  MXS Phy is used by some of the i.MX SoCs, for example imx23/28/6x.
 
+config USB_HI6220_PHY
+	tristate "hi6220 USB PHY support"
+	select USB_PHY
+	select MFD_SYSCON
+	help
+	  Enable this to support the HISILICON HI6220 USB PHY.
+
+	  To compile this driver as a module, choose M here.
+
 config USB_RCAR_PHY
 	tristate "Renesas R-Car USB PHY support"
 	depends on USB || USB_GADGET
drivers/usb/phy/Makefile index renamed from drivers/usb/phy/Makefile +0 -0

75f2bba..00172d3 100644

drivers/usb/phy/Makefile +0 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_SAMSUNG_USBPHY)		+= phy-

samsung-usb.o

Quoted 7 lines

drivers/usb/phy/Makefile obj-$(CONFIG_SAMSUNG_USBPHY) += phy-samsung-usb.o · line 21

Quoted 4 lines
drivers/usb/phy/Makefile +1 -0
 obj-$(CONFIG_TWL6030_USB)		+= phy-twl6030-usb.o
 obj-$(CONFIG_USB_EHCI_TEGRA)		+= phy-tegra-usb.o
 obj-$(CONFIG_USB_GPIO_VBUS)		+= phy-gpio-vbus-usb.o
+obj-$(CONFIG_USB_HI6220_PHY)		+= phy-hi6220-usb.o

new drivers only on drivers/phy/, sorry.

This driver has many USB dependencies, like otg, gadget. I don't know it can use generic phy currently.

Peter

#10 lore raw

PATCH RESEND v3 4/4 usb: phy: add phy-hi6220-usb

Hi Peter, Felipe,

Quoted 4 lines
Quoted 1 line

new drivers only on drivers/phy/, sorry.

This driver has many USB dependencies, like otg, gadget. I don't know it can use generic phy currently.

I would like to remind you the thread at
http://thread.gmane.org/gmane.linux.kernel/1858137. I have a USB PHY driver here that depends on notify_connect/notify_disconnect, which are not currently provided by the generic phy infrastructure (drivers/phy/). What would be acceptable solution for this case?

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#11 lore raw

PATCH RESEND v3 4/4 usb: phy: add phy-hi6220-usb

Quoted 4 lines · Baruch Siach

Hi Peter, Felipe,

Quoted 2 lines
Quoted 1 line

new drivers only on drivers/phy/, sorry.

Quoted 8 lines
Quoted 2 lines

This driver has many USB dependencies, like otg, gadget. I don't know it can use generic phy currently.

I would like to remind you the thread at
http://thread.gmane.org/gmane.linux.kernel/1858137. I have a USB PHY driver here that depends on notify_connect/notify_disconnect, which are not currently provided by the generic phy infrastructure (drivers/phy/). What would be acceptable solution for this case?

work with Kishon (generic phy maintainer) to add missing pieces you need.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150223/15f8f2d8/attachment.sig>
#12 lore raw

PATCH RESEND v3 4/4 usb: phy: add phy-hi6220-usb

In reply to Peter Chen
Quoted 41 lines · Peter Chen
Quoted 41 lines

drivers/usb/phy/Makefile obj-$(CONFIG_SAMSUNG_USBPHY) += phy-

Quoted 35 lines
---
 drivers/usb/phy/Kconfig          |   9 ++
 drivers/usb/phy/Makefile         |   1 +
 drivers/usb/phy/phy-hi6220-usb.c | 306
+++++++++++++++++++++++++++++++++++++++
 3 files changed, 316 insertions(+)
 create mode 100644 drivers/usb/phy/phy-hi6220-usb.c
drivers/usb/phy/Kconfig index renamed from drivers/usb/phy/Kconfig +0 -0

c6d0c8e..405a3d0 100644

drivers/usb/phy/Kconfig +9 -0
@@ -173,6 +173,15 @@ config USB_MXS_PHY
 
 	  MXS Phy is used by some of the i.MX SoCs, for example imx23/28/6x.
 
+config USB_HI6220_PHY
+	tristate "hi6220 USB PHY support"
+	select USB_PHY
+	select MFD_SYSCON
+	help
+	  Enable this to support the HISILICON HI6220 USB PHY.
+
+	  To compile this driver as a module, choose M here.
+
 config USB_RCAR_PHY
 	tristate "Renesas R-Car USB PHY support"
 	depends on USB || USB_GADGET
drivers/usb/phy/Makefile index renamed from drivers/usb/phy/Makefile +0 -0

75f2bba..00172d3 100644

drivers/usb/phy/Makefile +0 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_SAMSUNG_USBPHY)		+= phy-

samsung-usb.o

Quoted 4 lines
drivers/usb/phy/Makefile +1 -0
 obj-$(CONFIG_TWL6030_USB)		+= phy-twl6030-usb.o
 obj-$(CONFIG_USB_EHCI_TEGRA)		+= phy-tegra-usb.o
 obj-$(CONFIG_USB_GPIO_VBUS)		+= phy-gpio-vbus-usb.o
+obj-$(CONFIG_USB_HI6220_PHY)		+= phy-hi6220-usb.o
Quoted 5 lines
Quoted 2 lines

new drivers only on drivers/phy/, sorry.

This driver has many USB dependencies, like otg, gadget. I don't know it can use generic phy currently.

then we improve generic phy framework. It's about time we moved everything to that anyway.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150223/1ab420a7/attachment.sig>
author
#13 lore raw

PATCH RESEND v3 4/4 usb: phy: add phy-hi6220-usb

In reply to Felipe Balbi
Quoted 23 lines · Felipe Balbi
Quoted 23 lines
drivers/usb/phy/Kconfig +9 -0
index c6d0c8e..405a3d0 100644
@@ -173,6 +173,15 @@ config USB_MXS_PHY
 
  	  MXS Phy is used by some of the i.MX SoCs, for example imx23/28/6x.
 
+config USB_HI6220_PHY
+	tristate "hi6220 USB PHY support"
+	select USB_PHY
+	select MFD_SYSCON
+	help
+	  Enable this to support the HISILICON HI6220 USB PHY.
+
+	  To compile this driver as a module, choose M here.
+
  config USB_RCAR_PHY
  	tristate "Renesas R-Car USB PHY support"
  	depends on USB || USB_GADGET
drivers/usb/phy/Makefile +0 -1
index 75f2bba..00172d3 100644
--- a/drivers/usb/phy/Makefile
Quoted 9 lines

drivers/usb/phy/Makefile obj-$(CONFIG_SAMSUNG_USBPHY) += phy-samsung-usb.o · line 21

Quoted 6 lines

+++ b/drivers/usb/phy/Makefile

drivers/usb/phy/Makefile +1 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_SAMSUNG_USBPHY)		+= phy-samsung-usb.o
  obj-$(CONFIG_TWL6030_USB)		+= phy-twl6030-usb.o
  obj-$(CONFIG_USB_EHCI_TEGRA)		+= phy-tegra-usb.o
  obj-$(CONFIG_USB_GPIO_VBUS)		+= phy-gpio-vbus-usb.o
+obj-$(CONFIG_USB_HI6220_PHY)		+= phy-hi6220-usb.o

new drivers only on drivers/phy/, sorry.

One more quesiton.
Should I also move Documentation/devicetree/bindings/usb/hi6220-usb.txt to Documentation/devicetree/bindings/phy/?

I describing both usb controller and phy here, is it still should be put under Documentation/devicetree/bindings/usb/?

Hisilicon hi6220 SoC USB controller
-----------------------------

usb controller is inherited from dwc2, refer dwc2.txt
-----

Required properties:
- compatible: "hisilicon,hi6220-usb"
Refer to dwc2.txt for dwc2 usb properties

PHY:
-----

Required properties:
- compatible: "hisilicon,hi6220-usb-phy"
- vcc-supply: phandle to the regulator that provides power to the PHY.
- clocks: phandle and clock specifier of the PHY clock.
- hisilicon,peripheral-syscon: phandle of syscon used to control peripheral.
- hisilicon,vbus-gpios: gpio of detecting vbus.
- hisilicon,id-gpios: gpio of detecting id.

Example:

	sys_ctrl: syscon at f7030000 {
		compatible = "hisilicon,sysctrl", "syscon";
	        reg = <0x0 0xf7030000 0x0 0x1000>;
	};

	usb_phy: usb-phy {
		compatible = "hisilicon,hi6220-usb-phy";
		vcc-supply = <&fixed_5v_hub>;
		hisilicon,vbus-gpios = <&gpio2 6 0>;
		hisilicon,id-gpios = <&gpio2 5 0>;
		hisilicon,peripheral-syscon = <&sys_ctrl>;
		clocks = <&clock_sys HI6220_USBOTG_HCLK>;
	};

	usb: usb at f72c0000 {
		compatible = "hisilicon,hi6220-usb";
		reg = <0x0 0xf72c0000 0x0 0x40000>;
		phys = <&usb_phy>;
		dr_mode = "otg";
		g-use-dma;
		g-rx-fifo-size = <512>;
		g-np-tx-fifo-size = <128>;
		g-tx-fifo-size = <128>;
		interrupts = <0 77 0x4>;
	};