Skip to contentSkip to conversation

USB support for DRA7-evm

PATCH In review Roger Quadros 5 participants 25 messages Mar 7, 2014 – Jul 2, 2014

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

cover USB support for DRA7-evm

Hi,

This series enables the 2 USB ports on the DRA7-evm.

Patches are based on on 3.14-rc4 with balbi/next, linux-phy/next, omap-for-v3.15/dt merged and [1] applied.

[1] - http://article.gmane.org/gmane.linux.drivers.devicetree/65223.

cheers,
-roger

---
Roger Quadros (8):
CLK: ti: dra7: Initialize USB_DPLL
ARM: dts: dra7-clock: Add "l3init_960m_gfclk" clock gate
ARM: DRA7: hwmod: Add SYSCONFIG for usb_otg_ss
phy: omap-usb2: Use generic clock names "wkupclk" and "refclk"
phy: omap-usb2: Add clock names to Documentation binding
ARM: dts: omap4+: Add clocks to USB2 PHY node
ARM: dts: dra7: Add USB related nodes
dts: dra7-evm: add USB support

 Documentation/devicetree/bindings/phy/ti-phy.txt |   7 ++
 arch/arm/boot/dts/dra7-evm.dts                   |  24 +++++
 arch/arm/boot/dts/dra7.dtsi                      | 110 +++++++++++++++++++++++
 arch/arm/boot/dts/dra7xx-clocks.dtsi             |  12 ++-
 arch/arm/boot/dts/omap4.dtsi                     |   2 +
 arch/arm/boot/dts/omap5.dtsi                     |   2 +
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c        |  22 ++---
 drivers/clk/ti/clk-7xx.c                         |  11 +++
 drivers/phy/phy-omap-usb2.c                      |   8 +-
 9 files changed, 182 insertions(+), 16 deletions(-)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/8 CLK: ti: dra7: Initialize USB_DPLL

USB_DPLL must be initialized and locked at boot so that USB modules can work.

Also program USB_DLL_M2 output to half rate.

CC Mike Turquette <[email protected]>
CC Tero Kristo <[email protected]>
---
 drivers/clk/ti/clk-7xx.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/clk/ti/clk-7xx.c +11 -0
index 9977653..f89f3c2 100644
@@ -18,6 +18,7 @@
 
 #define DRA7_DPLL_ABE_DEFFREQ				361267200
 #define DRA7_DPLL_GMAC_DEFFREQ				1000000000
+#define DRA7_DPLL_USB_DEFFREQ				960000000
 
 
 static struct ti_dt_clk dra7xx_clks[] = {
@@ -328,5 +329,15 @@ int __init dra7xx_dt_clk_init(void)
 	if (rc)
 		pr_err("%s: failed to configure GMAC DPLL!\n", __func__);
 
+	dpll_ck = clk_get_sys(NULL, "dpll_usb_ck");
+	rc = clk_set_rate(dpll_ck, DRA7_DPLL_USB_DEFFREQ);
+	if (rc)
+		pr_err("%s: failed to configure USB DPLL!\n", __func__);
+
+	dpll_ck = clk_get_sys(NULL, "dpll_usb_m2_ck");
+	rc = clk_set_rate(dpll_ck, DRA7_DPLL_USB_DEFFREQ/2);
+	if (rc)
+		pr_err("%s: failed to set USB_DPLL M2 OUT\n", __func__);
+
 	return rc;
 }
Signature · 1 line
1.8.3.2
#2 lore raw

Re: [PATCH 1/8] CLK: ti: dra7: Initialize USB_DPLL

Quoted 28 lines · Roger Quadros

USB_DPLL must be initialized and locked at boot so that USB modules can work.

Also program USB_DLL_M2 output to half rate.

CC Mike Turquette <[email protected]>
CC Tero Kristo <[email protected]>
---
  drivers/clk/ti/clk-7xx.c | 11 +++++++++++
  1 file changed, 11 insertions(+)
drivers/clk/ti/clk-7xx.c +1 -0
index 9977653..f89f3c2 100644
@@ -18,6 +18,7 @@
 
  #define DRA7_DPLL_ABE_DEFFREQ				361267200
  #define DRA7_DPLL_GMAC_DEFFREQ				1000000000
+#define DRA7_DPLL_USB_DEFFREQ				960000000
 
 
  static struct ti_dt_clk dra7xx_clks[] = {
@@ -328,5 +329,15 @@ int __init dra7xx_dt_clk_init(void)
  	if (rc)
  		pr_err("%s: failed to configure GMAC DPLL!\n", __func__);
 

drivers/clk/ti/clk-7xx.c int __init dra7xx_dt_clk_init(void) · line 341

Quoted 10 lines
drivers/clk/ti/clk-7xx.c +10 -0
+	dpll_ck = clk_get_sys(NULL, "dpll_usb_ck");
+	rc = clk_set_rate(dpll_ck, DRA7_DPLL_USB_DEFFREQ);
+	if (rc)
+		pr_err("%s: failed to configure USB DPLL!\n", __func__);
+
+	dpll_ck = clk_get_sys(NULL, "dpll_usb_m2_ck");
+	rc = clk_set_rate(dpll_ck, DRA7_DPLL_USB_DEFFREQ/2);
+	if (rc)
+		pr_err("%s: failed to set USB_DPLL M2 OUT\n", __func__);
+

I would rather see this done using the default-rate mechanism provided here:

https://www.mail-archive.com/linux-omap at vger.kernel.org/msg101300.html

However, this remains to be commented by Mike whether the patch is okay or not.

-Tero

Quoted 3 lines
drivers/clk/ti/clk-7xx.c +0 -0
  	return rc;
  }
maintainer
#3 lore raw

Re: [PATCH 1/8] CLK: ti: dra7: Initialize USB_DPLL

Quoted 42 lines · Tero Kristo
Quoted 28 lines · Roger Quadros

USB_DPLL must be initialized and locked at boot so that USB modules can work.

Also program USB_DLL_M2 output to half rate.

CC Mike Turquette <[email protected]>
CC Tero Kristo <[email protected]>
---
 drivers/clk/ti/clk-7xx.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/clk/ti/clk-7xx.c +1 -0
index 9977653..f89f3c2 100644
@@ -18,6 +18,7 @@
 
 #define DRA7_DPLL_ABE_DEFFREQ				361267200
 #define DRA7_DPLL_GMAC_DEFFREQ				1000000000
+#define DRA7_DPLL_USB_DEFFREQ				960000000
 
 
 static struct ti_dt_clk dra7xx_clks[] = {
@@ -328,5 +329,15 @@ int __init dra7xx_dt_clk_init(void)
 	if (rc)
 		pr_err("%s: failed to configure GMAC DPLL!\n", __func__);
 

drivers/clk/ti/clk-7xx.c int __init dra7xx_dt_clk_init(void) · line 341

Quoted 10 lines
drivers/clk/ti/clk-7xx.c +10 -0
+	dpll_ck = clk_get_sys(NULL, "dpll_usb_ck");
+	rc = clk_set_rate(dpll_ck, DRA7_DPLL_USB_DEFFREQ);
+	if (rc)
+		pr_err("%s: failed to configure USB DPLL!\n", __func__);
+
+	dpll_ck = clk_get_sys(NULL, "dpll_usb_m2_ck");
+	rc = clk_set_rate(dpll_ck, DRA7_DPLL_USB_DEFFREQ/2);
+	if (rc)
+		pr_err("%s: failed to set USB_DPLL M2 OUT\n", __func__);
+

I would rather see this done using the default-rate mechanism provided here:

Quoted 4 lines

https://www.mail-archive.com/linux-omap at vger.kernel.org/msg101300.html

However, this remains to be commented by Mike whether the patch is okay or not.

Yes let's wait for that and not add hacks for new features.

Regards,

Tony

#4 lore raw

PATCH v2 1/8 ARM: dts: dra7: Initialize USB_DPLL

In reply to Roger Quadros

USB_DPLL must be initialized and locked at boot so that USB modules can work.

Program USB_DLL_M2 output to half rate as well.

Patch depends on
https://www.mail-archive.com/linux-omap at vger.kernel.org/msg101300.html

CC Mike Turquette <[email protected]>
CC Tero Kristo <[email protected]>
---
 arch/arm/boot/dts/dra7.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/dra7.dtsi +8 -0
index 597979b..f376923 100644
@@ -815,3 +815,11 @@
 };
 
 /include/ "dra7xx-clocks.dtsi"
+
+&dpll_usb_ck {
+        default-rate = <960000000>;
+};
+
+&dpll_usb_m2_ck {
+	default-rate = <480000000>;
+};
Signature · 1 line
1.8.3.2
#5 lore raw

Re: [PATCH v2 1/8] ARM: dts: dra7: Initialize USB_DPLL

Quoted 22 lines · Roger Quadros

USB_DPLL must be initialized and locked at boot so that USB modules can work.

Program USB_DLL_M2 output to half rate as well.

Patch depends on
https://www.mail-archive.com/linux-omap at vger.kernel.org/msg101300.html

CC Mike Turquette <[email protected]>
CC Tero Kristo <[email protected]>
---
  arch/arm/boot/dts/dra7.dtsi | 8 ++++++++
  1 file changed, 8 insertions(+)
arch/arm/boot/dts/dra7.dtsi +0 -0
index 597979b..f376923 100644
@@ -815,3 +815,11 @@
  };

arch/arm/boot/dts/dra7.dtsi line 825

Quoted 10 lines
arch/arm/boot/dts/dra7.dtsi +8 -0
 
  /include/ "dra7xx-clocks.dtsi"
+
+&dpll_usb_ck {
+        default-rate = <960000000>;
+};
+
+&dpll_usb_m2_ck {
+	default-rate = <480000000>;
+};

You can add these directly under the dra7xx-clocks.dtsi file as well, as I don't think anybody needs to modify these. And the properties can be added directly under the nodes themselves.

However, this patch can't be acked yet as we have no feedback from Mike for the default-rate proposal.

-Tero

#6 lore raw

Re: [PATCH v2 1/8] ARM: dts: dra7: Initialize USB_DPLL

Quoted 36 lines · Tero Kristo
Quoted 22 lines · Roger Quadros

USB_DPLL must be initialized and locked at boot so that USB modules can work.

Program USB_DLL_M2 output to half rate as well.

Patch depends on
https://www.mail-archive.com/linux-omap at vger.kernel.org/msg101300.html

CC Mike Turquette <[email protected]>
CC Tero Kristo <[email protected]>
---
  arch/arm/boot/dts/dra7.dtsi | 8 ++++++++
  1 file changed, 8 insertions(+)
arch/arm/boot/dts/dra7.dtsi +0 -0
index 597979b..f376923 100644
@@ -815,3 +815,11 @@
  };

arch/arm/boot/dts/dra7.dtsi line 825

Quoted 10 lines
arch/arm/boot/dts/dra7.dtsi +8 -0
 
  /include/ "dra7xx-clocks.dtsi"
+
+&dpll_usb_ck {
+        default-rate = <960000000>;
+};
+
+&dpll_usb_m2_ck {
+    default-rate = <480000000>;
+};

You can add these directly under the dra7xx-clocks.dtsi file as well, as I don't think anybody needs to modify these. And the properties can be added directly under the nodes themselves.

Quoted 1 line

However, this patch can't be acked yet as we have no feedback from Mike for the default-rate proposal.

OK. I'll wait for the "default-rate" patch to be approved first and then revise this patch based on your suggestion. Thanks for the review.

cheers,
-roger

#7 lore raw

Re: [PATCH 1/8] CLK: ti: dra7: Initialize USB_DPLL

In reply to Roger Quadros
Quoted 11 lines · Roger Quadros

USB_DPLL must be initialized and locked at boot so that USB modules can work.

Also program USB_DLL_M2 output to half rate.

CC Mike Turquette <[email protected]>
CC Tero Kristo <[email protected]>
---
  drivers/clk/ti/clk-7xx.c | 11 +++++++++++
  1 file changed, 11 insertions(+)

Hi,

Resurrecting this patch, as it seems the clock-parenting stuff via DT hasn't really moved that much forward.

Thus, this patch has been now queued for 3.17, thanks.

-Tero

Quoted 30 lines
drivers/clk/ti/clk-7xx.c +11 -0
index 9977653..f89f3c2 100644
@@ -18,6 +18,7 @@
 
  #define DRA7_DPLL_ABE_DEFFREQ				361267200
  #define DRA7_DPLL_GMAC_DEFFREQ				1000000000
+#define DRA7_DPLL_USB_DEFFREQ				960000000
 
 
  static struct ti_dt_clk dra7xx_clks[] = {
@@ -328,5 +329,15 @@ int __init dra7xx_dt_clk_init(void)
  	if (rc)
  		pr_err("%s: failed to configure GMAC DPLL!\n", __func__);
 
+	dpll_ck = clk_get_sys(NULL, "dpll_usb_ck");
+	rc = clk_set_rate(dpll_ck, DRA7_DPLL_USB_DEFFREQ);
+	if (rc)
+		pr_err("%s: failed to configure USB DPLL!\n", __func__);
+
+	dpll_ck = clk_get_sys(NULL, "dpll_usb_m2_ck");
+	rc = clk_set_rate(dpll_ck, DRA7_DPLL_USB_DEFFREQ/2);
+	if (rc)
+		pr_err("%s: failed to set USB_DPLL M2 OUT\n", __func__);
+
  	return rc;
  }
#8 lore raw

PATCH 2/8 ARM: dts: dra7-clock: Add "l3init_960m_gfclk" clock gate

In reply to Roger Quadros

This clock gate description was missing in older Reference manuals. It is present on the SoC to provide 960MHz reference clock to the internal USB PHYs.

Use l3init_960m_gfclk as parent of usb_otg_ss1_refclk960m and usb_otg_ss2_refclk960m.

---
 arch/arm/boot/dts/dra7xx-clocks.dtsi | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
arch/arm/boot/dts/dra7xx-clocks.dtsi +10 -2
index e96da9a..b8d3a9d 100644
@@ -1386,6 +1386,14 @@
 		ti,dividers = <1>, <8>;
 	};
 
+	l3init_960m_gfclk: l3init_960m_gfclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_usb_clkdcoldo>;
+		ti,bit-shift = <8>;
+		reg = <0x06c0>;
+	};
+
 	dss_32khz_clk: dss_32khz_clk {
 		#clock-cells = <0>;
 		compatible = "ti,gate-clock";
@@ -1533,7 +1541,7 @@
 	usb_otg_ss1_refclk960m: usb_otg_ss1_refclk960m {
 		#clock-cells = <0>;
 		compatible = "ti,gate-clock";
-		clocks = <&dpll_usb_clkdcoldo>;
+		clocks = <&l3init_960m_gfclk>;
 		ti,bit-shift = <8>;
 		reg = <0x13f0>;
 	};
@@ -1541,7 +1549,7 @@
 	usb_otg_ss2_refclk960m: usb_otg_ss2_refclk960m {
 		#clock-cells = <0>;
 		compatible = "ti,gate-clock";
-		clocks = <&dpll_usb_clkdcoldo>;
+		clocks = <&l3init_960m_gfclk>;
 		ti,bit-shift = <8>;
 		reg = <0x1340>;
 	};
Signature · 1 line
1.8.3.2
#9 lore raw

Re: [PATCH 2/8] ARM: dts: dra7-clock: Add "l3init_960m_gfclk" clock gate

Quoted 3 lines · Roger Quadros

This clock gate description was missing in older Reference manuals. It is present on the SoC to provide 960MHz reference clock to the internal USB PHYs.

Can you provide a document reference here?

-Tero

Quoted 48 lines

Use l3init_960m_gfclk as parent of usb_otg_ss1_refclk960m and usb_otg_ss2_refclk960m.

---
  arch/arm/boot/dts/dra7xx-clocks.dtsi | 12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)
arch/arm/boot/dts/dra7xx-clocks.dtsi +10 -2
index e96da9a..b8d3a9d 100644
@@ -1386,6 +1386,14 @@
  		ti,dividers = <1>, <8>;
  	};
 
+	l3init_960m_gfclk: l3init_960m_gfclk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&dpll_usb_clkdcoldo>;
+		ti,bit-shift = <8>;
+		reg = <0x06c0>;
+	};
+
  	dss_32khz_clk: dss_32khz_clk {
  		#clock-cells = <0>;
  		compatible = "ti,gate-clock";
@@ -1533,7 +1541,7 @@
  	usb_otg_ss1_refclk960m: usb_otg_ss1_refclk960m {
  		#clock-cells = <0>;
  		compatible = "ti,gate-clock";
-		clocks = <&dpll_usb_clkdcoldo>;
+		clocks = <&l3init_960m_gfclk>;
  		ti,bit-shift = <8>;
  		reg = <0x13f0>;
  	};
@@ -1541,7 +1549,7 @@
  	usb_otg_ss2_refclk960m: usb_otg_ss2_refclk960m {
  		#clock-cells = <0>;
  		compatible = "ti,gate-clock";
-		clocks = <&dpll_usb_clkdcoldo>;
+		clocks = <&l3init_960m_gfclk>;
  		ti,bit-shift = <8>;
  		reg = <0x1340>;
  	};
#10 lore raw

Re: [PATCH 2/8] ARM: dts: dra7-clock: Add "l3init_960m_gfclk" clock gate

Quoted 7 lines · Tero Kristo
Quoted 3 lines · Roger Quadros

This clock gate description was missing in older Reference manuals. It is present on the SoC to provide 960MHz reference clock to the internal USB PHYs.

Can you provide a document reference here?

Unfortunately it hasn't yet been included in the TRM.
I have the internal defect ID but I don't think it makes any sense here.

DRA7xx-TRMINC00203

cheers,
-roger

Quoted 50 lines
Quoted 49 lines

Use l3init_960m_gfclk as parent of usb_otg_ss1_refclk960m and usb_otg_ss2_refclk960m.

---
  arch/arm/boot/dts/dra7xx-clocks.dtsi | 12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)
arch/arm/boot/dts/dra7xx-clocks.dtsi +10 -2
index e96da9a..b8d3a9d 100644
@@ -1386,6 +1386,14 @@
          ti,dividers = <1>, <8>;
      };
 
+    l3init_960m_gfclk: l3init_960m_gfclk {
+        #clock-cells = <0>;
+        compatible = "ti,gate-clock";
+        clocks = <&dpll_usb_clkdcoldo>;
+        ti,bit-shift = <8>;
+        reg = <0x06c0>;
+    };
+
      dss_32khz_clk: dss_32khz_clk {
          #clock-cells = <0>;
          compatible = "ti,gate-clock";
@@ -1533,7 +1541,7 @@
      usb_otg_ss1_refclk960m: usb_otg_ss1_refclk960m {
          #clock-cells = <0>;
          compatible = "ti,gate-clock";
-        clocks = <&dpll_usb_clkdcoldo>;
+        clocks = <&l3init_960m_gfclk>;
          ti,bit-shift = <8>;
          reg = <0x13f0>;
      };
@@ -1541,7 +1549,7 @@
      usb_otg_ss2_refclk960m: usb_otg_ss2_refclk960m {
          #clock-cells = <0>;
          compatible = "ti,gate-clock";
-        clocks = <&dpll_usb_clkdcoldo>;
+        clocks = <&l3init_960m_gfclk>;
          ti,bit-shift = <8>;
          reg = <0x1340>;
      };
#11 lore raw

PATCH 3/8 ARM: DRA7: hwmod: Add SYSCONFIG for usb_otg_ss

In reply to Roger Quadros

Add the sysconfig class bits for the Super Speed USB controllers

---
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/mach-omap2/omap_hwmod_7xx_data.c +12 -0
index 3c9a430..cca24ad 100644
@@ -1752,8 +1752,20 @@ static struct omap_hwmod dra7xx_uart6_hwmod = {
  *
  */
 
+static struct omap_hwmod_class_sysconfig dra7xx_usb_otg_ss_sysc = {
+	.rev_offs	= 0x0000,
+	.sysc_offs	= 0x0010,
+	.sysc_flags	= (SYSC_HAS_DMADISABLE | SYSC_HAS_MIDLEMODE |
+			   SYSC_HAS_SIDLEMODE),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+			   SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
+			   MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
+	.sysc_fields	= &omap_hwmod_sysc_type2,
+};
+
 static struct omap_hwmod_class dra7xx_usb_otg_ss_hwmod_class = {
 	.name	= "usb_otg_ss",
+	.sysc	= &dra7xx_usb_otg_ss_sysc,
 };
 
 /* usb_otg_ss1 */
Signature · 1 line
1.8.3.2
#12 lore raw

PATCH 4/8 phy: omap-usb2: Use generic clock names "wkupclk" and "refclk"

In reply to Roger Quadros

As clocks might be named differently on multiple platforms, use a generic name in the driver and allow device tree node to specify the platform specific clock name.

---
 drivers/phy/phy-omap-usb2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/phy/phy-omap-usb2.c +4 -4
index a2205a8..fb5e515 100644
@@ -275,16 +275,16 @@ static int omap_usb2_probe(struct platform_device *pdev)
 	if (IS_ERR(phy_provider))
 		return PTR_ERR(phy_provider);
 
-	phy->wkupclk = devm_clk_get(phy->dev, "usb_phy_cm_clk32k");
+	phy->wkupclk = devm_clk_get(phy->dev, "wkupclk");
 	if (IS_ERR(phy->wkupclk)) {
-		dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n");
+		dev_err(&pdev->dev, "unable to get wkupclk\n");
 		return PTR_ERR(phy->wkupclk);
 	}
 	clk_prepare(phy->wkupclk);
 
-	phy->optclk = devm_clk_get(phy->dev, "usb_otg_ss_refclk960m");
+	phy->optclk = devm_clk_get(phy->dev, "refclk");
 	if (IS_ERR(phy->optclk))
-		dev_vdbg(&pdev->dev, "unable to get refclk960m\n");
+		dev_dbg(&pdev->dev, "unable to get refclk\n");
 	else
 		clk_prepare(phy->optclk);
 
Signature · 1 line
1.8.3.2
#13 lore raw

PATCH 5/8 phy: omap-usb2: Add clock names to Documentation binding

In reply to Roger Quadros

Add "wkupclk" and "refclk" information to DT binding information.

---
 Documentation/devicetree/bindings/phy/ti-phy.txt | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/phy/ti-phy.txt +7 -0
index 4ab9cb1..49c381c 100644
@@ -36,6 +36,11 @@ Required properties:
  - reg : Address and length of the register set for the device.
  - #phy-cells: determine the number of cells that should be given in the
    phandle while referencing this phy.
+ - clocks: a list of phandles and clock-specifier pairs, one for each entry in
+   clock-names.
+ - clock-names: should include:
+   * "wkupclk" - wakeup clock.
+   * "refclk" - reference clock (optional).
 
 Optional properties:
  - ctrl-module : phandle of the control module used by PHY driver to power on
@@ -48,6 +53,8 @@ usb2phy at 4a0ad080 {
 	reg = <0x4a0ad080 0x58>;
 	ctrl-module = <&omap_control_usb>;
 	#phy-cells = <0>;
+	clocks = <&usb_phy_cm_clk32k>, <&usb_otg_ss_refclk960m>;
+	clock-names = "wkupclk", "refclk";
 };
 
 TI PIPE3 PHY
Signature · 1 line
1.8.3.2
#14 lore raw

Re: [PATCH 5/8] phy: omap-usb2: Add clock names to Documentation binding

Quoted 4 lines · Roger Quadros

Add "wkupclk" and "refclk" information to DT binding information.

---

so, should I take this one ?

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/20140307/bc09c9a4/attachment.sig>
#15 lore raw

Re: [PATCH 5/8] phy: omap-usb2: Add clock names to Documentation binding

Felipe,

Quoted 7 lines · Felipe Balbi
Quoted 4 lines · Roger Quadros

Add "wkupclk" and "refclk" information to DT binding information.

---

so, should I take this one ?

yes.. the ti-phy.txt is only in your tree.

Thanks
Kishon

Quoted 1 line
#16 lore raw

Re: [PATCH 5/8] phy: omap-usb2: Add clock names to Documentation binding

Quoted 4 lines · Kishon Vijay Abraham I

Felipe,

Quoted 1 line · Felipe Balbi

On Fri, Mar 07, 2014 at 03:09:08PM +0200, Roger Quadros wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Add "wkupclk" and "refclk" information to DT binding information.

---

so, should I take this one ?

yes.. the ti-phy.txt is only in your tree.

yeah, I know that, but I need to know if this is safe to be applied as in "it won't change anymore".

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/20140307/0e1f347b/attachment.sig>
#17 lore raw

PATCH 6/8 ARM: dts: omap4+: Add clocks to USB2 PHY node

In reply to Roger Quadros

The USB2 PHY driver expects named clocks for wakeup clock and reference clock. Provide this information for USB2 PHY nodes in OMAP4 and OMAP5 SoC DTS.

---
 arch/arm/boot/dts/omap4.dtsi | 2 ++
 arch/arm/boot/dts/omap5.dtsi | 2 ++
 2 files changed, 4 insertions(+)
arch/arm/boot/dts/omap4.dtsi +2 -0
index 4e15be5..2f6cfa6 100644
@@ -608,6 +608,8 @@
 				compatible = "ti,omap-usb2";
 				reg = <0x4a0ad080 0x58>;
 				ctrl-module = <&omap_control_usb2phy>;
+				clocks = <&usb_phy_cm_clk32k>;
+				clock-names = "wkupclk";
 				#phy-cells = <0>;
 			};
 		};
arch/arm/boot/dts/omap5.dtsi +2 -0
index 521caab..bf629bb 100644
@@ -769,6 +769,8 @@
 				compatible = "ti,omap-usb2";
 				reg = <0x4a084000 0x7c>;
 				ctrl-module = <&omap_control_usb2phy>;
+				clocks = <&usb_phy_cm_clk32k>, <&usb_otg_ss_refclk960m>;
+				clock-names = "wkupclk", "refclk";
 				#phy-cells = <0>;
 			};
 
Signature · 1 line
1.8.3.2
#18 lore raw

PATCH 7/8 ARM: dts: dra7: Add USB related nodes

In reply to Roger Quadros

Add nodes for the Super Speed USB controllers, omap-control-usb, USB2 PHY and USB3 PHY devices.

Remove ocp2scp1 address space from hwmod data as it is now provided via device tree.

---
 arch/arm/boot/dts/dra7.dtsi               | 110 ++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c |  10 ---
 2 files changed, 110 insertions(+), 10 deletions(-)
arch/arm/boot/dts/dra7.dtsi +110 -0
index 597979b..1e73900 100644
@@ -811,6 +811,116 @@
 			clocks = <&sata_ref_clk>;
 			ti,hwmods = "sata";
 		};
+
+		omap_control_usb2phy1: control-phy at 4a002300 {
+			compatible = "ti,control-phy-usb2";
+			reg = <0x4a002300 0x4>;
+			reg-names = "power";
+		};
+
+		omap_control_usb3phy1: control-phy at 4a002370 {
+			compatible = "ti,control-phy-pipe3";
+			reg = <0x4a002370 0x4>;
+			reg-names = "power";
+		};
+
+		omap_control_usb2phy2: control-phy at 0x4a002e74 {
+			compatible = "ti,control-phy-usb2-dra7";
+			reg = <0x4a002e74 0x4>;
+			reg-names = "power";
+		};
+
+		/* OCP2SCP1 */
+		ocp2scp at 4a080000 {
+			compatible = "ti,omap-ocp2scp";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+			reg = <0x4a080000 0x20>;
+			ti,hwmods = "ocp2scp1";
+
+			usb2_phy1: phy at 4a084000 {
+				compatible = "ti,omap-usb2";
+				reg = <0x4a084000 0x400>;
+				ctrl-module = <&omap_control_usb2phy1>;
+				clocks = <&usb_phy1_always_on_clk32k>,
+					 <&usb_otg_ss1_refclk960m>;
+				clock-names =	"wkupclk",
+						"refclk";
+				#phy-cells = <0>;
+			};
+
+			usb2_phy2: phy at 4a085000 {
+				compatible = "ti,omap-usb2";
+				reg = <0x4a085000 0x400>;
+				ctrl-module = <&omap_control_usb2phy2>;
+				clocks = <&usb_phy2_always_on_clk32k>,
+					 <&usb_otg_ss2_refclk960m>;
+				clock-names =	"wkupclk",
+						"refclk";
+				#phy-cells = <0>;
+			};
+
+			usb3_phy1: phy at 4a084400 {
+				compatible = "ti,omap-usb3";
+				reg = <0x4a084400 0x80>,
+				      <0x4a084800 0x64>,
+				      <0x4a084c00 0x40>;
+				reg-names = "phy_rx", "phy_tx", "pll_ctrl";
+				ctrl-module = <&omap_control_usb3phy1>;
+				clocks = <&usb_phy3_always_on_clk32k>,
+					 <&sys_clkin1>,
+					 <&usb_otg_ss1_refclk960m>,
+					 <&dpll_core_h13x2_ck>;
+				clock-names =	"wkupclk",
+						"sysclk",
+						"refclk",
+						"optclk";
+				#phy-cells = <0>;
+			};
+		};
+
+		omap_dwc3_1 at 48880000 {
+			compatible = "ti,dwc3";
+			ti,hwmods = "usb_otg_ss1";
+			reg = <0x48880000 0x10000>;
+			interrupts = <0 77 4>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			utmi-mode = <2>;
+			ranges;
+			usb1: usb at 48890000 {
+				compatible = "snps,dwc3";
+				reg = <0x48890000 0x17000>;
+				interrupts = <0 76 4>;
+				phys = <&usb2_phy1>, <&usb3_phy1>;
+				phy-names = "usb2-phy", "usb3-phy";
+				tx-fifo-resize;
+				maximum-speed = "super-speed";
+				dr_mode = "otg";
+			};
+		};
+
+		omap_dwc3_2 at 488c0000 {
+			compatible = "ti,dwc3";
+			ti,hwmods = "usb_otg_ss2";
+			reg = <0x488c0000 0x10000>;
+			interrupts = <0 92 4>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			utmi-mode = <2>;
+			ranges;
+			usb2: usb at 488d0000 {
+				compatible = "snps,dwc3";
+				reg = <0x488d0000 0x17000>;
+				interrupts = <0 78 4>;
+				phys = <&usb2_phy2>;
+				phy-names = "usb2-phy";
+				tx-fifo-resize;
+				maximum-speed = "high-speed";
+				dr_mode = "otg";
+			};
+		};
 	};
 };
 
arch/arm/mach-omap2/omap_hwmod_7xx_data.c +0 -10
index cca24ad..403ba02 100644
@@ -2351,21 +2351,11 @@ static struct omap_hwmod_ocp_if dra7xx_l4_cfg__mpu = {
 	.user		= OCP_USER_MPU | OCP_USER_SDMA,
 };
 
-static struct omap_hwmod_addr_space dra7xx_ocp2scp1_addrs[] = {
-	{
-		.pa_start	= 0x4a080000,
-		.pa_end		= 0x4a08001f,
-		.flags		= ADDR_TYPE_RT
-	},
-	{ }
-};
-
 /* l4_cfg -> ocp2scp1 */
 static struct omap_hwmod_ocp_if dra7xx_l4_cfg__ocp2scp1 = {
 	.master		= &dra7xx_l4_cfg_hwmod,
 	.slave		= &dra7xx_ocp2scp1_hwmod,
 	.clk		= "l4_root_clk_div",
-	.addr		= dra7xx_ocp2scp1_addrs,
 	.user		= OCP_USER_MPU | OCP_USER_SDMA,
 };
 
Signature · 1 line
1.8.3.2
#19 lore raw

Re: [PATCH 7/8] ARM: dts: dra7: Add USB related nodes

Hi Roger,

Quoted 75 lines · Roger Quadros

Add nodes for the Super Speed USB controllers, omap-control-usb, USB2 PHY and USB3 PHY devices.

Remove ocp2scp1 address space from hwmod data as it is now provided via device tree.

---
  arch/arm/boot/dts/dra7.dtsi               | 110 ++++++++++++++++++++++++++++++
  arch/arm/mach-omap2/omap_hwmod_7xx_data.c |  10 ---
  2 files changed, 110 insertions(+), 10 deletions(-)
arch/arm/boot/dts/dra7.dtsi +55 -0
index 597979b..1e73900 100644
@@ -811,6 +811,116 @@
  			clocks = <&sata_ref_clk>;
  			ti,hwmods = "sata";
  		};
+
+		omap_control_usb2phy1: control-phy at 4a002300 {
+			compatible = "ti,control-phy-usb2";
+			reg = <0x4a002300 0x4>;
+			reg-names = "power";
+		};
+
+		omap_control_usb3phy1: control-phy at 4a002370 {
+			compatible = "ti,control-phy-pipe3";
+			reg = <0x4a002370 0x4>;
+			reg-names = "power";
+		};
+
+		omap_control_usb2phy2: control-phy at 0x4a002e74 {
+			compatible = "ti,control-phy-usb2-dra7";
+			reg = <0x4a002e74 0x4>;
+			reg-names = "power";
+		};
+
+		/* OCP2SCP1 */
+		ocp2scp at 4a080000 {
+			compatible = "ti,omap-ocp2scp";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+			reg = <0x4a080000 0x20>;
+			ti,hwmods = "ocp2scp1";
+
+			usb2_phy1: phy at 4a084000 {
+				compatible = "ti,omap-usb2";
+				reg = <0x4a084000 0x400>;
+				ctrl-module = <&omap_control_usb2phy1>;
+				clocks = <&usb_phy1_always_on_clk32k>,
+					 <&usb_otg_ss1_refclk960m>;
+				clock-names =	"wkupclk",
+						"refclk";
+				#phy-cells = <0>;
+			};
+
+			usb2_phy2: phy at 4a085000 {
+				compatible = "ti,omap-usb2";
+				reg = <0x4a085000 0x400>;
+				ctrl-module = <&omap_control_usb2phy2>;
+				clocks = <&usb_phy2_always_on_clk32k>,
+					 <&usb_otg_ss2_refclk960m>;
+				clock-names =	"wkupclk",
+						"refclk";
+				#phy-cells = <0>;
+			};
+
+			usb3_phy1: phy at 4a084400 {
+				compatible = "ti,omap-usb3";
+				reg = <0x4a084400 0x80>,
+				      <0x4a084800 0x64>,
+				      <0x4a084c00 0x40>;

arch/arm/boot/dts/dra7.dtsi line 878

Quoted 10 lines
arch/arm/boot/dts/dra7.dtsi +10 -0
+				reg-names = "phy_rx", "phy_tx", "pll_ctrl";
+				ctrl-module = <&omap_control_usb3phy1>;
+				clocks = <&usb_phy3_always_on_clk32k>,
+					 <&sys_clkin1>,
+					 <&usb_otg_ss1_refclk960m>,
+					 <&dpll_core_h13x2_ck>;
+				clock-names =	"wkupclk",
+						"sysclk",
+						"refclk",
+						"optclk";

Do we use this 'optclk' in driver?

-Kishon

#20 lore raw

Re: [PATCH 7/8] ARM: dts: dra7: Add USB related nodes

Quoted 82 lines · Kishon Vijay Abraham I

Hi Roger,

Quoted 79 lines · Roger Quadros

Add nodes for the Super Speed USB controllers, omap-control-usb, USB2 PHY and USB3 PHY devices.

Remove ocp2scp1 address space from hwmod data as it is now provided via device tree.

---
  arch/arm/boot/dts/dra7.dtsi               | 110 ++++++++++++++++++++++++++++++
  arch/arm/mach-omap2/omap_hwmod_7xx_data.c |  10 ---
  2 files changed, 110 insertions(+), 10 deletions(-)
arch/arm/boot/dts/dra7.dtsi +59 -0
index 597979b..1e73900 100644
@@ -811,6 +811,116 @@
              clocks = <&sata_ref_clk>;
              ti,hwmods = "sata";
          };
+
+        omap_control_usb2phy1: control-phy at 4a002300 {
+            compatible = "ti,control-phy-usb2";
+            reg = <0x4a002300 0x4>;
+            reg-names = "power";
+        };
+
+        omap_control_usb3phy1: control-phy at 4a002370 {
+            compatible = "ti,control-phy-pipe3";
+            reg = <0x4a002370 0x4>;
+            reg-names = "power";
+        };
+
+        omap_control_usb2phy2: control-phy at 0x4a002e74 {
+            compatible = "ti,control-phy-usb2-dra7";
+            reg = <0x4a002e74 0x4>;
+            reg-names = "power";
+        };
+
+        /* OCP2SCP1 */
+        ocp2scp at 4a080000 {
+            compatible = "ti,omap-ocp2scp";
+            #address-cells = <1>;
+            #size-cells = <1>;
+            ranges;
+            reg = <0x4a080000 0x20>;
+            ti,hwmods = "ocp2scp1";
+
+            usb2_phy1: phy at 4a084000 {
+                compatible = "ti,omap-usb2";
+                reg = <0x4a084000 0x400>;
+                ctrl-module = <&omap_control_usb2phy1>;
+                clocks = <&usb_phy1_always_on_clk32k>,
+                     <&usb_otg_ss1_refclk960m>;
+                clock-names =    "wkupclk",
+                        "refclk";
+                #phy-cells = <0>;
+            };
+
+            usb2_phy2: phy at 4a085000 {
+                compatible = "ti,omap-usb2";
+                reg = <0x4a085000 0x400>;
+                ctrl-module = <&omap_control_usb2phy2>;
+                clocks = <&usb_phy2_always_on_clk32k>,
+                     <&usb_otg_ss2_refclk960m>;
+                clock-names =    "wkupclk",
+                        "refclk";
+                #phy-cells = <0>;
+            };
+
+            usb3_phy1: phy at 4a084400 {
+                compatible = "ti,omap-usb3";
+                reg = <0x4a084400 0x80>,
+                      <0x4a084800 0x64>,
+                      <0x4a084c00 0x40>;
+                reg-names = "phy_rx", "phy_tx", "pll_ctrl";
+                ctrl-module = <&omap_control_usb3phy1>;
+                clocks = <&usb_phy3_always_on_clk32k>,
+                     <&sys_clkin1>,
Quoted 8 lines

arch/arm/boot/dts/dra7.dtsi line 878

Quoted 6 lines
arch/arm/boot/dts/dra7.dtsi +6 -0
+                     <&usb_otg_ss1_refclk960m>,
+                     <&dpll_core_h13x2_ck>;
+                clock-names =    "wkupclk",
+                        "sysclk",
+                        "refclk",
+                        "optclk";

Do we use this 'optclk' in driver?

No we don't. Still the device seems to work without it. This is supposed to be USB_LFPS_TX_GFCLK or USB3PHY_REF_CLK.

Any idea why it works without that on OMAP5 as well?

cheers,
-roger

#21 lore raw

Re: [PATCH 7/8] ARM: dts: dra7: Add USB related nodes

Quoted 92 lines · Roger Quadros
Quoted 82 lines · Kishon Vijay Abraham I

Hi Roger,

Quoted 79 lines · Roger Quadros

Add nodes for the Super Speed USB controllers, omap-control-usb, USB2 PHY and USB3 PHY devices.

Remove ocp2scp1 address space from hwmod data as it is now provided via device tree.

---
   arch/arm/boot/dts/dra7.dtsi               | 110 ++++++++++++++++++++++++++++++
   arch/arm/mach-omap2/omap_hwmod_7xx_data.c |  10 ---
   2 files changed, 110 insertions(+), 10 deletions(-)
arch/arm/boot/dts/dra7.dtsi +59 -0
index 597979b..1e73900 100644
@@ -811,6 +811,116 @@
               clocks = <&sata_ref_clk>;
               ti,hwmods = "sata";
           };
+
+        omap_control_usb2phy1: control-phy at 4a002300 {
+            compatible = "ti,control-phy-usb2";
+            reg = <0x4a002300 0x4>;
+            reg-names = "power";
+        };
+
+        omap_control_usb3phy1: control-phy at 4a002370 {
+            compatible = "ti,control-phy-pipe3";
+            reg = <0x4a002370 0x4>;
+            reg-names = "power";
+        };
+
+        omap_control_usb2phy2: control-phy at 0x4a002e74 {
+            compatible = "ti,control-phy-usb2-dra7";
+            reg = <0x4a002e74 0x4>;
+            reg-names = "power";
+        };
+
+        /* OCP2SCP1 */
+        ocp2scp at 4a080000 {
+            compatible = "ti,omap-ocp2scp";
+            #address-cells = <1>;
+            #size-cells = <1>;
+            ranges;
+            reg = <0x4a080000 0x20>;
+            ti,hwmods = "ocp2scp1";
+
+            usb2_phy1: phy at 4a084000 {
+                compatible = "ti,omap-usb2";
+                reg = <0x4a084000 0x400>;
+                ctrl-module = <&omap_control_usb2phy1>;
+                clocks = <&usb_phy1_always_on_clk32k>,
+                     <&usb_otg_ss1_refclk960m>;
+                clock-names =    "wkupclk",
+                        "refclk";
+                #phy-cells = <0>;
+            };
+
+            usb2_phy2: phy at 4a085000 {
+                compatible = "ti,omap-usb2";
+                reg = <0x4a085000 0x400>;
+                ctrl-module = <&omap_control_usb2phy2>;
+                clocks = <&usb_phy2_always_on_clk32k>,
+                     <&usb_otg_ss2_refclk960m>;
+                clock-names =    "wkupclk",
+                        "refclk";
+                #phy-cells = <0>;
+            };
+
+            usb3_phy1: phy at 4a084400 {
+                compatible = "ti,omap-usb3";
+                reg = <0x4a084400 0x80>,
+                      <0x4a084800 0x64>,
+                      <0x4a084c00 0x40>;
+                reg-names = "phy_rx", "phy_tx", "pll_ctrl";
+                ctrl-module = <&omap_control_usb3phy1>;
+                clocks = <&usb_phy3_always_on_clk32k>,
+                     <&sys_clkin1>,
Quoted 8 lines

arch/arm/boot/dts/dra7.dtsi line 878

Quoted 6 lines
arch/arm/boot/dts/dra7.dtsi +6 -0
+                     <&usb_otg_ss1_refclk960m>,
+                     <&dpll_core_h13x2_ck>;
+                clock-names =    "wkupclk",
+                        "sysclk",
+                        "refclk",
+                        "optclk";

Do we use this 'optclk' in driver?

Quoted 2 lines

No we don't. Still the device seems to work without it. This is supposed to be USB_LFPS_TX_GFCLK or USB3PHY_REF_CLK.

I think it should be enabled. Did you check the status of this clock in CM_L3INIT_CLKSTCTRL? Moreover USB_LFPS_TX_GFCLK is an interface clock, so IIUC setting the module mode will enable it.

Btw how did you tell dpll_core_h13x2_ck enables USB_LFPS_TX_GFCLK?

Cheers
Kishon

#22 lore raw

Re: [PATCH 7/8] ARM: dts: dra7: Add USB related nodes

Quoted 98 lines · Kishon Vijay Abraham I
Quoted 92 lines · Roger Quadros
Quoted 82 lines · Kishon Vijay Abraham I

Hi Roger,

Quoted 79 lines · Roger Quadros

Add nodes for the Super Speed USB controllers, omap-control-usb, USB2 PHY and USB3 PHY devices.

Remove ocp2scp1 address space from hwmod data as it is now provided via device tree.

---
   arch/arm/boot/dts/dra7.dtsi               | 110 ++++++++++++++++++++++++++++++
   arch/arm/mach-omap2/omap_hwmod_7xx_data.c |  10 ---
   2 files changed, 110 insertions(+), 10 deletions(-)
arch/arm/boot/dts/dra7.dtsi +59 -0
index 597979b..1e73900 100644
@@ -811,6 +811,116 @@
               clocks = <&sata_ref_clk>;
               ti,hwmods = "sata";
           };
+
+        omap_control_usb2phy1: control-phy at 4a002300 {
+            compatible = "ti,control-phy-usb2";
+            reg = <0x4a002300 0x4>;
+            reg-names = "power";
+        };
+
+        omap_control_usb3phy1: control-phy at 4a002370 {
+            compatible = "ti,control-phy-pipe3";
+            reg = <0x4a002370 0x4>;
+            reg-names = "power";
+        };
+
+        omap_control_usb2phy2: control-phy at 0x4a002e74 {
+            compatible = "ti,control-phy-usb2-dra7";
+            reg = <0x4a002e74 0x4>;
+            reg-names = "power";
+        };
+
+        /* OCP2SCP1 */
+        ocp2scp at 4a080000 {
+            compatible = "ti,omap-ocp2scp";
+            #address-cells = <1>;
+            #size-cells = <1>;
+            ranges;
+            reg = <0x4a080000 0x20>;
+            ti,hwmods = "ocp2scp1";
+
+            usb2_phy1: phy at 4a084000 {
+                compatible = "ti,omap-usb2";
+                reg = <0x4a084000 0x400>;
+                ctrl-module = <&omap_control_usb2phy1>;
+                clocks = <&usb_phy1_always_on_clk32k>,
+                     <&usb_otg_ss1_refclk960m>;
+                clock-names =    "wkupclk",
+                        "refclk";
+                #phy-cells = <0>;
+            };
+
+            usb2_phy2: phy at 4a085000 {
+                compatible = "ti,omap-usb2";
+                reg = <0x4a085000 0x400>;
+                ctrl-module = <&omap_control_usb2phy2>;
+                clocks = <&usb_phy2_always_on_clk32k>,
+                     <&usb_otg_ss2_refclk960m>;
+                clock-names =    "wkupclk",
+                        "refclk";
+                #phy-cells = <0>;
+            };
+
+            usb3_phy1: phy at 4a084400 {
+                compatible = "ti,omap-usb3";
+                reg = <0x4a084400 0x80>,
+                      <0x4a084800 0x64>,
+                      <0x4a084c00 0x40>;
+                reg-names = "phy_rx", "phy_tx", "pll_ctrl";
+                ctrl-module = <&omap_control_usb3phy1>;
+                clocks = <&usb_phy3_always_on_clk32k>,
+                     <&sys_clkin1>,
Quoted 8 lines

arch/arm/boot/dts/dra7.dtsi line 878

Quoted 6 lines
arch/arm/boot/dts/dra7.dtsi +6 -0
+                     <&usb_otg_ss1_refclk960m>,
+                     <&dpll_core_h13x2_ck>;
+                clock-names =    "wkupclk",
+                        "sysclk",
+                        "refclk",
+                        "optclk";

Do we use this 'optclk' in driver?

Quoted 2 lines

No we don't. Still the device seems to work without it. This is supposed to be USB_LFPS_TX_GFCLK or USB3PHY_REF_CLK.

Quoted 6 lines

I think it should be enabled. Did you check the status of this clock in CM_L3INIT_CLKSTCTRL? Moreover USB_LFPS_TX_GFCLK is an interface clock, so IIUC setting the module mode will enable it.

Btw how did you tell dpll_core_h13x2_ck enables USB_LFPS_TX_GFCLK?

From the clock tree tool. It looks like the clock is gated automatically with the module mode

as you suggested. I'll get rid of this clock reference then.

cheers,
-roger

#23 lore raw

Re: [PATCH 7/8] ARM: dts: dra7: Add USB related nodes

Quoted 103 lines · Roger Quadros
Quoted 102 lines · Kishon Vijay Abraham I
Quoted 92 lines · Roger Quadros
Quoted 82 lines · Kishon Vijay Abraham I

Hi Roger,

Quoted 79 lines · Roger Quadros

Add nodes for the Super Speed USB controllers, omap-control-usb, USB2 PHY and USB3 PHY devices.

Remove ocp2scp1 address space from hwmod data as it is now provided via device tree.

---
   arch/arm/boot/dts/dra7.dtsi               | 110 ++++++++++++++++++++++++++++++
   arch/arm/mach-omap2/omap_hwmod_7xx_data.c |  10 ---
   2 files changed, 110 insertions(+), 10 deletions(-)
arch/arm/boot/dts/dra7.dtsi +59 -0
index 597979b..1e73900 100644
@@ -811,6 +811,116 @@
               clocks = <&sata_ref_clk>;
               ti,hwmods = "sata";
           };
+
+        omap_control_usb2phy1: control-phy at 4a002300 {
+            compatible = "ti,control-phy-usb2";
+            reg = <0x4a002300 0x4>;
+            reg-names = "power";
+        };
+
+        omap_control_usb3phy1: control-phy at 4a002370 {
+            compatible = "ti,control-phy-pipe3";
+            reg = <0x4a002370 0x4>;
+            reg-names = "power";
+        };
+
+        omap_control_usb2phy2: control-phy at 0x4a002e74 {
+            compatible = "ti,control-phy-usb2-dra7";
+            reg = <0x4a002e74 0x4>;
+            reg-names = "power";
+        };
+
+        /* OCP2SCP1 */
+        ocp2scp at 4a080000 {
+            compatible = "ti,omap-ocp2scp";
+            #address-cells = <1>;
+            #size-cells = <1>;
+            ranges;
+            reg = <0x4a080000 0x20>;
+            ti,hwmods = "ocp2scp1";
+
+            usb2_phy1: phy at 4a084000 {
+                compatible = "ti,omap-usb2";
+                reg = <0x4a084000 0x400>;
+                ctrl-module = <&omap_control_usb2phy1>;
+                clocks = <&usb_phy1_always_on_clk32k>,
+                     <&usb_otg_ss1_refclk960m>;
+                clock-names =    "wkupclk",
+                        "refclk";
+                #phy-cells = <0>;
+            };
+
+            usb2_phy2: phy at 4a085000 {
+                compatible = "ti,omap-usb2";
+                reg = <0x4a085000 0x400>;
+                ctrl-module = <&omap_control_usb2phy2>;
+                clocks = <&usb_phy2_always_on_clk32k>,
+                     <&usb_otg_ss2_refclk960m>;
+                clock-names =    "wkupclk",
+                        "refclk";
+                #phy-cells = <0>;
+            };
+
+            usb3_phy1: phy at 4a084400 {
+                compatible = "ti,omap-usb3";
+                reg = <0x4a084400 0x80>,
+                      <0x4a084800 0x64>,
+                      <0x4a084c00 0x40>;
+                reg-names = "phy_rx", "phy_tx", "pll_ctrl";
+                ctrl-module = <&omap_control_usb3phy1>;
+                clocks = <&usb_phy3_always_on_clk32k>,
+                     <&sys_clkin1>,
Quoted 8 lines

arch/arm/boot/dts/dra7.dtsi line 878

Quoted 6 lines
arch/arm/boot/dts/dra7.dtsi +6 -0
+                     <&usb_otg_ss1_refclk960m>,
+                     <&dpll_core_h13x2_ck>;
+                clock-names =    "wkupclk",
+                        "sysclk",
+                        "refclk",
+                        "optclk";

Do we use this 'optclk' in driver?

Quoted 2 lines

No we don't. Still the device seems to work without it. This is supposed to be USB_LFPS_TX_GFCLK or USB3PHY_REF_CLK.

I think it should be enabled. Did you check the status of this clock in CM_L3INIT_CLKSTCTRL? Moreover USB_LFPS_TX_GFCLK is an interface clock, so IIUC setting the module mode will enable it.

Quoted 6 lines
Quoted 2 lines

Btw how did you tell dpll_core_h13x2_ck enables USB_LFPS_TX_GFCLK?

From the clock tree tool. It looks like the clock is gated automatically with the module mode as you suggested. I'll get rid of this clock reference then.

note that we can change the input clock of some parts of dwc3, maybe that's why it works without, we're probably using another clock as input.

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/20140314/68229111/attachment-0001.sig>
#24 lore raw

PATCH 8/8 dts: dra7-evm: add USB support

In reply to Roger Quadros

Add USB pinmux information and USB modes
for the first 2 USB controllers.

---
 arch/arm/boot/dts/dra7-evm.dts | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm/boot/dts/dra7-evm.dts +24 -0
index 5babba0..41c600b 100644
@@ -93,6 +93,18 @@
 			0x24c (PIN_INPUT_SLEW | MUX_MODE0) /* uart3_txd */
 		>;
 	};
+
+	usb1_pins: pinmux_usb1_pins {
+                pinctrl-single,pins = <
+			0x280	0xc0000	/* usb1_drvvbus, SLOW_SLEW | PULLUPEN | MODE0 */
+                >;
+        };
+
+	usb2_pins: pinmux_usb2_pins {
+                pinctrl-single,pins = <
+			0x284	0xc0000 /* usb2_drvvbus, SLOW_SLEW | PULLUPEN | MODE0 */
+                >;
+        };
 };
 
 &i2c1 {
@@ -273,3 +285,15 @@
 &cpu0 {
 	cpu0-supply = <&smps123_reg>;
 };
+
+&usb1 {
+	dr_mode = "otg";
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb1_pins>;
+};
+
+&usb2 {
+	dr_mode = "otg";
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb2_pins>;
+};
Signature · 1 line
1.8.3.2