Linux Samsung SOC development
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: exynos: Enable DWC2 dual-role support on OdroidU3+ boards
       [not found] <CGME20201103140221eucas1p1c4479a8a89e7e9a05c7582462d79e5c7@eucas1p1.samsung.com>
@ 2020-11-03 14:02 ` Marek Szyprowski
  2020-11-03 21:24   ` Marek Szyprowski
  2020-11-05 19:10   ` Krzysztof Kozlowski
  0 siblings, 2 replies; 4+ messages in thread
From: Marek Szyprowski @ 2020-11-03 14:02 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Marek Szyprowski, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz

MicroUSB port on OdroidU3+ boards can operate both as peripheral or as
host port. Till now it was configured as pheriperal only port, but it
turned out that the DWC2 driver code already handles everything needed to
support USB role-switch, so switch it to dual-role (OTG) mode. This has
no effect on OdroidU3 (with 'plus') and OdroidX2, which doesn't have USB
needed ID pin and VBUS wiring. Those will still operate correctly in
pheriperal mode only.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 arch/arm/boot/dts/exynos4412-odroid-common.dtsi |  1 -
 arch/arm/boot/dts/exynos4412-odroidu3.dts       | 14 ++++++++++++++
 arch/arm/boot/dts/exynos4412-odroidx.dts        |  4 ++++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
index 2a6f5b1d7645..2b20d9095d9f 100644
--- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
+++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
@@ -255,7 +255,6 @@
 };
 
 &hsotg {
-	dr_mode = "peripheral";
 	status = "okay";
 	vusb_d-supply = <&ldo15_reg>;
 	vusb_a-supply = <&ldo12_reg>;
diff --git a/arch/arm/boot/dts/exynos4412-odroidu3.dts b/arch/arm/boot/dts/exynos4412-odroidu3.dts
index b8549d846f86..746c2a99a83c 100644
--- a/arch/arm/boot/dts/exynos4412-odroidu3.dts
+++ b/arch/arm/boot/dts/exynos4412-odroidu3.dts
@@ -21,6 +21,15 @@
 		reg = <0x40000000 0x7FF00000>;
 	};
 
+	vbus_otg_reg: voltage-regulator-1 {
+		compatible = "regulator-fixed";
+		regulator-name = "VBUS_VDD_5.0V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&gpl2 0 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
 	leds {
 		compatible = "gpio-leds";
 		led1 {
@@ -105,6 +114,11 @@
 	phy-names = "hsic0", "hsic1";
 };
 
+&hsotg {
+	dr_mode = "otg";
+	vbus-supply = <&vbus_otg_reg>;
+};
+
 &sound {
 	model = "Odroid-U3";
 	samsung,audio-widgets =
diff --git a/arch/arm/boot/dts/exynos4412-odroidx.dts b/arch/arm/boot/dts/exynos4412-odroidx.dts
index 46381e9097f4..d6ee62bf336c 100644
--- a/arch/arm/boot/dts/exynos4412-odroidx.dts
+++ b/arch/arm/boot/dts/exynos4412-odroidx.dts
@@ -76,6 +76,10 @@
 	};
 };
 
+&hsotg {
+	dr_mode = "peripheral";
+};
+
 &mshc_0 {
 	vqmmc-supply = <&buck8_reg>;
 };
-- 
2.17.1


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

* Re: [PATCH] ARM: dts: exynos: Enable DWC2 dual-role support on OdroidU3+ boards
  2020-11-03 14:02 ` [PATCH] ARM: dts: exynos: Enable DWC2 dual-role support on OdroidU3+ boards Marek Szyprowski
@ 2020-11-03 21:24   ` Marek Szyprowski
  2020-11-05  7:48     ` Anand Moon
  2020-11-05 19:10   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 4+ messages in thread
From: Marek Szyprowski @ 2020-11-03 21:24 UTC (permalink / raw)
  To: linux-samsung-soc; +Cc: Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz

On 03.11.2020 15:02, Marek Szyprowski wrote:
> MicroUSB port on OdroidU3+ boards can operate both as peripheral or as
> host port. Till now it was configured as pheriperal only port, but it
> turned out that the DWC2 driver code already handles everything needed to
> support USB role-switch, so switch it to dual-role (OTG) mode. This has
> no effect on OdroidU3 (with 'plus') and OdroidX2, which doesn't have USB
/s/with/without
> needed ID pin and VBUS wiring. Those will still operate correctly in
> pheriperal mode only.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>   arch/arm/boot/dts/exynos4412-odroid-common.dtsi |  1 -
>   arch/arm/boot/dts/exynos4412-odroidu3.dts       | 14 ++++++++++++++
>   arch/arm/boot/dts/exynos4412-odroidx.dts        |  4 ++++
>   3 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
> index 2a6f5b1d7645..2b20d9095d9f 100644
> --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
> +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
> @@ -255,7 +255,6 @@
>   };
>   
>   &hsotg {
> -	dr_mode = "peripheral";
>   	status = "okay";
>   	vusb_d-supply = <&ldo15_reg>;
>   	vusb_a-supply = <&ldo12_reg>;
> diff --git a/arch/arm/boot/dts/exynos4412-odroidu3.dts b/arch/arm/boot/dts/exynos4412-odroidu3.dts
> index b8549d846f86..746c2a99a83c 100644
> --- a/arch/arm/boot/dts/exynos4412-odroidu3.dts
> +++ b/arch/arm/boot/dts/exynos4412-odroidu3.dts
> @@ -21,6 +21,15 @@
>   		reg = <0x40000000 0x7FF00000>;
>   	};
>   
> +	vbus_otg_reg: voltage-regulator-1 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "VBUS_VDD_5.0V";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		gpio = <&gpl2 0 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +	};
> +
>   	leds {
>   		compatible = "gpio-leds";
>   		led1 {
> @@ -105,6 +114,11 @@
>   	phy-names = "hsic0", "hsic1";
>   };
>   
> +&hsotg {
> +	dr_mode = "otg";
> +	vbus-supply = <&vbus_otg_reg>;
> +};
> +
>   &sound {
>   	model = "Odroid-U3";
>   	samsung,audio-widgets =
> diff --git a/arch/arm/boot/dts/exynos4412-odroidx.dts b/arch/arm/boot/dts/exynos4412-odroidx.dts
> index 46381e9097f4..d6ee62bf336c 100644
> --- a/arch/arm/boot/dts/exynos4412-odroidx.dts
> +++ b/arch/arm/boot/dts/exynos4412-odroidx.dts
> @@ -76,6 +76,10 @@
>   	};
>   };
>   
> +&hsotg {
> +	dr_mode = "peripheral";
> +};
> +
>   &mshc_0 {
>   	vqmmc-supply = <&buck8_reg>;
>   };

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


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

* Re: [PATCH] ARM: dts: exynos: Enable DWC2 dual-role support on OdroidU3+ boards
  2020-11-03 21:24   ` Marek Szyprowski
@ 2020-11-05  7:48     ` Anand Moon
  0 siblings, 0 replies; 4+ messages in thread
From: Anand Moon @ 2020-11-05  7:48 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-samsung-soc, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz

Hi Marek,

On Wed, 4 Nov 2020 at 02:56, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>
> On 03.11.2020 15:02, Marek Szyprowski wrote:
> > MicroUSB port on OdroidU3+ boards can operate both as peripheral or as
> > host port. Till now it was configured as pheriperal only port, but it
> > turned out that the DWC2 driver code already handles everything needed to
> > support USB role-switch, so switch it to dual-role (OTG) mode. This has
> > no effect on OdroidU3 (with 'plus') and OdroidX2, which doesn't have USB
> /s/with/without
> > needed ID pin and VBUS wiring. Those will still operate correctly in
> > pheriperal mode only.
> >
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > ---

Thanks I have tested this patch on Odroid U3+
it enable the otg port

[alarm@archl-u3et ~]$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ehci/3p, 480M
    |__ Port 2: Dev 2, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc2/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M

Please add my
Tested-by: Anand Moon <linux.amoon@gmail.com>

Best Regards
Anand

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

* Re: [PATCH] ARM: dts: exynos: Enable DWC2 dual-role support on OdroidU3+ boards
  2020-11-03 14:02 ` [PATCH] ARM: dts: exynos: Enable DWC2 dual-role support on OdroidU3+ boards Marek Szyprowski
  2020-11-03 21:24   ` Marek Szyprowski
@ 2020-11-05 19:10   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-05 19:10 UTC (permalink / raw)
  To: Marek Szyprowski; +Cc: linux-samsung-soc, Bartlomiej Zolnierkiewicz

On Tue, Nov 03, 2020 at 03:02:14PM +0100, Marek Szyprowski wrote:
> MicroUSB port on OdroidU3+ boards can operate both as peripheral or as
> host port. Till now it was configured as pheriperal only port, but it
> turned out that the DWC2 driver code already handles everything needed to
> support USB role-switch, so switch it to dual-role (OTG) mode. This has
> no effect on OdroidU3 (with 'plus') and OdroidX2, which doesn't have USB
> needed ID pin and VBUS wiring. Those will still operate correctly in
> pheriperal mode only.
> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  arch/arm/boot/dts/exynos4412-odroid-common.dtsi |  1 -
>  arch/arm/boot/dts/exynos4412-odroidu3.dts       | 14 ++++++++++++++
>  arch/arm/boot/dts/exynos4412-odroidx.dts        |  4 ++++

Thanks, applied with corrected 'without', Anand's tag and node named
just "regulator-1" (X has one and it is more generic).

Best regards,
Krzysztof


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

end of thread, other threads:[~2020-11-05 19:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20201103140221eucas1p1c4479a8a89e7e9a05c7582462d79e5c7@eucas1p1.samsung.com>
2020-11-03 14:02 ` [PATCH] ARM: dts: exynos: Enable DWC2 dual-role support on OdroidU3+ boards Marek Szyprowski
2020-11-03 21:24   ` Marek Szyprowski
2020-11-05  7:48     ` Anand Moon
2020-11-05 19:10   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox