linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] Add support for USB on STM32MP13
@ 2022-10-14  9:26 Fabrice Gasnier
  2022-10-14  9:26 ` [PATCH 01/10] ARM: dts: stm32: add PWR fixed regulators on stm32mp131 Fabrice Gasnier
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: Fabrice Gasnier @ 2022-10-14  9:26 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

Add support for USBPHYC, USB Host and USB OTG on STM32MP13.
Enable all these interfaces on STM32MP135F-DK board.
Enable the STM32G0 UCSI driver as module.
Dependency on PWR and PMIC regulator is tempoarily managed by using
fixed regulators (resp in the SoC dtsi and the board dts files).
The USB support is functional when these regulators gets enabled at
boot time before entering the kernel.

Amelie Delaunay (5):
  ARM: dts: stm32: add USBPHYC and dual USB HS PHY support on stm32mp131
  ARM: dts: stm32: add UBSH EHCI and OHCI support on stm32mp131
  ARM: dts: stm32: add USB OTG HS support on stm32mp131
  ARM: dts: stm32: enable USB HS phys on stm32mp135f-dk
  ARM: dts: stm32: enable USB Host EHCI on stm32mp135f-dk

Fabrice Gasnier (5):
  ARM: dts: stm32: add PWR fixed regulators on stm32mp131
  ARM: dts: stm32: add fixed regulators to support usb on stm32mp135f-dk
  ARM: dts: stm32: add pins for stm32g0 typec controller on stm32mp13
  ARM: dts: stm32: enable USB OTG in dual role mode on stm32mp135f-dk
  ARM: multi_v7_defconfig: enable Type-C UCSI and STM32G0 as modules

 arch/arm/boot/dts/stm32mp13-pinctrl.dtsi |  7 ++
 arch/arm/boot/dts/stm32mp131.dtsi        | 81 ++++++++++++++++++++
 arch/arm/boot/dts/stm32mp135f-dk.dts     | 95 ++++++++++++++++++++++++
 arch/arm/configs/multi_v7_defconfig      |  2 +
 4 files changed, 185 insertions(+)

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 01/10] ARM: dts: stm32: add PWR fixed regulators on stm32mp131
  2022-10-14  9:26 [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
@ 2022-10-14  9:26 ` Fabrice Gasnier
  2022-10-14  9:26 ` [PATCH 02/10] ARM: dts: stm32: add USBPHYC and dual USB HS PHY support " Fabrice Gasnier
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabrice Gasnier @ 2022-10-14  9:26 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

Add 1v1, 1v8 and 3v3 PWR regulators on stm32mp131. Temporary add them
as fixed regulators, waiting for full SCMI regulators support.

This is a precursor patch to enable USB support on STM32MP13.
Note: USB support requires these regulators to be enabled before
entering kernel.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 arch/arm/boot/dts/stm32mp131.dtsi | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp131.dtsi b/arch/arm/boot/dts/stm32mp131.dtsi
index dd35a607073d..e0e0e27a9221 100644
--- a/arch/arm/boot/dts/stm32mp131.dtsi
+++ b/arch/arm/boot/dts/stm32mp131.dtsi
@@ -77,6 +77,28 @@ timer {
 		always-on;
 	};
 
+	/* PWR 1v1, 1v8 and 3v3 regulators defined as fixed, waiting for SCMI */
+	reg11: reg11 {
+		compatible = "regulator-fixed";
+		regulator-name = "reg11";
+		regulator-min-microvolt = <1100000>;
+		regulator-max-microvolt = <1100000>;
+	};
+
+	reg18: reg18 {
+		compatible = "regulator-fixed";
+		regulator-name = "reg18";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
+	usb33: usb33 {
+		compatible = "regulator-fixed";
+		regulator-name = "usb33";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
 	soc {
 		compatible = "simple-bus";
 		#address-cells = <1>;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 02/10] ARM: dts: stm32: add USBPHYC and dual USB HS PHY support on stm32mp131
  2022-10-14  9:26 [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
  2022-10-14  9:26 ` [PATCH 01/10] ARM: dts: stm32: add PWR fixed regulators on stm32mp131 Fabrice Gasnier
@ 2022-10-14  9:26 ` Fabrice Gasnier
  2022-10-14  9:26 ` [PATCH 03/10] ARM: dts: stm32: add UBSH EHCI and OHCI " Fabrice Gasnier
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabrice Gasnier @ 2022-10-14  9:26 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

From: Amelie Delaunay <amelie.delaunay@foss.st.com>

This patch adds support for USBPHYC and its two USB HS PHY on stm32mp131.

Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 arch/arm/boot/dts/stm32mp131.dtsi | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp131.dtsi b/arch/arm/boot/dts/stm32mp131.dtsi
index e0e0e27a9221..cd31fdd47536 100644
--- a/arch/arm/boot/dts/stm32mp131.dtsi
+++ b/arch/arm/boot/dts/stm32mp131.dtsi
@@ -409,6 +409,29 @@ iwdg2: watchdog@5a002000 {
 			status = "disabled";
 		};
 
+		usbphyc: usbphyc@5a006000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			#clock-cells = <0>;
+			compatible = "st,stm32mp1-usbphyc";
+			reg = <0x5a006000 0x1000>;
+			clocks = <&rcc USBPHY_K>;
+			resets = <&rcc USBPHY_R>;
+			vdda1v1-supply = <&reg11>;
+			vdda1v8-supply = <&reg18>;
+			status = "disabled";
+
+			usbphyc_port0: usb-phy@0 {
+				#phy-cells = <0>;
+				reg = <0>;
+			};
+
+			usbphyc_port1: usb-phy@1 {
+				#phy-cells = <1>;
+				reg = <1>;
+			};
+		};
+
 		rtc: rtc@5c004000 {
 			compatible = "st,stm32mp1-rtc";
 			reg = <0x5c004000 0x400>;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 03/10] ARM: dts: stm32: add UBSH EHCI and OHCI support on stm32mp131
  2022-10-14  9:26 [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
  2022-10-14  9:26 ` [PATCH 01/10] ARM: dts: stm32: add PWR fixed regulators on stm32mp131 Fabrice Gasnier
  2022-10-14  9:26 ` [PATCH 02/10] ARM: dts: stm32: add USBPHYC and dual USB HS PHY support " Fabrice Gasnier
@ 2022-10-14  9:26 ` Fabrice Gasnier
  2022-10-14  9:26 ` [PATCH 04/10] ARM: dts: stm32: add USB OTG HS " Fabrice Gasnier
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabrice Gasnier @ 2022-10-14  9:26 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

From: Amelie Delaunay <amelie.delaunay@foss.st.com>

This patch adds USB Host EHCI and OHCI support on stm32mp131.

Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 arch/arm/boot/dts/stm32mp131.dtsi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp131.dtsi b/arch/arm/boot/dts/stm32mp131.dtsi
index cd31fdd47536..b372786d2a64 100644
--- a/arch/arm/boot/dts/stm32mp131.dtsi
+++ b/arch/arm/boot/dts/stm32mp131.dtsi
@@ -401,6 +401,25 @@ sdmmc2: mmc@58007000 {
 			status = "disabled";
 		};
 
+		usbh_ohci: usbh-ohci@5800c000 {
+			compatible = "generic-ohci";
+			reg = <0x5800c000 0x1000>;
+			clocks = <&usbphyc>, <&rcc USBH>;
+			resets = <&rcc USBH_R>;
+			interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
+		usbh_ehci: usbh-ehci@5800d000 {
+			compatible = "generic-ehci";
+			reg = <0x5800d000 0x1000>;
+			clocks = <&usbphyc>, <&rcc USBH>;
+			resets = <&rcc USBH_R>;
+			interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
+			companion = <&usbh_ohci>;
+			status = "disabled";
+		};
+
 		iwdg2: watchdog@5a002000 {
 			compatible = "st,stm32mp1-iwdg";
 			reg = <0x5a002000 0x400>;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 04/10] ARM: dts: stm32: add USB OTG HS support on stm32mp131
  2022-10-14  9:26 [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
                   ` (2 preceding siblings ...)
  2022-10-14  9:26 ` [PATCH 03/10] ARM: dts: stm32: add UBSH EHCI and OHCI " Fabrice Gasnier
@ 2022-10-14  9:26 ` Fabrice Gasnier
  2022-10-14  9:26 ` [PATCH 05/10] ARM: dts: stm32: add fixed regulators to support usb on stm32mp135f-dk Fabrice Gasnier
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabrice Gasnier @ 2022-10-14  9:26 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

From: Amelie Delaunay <amelie.delaunay@foss.st.com>

This patch adds USB OTG HS support on stm32mp131.

Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 arch/arm/boot/dts/stm32mp131.dtsi | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp131.dtsi b/arch/arm/boot/dts/stm32mp131.dtsi
index b372786d2a64..517c3fc3fb40 100644
--- a/arch/arm/boot/dts/stm32mp131.dtsi
+++ b/arch/arm/boot/dts/stm32mp131.dtsi
@@ -253,6 +253,23 @@ dmamux1: dma-router@48002000 {
 			dma-channels = <16>;
 		};
 
+		usbotg_hs: usb-otg@49000000 {
+			compatible = "st,stm32mp15-hsotg", "snps,dwc2";
+			reg = <0x49000000 0x40000>;
+			clocks = <&rcc USBO_K>;
+			clock-names = "otg";
+			resets = <&rcc USBO_R>;
+			reset-names = "dwc2";
+			interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
+			g-rx-fifo-size = <512>;
+			g-np-tx-fifo-size = <32>;
+			g-tx-fifo-size = <256 16 16 16 16 16 16 16>;
+			dr_mode = "otg";
+			otg-rev = <0x200>;
+			usb33d-supply = <&usb33>;
+			status = "disabled";
+		};
+
 		spi4: spi@4c002000 {
 			compatible = "st,stm32h7-spi";
 			reg = <0x4c002000 0x400>;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 05/10] ARM: dts: stm32: add fixed regulators to support usb on stm32mp135f-dk
  2022-10-14  9:26 [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
                   ` (3 preceding siblings ...)
  2022-10-14  9:26 ` [PATCH 04/10] ARM: dts: stm32: add USB OTG HS " Fabrice Gasnier
@ 2022-10-14  9:26 ` Fabrice Gasnier
  2022-10-14  9:26 ` [PATCH 06/10] ARM: dts: stm32: enable USB HS phys " Fabrice Gasnier
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabrice Gasnier @ 2022-10-14  9:26 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

Add VDD_USB and 3V3_SW regulators on stm32mp135f-dk. Temporary add them
as fixed regulators, waiting for full SCMI regulators support.

This is a precursor patch to enable USB support on STM32MP13:
- VDD_USB supplies the STM32MP13 USB internals
- 3V3_SW supplies various peripherals, including the onboard HUB.
Note: USB support requires these regulators to be enabled before
entering the kernel.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 arch/arm/boot/dts/stm32mp135f-dk.dts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp135f-dk.dts b/arch/arm/boot/dts/stm32mp135f-dk.dts
index de341d17e87d..291f05a958fd 100644
--- a/arch/arm/boot/dts/stm32mp135f-dk.dts
+++ b/arch/arm/boot/dts/stm32mp135f-dk.dts
@@ -66,6 +66,22 @@ vdd_sd: vdd-sd {
 		regulator-max-microvolt = <2900000>;
 		regulator-always-on;
 	};
+
+	vdd_usb: vdd-usb {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd_usb";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-always-on;
+	};
+
+	v3v3_sw: v3v3-sw {
+		compatible = "regulator-fixed";
+		regulator-name = "v3v3_sw";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-always-on;
+	};
 };
 
 &i2c1 {
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 06/10] ARM: dts: stm32: enable USB HS phys on stm32mp135f-dk
  2022-10-14  9:26 [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
                   ` (4 preceding siblings ...)
  2022-10-14  9:26 ` [PATCH 05/10] ARM: dts: stm32: add fixed regulators to support usb on stm32mp135f-dk Fabrice Gasnier
@ 2022-10-14  9:26 ` Fabrice Gasnier
  2022-10-14  9:26 ` [PATCH 07/10] ARM: dts: stm32: enable USB Host EHCI " Fabrice Gasnier
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabrice Gasnier @ 2022-10-14  9:26 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

From: Amelie Delaunay <amelie.delaunay@foss.st.com>

USBPHYC manages the two USB High-Speed phys. port0 is used by USBH and
port1 is used by USBOTG.
Enable and tune both PHYs on stm32mp135f-dk.

Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 arch/arm/boot/dts/stm32mp135f-dk.dts | 32 ++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp135f-dk.dts b/arch/arm/boot/dts/stm32mp135f-dk.dts
index 291f05a958fd..af87fb36eabc 100644
--- a/arch/arm/boot/dts/stm32mp135f-dk.dts
+++ b/arch/arm/boot/dts/stm32mp135f-dk.dts
@@ -144,3 +144,35 @@ &uart4 {
 	pinctrl-0 = <&uart4_pins_a>;
 	status = "okay";
 };
+
+&usbphyc {
+	status = "okay";
+};
+
+&usbphyc_port0 {
+	phy-supply = <&vdd_usb>;
+	st,current-boost-microamp = <1000>;
+	st,decrease-hs-slew-rate;
+	st,tune-hs-dc-level = <2>;
+	st,enable-hs-rftime-reduction;
+	st,trim-hs-current = <11>;
+	st,trim-hs-impedance = <2>;
+	st,tune-squelch-level = <1>;
+	st,enable-hs-rx-gain-eq;
+	st,no-hs-ftime-ctrl;
+	st,no-lsfs-sc;
+};
+
+&usbphyc_port1 {
+	phy-supply = <&vdd_usb>;
+	st,current-boost-microamp = <1000>;
+	st,decrease-hs-slew-rate;
+	st,tune-hs-dc-level = <2>;
+	st,enable-hs-rftime-reduction;
+	st,trim-hs-current = <11>;
+	st,trim-hs-impedance = <2>;
+	st,tune-squelch-level = <1>;
+	st,enable-hs-rx-gain-eq;
+	st,no-hs-ftime-ctrl;
+	st,no-lsfs-sc;
+};
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 07/10] ARM: dts: stm32: enable USB Host EHCI on stm32mp135f-dk
  2022-10-14  9:26 [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
                   ` (5 preceding siblings ...)
  2022-10-14  9:26 ` [PATCH 06/10] ARM: dts: stm32: enable USB HS phys " Fabrice Gasnier
@ 2022-10-14  9:26 ` Fabrice Gasnier
  2022-10-14  9:26 ` [PATCH 08/10] ARM: dts: stm32: add pins for stm32g0 typec controller on stm32mp13 Fabrice Gasnier
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabrice Gasnier @ 2022-10-14  9:26 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

From: Amelie Delaunay <amelie.delaunay@foss.st.com>

USBH Host EHCI controller manages the USB High-Speed hub controller IC
offering Type-A CN5 & CN6 connectors available on stm32mp135f-dk.
USB Host OHCI controller doesn't need to be enabled as Full-Speed and
Low-Speed traffic will be managed by the hub.
This USB2514B onboard hub is supplied by a 3v3 PMIC regulator.

Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 arch/arm/boot/dts/stm32mp135f-dk.dts | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp135f-dk.dts b/arch/arm/boot/dts/stm32mp135f-dk.dts
index af87fb36eabc..02ff2bc664da 100644
--- a/arch/arm/boot/dts/stm32mp135f-dk.dts
+++ b/arch/arm/boot/dts/stm32mp135f-dk.dts
@@ -145,6 +145,19 @@ &uart4 {
 	status = "okay";
 };
 
+&usbh_ehci {
+	phys = <&usbphyc_port0>;
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+	/* onboard HUB */
+	hub@1 {
+		compatible = "usb424,2514";
+		reg = <1>;
+		vdd-supply = <&v3v3_sw>;
+	};
+};
+
 &usbphyc {
 	status = "okay";
 };
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 08/10] ARM: dts: stm32: add pins for stm32g0 typec controller on stm32mp13
  2022-10-14  9:26 [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
                   ` (6 preceding siblings ...)
  2022-10-14  9:26 ` [PATCH 07/10] ARM: dts: stm32: enable USB Host EHCI " Fabrice Gasnier
@ 2022-10-14  9:26 ` Fabrice Gasnier
  2022-10-14  9:26 ` [PATCH 09/10] ARM: dts: stm32: enable USB OTG in dual role mode on stm32mp135f-dk Fabrice Gasnier
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Fabrice Gasnier @ 2022-10-14  9:26 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

Add gpio pin configuration to be used with stm32g0 typec controller. Define
the PI2 to enable internal pull-up on stm32mp13, used as interrupt pin on
stm32mp135f-dk board.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 arch/arm/boot/dts/stm32mp13-pinctrl.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp13-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp13-pinctrl.dtsi
index efdd163eba30..5c85c9fc583c 100644
--- a/arch/arm/boot/dts/stm32mp13-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stm32mp13-pinctrl.dtsi
@@ -165,6 +165,13 @@ pins {
 		};
 	};
 
+	stm32g0_intn_pins_a: stm32g0-intn-0 {
+		pins {
+			pinmux = <STM32_PINMUX('I', 2, GPIO)>;
+			bias-pull-up;
+		};
+	};
+
 	uart4_pins_a: uart4-0 {
 		pins1 {
 			pinmux = <STM32_PINMUX('D', 6, AF8)>; /* UART4_TX */
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 09/10] ARM: dts: stm32: enable USB OTG in dual role mode on stm32mp135f-dk
  2022-10-14  9:26 [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
                   ` (7 preceding siblings ...)
  2022-10-14  9:26 ` [PATCH 08/10] ARM: dts: stm32: add pins for stm32g0 typec controller on stm32mp13 Fabrice Gasnier
@ 2022-10-14  9:26 ` Fabrice Gasnier
  2022-10-14 16:16   ` Krzysztof Kozlowski
  2022-10-14  9:26 ` [PATCH 10/10] ARM: multi_v7_defconfig: enable Type-C UCSI and STM32G0 as modules Fabrice Gasnier
  2022-10-14 14:01 ` [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
  10 siblings, 1 reply; 14+ messages in thread
From: Fabrice Gasnier @ 2022-10-14  9:26 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

The USB OTG controller provides the USB data available on stm32mp135f-dk,
on the Type-C connector. Data role is determined by "usb-role-switch".

A STM32G0 provides the USB Type-C and Power Delivery connectivity.
It controls dual role power and dual role data through UCSI protocol over
I2C. It's wired on I2C1, with an interrupt pin on PI2 GPIO.
Its firmware maybe updated over I2C, so use the optional firmware-name
to enable firmware update.

Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 arch/arm/boot/dts/stm32mp135f-dk.dts | 34 ++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp135f-dk.dts b/arch/arm/boot/dts/stm32mp135f-dk.dts
index 02ff2bc664da..1c92bf096397 100644
--- a/arch/arm/boot/dts/stm32mp135f-dk.dts
+++ b/arch/arm/boot/dts/stm32mp135f-dk.dts
@@ -95,6 +95,28 @@ &i2c1 {
 	/* spare dmas for other usage */
 	/delete-property/dmas;
 	/delete-property/dma-names;
+
+	stm32g0@53 {
+		compatible = "st,stm32g0-typec";
+		reg = <0x53>;
+		/* Alert pin on PI2 */
+		interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
+		interrupt-parent = <&gpioi>;
+		/* Internal pull-up on PI2 */
+		pinctrl-names = "default";
+		pinctrl-0 = <&stm32g0_intn_pins_a>;
+		firmware-name = "stm32g0-ucsi.mp135f-dk.fw";
+		connector {
+			compatible = "usb-c-connector";
+			label = "USB-C";
+
+			port {
+				con_usb_c_g0_ep: endpoint {
+					remote-endpoint = <&usbotg_hs_ep>;
+				};
+			};
+		};
+	};
 };
 
 &i2c5 {
@@ -158,6 +180,18 @@ hub@1 {
 	};
 };
 
+&usbotg_hs {
+	phys = <&usbphyc_port1 0>;
+	phy-names = "usb2-phy";
+	usb-role-switch;
+	status = "okay";
+	port {
+		usbotg_hs_ep: endpoint {
+			remote-endpoint = <&con_usb_c_g0_ep>;
+		};
+	};
+};
+
 &usbphyc {
 	status = "okay";
 };
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 10/10] ARM: multi_v7_defconfig: enable Type-C UCSI and STM32G0 as modules
  2022-10-14  9:26 [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
                   ` (8 preceding siblings ...)
  2022-10-14  9:26 ` [PATCH 09/10] ARM: dts: stm32: enable USB OTG in dual role mode on stm32mp135f-dk Fabrice Gasnier
@ 2022-10-14  9:26 ` Fabrice Gasnier
  2022-10-14 14:01 ` [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
  10 siblings, 0 replies; 14+ messages in thread
From: Fabrice Gasnier @ 2022-10-14  9:26 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

Enable the USB Type-C UCSI, and the STM32G0 UCSI drivers as modules, since
used on STM32MP13 board.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 arch/arm/configs/multi_v7_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 12b35008571f..d391f8216eea 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -899,6 +899,8 @@ CONFIG_USB_CONFIGFS_F_UVC=y
 CONFIG_USB_CONFIGFS_F_PRINTER=y
 CONFIG_USB_ETH=m
 CONFIG_TYPEC=m
+CONFIG_TYPEC_UCSI=m
+CONFIG_UCSI_STM32G0=m
 CONFIG_TYPEC_STUSB160X=m
 CONFIG_MMC=y
 CONFIG_MMC_BLOCK_MINORS=16
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 00/10] Add support for USB on STM32MP13
  2022-10-14  9:26 [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
                   ` (9 preceding siblings ...)
  2022-10-14  9:26 ` [PATCH 10/10] ARM: multi_v7_defconfig: enable Type-C UCSI and STM32G0 as modules Fabrice Gasnier
@ 2022-10-14 14:01 ` Fabrice Gasnier
  10 siblings, 0 replies; 14+ messages in thread
From: Fabrice Gasnier @ 2022-10-14 14:01 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel, linux-stm32

On 10/14/22 11:26, Fabrice Gasnier wrote:
> Add support for USBPHYC, USB Host and USB OTG on STM32MP13.
> Enable all these interfaces on STM32MP135F-DK board.
> Enable the STM32G0 UCSI driver as module.
> Dependency on PWR and PMIC regulator is tempoarily managed by using
> fixed regulators (resp in the SoC dtsi and the board dts files).
> The USB support is functional when these regulators gets enabled at
> boot time before entering the kernel.

Hi,

Please discard this series. Generic node names recommendation has been
missed.
I'll send a V2.

Sorry for the noise.
Best Regards,
Fabrice

> 
> Amelie Delaunay (5):
>   ARM: dts: stm32: add USBPHYC and dual USB HS PHY support on stm32mp131
>   ARM: dts: stm32: add UBSH EHCI and OHCI support on stm32mp131
>   ARM: dts: stm32: add USB OTG HS support on stm32mp131
>   ARM: dts: stm32: enable USB HS phys on stm32mp135f-dk
>   ARM: dts: stm32: enable USB Host EHCI on stm32mp135f-dk
> 
> Fabrice Gasnier (5):
>   ARM: dts: stm32: add PWR fixed regulators on stm32mp131
>   ARM: dts: stm32: add fixed regulators to support usb on stm32mp135f-dk
>   ARM: dts: stm32: add pins for stm32g0 typec controller on stm32mp13
>   ARM: dts: stm32: enable USB OTG in dual role mode on stm32mp135f-dk
>   ARM: multi_v7_defconfig: enable Type-C UCSI and STM32G0 as modules
> 
>  arch/arm/boot/dts/stm32mp13-pinctrl.dtsi |  7 ++
>  arch/arm/boot/dts/stm32mp131.dtsi        | 81 ++++++++++++++++++++
>  arch/arm/boot/dts/stm32mp135f-dk.dts     | 95 ++++++++++++++++++++++++
>  arch/arm/configs/multi_v7_defconfig      |  2 +
>  4 files changed, 185 insertions(+)
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 09/10] ARM: dts: stm32: enable USB OTG in dual role mode on stm32mp135f-dk
  2022-10-14  9:26 ` [PATCH 09/10] ARM: dts: stm32: enable USB OTG in dual role mode on stm32mp135f-dk Fabrice Gasnier
@ 2022-10-14 16:16   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2022-10-14 16:16 UTC (permalink / raw)
  To: Fabrice Gasnier, alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel, linux-stm32

On 14/10/2022 05:26, Fabrice Gasnier wrote:
> The USB OTG controller provides the USB data available on stm32mp135f-dk,
> on the Type-C connector. Data role is determined by "usb-role-switch".
> 
> A STM32G0 provides the USB Type-C and Power Delivery connectivity.
> It controls dual role power and dual role data through UCSI protocol over
> I2C. It's wired on I2C1, with an interrupt pin on PI2 GPIO.
> Its firmware maybe updated over I2C, so use the optional firmware-name
> to enable firmware update.
> 
> Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
> ---
>  arch/arm/boot/dts/stm32mp135f-dk.dts | 34 ++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/stm32mp135f-dk.dts b/arch/arm/boot/dts/stm32mp135f-dk.dts
> index 02ff2bc664da..1c92bf096397 100644
> --- a/arch/arm/boot/dts/stm32mp135f-dk.dts
> +++ b/arch/arm/boot/dts/stm32mp135f-dk.dts
> @@ -95,6 +95,28 @@ &i2c1 {
>  	/* spare dmas for other usage */
>  	/delete-property/dmas;
>  	/delete-property/dma-names;
> +
> +	stm32g0@53 {

Node names should be generic, usually typec.
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation


Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 00/10] Add support for USB on STM32MP13
@ 2022-10-14  8:31 Fabrice Gasnier
  0 siblings, 0 replies; 14+ messages in thread
From: Fabrice Gasnier @ 2022-10-14  8:31 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

Add support for USBPHYC, USB Host and USB OTG on STM32MP13.
Enable all these interfaces on STM32MP135F-DK board.
Enable the STM32G0 UCSI driver as module.
Dependency on PWR and PMIC regulator is tempoarily managed by using
fixed regulators (resp in the SoC dtsi and the board dts files).
The USB support is functional when these regulators gets enabled at
boot time before entering the kernel.

Amelie Delaunay (5):
  ARM: dts: stm32: add USBPHYC and dual USB HS PHY support on stm32mp131
  ARM: dts: stm32: add UBSH EHCI and OHCI support on stm32mp131
  ARM: dts: stm32: add USB OTG HS support on stm32mp131
  ARM: dts: stm32: enable USB HS phys on stm32mp135f-dk
  ARM: dts: stm32: enable USB Host EHCI on stm32mp135f-dk

Fabrice Gasnier (5):
  ARM: dts: stm32: add PWR fixed regulators on stm32mp131
  ARM: dts: stm32: add fixed regulators to support usb on stm32mp135f-dk
  ARM: dts: stm32: add pins for stm32g0 typec controller on stm32mp13
  ARM: dts: stm32: enable USB OTG in dual role mode on stm32mp135f-dk
  ARM: multi_v7_defconfig: enable Type-C UCSI and STM32G0 as modules

 arch/arm/boot/dts/stm32mp13-pinctrl.dtsi |  7 ++
 arch/arm/boot/dts/stm32mp131.dtsi        | 81 ++++++++++++++++++++
 arch/arm/boot/dts/stm32mp135f-dk.dts     | 95 ++++++++++++++++++++++++
 arch/arm/configs/multi_v7_defconfig      |  2 +
 4 files changed, 185 insertions(+)

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-10-14 16:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-14  9:26 [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
2022-10-14  9:26 ` [PATCH 01/10] ARM: dts: stm32: add PWR fixed regulators on stm32mp131 Fabrice Gasnier
2022-10-14  9:26 ` [PATCH 02/10] ARM: dts: stm32: add USBPHYC and dual USB HS PHY support " Fabrice Gasnier
2022-10-14  9:26 ` [PATCH 03/10] ARM: dts: stm32: add UBSH EHCI and OHCI " Fabrice Gasnier
2022-10-14  9:26 ` [PATCH 04/10] ARM: dts: stm32: add USB OTG HS " Fabrice Gasnier
2022-10-14  9:26 ` [PATCH 05/10] ARM: dts: stm32: add fixed regulators to support usb on stm32mp135f-dk Fabrice Gasnier
2022-10-14  9:26 ` [PATCH 06/10] ARM: dts: stm32: enable USB HS phys " Fabrice Gasnier
2022-10-14  9:26 ` [PATCH 07/10] ARM: dts: stm32: enable USB Host EHCI " Fabrice Gasnier
2022-10-14  9:26 ` [PATCH 08/10] ARM: dts: stm32: add pins for stm32g0 typec controller on stm32mp13 Fabrice Gasnier
2022-10-14  9:26 ` [PATCH 09/10] ARM: dts: stm32: enable USB OTG in dual role mode on stm32mp135f-dk Fabrice Gasnier
2022-10-14 16:16   ` Krzysztof Kozlowski
2022-10-14  9:26 ` [PATCH 10/10] ARM: multi_v7_defconfig: enable Type-C UCSI and STM32G0 as modules Fabrice Gasnier
2022-10-14 14:01 ` [PATCH 00/10] Add support for USB on STM32MP13 Fabrice Gasnier
  -- strict thread matches above, loose matches on Subject: below --
2022-10-14  8:31 Fabrice Gasnier

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).