All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Configure usb0 as peripheral on am335x boards
@ 2023-06-29 13:09 Julien Panis
  2023-06-29 13:09 ` [PATCH 1/3] ARM: dts: am335x-evm: Use usb0 as peripheral Julien Panis
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Julien Panis @ 2023-06-29 13:09 UTC (permalink / raw
  To: Tony Lindgren, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-omap, devicetree, linux-kernel, vigneshr, nm, Julien Panis

This series configures usb0 dr_mode as 'peripheral' for am335x-evm,
am335x-evmsk, and am335x-icev2. This USB port is mainly used for
RNDIS and DFU.

Initially, a series was submitted to overlay dr_mode in u-boot specific
device trees ('<board>-u-boot.dtsi'):
https://lore.kernel.org/all/20230621-fix_usb_ether_init-v2-0-ff121f0e8d7a@baylibre.com/

It was finally decided to modify linux device trees.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
---
Julien Panis (3):
      ARM: dts: am335x-evm: Use usb0 as peripheral
      ARM: dts: am335x-evmsk: Use usb0 as peripheral
      ARM: dts: am335x-icev2: Use usb0 as peripheral

 arch/arm/boot/dts/am335x-evm.dts   | 4 ++++
 arch/arm/boot/dts/am335x-evmsk.dts | 4 ++++
 arch/arm/boot/dts/am335x-icev2.dts | 4 ++++
 3 files changed, 12 insertions(+)
---
base-commit: 3a8a670eeeaa40d87bd38a587438952741980c18
change-id: 20230629-usb0-as-peripheral-15afa04c2185

Best regards,
-- 
Julien Panis <jpanis@baylibre.com>


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

* [PATCH 1/3] ARM: dts: am335x-evm: Use usb0 as peripheral
  2023-06-29 13:09 [PATCH 0/3] Configure usb0 as peripheral on am335x boards Julien Panis
@ 2023-06-29 13:09 ` Julien Panis
  2023-06-29 13:09 ` [PATCH 2/3] ARM: dts: am335x-evmsk: " Julien Panis
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Julien Panis @ 2023-06-29 13:09 UTC (permalink / raw
  To: Tony Lindgren, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-omap, devicetree, linux-kernel, vigneshr, nm, Julien Panis

This patch configures usb0 dr_mode as peripheral.
This USB port is mainly used for RNDIS and DFU.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
---
 arch/arm/boot/dts/am335x-evm.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 5beabaa5ff6a..75450458bcb8 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -411,6 +411,10 @@ tps: tps@2d {
 	};
 };
 
+&usb0 {
+	dr_mode = "peripheral";
+};
+
 &usb1 {
 	dr_mode = "host";
 };

-- 
2.37.3


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

* [PATCH 2/3] ARM: dts: am335x-evmsk: Use usb0 as peripheral
  2023-06-29 13:09 [PATCH 0/3] Configure usb0 as peripheral on am335x boards Julien Panis
  2023-06-29 13:09 ` [PATCH 1/3] ARM: dts: am335x-evm: Use usb0 as peripheral Julien Panis
@ 2023-06-29 13:09 ` Julien Panis
  2023-06-29 13:09 ` [PATCH 3/3] ARM: dts: am335x-icev2: " Julien Panis
  2023-06-30  7:20 ` [PATCH 0/3] Configure usb0 as peripheral on am335x boards Tony Lindgren
  3 siblings, 0 replies; 13+ messages in thread
From: Julien Panis @ 2023-06-29 13:09 UTC (permalink / raw
  To: Tony Lindgren, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-omap, devicetree, linux-kernel, vigneshr, nm, Julien Panis

This patch configures usb0 dr_mode as peripheral.
This USB port is mainly used for RNDIS and DFU.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
---
 arch/arm/boot/dts/am335x-evmsk.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index 5b3278c0c46a..03300bf45cdd 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -503,6 +503,10 @@ tlv320aic3106: tlv320aic3106@1b {
 	};
 };
 
+&usb0 {
+	dr_mode = "peripheral";
+};
+
 &usb1 {
 	dr_mode = "host";
 };

-- 
2.37.3


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

* [PATCH 3/3] ARM: dts: am335x-icev2: Use usb0 as peripheral
  2023-06-29 13:09 [PATCH 0/3] Configure usb0 as peripheral on am335x boards Julien Panis
  2023-06-29 13:09 ` [PATCH 1/3] ARM: dts: am335x-evm: Use usb0 as peripheral Julien Panis
  2023-06-29 13:09 ` [PATCH 2/3] ARM: dts: am335x-evmsk: " Julien Panis
@ 2023-06-29 13:09 ` Julien Panis
  2023-06-30  7:20 ` [PATCH 0/3] Configure usb0 as peripheral on am335x boards Tony Lindgren
  3 siblings, 0 replies; 13+ messages in thread
From: Julien Panis @ 2023-06-29 13:09 UTC (permalink / raw
  To: Tony Lindgren, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-omap, devicetree, linux-kernel, vigneshr, nm, Julien Panis

This patch configures usb0 dr_mode as peripheral.
This USB port is mainly used for RNDIS and DFU.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
---
 arch/arm/boot/dts/am335x-icev2.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-icev2.dts b/arch/arm/boot/dts/am335x-icev2.dts
index 5835c0cdda50..203e374676d3 100644
--- a/arch/arm/boot/dts/am335x-icev2.dts
+++ b/arch/arm/boot/dts/am335x-icev2.dts
@@ -360,6 +360,10 @@ adc {
 	};
 };
 
+&usb0 {
+	dr_mode = "peripheral";
+};
+
 #include "tps65910.dtsi"
 
 &tps {

-- 
2.37.3


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

* Re: [PATCH 0/3] Configure usb0 as peripheral on am335x boards
  2023-06-29 13:09 [PATCH 0/3] Configure usb0 as peripheral on am335x boards Julien Panis
                   ` (2 preceding siblings ...)
  2023-06-29 13:09 ` [PATCH 3/3] ARM: dts: am335x-icev2: " Julien Panis
@ 2023-06-30  7:20 ` Tony Lindgren
  2023-06-30  8:30   ` Julien Panis
  3 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2023-06-30  7:20 UTC (permalink / raw
  To: Julien Panis
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-omap,
	devicetree, linux-kernel, vigneshr, nm

Hi,

* Julien Panis <jpanis@baylibre.com> [230629 13:10]:
> This series configures usb0 dr_mode as 'peripheral' for am335x-evm,
> am335x-evmsk, and am335x-icev2. This USB port is mainly used for
> RNDIS and DFU.

Is this a mini-B connector? Just wondering if it was originally attempted
to be configured as OTG or how it ended up with a host configuration..

> Initially, a series was submitted to overlay dr_mode in u-boot specific
> device trees ('<board>-u-boot.dtsi'):
> https://lore.kernel.org/all/20230621-fix_usb_ether_init-v2-0-ff121f0e8d7a@baylibre.com/
> 
> It was finally decided to modify linux device trees.

Do we need these as fixes? If so is there a fixes tag for these?

Regards,

Tony

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

* Re: [PATCH 0/3] Configure usb0 as peripheral on am335x boards
  2023-06-30  7:20 ` [PATCH 0/3] Configure usb0 as peripheral on am335x boards Tony Lindgren
@ 2023-06-30  8:30   ` Julien Panis
  2023-06-30 19:40     ` Roger Quadros
  0 siblings, 1 reply; 13+ messages in thread
From: Julien Panis @ 2023-06-30  8:30 UTC (permalink / raw
  To: Tony Lindgren
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-omap,
	devicetree, linux-kernel, vigneshr, nm

Hello Tony,

On 6/30/23 09:20, Tony Lindgren wrote:
> Hi,
>
> * Julien Panis <jpanis@baylibre.com> [230629 13:10]:
>> This series configures usb0 dr_mode as 'peripheral' for am335x-evm,
>> am335x-evmsk, and am335x-icev2. This USB port is mainly used for
>> RNDIS and DFU.
> Is this a mini-B connector? Just wondering if it was originally attempted
> to be configured as OTG or how it ended up with a host configuration..

It's a micro USB-AB connector.
I don't know how it ended up with a host configuration, it looks like an oversight.
Maybe Vignesh or Nishanth can confirm (?)

>
>> Initially, a series was submitted to overlay dr_mode in u-boot specific
>> device trees ('<board>-u-boot.dtsi'):
>> https://lore.kernel.org/all/20230621-fix_usb_ether_init-v2-0-ff121f0e8d7a@baylibre.com/
>>
>> It was finally decided to modify linux device trees.
> Do we need these as fixes? If so is there a fixes tag for these?

I don't think so.
The u-boot series mentioned above was submitted to fix an error returned
by usb_ether_init() function. This error appeared after changes in u-boot
(arch/arm/mach-omap2/am33xx/board.c). The u-boot commit is:
6815a66ad7430 ("am33xx: musb: Remove unused configuration logic").
But this commit is right actually, and the error appeared because dr_mode
was not properly configured for am335x-evmsk and am335x-icev2 dts.
In other words, this u-boot commit is correct but revealed an oversight
in dr_mode configuration for these boards.
So, there is not a fixes tag here. That was just an omission in device trees.

>
> Regards,
>
> Tony

Julien

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

* Re: [PATCH 0/3] Configure usb0 as peripheral on am335x boards
  2023-06-30  8:30   ` Julien Panis
@ 2023-06-30 19:40     ` Roger Quadros
  2023-07-03 11:56       ` Julien Panis
  0 siblings, 1 reply; 13+ messages in thread
From: Roger Quadros @ 2023-06-30 19:40 UTC (permalink / raw
  To: Julien Panis, Tony Lindgren
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-omap,
	devicetree, linux-kernel, vigneshr, nm

Hi,

On 30/06/2023 11:30, Julien Panis wrote:
> Hello Tony,
> 
> On 6/30/23 09:20, Tony Lindgren wrote:
>> Hi,
>>
>> * Julien Panis <jpanis@baylibre.com> [230629 13:10]:
>>> This series configures usb0 dr_mode as 'peripheral' for am335x-evm,
>>> am335x-evmsk, and am335x-icev2. This USB port is mainly used for
>>> RNDIS and DFU.
>> Is this a mini-B connector? Just wondering if it was originally attempted
>> to be configured as OTG or how it ended up with a host configuration..
> 
> It's a micro USB-AB connector.
> I don't know how it ended up with a host configuration, it looks like an oversight.
> Maybe Vignesh or Nishanth can confirm (?)

usb0 role should be "otg".
It is rightly so in Linux DT. am33xx.dtsi contains "otg" and all AM335x board files inherit from it.

So I don't think setting it to "peripheral" in u-boot is the right thing to do.

> 
>>
>>> Initially, a series was submitted to overlay dr_mode in u-boot specific
>>> device trees ('<board>-u-boot.dtsi'):
>>> https://lore.kernel.org/all/20230621-fix_usb_ether_init-v2-0-ff121f0e8d7a@baylibre.com/
>>>
>>> It was finally decided to modify linux device trees.
>> Do we need these as fixes? If so is there a fixes tag for these?
> 
> I don't think so.
> The u-boot series mentioned above was submitted to fix an error returned
> by usb_ether_init() function. This error appeared after changes in u-boot
> (arch/arm/mach-omap2/am33xx/board.c). The u-boot commit is:
> 6815a66ad7430 ("am33xx: musb: Remove unused configuration logic").
> But this commit is right actually, and the error appeared because dr_mode
> was not properly configured for am335x-evmsk and am335x-icev2 dts.
> In other words, this u-boot commit is correct but revealed an oversight
> in dr_mode configuration for these boards.
> So, there is not a fixes tag here. That was just an omission in device trees.
> 
>>
>> Regards,
>>
>> Tony
> 
> Julien
> 

-- 
cheers,
-roger

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

* Re: [PATCH 0/3] Configure usb0 as peripheral on am335x boards
  2023-06-30 19:40     ` Roger Quadros
@ 2023-07-03 11:56       ` Julien Panis
  2023-07-03 13:44         ` Roger Quadros
  0 siblings, 1 reply; 13+ messages in thread
From: Julien Panis @ 2023-07-03 11:56 UTC (permalink / raw
  To: Roger Quadros, Tony Lindgren
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-omap,
	devicetree, linux-kernel, vigneshr, nm

On 6/30/23 21:40, Roger Quadros wrote:
> Hi,
>
> On 30/06/2023 11:30, Julien Panis wrote:
>> Hello Tony,
>>
>> On 6/30/23 09:20, Tony Lindgren wrote:
>>> Hi,
>>>
>>> * Julien Panis <jpanis@baylibre.com> [230629 13:10]:
>>>> This series configures usb0 dr_mode as 'peripheral' for am335x-evm,
>>>> am335x-evmsk, and am335x-icev2. This USB port is mainly used for
>>>> RNDIS and DFU.
>>> Is this a mini-B connector? Just wondering if it was originally attempted
>>> to be configured as OTG or how it ended up with a host configuration..
>> It's a micro USB-AB connector.
>> I don't know how it ended up with a host configuration, it looks like an oversight.
>> Maybe Vignesh or Nishanth can confirm (?)
> usb0 role should be "otg".
> It is rightly so in Linux DT. am33xx.dtsi contains "otg" and all AM335x board files inherit from it.
>
> So I don't think setting it to "peripheral" in u-boot is the right thing to do.

This series is for kernel (not for u-boot).
Why is it a problem to set usb0 as 'peripheral' in kernel for the 3 board dts ?

With usb0 not set as 'peripheral', the 3 boards (am335x-evm, evm-sk, icev2)
do not boot with uboot 2023.04. This error is returned, with LOG_LEVEL=5:
     No USB device found
     USB ether init failed
     initcall sequence 8ffdbba4 failed at call 808024d9 (err=-19)
     ### ERROR ### Please RESET the board ###
This error is also returned with usb0 as 'otg'.

Julien Panis

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

* Re: [PATCH 0/3] Configure usb0 as peripheral on am335x boards
  2023-07-03 11:56       ` Julien Panis
@ 2023-07-03 13:44         ` Roger Quadros
  2023-07-03 14:14           ` Julien Panis
  0 siblings, 1 reply; 13+ messages in thread
From: Roger Quadros @ 2023-07-03 13:44 UTC (permalink / raw
  To: Julien Panis, Tony Lindgren
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-omap,
	devicetree, linux-kernel, vigneshr, nm



On 03/07/2023 14:56, Julien Panis wrote:
> On 6/30/23 21:40, Roger Quadros wrote:
>> Hi,
>>
>> On 30/06/2023 11:30, Julien Panis wrote:
>>> Hello Tony,
>>>
>>> On 6/30/23 09:20, Tony Lindgren wrote:
>>>> Hi,
>>>>
>>>> * Julien Panis <jpanis@baylibre.com> [230629 13:10]:
>>>>> This series configures usb0 dr_mode as 'peripheral' for am335x-evm,
>>>>> am335x-evmsk, and am335x-icev2. This USB port is mainly used for
>>>>> RNDIS and DFU.
>>>> Is this a mini-B connector? Just wondering if it was originally attempted
>>>> to be configured as OTG or how it ended up with a host configuration..
>>> It's a micro USB-AB connector.
>>> I don't know how it ended up with a host configuration, it looks like an oversight.
>>> Maybe Vignesh or Nishanth can confirm (?)
>> usb0 role should be "otg".
>> It is rightly so in Linux DT. am33xx.dtsi contains "otg" and all AM335x board files inherit from it.
>>
>> So I don't think setting it to "peripheral" in u-boot is the right thing to do.
> 
> This series is for kernel (not for u-boot).
> Why is it a problem to set usb0 as 'peripheral' in kernel for the 3 board dts ?
> 
> With usb0 not set as 'peripheral', the 3 boards (am335x-evm, evm-sk, icev2)
> do not boot with uboot 2023.04. This error is returned, with LOG_LEVEL=5:
>     No USB device found
>     USB ether init failed
>     initcall sequence 8ffdbba4 failed at call 808024d9 (err=-19)
>     ### ERROR ### Please RESET the board ###
> This error is also returned with usb0 as 'otg'.

This error is at u-boot correct? This will need further investigation.

Does it function correctly in Linux when kept as 'otg'?

-- 
cheers,
-roger

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

* Re: [PATCH 0/3] Configure usb0 as peripheral on am335x boards
  2023-07-03 13:44         ` Roger Quadros
@ 2023-07-03 14:14           ` Julien Panis
  2023-07-03 15:27             ` Roger Quadros
  0 siblings, 1 reply; 13+ messages in thread
From: Julien Panis @ 2023-07-03 14:14 UTC (permalink / raw
  To: Roger Quadros, Tony Lindgren
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-omap,
	devicetree, linux-kernel, vigneshr, nm, Tom Rini

On 7/3/23 15:44, Roger Quadros wrote:
>
> On 03/07/2023 14:56, Julien Panis wrote:
>> On 6/30/23 21:40, Roger Quadros wrote:
>>> Hi,
>>>
>>> On 30/06/2023 11:30, Julien Panis wrote:
>>>> Hello Tony,
>>>>
>>>> On 6/30/23 09:20, Tony Lindgren wrote:
>>>>> Hi,
>>>>>
>>>>> * Julien Panis <jpanis@baylibre.com> [230629 13:10]:
>>>>>> This series configures usb0 dr_mode as 'peripheral' for am335x-evm,
>>>>>> am335x-evmsk, and am335x-icev2. This USB port is mainly used for
>>>>>> RNDIS and DFU.
>>>>> Is this a mini-B connector? Just wondering if it was originally attempted
>>>>> to be configured as OTG or how it ended up with a host configuration..
>>>> It's a micro USB-AB connector.
>>>> I don't know how it ended up with a host configuration, it looks like an oversight.
>>>> Maybe Vignesh or Nishanth can confirm (?)
>>> usb0 role should be "otg".
>>> It is rightly so in Linux DT. am33xx.dtsi contains "otg" and all AM335x board files inherit from it.
>>>
>>> So I don't think setting it to "peripheral" in u-boot is the right thing to do.
>> This series is for kernel (not for u-boot).
>> Why is it a problem to set usb0 as 'peripheral' in kernel for the 3 board dts ?
>>
>> With usb0 not set as 'peripheral', the 3 boards (am335x-evm, evm-sk, icev2)
>> do not boot with uboot 2023.04. This error is returned, with LOG_LEVEL=5:
>>      No USB device found
>>      USB ether init failed
>>      initcall sequence 8ffdbba4 failed at call 808024d9 (err=-19)
>>      ### ERROR ### Please RESET the board ###
>> This error is also returned with usb0 as 'otg'.
> This error is at u-boot correct? This will need further investigation.
>
> Does it function correctly in Linux when kept as 'otg'?
>

This error is at u-boot level, indeed. I add Tom Rini to this thread, since he
was involved in the discussion here:
https://lore.kernel.org/all/20230621-fix_usb_ether_init-v2-0-ff121f0e8d7a@baylibre.com/
If dr_mode is set as 'peripheral' in '<board>-u-boot.dtsi' and kept as 'otg'
in linux, it functions correctly in linux.

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

* Re: [PATCH 0/3] Configure usb0 as peripheral on am335x boards
  2023-07-03 14:14           ` Julien Panis
@ 2023-07-03 15:27             ` Roger Quadros
  2023-07-03 15:51               ` Julien Panis
  0 siblings, 1 reply; 13+ messages in thread
From: Roger Quadros @ 2023-07-03 15:27 UTC (permalink / raw
  To: Julien Panis, Tony Lindgren
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-omap,
	devicetree, linux-kernel, vigneshr, nm, Tom Rini



On 03/07/2023 17:14, Julien Panis wrote:
> On 7/3/23 15:44, Roger Quadros wrote:
>>
>> On 03/07/2023 14:56, Julien Panis wrote:
>>> On 6/30/23 21:40, Roger Quadros wrote:
>>>> Hi,
>>>>
>>>> On 30/06/2023 11:30, Julien Panis wrote:
>>>>> Hello Tony,
>>>>>
>>>>> On 6/30/23 09:20, Tony Lindgren wrote:
>>>>>> Hi,
>>>>>>
>>>>>> * Julien Panis <jpanis@baylibre.com> [230629 13:10]:
>>>>>>> This series configures usb0 dr_mode as 'peripheral' for am335x-evm,
>>>>>>> am335x-evmsk, and am335x-icev2. This USB port is mainly used for
>>>>>>> RNDIS and DFU.
>>>>>> Is this a mini-B connector? Just wondering if it was originally attempted
>>>>>> to be configured as OTG or how it ended up with a host configuration..
>>>>> It's a micro USB-AB connector.
>>>>> I don't know how it ended up with a host configuration, it looks like an oversight.
>>>>> Maybe Vignesh or Nishanth can confirm (?)
>>>> usb0 role should be "otg".
>>>> It is rightly so in Linux DT. am33xx.dtsi contains "otg" and all AM335x board files inherit from it.
>>>>
>>>> So I don't think setting it to "peripheral" in u-boot is the right thing to do.
>>> This series is for kernel (not for u-boot).
>>> Why is it a problem to set usb0 as 'peripheral' in kernel for the 3 board dts ?
>>>
>>> With usb0 not set as 'peripheral', the 3 boards (am335x-evm, evm-sk, icev2)
>>> do not boot with uboot 2023.04. This error is returned, with LOG_LEVEL=5:
>>>      No USB device found
>>>      USB ether init failed
>>>      initcall sequence 8ffdbba4 failed at call 808024d9 (err=-19)
>>>      ### ERROR ### Please RESET the board ###
>>> This error is also returned with usb0 as 'otg'.
>> This error is at u-boot correct? This will need further investigation.
>>
>> Does it function correctly in Linux when kept as 'otg'?
>>
> 
> This error is at u-boot level, indeed. I add Tom Rini to this thread, since he
> was involved in the discussion here:
> https://lore.kernel.org/all/20230621-fix_usb_ether_init-v2-0-ff121f0e8d7a@baylibre.com/
> If dr_mode is set as 'peripheral' in '<board>-u-boot.dtsi' and kept as 'otg'
> in linux, it functions correctly in linux.

OK.

So NAK for this patch series as we don't want to break 'otg' on Linux.

u-boot doesn't support 'otg' mode. So we need to force it either to
'peripheral' or 'host'.

One solution would be to have 'peripheral' in am335x-*-u-boot.dts?

-- 
cheers,
-roger

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

* Re: [PATCH 0/3] Configure usb0 as peripheral on am335x boards
  2023-07-03 15:27             ` Roger Quadros
@ 2023-07-03 15:51               ` Julien Panis
  2023-07-06  3:51                 ` Tony Lindgren
  0 siblings, 1 reply; 13+ messages in thread
From: Julien Panis @ 2023-07-03 15:51 UTC (permalink / raw
  To: Roger Quadros, Tony Lindgren
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-omap,
	devicetree, linux-kernel, vigneshr, nm, Tom Rini

On 7/3/23 17:27, Roger Quadros wrote:
>
> On 03/07/2023 17:14, Julien Panis wrote:
>> On 7/3/23 15:44, Roger Quadros wrote:
>>> On 03/07/2023 14:56, Julien Panis wrote:
>>>> On 6/30/23 21:40, Roger Quadros wrote:
>>>>> Hi,
>>>>>
>>>>> On 30/06/2023 11:30, Julien Panis wrote:
>>>>>> Hello Tony,
>>>>>>
>>>>>> On 6/30/23 09:20, Tony Lindgren wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> * Julien Panis <jpanis@baylibre.com> [230629 13:10]:
>>>>>>>> This series configures usb0 dr_mode as 'peripheral' for am335x-evm,
>>>>>>>> am335x-evmsk, and am335x-icev2. This USB port is mainly used for
>>>>>>>> RNDIS and DFU.
>>>>>>> Is this a mini-B connector? Just wondering if it was originally attempted
>>>>>>> to be configured as OTG or how it ended up with a host configuration..
>>>>>> It's a micro USB-AB connector.
>>>>>> I don't know how it ended up with a host configuration, it looks like an oversight.
>>>>>> Maybe Vignesh or Nishanth can confirm (?)
>>>>> usb0 role should be "otg".
>>>>> It is rightly so in Linux DT. am33xx.dtsi contains "otg" and all AM335x board files inherit from it.
>>>>>
>>>>> So I don't think setting it to "peripheral" in u-boot is the right thing to do.
>>>> This series is for kernel (not for u-boot).
>>>> Why is it a problem to set usb0 as 'peripheral' in kernel for the 3 board dts ?
>>>>
>>>> With usb0 not set as 'peripheral', the 3 boards (am335x-evm, evm-sk, icev2)
>>>> do not boot with uboot 2023.04. This error is returned, with LOG_LEVEL=5:
>>>>       No USB device found
>>>>       USB ether init failed
>>>>       initcall sequence 8ffdbba4 failed at call 808024d9 (err=-19)
>>>>       ### ERROR ### Please RESET the board ###
>>>> This error is also returned with usb0 as 'otg'.
>>> This error is at u-boot correct? This will need further investigation.
>>>
>>> Does it function correctly in Linux when kept as 'otg'?
>>>
>> This error is at u-boot level, indeed. I add Tom Rini to this thread, since he
>> was involved in the discussion here:
>> https://lore.kernel.org/all/20230621-fix_usb_ether_init-v2-0-ff121f0e8d7a@baylibre.com/
>> If dr_mode is set as 'peripheral' in '<board>-u-boot.dtsi' and kept as 'otg'
>> in linux, it functions correctly in linux.
> OK.
>
> So NAK for this patch series as we don't want to break 'otg' on Linux.
>
> u-boot doesn't support 'otg' mode. So we need to force it either to
> 'peripheral' or 'host'.
>
> One solution would be to have 'peripheral' in am335x-*-u-boot.dts?
>

OK. In other words, we just need to reconsider my previous u-boot series. :-)
I was setting usb0 as 'peripheral' in 'am335x-*-u-boot.dts' here:
https://lore.kernel.org/all/20230621-fix_usb_ether_init-v2-0-ff121f0e8d7a@baylibre.com/

Julien

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

* Re: [PATCH 0/3] Configure usb0 as peripheral on am335x boards
  2023-07-03 15:51               ` Julien Panis
@ 2023-07-06  3:51                 ` Tony Lindgren
  0 siblings, 0 replies; 13+ messages in thread
From: Tony Lindgren @ 2023-07-06  3:51 UTC (permalink / raw
  To: Julien Panis
  Cc: Roger Quadros, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-omap, devicetree, linux-kernel, vigneshr, nm, Tom Rini

Hi,

* Julien Panis <jpanis@baylibre.com> [230703 15:51]:
> OK. In other words, we just need to reconsider my previous u-boot series. :-)
> I was setting usb0 as 'peripheral' in 'am335x-*-u-boot.dts' here:
> https://lore.kernel.org/all/20230621-fix_usb_ether_init-v2-0-ff121f0e8d7a@baylibre.com/

It would be best to not change the dts as it's describing the hardware
capabilities. Instead, it would be better to parse the capability in the
driver to handle a dual-role wired usb-ab connector as peripheral only in
u-boot.

Regards,

Tony

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

end of thread, other threads:[~2023-07-06  3:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-29 13:09 [PATCH 0/3] Configure usb0 as peripheral on am335x boards Julien Panis
2023-06-29 13:09 ` [PATCH 1/3] ARM: dts: am335x-evm: Use usb0 as peripheral Julien Panis
2023-06-29 13:09 ` [PATCH 2/3] ARM: dts: am335x-evmsk: " Julien Panis
2023-06-29 13:09 ` [PATCH 3/3] ARM: dts: am335x-icev2: " Julien Panis
2023-06-30  7:20 ` [PATCH 0/3] Configure usb0 as peripheral on am335x boards Tony Lindgren
2023-06-30  8:30   ` Julien Panis
2023-06-30 19:40     ` Roger Quadros
2023-07-03 11:56       ` Julien Panis
2023-07-03 13:44         ` Roger Quadros
2023-07-03 14:14           ` Julien Panis
2023-07-03 15:27             ` Roger Quadros
2023-07-03 15:51               ` Julien Panis
2023-07-06  3:51                 ` Tony Lindgren

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.