All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: renesas: revise properties for usb 2.0
@ 2018-08-31  8:20 Yoshihiro Shimoda
  2018-09-05 10:33 ` Simon Horman
  2018-09-05 12:59 ` Geert Uytterhoeven
  0 siblings, 2 replies; 9+ messages in thread
From: Yoshihiro Shimoda @ 2018-08-31  8:20 UTC (permalink / raw)
  To: horms, magnus.damm; +Cc: linux-renesas-soc, Yoshihiro Shimoda

R-Car Gen3 needs to enable/deassert clocks/resets of both usb 2.0
host (included phy) and peripheral. Otherwise, other side device
cannot work correctly. So, this patch revises properties of clocks
and resets. After that, each device driver can enable/deassert
clocks/resets by its self.

Notes:
 - To work the renesas_usbhs driver correctly when host side drivers
   are disabled and the renesas_usbhs driver doesn't have multiple
   clock management, this patch doesn't change the order of the clocks
   property in each hsusb node.
 - This patch doesn't have any side-effects even if the renesas_usbhs
   driver doesn't have reset_control and multiple clock management.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 This patch is based on the renesas.git / renesas-devel-20180830-v4.19-rc1 tag.
 This patch is related to the following patch series:

  https://patchwork.kernel.org/project/linux-renesas-soc/list/?series=13587
  

 arch/arm64/boot/dts/renesas/r8a7795.dtsi  | 34 ++++++++++++++++---------------
 arch/arm64/boot/dts/renesas/r8a7796.dtsi  | 17 ++++++++--------
 arch/arm64/boot/dts/renesas/r8a77965.dtsi | 17 ++++++++--------
 arch/arm64/boot/dts/renesas/r8a77990.dtsi | 12 +++++------
 arch/arm64/boot/dts/renesas/r8a77995.dtsi | 12 +++++------
 5 files changed, 48 insertions(+), 44 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
index c417d4a..9e9aead 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
@@ -707,7 +707,8 @@
 				     "renesas,rcar-gen3-usbhs";
 			reg = <0 0xe6590000 0 0x100>;
 			interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 704>;
+			clocks = <&cpg CPG_MOD 704>, <&cpg CPG_MOD 703>;
+			clock-names = "hsusb", "ehci/ohci";
 			dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
 			       <&usb_dmac1 0>, <&usb_dmac1 1>;
 			dma-names = "ch0", "ch1", "ch2", "ch3";
@@ -715,7 +716,7 @@
 			phys = <&usb2_phy0>;
 			phy-names = "usb";
 			power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-			resets = <&cpg 704>;
+			resets = <&cpg 704>, <&cpg 703>;
 			status = "disabled";
 		};
 
@@ -724,7 +725,8 @@
 				     "renesas,rcar-gen3-usbhs";
 			reg = <0 0xe659c000 0 0x100>;
 			interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 705>;
+			clocks = <&cpg CPG_MOD 705>, <&cpg CPG_MOD 700>;
+			clock-names = "hsusb", "ehci/ohci";
 			dmas = <&usb_dmac2 0>, <&usb_dmac2 1>,
 			       <&usb_dmac3 0>, <&usb_dmac3 1>;
 			dma-names = "ch0", "ch1", "ch2", "ch3";
@@ -732,7 +734,7 @@
 			phys = <&usb2_phy3>;
 			phy-names = "usb";
 			power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-			resets = <&cpg 705>;
+			resets = <&cpg 705>, <&cpg 700>;
 			status = "disabled";
 		};
 
@@ -2098,11 +2100,11 @@
 			compatible = "generic-ohci";
 			reg = <0 0xee080000 0 0x100>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			phys = <&usb2_phy0>;
 			phy-names = "usb";
 			power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			status = "disabled";
 		};
 
@@ -2134,11 +2136,11 @@
 			compatible = "generic-ohci";
 			reg = <0 0xee0e0000 0 0x100>;
 			interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 700>;
+			clocks = <&cpg CPG_MOD 700>, <&cpg CPG_MOD 705>;
 			phys = <&usb2_phy3>;
 			phy-names = "usb";
 			power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-			resets = <&cpg 700>;
+			resets = <&cpg 700>, <&cpg 705>;
 			status = "disabled";
 		};
 
@@ -2146,12 +2148,12 @@
 			compatible = "generic-ehci";
 			reg = <0 0xee080100 0 0x100>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			phys = <&usb2_phy0>;
 			phy-names = "usb";
 			companion = <&ohci0>;
 			power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			status = "disabled";
 		};
 
@@ -2185,12 +2187,12 @@
 			compatible = "generic-ehci";
 			reg = <0 0xee0e0100 0 0x100>;
 			interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 700>;
+			clocks = <&cpg CPG_MOD 700>, <&cpg CPG_MOD 705>;
 			phys = <&usb2_phy3>;
 			phy-names = "usb";
 			companion = <&ohci3>;
 			power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-			resets = <&cpg 700>;
+			resets = <&cpg 700>, <&cpg 705>;
 			status = "disabled";
 		};
 
@@ -2199,9 +2201,9 @@
 				     "renesas,rcar-gen3-usb2-phy";
 			reg = <0 0xee080200 0 0x700>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			#phy-cells = <0>;
 			status = "disabled";
 		};
@@ -2233,9 +2235,9 @@
 				     "renesas,rcar-gen3-usb2-phy";
 			reg = <0 0xee0e0200 0 0x700>;
 			interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 700>;
+			clocks = <&cpg CPG_MOD 700>, <&cpg CPG_MOD 705>;
 			power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-			resets = <&cpg 700>;
+			resets = <&cpg 700>, <&cpg 705>;
 			#phy-cells = <0>;
 			status = "disabled";
 		};
diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
index 28a0794..7b1472d 100644
--- a/arch/arm64/boot/dts/renesas/r8a7796.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
@@ -677,7 +677,8 @@
 				     "renesas,rcar-gen3-usbhs";
 			reg = <0 0xe6590000 0 0x100>;
 			interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 704>;
+			clocks = <&cpg CPG_MOD 704>, <&cpg CPG_MOD 703>;
+			clock-names = "hsusb", "ehci/ohci";
 			dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
 			       <&usb_dmac1 0>, <&usb_dmac1 1>;
 			dma-names = "ch0", "ch1", "ch2", "ch3";
@@ -685,7 +686,7 @@
 			phys = <&usb2_phy0>;
 			phy-names = "usb";
 			power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
-			resets = <&cpg 704>;
+			resets = <&cpg 704>, <&cpg 703>;
 			status = "disabled";
 		};
 
@@ -1970,11 +1971,11 @@
 			compatible = "generic-ohci";
 			reg = <0 0xee080000 0 0x100>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			phys = <&usb2_phy0>;
 			phy-names = "usb";
 			power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			status = "disabled";
 		};
 
@@ -1994,12 +1995,12 @@
 			compatible = "generic-ehci";
 			reg = <0 0xee080100 0 0x100>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			phys = <&usb2_phy0>;
 			phy-names = "usb";
 			companion = <&ohci0>;
 			power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			status = "disabled";
 		};
 
@@ -2021,9 +2022,9 @@
 				     "renesas,rcar-gen3-usb2-phy";
 			reg = <0 0xee080200 0 0x700>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			#phy-cells = <0>;
 			status = "disabled";
 		};
diff --git a/arch/arm64/boot/dts/renesas/r8a77965.dtsi b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
index 77fb909..80cb19d 100644
--- a/arch/arm64/boot/dts/renesas/r8a77965.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
@@ -593,7 +593,8 @@
 				     "renesas,rcar-gen3-usbhs";
 			reg = <0 0xe6590000 0 0x100>;
 			interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 704>;
+			clocks = <&cpg CPG_MOD 704>, <&cpg CPG_MOD 703>;
+			clock-names = "hsusb", "ehci/ohci";
 			dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
 			       <&usb_dmac1 0>, <&usb_dmac1 1>;
 			dma-names = "ch0", "ch1", "ch2", "ch3";
@@ -601,7 +602,7 @@
 			phys = <&usb2_phy0>;
 			phy-names = "usb";
 			power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
-			resets = <&cpg 704>;
+			resets = <&cpg 704>, <&cpg 703>;
 			status = "disabled";
 		};
 
@@ -1468,11 +1469,11 @@
 			compatible = "generic-ohci";
 			reg = <0 0xee080000 0 0x100>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			phys = <&usb2_phy0>;
 			phy-names = "usb";
 			power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			status = "disabled";
 		};
 
@@ -1492,12 +1493,12 @@
 			compatible = "generic-ehci";
 			reg = <0 0xee080100 0 0x100>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			phys = <&usb2_phy0>;
 			phy-names = "usb";
 			companion = <&ohci0>;
 			power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			status = "disabled";
 		};
 
@@ -1519,9 +1520,9 @@
 				     "renesas,rcar-gen3-usb2-phy";
 			reg = <0 0xee080200 0 0x700>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			#phy-cells = <0>;
 			status = "disabled";
 		};
diff --git a/arch/arm64/boot/dts/renesas/r8a77990.dtsi b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
index 2ee0edf..6b1a307 100644
--- a/arch/arm64/boot/dts/renesas/r8a77990.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
@@ -434,11 +434,11 @@
 			compatible = "generic-ohci";
 			reg = <0 0xee080000 0 0x100>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			phys = <&usb2_phy0>;
 			phy-names = "usb";
 			power-domains = <&sysc 32>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			status = "disabled";
 		};
 
@@ -446,12 +446,12 @@
 			compatible = "generic-ehci";
 			reg = <0 0xee080100 0 0x100>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			phys = <&usb2_phy0>;
 			phy-names = "usb";
 			companion = <&ohci0>;
 			power-domains = <&sysc 32>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			status = "disabled";
 		};
 
@@ -460,9 +460,9 @@
 				     "renesas,rcar-gen3-usb2-phy";
 			reg = <0 0xee080200 0 0x700>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			power-domains = <&sysc 32>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			#phy-cells = <0>;
 			status = "disabled";
 		};
diff --git a/arch/arm64/boot/dts/renesas/r8a77995.dtsi b/arch/arm64/boot/dts/renesas/r8a77995.dtsi
index 625ba2b..89a04a4 100644
--- a/arch/arm64/boot/dts/renesas/r8a77995.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77995.dtsi
@@ -829,11 +829,11 @@
 			compatible = "generic-ohci";
 			reg = <0 0xee080000 0 0x100>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			phys = <&usb2_phy0>;
 			phy-names = "usb";
 			power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			status = "disabled";
 		};
 
@@ -841,12 +841,12 @@
 			compatible = "generic-ehci";
 			reg = <0 0xee080100 0 0x100>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			phys = <&usb2_phy0>;
 			phy-names = "usb";
 			companion = <&ohci0>;
 			power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			status = "disabled";
 		};
 
@@ -855,9 +855,9 @@
 				     "renesas,rcar-gen3-usb2-phy";
 			reg = <0 0xee080200 0 0x700>;
 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&cpg CPG_MOD 703>;
+			clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
 			power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
-			resets = <&cpg 703>;
+			resets = <&cpg 703>, <&cpg 704>;
 			#phy-cells = <0>;
 			status = "disabled";
 		};
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] arm64: dts: renesas: revise properties for usb 2.0
  2018-08-31  8:20 [PATCH] arm64: dts: renesas: revise properties for usb 2.0 Yoshihiro Shimoda
@ 2018-09-05 10:33 ` Simon Horman
  2018-09-20  5:55   ` Yoshihiro Shimoda
  2018-09-05 12:59 ` Geert Uytterhoeven
  1 sibling, 1 reply; 9+ messages in thread
From: Simon Horman @ 2018-09-05 10:33 UTC (permalink / raw)
  To: Yoshihiro Shimoda; +Cc: magnus.damm, linux-renesas-soc

On Fri, Aug 31, 2018 at 05:20:51PM +0900, Yoshihiro Shimoda wrote:
> R-Car Gen3 needs to enable/deassert clocks/resets of both usb 2.0
> host (included phy) and peripheral. Otherwise, other side device
> cannot work correctly. So, this patch revises properties of clocks
> and resets. After that, each device driver can enable/deassert
> clocks/resets by its self.
> 
> Notes:
>  - To work the renesas_usbhs driver correctly when host side drivers
>    are disabled and the renesas_usbhs driver doesn't have multiple
>    clock management, this patch doesn't change the order of the clocks
>    property in each hsusb node.
>  - This patch doesn't have any side-effects even if the renesas_usbhs
>    driver doesn't have reset_control and multiple clock management.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Thanks Shimoda-san,

This looks fine to me but I will wait to see if there are other reviews
before applying.

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] arm64: dts: renesas: revise properties for usb 2.0
  2018-08-31  8:20 [PATCH] arm64: dts: renesas: revise properties for usb 2.0 Yoshihiro Shimoda
  2018-09-05 10:33 ` Simon Horman
@ 2018-09-05 12:59 ` Geert Uytterhoeven
  2018-09-06 10:09   ` Yoshihiro Shimoda
  1 sibling, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2018-09-05 12:59 UTC (permalink / raw)
  To: Yoshihiro Shimoda; +Cc: Simon Horman, Magnus Damm, Linux-Renesas

Hi Shimoda-san,

On Fri, Aug 31, 2018 at 10:22 AM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> R-Car Gen3 needs to enable/deassert clocks/resets of both usb 2.0
> host (included phy) and peripheral. Otherwise, other side device
> cannot work correctly. So, this patch revises properties of clocks
> and resets. After that, each device driver can enable/deassert
> clocks/resets by its self.
>
> Notes:
>  - To work the renesas_usbhs driver correctly when host side drivers
>    are disabled and the renesas_usbhs driver doesn't have multiple
>    clock management, this patch doesn't change the order of the clocks
>    property in each hsusb node.
>  - This patch doesn't have any side-effects even if the renesas_usbhs
>    driver doesn't have reset_control and multiple clock management.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Thanks for your patch!

I'm a bit confused about the HS-USB <-> EHCI/OHCI topology.
Can you please explain?

Thanks!

> --- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
> @@ -707,7 +707,8 @@
>                                      "renesas,rcar-gen3-usbhs";
>                         reg = <0 0xe6590000 0 0x100>;
>                         interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
> -                       clocks = <&cpg CPG_MOD 704>;
> +                       clocks = <&cpg CPG_MOD 704>, <&cpg CPG_MOD 703>;
> +                       clock-names = "hsusb", "ehci/ohci";

703 is EHCI/OHCI0. What about EHCI/OHCI1 and EHCI/OHCI2?

>                         dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
>                                <&usb_dmac1 0>, <&usb_dmac1 1>;
>                         dma-names = "ch0", "ch1", "ch2", "ch3";
> @@ -715,7 +716,7 @@
>                         phys = <&usb2_phy0>;
>                         phy-names = "usb";
>                         power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
> -                       resets = <&cpg 704>;
> +                       resets = <&cpg 704>, <&cpg 703>;
>                         status = "disabled";
>                 };
>
> @@ -724,7 +725,8 @@
>                                      "renesas,rcar-gen3-usbhs";
>                         reg = <0 0xe659c000 0 0x100>;
>                         interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
> -                       clocks = <&cpg CPG_MOD 705>;
> +                       clocks = <&cpg CPG_MOD 705>, <&cpg CPG_MOD 700>;
> +                       clock-names = "hsusb", "ehci/ohci";

So this one is linked to EHCI/OHCI3?

>                         dmas = <&usb_dmac2 0>, <&usb_dmac2 1>,
>                                <&usb_dmac3 0>, <&usb_dmac3 1>;
>                         dma-names = "ch0", "ch1", "ch2", "ch3";
> @@ -732,7 +734,7 @@
>                         phys = <&usb2_phy3>;
>                         phy-names = "usb";
>                         power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
> -                       resets = <&cpg 705>;
> +                       resets = <&cpg 705>, <&cpg 700>;
>                         status = "disabled";
>                 };
>
> @@ -2098,11 +2100,11 @@
>                         compatible = "generic-ohci";
>                         reg = <0 0xee080000 0 0x100>;
>                         interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
> -                       clocks = <&cpg CPG_MOD 703>;
> +                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
>                         phys = <&usb2_phy0>;
>                         phy-names = "usb";
>                         power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
> -                       resets = <&cpg 703>;
> +                       resets = <&cpg 703>, <&cpg 704>;
>                         status = "disabled";
>                 };

The above is for the ohci0 node.
What about ohci1 and ohci2?

Same for ehci below.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] arm64: dts: renesas: revise properties for usb 2.0
  2018-09-05 12:59 ` Geert Uytterhoeven
@ 2018-09-06 10:09   ` Yoshihiro Shimoda
  2018-09-06 10:19     ` Geert Uytterhoeven
  0 siblings, 1 reply; 9+ messages in thread
From: Yoshihiro Shimoda @ 2018-09-06 10:09 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Simon Horman, Magnus Damm, Linux-Renesas

Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Wednesday, September 5, 2018 9:59 PM
> 
> Hi Shimoda-san,
> 
> On Fri, Aug 31, 2018 at 10:22 AM Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com> wrote:
> > R-Car Gen3 needs to enable/deassert clocks/resets of both usb 2.0
> > host (included phy) and peripheral. Otherwise, other side device
> > cannot work correctly. So, this patch revises properties of clocks
> > and resets. After that, each device driver can enable/deassert
> > clocks/resets by its self.
> >
> > Notes:
> >  - To work the renesas_usbhs driver correctly when host side drivers
> >    are disabled and the renesas_usbhs driver doesn't have multiple
> >    clock management, this patch doesn't change the order of the clocks
> >    property in each hsusb node.
> >  - This patch doesn't have any side-effects even if the renesas_usbhs
> >    driver doesn't have reset_control and multiple clock management.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> 
> Thanks for your patch!
> 
> I'm a bit confused about the HS-USB <-> EHCI/OHCI topology.
> Can you please explain?
> 
> Thanks!

HS-USB <-> EHCI/OHCI topology on R-Car H3 is:

 EHCI/OHCI ch0/3 ---+--- PHY (is included on the EHCI/OHCI) --- External pins
 HS-USB ch0/3    ---+

 EHCI ch1/2      ------- PHY (is included on the EHCI/OHCI) --- External pins
 # These channels don't have HS-USB.

And module stops and resets of HS-USB and EHCI/OHCI topology on R-Car H3 is:

 MSTP/RST703 ---+(OR)---+--- EHCI/OHCI ch0
 MSTP/RST704 ---+       +--- HS-USB ch0

 MSTP/RST702 --------------- EHCI/OHCI ch1
 MSTP/RST701 --------------- EHCI/OHCI ch2

 MSTP/RST700 ---+(OR)---+--- EHCI/OHCI ch3
 MSTP/RST705 ---+       +--- HS-USB ch3

Should I describe these topology on the commit log or somewhere?

> > --- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
> > @@ -707,7 +707,8 @@
> >                                      "renesas,rcar-gen3-usbhs";
> >                         reg = <0 0xe6590000 0 0x100>;
> >                         interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
> > -                       clocks = <&cpg CPG_MOD 704>;
> > +                       clocks = <&cpg CPG_MOD 704>, <&cpg CPG_MOD 703>;
> > +                       clock-names = "hsusb", "ehci/ohci";
> 
> 703 is EHCI/OHCI0. What about EHCI/OHCI1 and EHCI/OHCI2?

EHCI/OHCI1 and EHCI/OHCI2 don't need because they are not related to the HS-USB0.

> >                         dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
> >                                <&usb_dmac1 0>, <&usb_dmac1 1>;
> >                         dma-names = "ch0", "ch1", "ch2", "ch3";
> > @@ -715,7 +716,7 @@
> >                         phys = <&usb2_phy0>;
> >                         phy-names = "usb";
> >                         power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
> > -                       resets = <&cpg 704>;
> > +                       resets = <&cpg 704>, <&cpg 703>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -724,7 +725,8 @@
> >                                      "renesas,rcar-gen3-usbhs";
> >                         reg = <0 0xe659c000 0 0x100>;
> >                         interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
> > -                       clocks = <&cpg CPG_MOD 705>;
> > +                       clocks = <&cpg CPG_MOD 705>, <&cpg CPG_MOD 700>;
> > +                       clock-names = "hsusb", "ehci/ohci";
> 
> So this one is linked to EHCI/OHCI3?

Yes.

> >                         dmas = <&usb_dmac2 0>, <&usb_dmac2 1>,
> >                                <&usb_dmac3 0>, <&usb_dmac3 1>;
> >                         dma-names = "ch0", "ch1", "ch2", "ch3";
> > @@ -732,7 +734,7 @@
> >                         phys = <&usb2_phy3>;
> >                         phy-names = "usb";
> >                         power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
> > -                       resets = <&cpg 705>;
> > +                       resets = <&cpg 705>, <&cpg 700>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -2098,11 +2100,11 @@
> >                         compatible = "generic-ohci";
> >                         reg = <0 0xee080000 0 0x100>;
> >                         interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
> > -                       clocks = <&cpg CPG_MOD 703>;
> > +                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
> >                         phys = <&usb2_phy0>;
> >                         phy-names = "usb";
> >                         power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
> > -                       resets = <&cpg 703>;
> > +                       resets = <&cpg 703>, <&cpg 704>;
> >                         status = "disabled";
> >                 };
> 
> The above is for the ohci0 node.
> What about ohci1 and ohci2?
> 
> Same for ehci below.

[oe]hci[12] don't have HS-USB. So, we don't need to revise them.

Best regards,
Yoshihiro Shimoda

> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] arm64: dts: renesas: revise properties for usb 2.0
  2018-09-06 10:09   ` Yoshihiro Shimoda
@ 2018-09-06 10:19     ` Geert Uytterhoeven
  2018-09-06 10:43       ` Yoshihiro Shimoda
  0 siblings, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2018-09-06 10:19 UTC (permalink / raw)
  To: Yoshihiro Shimoda; +Cc: Simon Horman, Magnus Damm, Linux-Renesas

Hi Shimoda-san,

On Thu, Sep 6, 2018 at 12:09 PM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> > From: Geert Uytterhoeven, Sent: Wednesday, September 5, 2018 9:59 PM
> > On Fri, Aug 31, 2018 at 10:22 AM Yoshihiro Shimoda
> > <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > R-Car Gen3 needs to enable/deassert clocks/resets of both usb 2.0
> > > host (included phy) and peripheral. Otherwise, other side device
> > > cannot work correctly. So, this patch revises properties of clocks
> > > and resets. After that, each device driver can enable/deassert
> > > clocks/resets by its self.
> > >
> > > Notes:
> > >  - To work the renesas_usbhs driver correctly when host side drivers
> > >    are disabled and the renesas_usbhs driver doesn't have multiple
> > >    clock management, this patch doesn't change the order of the clocks
> > >    property in each hsusb node.
> > >  - This patch doesn't have any side-effects even if the renesas_usbhs
> > >    driver doesn't have reset_control and multiple clock management.
> > >
> > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> >
> > Thanks for your patch!
> >
> > I'm a bit confused about the HS-USB <-> EHCI/OHCI topology.
> > Can you please explain?
> >
> > Thanks!
>
> HS-USB <-> EHCI/OHCI topology on R-Car H3 is:
>
>  EHCI/OHCI ch0/3 ---+--- PHY (is included on the EHCI/OHCI) --- External pins
>  HS-USB ch0/3    ---+
>
>  EHCI ch1/2      ------- PHY (is included on the EHCI/OHCI) --- External pins
>  # These channels don't have HS-USB.

Thanks, that's the part is missed, and couldn't find immediately in the
HW manual.

So HS-USB is the usb device ("gadget") part, and EHCI/OHCI is the
usb host part?

>
> And module stops and resets of HS-USB and EHCI/OHCI topology on R-Car H3 is:
>
>  MSTP/RST703 ---+(OR)---+--- EHCI/OHCI ch0
>  MSTP/RST704 ---+       +--- HS-USB ch0
>
>  MSTP/RST702 --------------- EHCI/OHCI ch1
>  MSTP/RST701 --------------- EHCI/OHCI ch2
>
>  MSTP/RST700 ---+(OR)---+--- EHCI/OHCI ch3
>  MSTP/RST705 ---+       +--- HS-USB ch3
>
> Should I describe these topology on the commit log or somewhere?

Yes, I think that would be helpful.

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] arm64: dts: renesas: revise properties for usb 2.0
  2018-09-06 10:19     ` Geert Uytterhoeven
@ 2018-09-06 10:43       ` Yoshihiro Shimoda
  0 siblings, 0 replies; 9+ messages in thread
From: Yoshihiro Shimoda @ 2018-09-06 10:43 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Simon Horman, Magnus Damm, Linux-Renesas

Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Thursday, September 6, 2018 7:19 PM
> 
> Hi Shimoda-san,
> 
> On Thu, Sep 6, 2018 at 12:09 PM Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > From: Geert Uytterhoeven, Sent: Wednesday, September 5, 2018 9:59 PM
> > > On Fri, Aug 31, 2018 at 10:22 AM Yoshihiro Shimoda
> > > <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > > R-Car Gen3 needs to enable/deassert clocks/resets of both usb 2.0
> > > > host (included phy) and peripheral. Otherwise, other side device
> > > > cannot work correctly. So, this patch revises properties of clocks
> > > > and resets. After that, each device driver can enable/deassert
> > > > clocks/resets by its self.
> > > >
> > > > Notes:
> > > >  - To work the renesas_usbhs driver correctly when host side drivers
> > > >    are disabled and the renesas_usbhs driver doesn't have multiple
> > > >    clock management, this patch doesn't change the order of the clocks
> > > >    property in each hsusb node.
> > > >  - This patch doesn't have any side-effects even if the renesas_usbhs
> > > >    driver doesn't have reset_control and multiple clock management.
> > > >
> > > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > >
> > > Thanks for your patch!
> > >
> > > I'm a bit confused about the HS-USB <-> EHCI/OHCI topology.
> > > Can you please explain?
> > >
> > > Thanks!
> >
> > HS-USB <-> EHCI/OHCI topology on R-Car H3 is:
> >
> >  EHCI/OHCI ch0/3 ---+--- PHY (is included on the EHCI/OHCI) --- External pins
> >  HS-USB ch0/3    ---+
> >
> >  EHCI ch1/2      ------- PHY (is included on the EHCI/OHCI) --- External pins
> >  # These channels don't have HS-USB.
> 
> Thanks, that's the part is missed, and couldn't find immediately in the
> HW manual.

That's true...

> So HS-USB is the usb device ("gadget") part, and EHCI/OHCI is the
> usb host part?

That's right.

> >
> > And module stops and resets of HS-USB and EHCI/OHCI topology on R-Car H3 is:
> >
> >  MSTP/RST703 ---+(OR)---+--- EHCI/OHCI ch0
> >  MSTP/RST704 ---+       +--- HS-USB ch0
> >
> >  MSTP/RST702 --------------- EHCI/OHCI ch1
> >  MSTP/RST701 --------------- EHCI/OHCI ch2
> >
> >  MSTP/RST700 ---+(OR)---+--- EHCI/OHCI ch3
> >  MSTP/RST705 ---+       +--- HS-USB ch3
> >
> > Should I describe these topology on the commit log or somewhere?
> 
> Yes, I think that would be helpful.

I got it. I'll submit v2 patch tomorrow or later.

Best regards,
Yoshihiro Shimoda

> Thanks!
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] arm64: dts: renesas: revise properties for usb 2.0
  2018-09-05 10:33 ` Simon Horman
@ 2018-09-20  5:55   ` Yoshihiro Shimoda
  2018-09-21  7:37     ` Simon Horman
  0 siblings, 1 reply; 9+ messages in thread
From: Yoshihiro Shimoda @ 2018-09-20  5:55 UTC (permalink / raw)
  To: Simon Horman; +Cc: magnus.damm, linux-renesas-soc

Hi Simon-san,

> From: Simon Horman, Sent: Wednesday, September 5, 2018 7:33 PM
> 
> On Fri, Aug 31, 2018 at 05:20:51PM +0900, Yoshihiro Shimoda wrote:
> > R-Car Gen3 needs to enable/deassert clocks/resets of both usb 2.0
> > host (included phy) and peripheral. Otherwise, other side device
> > cannot work correctly. So, this patch revises properties of clocks
> > and resets. After that, each device driver can enable/deassert
> > clocks/resets by its self.
> >
> > Notes:
> >  - To work the renesas_usbhs driver correctly when host side drivers
> >    are disabled and the renesas_usbhs driver doesn't have multiple
> >    clock management, this patch doesn't change the order of the clocks
> >    property in each hsusb node.
> >  - This patch doesn't have any side-effects even if the renesas_usbhs
> >    driver doesn't have reset_control and multiple clock management.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> 
> Thanks Shimoda-san,
> 
> This looks fine to me but I will wait to see if there are other reviews
> before applying.
> 
> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

Thank you for your review!
However, since clock-names will be not used by renesas_usbhs driver,
I'll submit v2 patch to remove the properties.

Best regards,
Yoshihiro Shimoda

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] arm64: dts: renesas: revise properties for usb 2.0
  2018-09-20  5:55   ` Yoshihiro Shimoda
@ 2018-09-21  7:37     ` Simon Horman
  2018-09-21  7:58       ` Yoshihiro Shimoda
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Horman @ 2018-09-21  7:37 UTC (permalink / raw)
  To: Yoshihiro Shimoda; +Cc: magnus.damm, linux-renesas-soc

On Thu, Sep 20, 2018 at 05:55:00AM +0000, Yoshihiro Shimoda wrote:
> Hi Simon-san,
> 
> > From: Simon Horman, Sent: Wednesday, September 5, 2018 7:33 PM
> > 
> > On Fri, Aug 31, 2018 at 05:20:51PM +0900, Yoshihiro Shimoda wrote:
> > > R-Car Gen3 needs to enable/deassert clocks/resets of both usb 2.0
> > > host (included phy) and peripheral. Otherwise, other side device
> > > cannot work correctly. So, this patch revises properties of clocks
> > > and resets. After that, each device driver can enable/deassert
> > > clocks/resets by its self.
> > >
> > > Notes:
> > >  - To work the renesas_usbhs driver correctly when host side drivers
> > >    are disabled and the renesas_usbhs driver doesn't have multiple
> > >    clock management, this patch doesn't change the order of the clocks
> > >    property in each hsusb node.
> > >  - This patch doesn't have any side-effects even if the renesas_usbhs
> > >    driver doesn't have reset_control and multiple clock management.
> > >
> > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > 
> > Thanks Shimoda-san,
> > 
> > This looks fine to me but I will wait to see if there are other reviews
> > before applying.
> > 
> > Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> 
> Thank you for your review!
> However, since clock-names will be not used by renesas_usbhs driver,
> I'll submit v2 patch to remove the properties.

Thanks, I'll wait for v2.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] arm64: dts: renesas: revise properties for usb 2.0
  2018-09-21  7:37     ` Simon Horman
@ 2018-09-21  7:58       ` Yoshihiro Shimoda
  0 siblings, 0 replies; 9+ messages in thread
From: Yoshihiro Shimoda @ 2018-09-21  7:58 UTC (permalink / raw)
  To: Simon Horman; +Cc: magnus.damm, linux-renesas-soc

Hi Simon-san,

> From: Simon Horman, Sent: Friday, September 21, 2018 4:37 PM
> 
> On Thu, Sep 20, 2018 at 05:55:00AM +0000, Yoshihiro Shimoda wrote:
> > Hi Simon-san,
> >
> > > From: Simon Horman, Sent: Wednesday, September 5, 2018 7:33 PM
> > >
> > > On Fri, Aug 31, 2018 at 05:20:51PM +0900, Yoshihiro Shimoda wrote:
> > > > R-Car Gen3 needs to enable/deassert clocks/resets of both usb 2.0
> > > > host (included phy) and peripheral. Otherwise, other side device
> > > > cannot work correctly. So, this patch revises properties of clocks
> > > > and resets. After that, each device driver can enable/deassert
> > > > clocks/resets by its self.
> > > >
> > > > Notes:
> > > >  - To work the renesas_usbhs driver correctly when host side drivers
> > > >    are disabled and the renesas_usbhs driver doesn't have multiple
> > > >    clock management, this patch doesn't change the order of the clocks
> > > >    property in each hsusb node.
> > > >  - This patch doesn't have any side-effects even if the renesas_usbhs
> > > >    driver doesn't have reset_control and multiple clock management.
> > > >
> > > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > >
> > > Thanks Shimoda-san,
> > >
> > > This looks fine to me but I will wait to see if there are other reviews
> > > before applying.
> > >
> > > Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> >
> > Thank you for your review!
> > However, since clock-names will be not used by renesas_usbhs driver,
> > I'll submit v2 patch to remove the properties.
> 
> Thanks, I'll wait for v2.

I submitted v2 patch:
https://patchwork.kernel.org/patch/10609245/

Best regards,
Yoshihiro Shimoda

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-09-21 13:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31  8:20 [PATCH] arm64: dts: renesas: revise properties for usb 2.0 Yoshihiro Shimoda
2018-09-05 10:33 ` Simon Horman
2018-09-20  5:55   ` Yoshihiro Shimoda
2018-09-21  7:37     ` Simon Horman
2018-09-21  7:58       ` Yoshihiro Shimoda
2018-09-05 12:59 ` Geert Uytterhoeven
2018-09-06 10:09   ` Yoshihiro Shimoda
2018-09-06 10:19     ` Geert Uytterhoeven
2018-09-06 10:43       ` Yoshihiro Shimoda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.