All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: ls1028a: default to OTG mode for USB
@ 2022-03-30 11:34 ` Michael Walle
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Walle @ 2022-03-30 11:34 UTC (permalink / raw)
  To: Shawn Guo, Li Yang, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, devicetree, linux-kernel, Michael Walle

At the moment, the dtsi will force the dr_mode to host. This is
problematic because it will always turn on the Vbus voltage regardless
if the port is host or device. This might lead to a "shortcut" between
the two USB endpoints because both might have their Vbus supplies
enabled. Therefore, the default should be "otg" for any ports which
aren't host only (from a SoC point of view) and have a user of the dtsi
file overwrite that explicitly.

Move the 'dr_mode = "host";' into the board dts. Now that the dtsi
doesn't set the dr_mode anymore, we can also drop the 'dr_mode = "otg";'
in the board dts because that is the default value if dr_mode is not
set.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts | 1 +
 arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts          | 2 ++
 arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts          | 2 +-
 arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi             | 2 --
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts
index fef1bb585dce..68d11a9c67f3 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts
@@ -341,5 +341,6 @@ &usb0 {
 };
 
 &usb1 {
+	dr_mode = "host";
 	status = "okay";
 };
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
index 19d3952dbffe..5baf060acf93 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
@@ -382,9 +382,11 @@ &sata {
 };
 
 &usb0 {
+	dr_mode = "host";
 	status = "okay";
 };
 
 &usb1 {
+	dr_mode = "host";
 	status = "okay";
 };
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
index 68c31cb8eead..e0cd1516d05b 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
@@ -299,10 +299,10 @@ &sata {
 };
 
 &usb0 {
+	dr_mode = "host";
 	status = "okay";
 };
 
 &usb1 {
-	dr_mode = "otg";
 	status = "okay";
 };
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
index 088271d49139..92465f777603 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
@@ -599,7 +599,6 @@ usb0: usb@3100000 {
 			compatible = "fsl,ls1028a-dwc3", "snps,dwc3";
 			reg = <0x0 0x3100000 0x0 0x10000>;
 			interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
-			dr_mode = "host";
 			snps,dis_rxdet_inp3_quirk;
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
@@ -610,7 +609,6 @@ usb1: usb@3110000 {
 			compatible = "fsl,ls1028a-dwc3", "snps,dwc3";
 			reg = <0x0 0x3110000 0x0 0x10000>;
 			interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
-			dr_mode = "host";
 			snps,dis_rxdet_inp3_quirk;
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
-- 
2.30.2


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

* [PATCH] arm64: dts: ls1028a: default to OTG mode for USB
@ 2022-03-30 11:34 ` Michael Walle
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Walle @ 2022-03-30 11:34 UTC (permalink / raw)
  To: Shawn Guo, Li Yang, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, devicetree, linux-kernel, Michael Walle

At the moment, the dtsi will force the dr_mode to host. This is
problematic because it will always turn on the Vbus voltage regardless
if the port is host or device. This might lead to a "shortcut" between
the two USB endpoints because both might have their Vbus supplies
enabled. Therefore, the default should be "otg" for any ports which
aren't host only (from a SoC point of view) and have a user of the dtsi
file overwrite that explicitly.

Move the 'dr_mode = "host";' into the board dts. Now that the dtsi
doesn't set the dr_mode anymore, we can also drop the 'dr_mode = "otg";'
in the board dts because that is the default value if dr_mode is not
set.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts | 1 +
 arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts          | 2 ++
 arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts          | 2 +-
 arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi             | 2 --
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts
index fef1bb585dce..68d11a9c67f3 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts
@@ -341,5 +341,6 @@ &usb0 {
 };
 
 &usb1 {
+	dr_mode = "host";
 	status = "okay";
 };
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
index 19d3952dbffe..5baf060acf93 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
@@ -382,9 +382,11 @@ &sata {
 };
 
 &usb0 {
+	dr_mode = "host";
 	status = "okay";
 };
 
 &usb1 {
+	dr_mode = "host";
 	status = "okay";
 };
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
index 68c31cb8eead..e0cd1516d05b 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
@@ -299,10 +299,10 @@ &sata {
 };
 
 &usb0 {
+	dr_mode = "host";
 	status = "okay";
 };
 
 &usb1 {
-	dr_mode = "otg";
 	status = "okay";
 };
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
index 088271d49139..92465f777603 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
@@ -599,7 +599,6 @@ usb0: usb@3100000 {
 			compatible = "fsl,ls1028a-dwc3", "snps,dwc3";
 			reg = <0x0 0x3100000 0x0 0x10000>;
 			interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
-			dr_mode = "host";
 			snps,dis_rxdet_inp3_quirk;
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
@@ -610,7 +609,6 @@ usb1: usb@3110000 {
 			compatible = "fsl,ls1028a-dwc3", "snps,dwc3";
 			reg = <0x0 0x3110000 0x0 0x10000>;
 			interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
-			dr_mode = "host";
 			snps,dis_rxdet_inp3_quirk;
 			snps,quirk-frame-length-adjustment = <0x20>;
 			snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
-- 
2.30.2


_______________________________________________
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] 4+ messages in thread

* Re: [PATCH] arm64: dts: ls1028a: default to OTG mode for USB
  2022-03-30 11:34 ` Michael Walle
@ 2022-04-11  0:54   ` Shawn Guo
  -1 siblings, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2022-04-11  0:54 UTC (permalink / raw)
  To: Michael Walle
  Cc: Li Yang, Rob Herring, Krzysztof Kozlowski, linux-arm-kernel,
	devicetree, linux-kernel

On Wed, Mar 30, 2022 at 01:34:42PM +0200, Michael Walle wrote:
> At the moment, the dtsi will force the dr_mode to host. This is
> problematic because it will always turn on the Vbus voltage regardless
> if the port is host or device. This might lead to a "shortcut" between
> the two USB endpoints because both might have their Vbus supplies
> enabled. Therefore, the default should be "otg" for any ports which
> aren't host only (from a SoC point of view) and have a user of the dtsi
> file overwrite that explicitly.
> 
> Move the 'dr_mode = "host";' into the board dts. Now that the dtsi
> doesn't set the dr_mode anymore, we can also drop the 'dr_mode = "otg";'
> in the board dts because that is the default value if dr_mode is not
> set.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>

Applied, thanks!

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

* Re: [PATCH] arm64: dts: ls1028a: default to OTG mode for USB
@ 2022-04-11  0:54   ` Shawn Guo
  0 siblings, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2022-04-11  0:54 UTC (permalink / raw)
  To: Michael Walle
  Cc: Li Yang, Rob Herring, Krzysztof Kozlowski, linux-arm-kernel,
	devicetree, linux-kernel

On Wed, Mar 30, 2022 at 01:34:42PM +0200, Michael Walle wrote:
> At the moment, the dtsi will force the dr_mode to host. This is
> problematic because it will always turn on the Vbus voltage regardless
> if the port is host or device. This might lead to a "shortcut" between
> the two USB endpoints because both might have their Vbus supplies
> enabled. Therefore, the default should be "otg" for any ports which
> aren't host only (from a SoC point of view) and have a user of the dtsi
> file overwrite that explicitly.
> 
> Move the 'dr_mode = "host";' into the board dts. Now that the dtsi
> doesn't set the dr_mode anymore, we can also drop the 'dr_mode = "otg";'
> in the board dts because that is the default value if dr_mode is not
> set.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>

Applied, thanks!

_______________________________________________
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] 4+ messages in thread

end of thread, other threads:[~2022-04-11  0:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 11:34 [PATCH] arm64: dts: ls1028a: default to OTG mode for USB Michael Walle
2022-03-30 11:34 ` Michael Walle
2022-04-11  0:54 ` Shawn Guo
2022-04-11  0:54   ` Shawn Guo

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.