mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: pbab01: allow USB-OTG port runtime configuration
@ 2022-04-19  8:39 Andrej Picej
  2022-04-19  9:16 ` Ahmad Fatoum
  0 siblings, 1 reply; 3+ messages in thread
From: Andrej Picej @ 2022-04-19  8:39 UTC (permalink / raw)
  To: barebox; +Cc: upstream

Since commit a5a4c1d5a3 ("dts: update to v5.13-rc1"), which synced
kernel dts, USB-OTG port on phyFLEX board was set to work only in
peripheral mode. This has to do with phyFLEX baseboard hardware bug,
which prevents correct USB OTG ID pin detection in kernel code.

Unlike linux kernel, barebox doesn't support OTG auto-detection mode via
ID pin. In barebox, user has to select desired USB mode of operation by
setting 'otg.mode' variable. Thus delete 'dr_mode' property from dts to
be able to later select USB OTG operating mode at runtime (either host
or peripheral).

Signed-off-by: Andrej Picej <andrej.picej@norik.com>
---
 arch/arm/dts/imx6qdl-phytec-pbab01.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/imx6qdl-phytec-pbab01.dtsi b/arch/arm/dts/imx6qdl-phytec-pbab01.dtsi
index 991c7e4fab..36870facdd 100644
--- a/arch/arm/dts/imx6qdl-phytec-pbab01.dtsi
+++ b/arch/arm/dts/imx6qdl-phytec-pbab01.dtsi
@@ -15,6 +15,10 @@
 	status = "okay";
 };
 
+&usbotg {
+	/delete-property/ dr_mode;
+};
+
 #ifdef USE_STATE_EXAMPLE
 #include "state-example.dtsi"
 #endif
-- 
2.25.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH] ARM: pbab01: allow USB-OTG port runtime configuration
  2022-04-19  8:39 [PATCH] ARM: pbab01: allow USB-OTG port runtime configuration Andrej Picej
@ 2022-04-19  9:16 ` Ahmad Fatoum
  2022-04-19 11:57   ` Andrej Picej
  0 siblings, 1 reply; 3+ messages in thread
From: Ahmad Fatoum @ 2022-04-19  9:16 UTC (permalink / raw)
  To: Andrej Picej, barebox; +Cc: upstream

Hello Andrej,

On 19.04.22 10:39, Andrej Picej wrote:
> Since commit a5a4c1d5a3 ("dts: update to v5.13-rc1"), which synced
> kernel dts, USB-OTG port on phyFLEX board was set to work only in
> peripheral mode. This has to do with phyFLEX baseboard hardware bug,
> which prevents correct USB OTG ID pin detection in kernel code.
> 
> Unlike linux kernel, barebox doesn't support OTG auto-detection mode via
> ID pin. In barebox, user has to select desired USB mode of operation by
> setting 'otg.mode' variable. Thus delete 'dr_mode' property from dts to
> be able to later select USB OTG operating mode at runtime (either host
> or peripheral).
> 
> Signed-off-by: Andrej Picej <andrej.picej@norik.com>
> ---
>  arch/arm/dts/imx6qdl-phytec-pbab01.dtsi | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/dts/imx6qdl-phytec-pbab01.dtsi b/arch/arm/dts/imx6qdl-phytec-pbab01.dtsi
> index 991c7e4fab..36870facdd 100644
> --- a/arch/arm/dts/imx6qdl-phytec-pbab01.dtsi
> +++ b/arch/arm/dts/imx6qdl-phytec-pbab01.dtsi
> @@ -15,6 +15,10 @@
>  	status = "okay";
>  };
>  
> +&usbotg {
> +	/delete-property/ dr_mode;
> +};

Wouldn't it be better to be explicit and set dr_mode = "otg"?
It doesn't matter here, but some other USB controllers default
to "host" in absence of the property, so setting it to "otg"
will be clearer IMO.

Thanks,
Ahmad

> +
>  #ifdef USE_STATE_EXAMPLE
>  #include "state-example.dtsi"
>  #endif


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH] ARM: pbab01: allow USB-OTG port runtime configuration
  2022-04-19  9:16 ` Ahmad Fatoum
@ 2022-04-19 11:57   ` Andrej Picej
  0 siblings, 0 replies; 3+ messages in thread
From: Andrej Picej @ 2022-04-19 11:57 UTC (permalink / raw)
  To: Ahmad Fatoum, barebox; +Cc: upstream

Hi Ahmad,

On 19. 04. 22 11:16, Ahmad Fatoum wrote:
> Hello Andrej,
> 
> On 19.04.22 10:39, Andrej Picej wrote:
>> Since commit a5a4c1d5a3 ("dts: update to v5.13-rc1"), which synced
>> kernel dts, USB-OTG port on phyFLEX board was set to work only in
>> peripheral mode. This has to do with phyFLEX baseboard hardware bug,
>> which prevents correct USB OTG ID pin detection in kernel code.
>>
>> Unlike linux kernel, barebox doesn't support OTG auto-detection mode via
>> ID pin. In barebox, user has to select desired USB mode of operation by
>> setting 'otg.mode' variable. Thus delete 'dr_mode' property from dts to
>> be able to later select USB OTG operating mode at runtime (either host
>> or peripheral).
>>
>> Signed-off-by: Andrej Picej <andrej.picej@norik.com>
>> ---
>>   arch/arm/dts/imx6qdl-phytec-pbab01.dtsi | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/arm/dts/imx6qdl-phytec-pbab01.dtsi b/arch/arm/dts/imx6qdl-phytec-pbab01.dtsi
>> index 991c7e4fab..36870facdd 100644
>> --- a/arch/arm/dts/imx6qdl-phytec-pbab01.dtsi
>> +++ b/arch/arm/dts/imx6qdl-phytec-pbab01.dtsi
>> @@ -15,6 +15,10 @@
>>   	status = "okay";
>>   };
>>   
>> +&usbotg {
>> +	/delete-property/ dr_mode;
>> +};
> 
> Wouldn't it be better to be explicit and set dr_mode = "otg"?
> It doesn't matter here, but some other USB controllers default
> to "host" in absence of the property, so setting it to "otg"
> will be clearer IMO.
> 

hm...yes, I think you are right. I will fix this and send a v2.

Thanks for your review.

Best regards,
Andrej

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

end of thread, other threads:[~2022-04-19 13:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19  8:39 [PATCH] ARM: pbab01: allow USB-OTG port runtime configuration Andrej Picej
2022-04-19  9:16 ` Ahmad Fatoum
2022-04-19 11:57   ` Andrej Picej

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