linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] USB OTG Dual Role on STM32MP15
@ 2020-02-04 13:26 Amelie Delaunay
  2020-02-04 13:26 ` [PATCH 1/3] ARM: dts: stm32: add USB OTG full support on stm32mp151 Amelie Delaunay
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Amelie Delaunay @ 2020-02-04 13:26 UTC (permalink / raw)
  To: Maxime Coquelin, Alexandre Torgue, Rob Herring, Mark Rutland
  Cc: linux-stm32, linux-arm-kernel, devicetree, linux-kernel, Amelie Delaunay

This patchset adds support for USB OTG Dual Role on stm32mp15.
USB OTG HS is configured in Dual Role mode on stm32mp157c-ev1, role detection
uses ID pin.

Amelie Delaunay (3):
  ARM: dts: stm32: add USB OTG full support on stm32mp151
  ARM: dts: stm32: add USB OTG pinctrl to stm32mp15
  ARM: dts: stm32: enable USB OTG Dual Role on stm32mp157c-ev1

 arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 13 +++++++++++++
 arch/arm/boot/dts/stm32mp151.dtsi        |  3 ++-
 arch/arm/boot/dts/stm32mp157c-ed1.dts    |  4 ++++
 arch/arm/boot/dts/stm32mp157c-ev1.dts    |  3 ++-
 4 files changed, 21 insertions(+), 2 deletions(-)

-- 
2.17.1


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

* [PATCH 1/3] ARM: dts: stm32: add USB OTG full support on stm32mp151
  2020-02-04 13:26 [PATCH 0/3] USB OTG Dual Role on STM32MP15 Amelie Delaunay
@ 2020-02-04 13:26 ` Amelie Delaunay
  2020-02-04 13:26 ` [PATCH 2/3] ARM: dts: stm32: add USB OTG pinctrl to stm32mp15 Amelie Delaunay
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Amelie Delaunay @ 2020-02-04 13:26 UTC (permalink / raw)
  To: Maxime Coquelin, Alexandre Torgue, Rob Herring, Mark Rutland
  Cc: linux-stm32, linux-arm-kernel, devicetree, linux-kernel, Amelie Delaunay

Using the st,stm32mp15-hsotg compatible allows to use USB OTG with Dual Role
mode support.

Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
---
 arch/arm/boot/dts/stm32mp151.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi
index fb41d0778b00..53fa6ed82b34 100644
--- a/arch/arm/boot/dts/stm32mp151.dtsi
+++ b/arch/arm/boot/dts/stm32mp151.dtsi
@@ -1044,7 +1044,7 @@
 		};
 
 		usbotg_hs: usb-otg@49000000 {
-			compatible = "snps,dwc2";
+			compatible = "st,stm32mp15-hsotg", "snps,dwc2";
 			reg = <0x49000000 0x10000>;
 			clocks = <&rcc USBO_K>;
 			clock-names = "otg";
@@ -1055,6 +1055,7 @@
 			g-np-tx-fifo-size = <32>;
 			g-tx-fifo-size = <128 128 64 64 64 64 32 32>;
 			dr_mode = "otg";
+			usb33d-supply = <&usb33>;
 			status = "disabled";
 		};
 
-- 
2.17.1


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

* [PATCH 2/3] ARM: dts: stm32: add USB OTG pinctrl to stm32mp15
  2020-02-04 13:26 [PATCH 0/3] USB OTG Dual Role on STM32MP15 Amelie Delaunay
  2020-02-04 13:26 ` [PATCH 1/3] ARM: dts: stm32: add USB OTG full support on stm32mp151 Amelie Delaunay
@ 2020-02-04 13:26 ` Amelie Delaunay
  2020-02-04 13:26 ` [PATCH 3/3] ARM: dts: stm32: enable USB OTG Dual Role on stm32mp157c-ev1 Amelie Delaunay
  2020-02-10 16:44 ` [PATCH 0/3] USB OTG Dual Role on STM32MP15 Alexandre Torgue
  3 siblings, 0 replies; 5+ messages in thread
From: Amelie Delaunay @ 2020-02-04 13:26 UTC (permalink / raw)
  To: Maxime Coquelin, Alexandre Torgue, Rob Herring, Mark Rutland
  Cc: linux-stm32, linux-arm-kernel, devicetree, linux-kernel, Amelie Delaunay

Add pinctrl definition for USB High-Speed OTG ID pin and USB Full-Speed OTG
DP and DM lines that can be used on stm32mp15.

Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
---
 arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi
index 0237d4ddaa92..345dc18d2224 100644
--- a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi
@@ -1040,6 +1040,19 @@
 			bias-disable;
 		};
 	};
+
+	usbotg_hs_pins_a: usbotg-hs-0 {
+		pins {
+			pinmux = <STM32_PINMUX('A', 10, ANALOG)>; /* OTG_ID */
+		};
+	};
+
+	usbotg_fs_dp_dm_pins_a: usbotg-fs-dp-dm-0 {
+		pins {
+			pinmux = <STM32_PINMUX('A', 11, ANALOG)>, /* OTG_FS_DM */
+				 <STM32_PINMUX('A', 12, ANALOG)>; /* OTG_FS_DP */
+		};
+	};
 };
 
 &pinctrl_z {
-- 
2.17.1


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

* [PATCH 3/3] ARM: dts: stm32: enable USB OTG Dual Role on stm32mp157c-ev1
  2020-02-04 13:26 [PATCH 0/3] USB OTG Dual Role on STM32MP15 Amelie Delaunay
  2020-02-04 13:26 ` [PATCH 1/3] ARM: dts: stm32: add USB OTG full support on stm32mp151 Amelie Delaunay
  2020-02-04 13:26 ` [PATCH 2/3] ARM: dts: stm32: add USB OTG pinctrl to stm32mp15 Amelie Delaunay
@ 2020-02-04 13:26 ` Amelie Delaunay
  2020-02-10 16:44 ` [PATCH 0/3] USB OTG Dual Role on STM32MP15 Alexandre Torgue
  3 siblings, 0 replies; 5+ messages in thread
From: Amelie Delaunay @ 2020-02-04 13:26 UTC (permalink / raw)
  To: Maxime Coquelin, Alexandre Torgue, Rob Herring, Mark Rutland
  Cc: linux-stm32, linux-arm-kernel, devicetree, linux-kernel, Amelie Delaunay

Now that st,stm32mp15-hsotg is used, dual role is supported. ID pin is
managed to detect the current role.
On stm32mp157c-ev1, Host mode requires a vbus-supply property. Charge pump
for vbus is provided by PMIC VBUS_OTG.

Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
---
 arch/arm/boot/dts/stm32mp157c-ed1.dts | 4 ++++
 arch/arm/boot/dts/stm32mp157c-ev1.dts | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/stm32mp157c-ed1.dts b/arch/arm/boot/dts/stm32mp157c-ed1.dts
index 1fc43251d697..c84f14b17371 100644
--- a/arch/arm/boot/dts/stm32mp157c-ed1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ed1.dts
@@ -355,6 +355,10 @@
 	status = "okay";
 };
 
+&usbotg_hs {
+	vbus-supply = <&vbus_otg>;
+};
+
 &usbphyc_port0 {
 	phy-supply = <&vdd_usb>;
 	vdda1v1-supply = <&reg11>;
diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts
index 228e35e16884..8f1fe0781d9f 100644
--- a/arch/arm/boot/dts/stm32mp157c-ev1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts
@@ -353,7 +353,8 @@
 };
 
 &usbotg_hs {
-	dr_mode = "peripheral";
+	pinctrl-0 = <&usbotg_hs_pins_a>;
+	pinctrl-names = "default";
 	phys = <&usbphyc_port1 0>;
 	phy-names = "usb2-phy";
 	status = "okay";
-- 
2.17.1


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

* Re: [PATCH 0/3] USB OTG Dual Role on STM32MP15
  2020-02-04 13:26 [PATCH 0/3] USB OTG Dual Role on STM32MP15 Amelie Delaunay
                   ` (2 preceding siblings ...)
  2020-02-04 13:26 ` [PATCH 3/3] ARM: dts: stm32: enable USB OTG Dual Role on stm32mp157c-ev1 Amelie Delaunay
@ 2020-02-10 16:44 ` Alexandre Torgue
  3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Torgue @ 2020-02-10 16:44 UTC (permalink / raw)
  To: Amelie Delaunay, Maxime Coquelin, Rob Herring, Mark Rutland
  Cc: linux-stm32, linux-arm-kernel, devicetree, linux-kernel

Hi Amélie

On 2/4/20 2:26 PM, Amelie Delaunay wrote:
> This patchset adds support for USB OTG Dual Role on stm32mp15.
> USB OTG HS is configured in Dual Role mode on stm32mp157c-ev1, role detection
> uses ID pin.
> 
> Amelie Delaunay (3):
>    ARM: dts: stm32: add USB OTG full support on stm32mp151
>    ARM: dts: stm32: add USB OTG pinctrl to stm32mp15
>    ARM: dts: stm32: enable USB OTG Dual Role on stm32mp157c-ev1
> 
>   arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 13 +++++++++++++
>   arch/arm/boot/dts/stm32mp151.dtsi        |  3 ++-
>   arch/arm/boot/dts/stm32mp157c-ed1.dts    |  4 ++++
>   arch/arm/boot/dts/stm32mp157c-ev1.dts    |  3 ++-
>   4 files changed, 21 insertions(+), 2 deletions(-)
> 

Series applied on stm32-next.

Thanks
Alex

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

end of thread, other threads:[~2020-02-10 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 13:26 [PATCH 0/3] USB OTG Dual Role on STM32MP15 Amelie Delaunay
2020-02-04 13:26 ` [PATCH 1/3] ARM: dts: stm32: add USB OTG full support on stm32mp151 Amelie Delaunay
2020-02-04 13:26 ` [PATCH 2/3] ARM: dts: stm32: add USB OTG pinctrl to stm32mp15 Amelie Delaunay
2020-02-04 13:26 ` [PATCH 3/3] ARM: dts: stm32: enable USB OTG Dual Role on stm32mp157c-ev1 Amelie Delaunay
2020-02-10 16:44 ` [PATCH 0/3] USB OTG Dual Role on STM32MP15 Alexandre Torgue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).