Skip to contentSkip to conversation

ARM: dts: exynos: fix roles of USB 3.0 ports on Odroid XU

PATCH In review Krzysztof Kozlowski 1 participant 5 messages Oct 15, 2020 – Oct 26, 2020

Subsystems (3)
lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

PATCH 1/4 ARM: dts: exynos: fix roles of USB 3.0 ports on Odroid XU

On Odroid XU board the USB3-0 port is a microUSB and USB3-1 port is USB type A (host). The roles were copied from Odroid XU3 (Exynos5422) design which has it reversed.

Fixes 8149afe4dbf9 ("ARM: dts: exynos: Add initial support for Odroid XU board")
---
 arch/arm/boot/dts/exynos5410-odroidxu.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/exynos5410-odroidxu.dts +2 -2
index 4f9297ae0763..353eb6ef3a04 100644
@@ -637,11 +637,11 @@ &tmu_cpu3 {
 };
 
 &usbdrd_dwc3_0 {
-	dr_mode = "host";
+	dr_mode = "peripheral";
 };
 
 &usbdrd_dwc3_1 {
-	dr_mode = "peripheral";
+	dr_mode = "host";
 };
 
 &usbdrd3_0 {
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 2/4 ARM: dts: exynos: fix USB 3.0 VBUS control and over-current pins on Exynos5410

The VBUS control (PWREN) and over-current pins of USB 3.0 DWC3 controllers are on Exynos5410 regular GPIOs. This is different than for example on Exynos5422 where these are special ETC pins with proper reset values (pulls, functions).

Therefore these pins should be configured to enable proper USB 3.0 peripheral and host modes. This also fixes over-current warning:

    [    6.024658] usb usb4-port1: over-current condition
    [    6.028271] usb usb3-port1: over-current condition
Fixes cb0896562228 ("ARM: dts: exynos: Add USB to Exynos5410")
---
 arch/arm/boot/dts/exynos5410-pinctrl.dtsi | 28 +++++++++++++++++++++++
 arch/arm/boot/dts/exynos5410.dtsi         |  4 ++++
 2 files changed, 32 insertions(+)
arch/arm/boot/dts/exynos5410-pinctrl.dtsi +28 -0
index e5d0a2a4f648..d0aa18443a69 100644
@@ -560,6 +560,34 @@ gpk3: gpk3 {
 		interrupt-controller;
 		#interrupt-cells = <2>;
 	};
+
+	usb3_1_oc: usb3-1-oc {
+		samsung,pins = "gpk2-4", "gpk2-5";
+		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+	};
+
+	usb3_1_vbusctrl: usb3-1-vbusctrl {
+		samsung,pins = "gpk2-6", "gpk2-7";
+		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+	};
+
+	usb3_0_oc: usb3-0-oc {
+		samsung,pins = "gpk3-0", "gpk3-1";
+		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+	};
+
+	usb3_0_vbusctrl: usb3-0-vbusctrl {
+		samsung,pins = "gpk3-2", "gpk3-3";
+		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+	};
 };
 
 &pinctrl_2 {
arch/arm/boot/dts/exynos5410.dtsi +4 -0
index abe75b9e39f5..060b8696d24d 100644
@@ -390,6 +390,8 @@ &trng {
 &usbdrd3_0 {
 	clocks = <&clock CLK_USBD300>;
 	clock-names = "usbdrd30";
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb3_0_oc>, <&usb3_0_vbusctrl>;
 };
 
 &usbdrd_phy0 {
@@ -401,6 +403,8 @@ &usbdrd_phy0 {
 &usbdrd3_1 {
 	clocks = <&clock CLK_USBD301>;
 	clock-names = "usbdrd30";
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb3_1_oc>, <&usb3_1_vbusctrl>;
 };
 
 &usbdrd_dwc3_1 {
Signature · 1 line
2.25.1
author maintainer
#2 lore raw

PATCH 3/4 ARM: dts: exynos: fix USB 3.0 pins supply being turned off on Odroid XU

In reply to Krzysztof Kozlowski

On Odroid XU LDO12 and LDO15 supplies the power to USB 3.0 blocks but the GPK GPIO pins are supplied by LDO7 (VDDQ_LCD). LDO7 also supplies GPJ GPIO pins.

The Exynos pinctrl driver does not take any supplies, so to have entire GPIO block always available, make the regulator always on.

Fixes 88644b4c750b ("ARM: dts: exynos: Configure PWM, usb3503, PMIC and thermal on Odroid XU board")
---
 arch/arm/boot/dts/exynos5410-odroidxu.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/exynos5410-odroidxu.dts +2 -0
index 353eb6ef3a04..6cc4d4653f84 100644
@@ -327,6 +327,8 @@ ldo7_reg: LDO7 {
 				regulator-name = "vddq_lcd";
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <1800000>;
+				/* Supplies also GPK and GPJ */
+				regulator-always-on;
 			};
 
 			ldo8_reg: LDO8 {
Signature · 1 line
2.25.1
author maintainer
#3 lore raw

PATCH 4/4 ARM: dts: exynos: disable pull up of USB 3.0 over-current on Odroid XU

In reply to Krzysztof Kozlowski

The Odroid XU has external pull ups for USB 3.0 over-current pins, so disable the internal one.

---
 arch/arm/boot/dts/exynos5410-odroidxu.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/exynos5410-odroidxu.dts +10 -0
index 6cc4d4653f84..27f079d33eb1 100644
@@ -638,6 +638,16 @@ &tmu_cpu3 {
 	vtmu-supply = <&ldo10_reg>;
 };
 
+&usb3_0_oc {
+	/* External pull up */
+	samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+};
+
+&usb3_1_oc {
+	/* External pull up */
+	samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+};
+
 &usbdrd_dwc3_0 {
 	dr_mode = "peripheral";
 };
Signature · 1 line
2.25.1
author maintainer
#4 lore raw
In reply to Krzysztof Kozlowski
Quoted 10 lines · Krzysztof Kozlowski

On Odroid XU board the USB3-0 port is a microUSB and USB3-1 port is USB type A (host). The roles were copied from Odroid XU3 (Exynos5422) design which has it reversed.

Fixes 8149afe4dbf9 ("ARM: dts: exynos: Add initial support for Odroid XU board")
---
 arch/arm/boot/dts/exynos5410-odroidxu.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied all four, with Gabriel's tested-by tag.

Best regards,
Krzysztof