[PATCH 5/5] arm64: tegra: smaug: Add usb-role-switch support

Diogo Ivo posted 5 patches 2 months, 1 week ago
[PATCH 5/5] arm64: tegra: smaug: Add usb-role-switch support
Posted by Diogo Ivo 2 months, 1 week ago
The USB2 port on Smaug is configured for OTG operation but lacked the
required 'usb-role-switch' property, leading to a failed probe and a
non-functioning USB port. Add the property along with setting the default
role to host.

Signed-off-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
---
 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
index b8d854f90be7..49bf23d6f593 100644
--- a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
@@ -1809,6 +1809,8 @@ usb2-0 {
 				status = "okay";
 				vbus-supply = <&usbc_vbus>;
 				mode = "otg";
+				usb-role-switch;
+				role-switch-default-mode = "host";
 			};
 
 			usb3-0 {

-- 
2.52.0
Re: [PATCH 5/5] arm64: tegra: smaug: Add usb-role-switch support
Posted by Jon Hunter 4 weeks ago
On 04/12/2025 21:27, Diogo Ivo wrote:
> The USB2 port on Smaug is configured for OTG operation but lacked the
> required 'usb-role-switch' property, leading to a failed probe and a
> non-functioning USB port. Add the property along with setting the default
> role to host.
> 
> Signed-off-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
> ---
>   arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> index b8d854f90be7..49bf23d6f593 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> +++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> @@ -1809,6 +1809,8 @@ usb2-0 {
>   				status = "okay";
>   				vbus-supply = <&usbc_vbus>;
>   				mode = "otg";
> +				usb-role-switch;
> +				role-switch-default-mode = "host";
>   			};


This change does add the following warning when building with CHECK_DTBS
...

arch/arm64/boot/dts/nvidia/tegra210-smaug.dtb: padctl@7009f000 (nvidia,tegra210-xusb-padctl): ports:usb2-0: 'role-switch-default-mode' does not match any of the regexes: '^pinctrl-[0-9]+$'
	from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra210-xusb-padctl.yaml

I know that there are many warnings seen for the smaug DTB, but it would
be good to ensure we don't add more.

Cheers
Jon

-- 
nvpublic
Re: [PATCH 5/5] arm64: tegra: smaug: Add usb-role-switch support
Posted by Diogo Ivo 3 weeks, 6 days ago

On 1/12/26 22:03, Jon Hunter wrote:
> 
> On 04/12/2025 21:27, Diogo Ivo wrote:
>> The USB2 port on Smaug is configured for OTG operation but lacked the
>> required 'usb-role-switch' property, leading to a failed probe and a
>> non-functioning USB port. Add the property along with setting the default
>> role to host.
>>
>> Signed-off-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
>> ---
>>   arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/ 
>> arm64/boot/dts/nvidia/tegra210-smaug.dts
>> index b8d854f90be7..49bf23d6f593 100644
>> --- a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
>> +++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
>> @@ -1809,6 +1809,8 @@ usb2-0 {
>>                   status = "okay";
>>                   vbus-supply = <&usbc_vbus>;
>>                   mode = "otg";
>> +                usb-role-switch;
>> +                role-switch-default-mode = "host";
>>               };
> 
> 
> This change does add the following warning when building with CHECK_DTBS
> ...
> 
> arch/arm64/boot/dts/nvidia/tegra210-smaug.dtb: padctl@7009f000 
> (nvidia,tegra210-xusb-padctl): ports:usb2-0: 'role-switch-default-mode' 
> does not match any of the regexes: '^pinctrl-[0-9]+$'
>      from schema $id: http://devicetree.org/schemas/phy/nvidia,tegra210- 
> xusb-padctl.yaml
> 
> I know that there are many warnings seen for the smaug DTB, but it would
> be good to ensure we don't add more.

The 'role-switch-default-mode' property is read by the driver to set the
initial role for the port [0] and is needed in order for the port to work
when booting so in order to fix the warning this property needs to be added
to the binding.

As for the other warning ('connector' is a dependency of 'usb-role-switch')
again I think the binding needs to be adjusted since in the Pixel C the
connector node should be under the (as for now not present)
cros-ec-typec node and the usb2-0 is then modeled as a remote-endpoint
for the full connector. I am currently working on fixing the cros-ec-typec
driver and already have a working fix for automatic role switching but
in any case I think the binding is what needs changing. If you agree
with this then I will add the necessary changes to the DT binding in v2.

Thanks,
Diogo

[0]: 
https://elixir.bootlin.com/linux/v6.18.4/source/drivers/phy/tegra/xusb.c#L730

> Cheers
> Jon
Re: [PATCH 5/5] arm64: tegra: smaug: Add usb-role-switch support
Posted by Jon Hunter 3 weeks, 6 days ago
On 13/01/2026 14:20, Diogo Ivo wrote:
> 
> 
> On 1/12/26 22:03, Jon Hunter wrote:
>>
>> On 04/12/2025 21:27, Diogo Ivo wrote:
>>> The USB2 port on Smaug is configured for OTG operation but lacked the
>>> required 'usb-role-switch' property, leading to a failed probe and a
>>> non-functioning USB port. Add the property along with setting the 
>>> default
>>> role to host.
>>>
>>> Signed-off-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
>>> ---
>>>   arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/ 
>>> arm64/boot/dts/nvidia/tegra210-smaug.dts
>>> index b8d854f90be7..49bf23d6f593 100644
>>> --- a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
>>> +++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
>>> @@ -1809,6 +1809,8 @@ usb2-0 {
>>>                   status = "okay";
>>>                   vbus-supply = <&usbc_vbus>;
>>>                   mode = "otg";
>>> +                usb-role-switch;
>>> +                role-switch-default-mode = "host";
>>>               };
>>
>>
>> This change does add the following warning when building with CHECK_DTBS
>> ...
>>
>> arch/arm64/boot/dts/nvidia/tegra210-smaug.dtb: padctl@7009f000 
>> (nvidia,tegra210-xusb-padctl): ports:usb2-0: 'role-switch-default- 
>> mode' does not match any of the regexes: '^pinctrl-[0-9]+$'
>>      from schema $id: http://devicetree.org/schemas/phy/ 
>> nvidia,tegra210- xusb-padctl.yaml
>>
>> I know that there are many warnings seen for the smaug DTB, but it would
>> be good to ensure we don't add more.
> 
> The 'role-switch-default-mode' property is read by the driver to set the
> initial role for the port [0] and is needed in order for the port to work
> when booting so in order to fix the warning this property needs to be added
> to the binding.

Correct.

> As for the other warning ('connector' is a dependency of 'usb-role-switch')
> again I think the binding needs to be adjusted since in the Pixel C the
> connector node should be under the (as for now not present)
> cros-ec-typec node and the usb2-0 is then modeled as a remote-endpoint
> for the full connector. I am currently working on fixing the cros-ec-typec
> driver and already have a working fix for automatic role switching but
> in any case I think the binding is what needs changing. If you agree
> with this then I will add the necessary changes to the DT binding in v2.

Yes in both cases we need fixes to the DT binding that's all.

Jon

-- 
nvpublic

Re: [PATCH 5/5] arm64: tegra: smaug: Add usb-role-switch support
Posted by Diogo Ivo 3 weeks, 6 days ago

On 1/13/26 14:49, Jon Hunter wrote:
> 
> On 13/01/2026 14:20, Diogo Ivo wrote:
>>
>>
>> On 1/12/26 22:03, Jon Hunter wrote:
>>>
>>> On 04/12/2025 21:27, Diogo Ivo wrote:
>>>> The USB2 port on Smaug is configured for OTG operation but lacked the
>>>> required 'usb-role-switch' property, leading to a failed probe and a
>>>> non-functioning USB port. Add the property along with setting the 
>>>> default
>>>> role to host.
>>>>
>>>> Signed-off-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
>>>> ---
>>>>   arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 2 ++
>>>>   1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/ 
>>>> arm64/boot/dts/nvidia/tegra210-smaug.dts
>>>> index b8d854f90be7..49bf23d6f593 100644
>>>> --- a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
>>>> +++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
>>>> @@ -1809,6 +1809,8 @@ usb2-0 {
>>>>                   status = "okay";
>>>>                   vbus-supply = <&usbc_vbus>;
>>>>                   mode = "otg";
>>>> +                usb-role-switch;
>>>> +                role-switch-default-mode = "host";
>>>>               };
>>>
>>>
>>> This change does add the following warning when building with CHECK_DTBS
>>> ...
>>>
>>> arch/arm64/boot/dts/nvidia/tegra210-smaug.dtb: padctl@7009f000 
>>> (nvidia,tegra210-xusb-padctl): ports:usb2-0: 'role-switch-default- 
>>> mode' does not match any of the regexes: '^pinctrl-[0-9]+$'
>>>      from schema $id: http://devicetree.org/schemas/phy/ 
>>> nvidia,tegra210- xusb-padctl.yaml
>>>
>>> I know that there are many warnings seen for the smaug DTB, but it would
>>> be good to ensure we don't add more.
>>
>> The 'role-switch-default-mode' property is read by the driver to set the
>> initial role for the port [0] and is needed in order for the port to work
>> when booting so in order to fix the warning this property needs to be 
>> added
>> to the binding.
> 
> Correct.
> 
>> As for the other warning ('connector' is a dependency of 'usb-role- 
>> switch')
>> again I think the binding needs to be adjusted since in the Pixel C the
>> connector node should be under the (as for now not present)
>> cros-ec-typec node and the usb2-0 is then modeled as a remote-endpoint
>> for the full connector. I am currently working on fixing the cros-ec- 
>> typec
>> driver and already have a working fix for automatic role switching but
>> in any case I think the binding is what needs changing. If you agree
>> with this then I will add the necessary changes to the DT binding in v2.
> 
> Yes in both cases we need fixes to the DT binding that's all.

Perfect, will do for v2.

Diogo

> Jon
>