2021-01-19 05:44:10

by JC Kuo

[permalink] [raw]
Subject: [PATCH] arm64: tegra: Enable Jetson-Xavier J512 USB host

This commit enables USB host mode at J512 type-C port of Jetson-Xavier.

Signed-off-by: JC Kuo <[email protected]>
---
.../arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 8 +++++++
.../boot/dts/nvidia/tegra194-p2972-0000.dts | 24 +++++++++++++++++--
2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
index d71b7a1140fe..7e7b0eb90c80 100644
--- a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
@@ -93,6 +93,10 @@ padctl@3520000 {
vclamp-usb-supply = <&vdd_1v8ao>;

ports {
+ usb2-0 {
+ vbus-supply = <&vdd_5v0_sys>;
+ };
+
usb2-1 {
vbus-supply = <&vdd_5v0_sys>;
};
@@ -105,6 +109,10 @@ usb3-0 {
vbus-supply = <&vdd_5v0_sys>;
};

+ usb3-2 {
+ vbus-supply = <&vdd_5v0_sys>;
+ };
+
usb3-3 {
vbus-supply = <&vdd_5v0_sys>;
};
diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts b/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
index 54d057beec59..8697927b1fe7 100644
--- a/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
@@ -57,6 +57,10 @@ padctl@3520000 {
pads {
usb2 {
lanes {
+ usb2-0 {
+ status = "okay";
+ };
+
usb2-1 {
status = "okay";
};
@@ -73,6 +77,10 @@ usb3-0 {
status = "okay";
};

+ usb3-2 {
+ status = "okay";
+ };
+
usb3-3 {
status = "okay";
};
@@ -81,6 +89,11 @@ usb3-3 {
};

ports {
+ usb2-0 {
+ mode = "host";
+ status = "okay";
+ };
+
usb2-1 {
mode = "host";
status = "okay";
@@ -96,6 +109,11 @@ usb3-0 {
status = "okay";
};

+ usb3-2 {
+ nvidia,usb2-companion = <0>;
+ status = "okay";
+ };
+
usb3-3 {
nvidia,usb2-companion = <3>;
maximum-speed = "super-speed";
@@ -107,11 +125,13 @@ usb3-3 {
usb@3610000 {
status = "okay";

- phys = <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-1}>,
+ phys = <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-0}>,
+ <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-1}>,
<&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-3}>,
<&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-0}>,
+ <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-2}>,
<&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-3}>;
- phy-names = "usb2-1", "usb2-3", "usb3-0", "usb3-3";
+ phy-names = "usb2-0", "usb2-1", "usb2-3", "usb3-0", "usb3-2", "usb3-3";
};

pwm@c340000 {
--
2.25.1


2021-01-21 10:29:24

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH] arm64: tegra: Enable Jetson-Xavier J512 USB host


On 19/01/2021 02:23, JC Kuo wrote:
> This commit enables USB host mode at J512 type-C port of Jetson-Xavier.
>
> Signed-off-by: JC Kuo <[email protected]>
> ---
> .../arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 8 +++++++
> .../boot/dts/nvidia/tegra194-p2972-0000.dts | 24 +++++++++++++++++--
> 2 files changed, 30 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
> index d71b7a1140fe..7e7b0eb90c80 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
> +++ b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
> @@ -93,6 +93,10 @@ padctl@3520000 {
> vclamp-usb-supply = <&vdd_1v8ao>;
>
> ports {
> + usb2-0 {
> + vbus-supply = <&vdd_5v0_sys>;
> + };
> +
> usb2-1 {
> vbus-supply = <&vdd_5v0_sys>;
> };
> @@ -105,6 +109,10 @@ usb3-0 {
> vbus-supply = <&vdd_5v0_sys>;
> };
>
> + usb3-2 {
> + vbus-supply = <&vdd_5v0_sys>;
> + };
> +
> usb3-3 {
> vbus-supply = <&vdd_5v0_sys>;
> };
> diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts b/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
> index 54d057beec59..8697927b1fe7 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
> +++ b/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
> @@ -57,6 +57,10 @@ padctl@3520000 {
> pads {
> usb2 {
> lanes {
> + usb2-0 {
> + status = "okay";
> + };
> +
> usb2-1 {
> status = "okay";
> };
> @@ -73,6 +77,10 @@ usb3-0 {
> status = "okay";
> };
>
> + usb3-2 {
> + status = "okay";
> + };
> +
> usb3-3 {
> status = "okay";
> };
> @@ -81,6 +89,11 @@ usb3-3 {
> };
>
> ports {
> + usb2-0 {
> + mode = "host";
> + status = "okay";
> + };
> +
> usb2-1 {
> mode = "host";
> status = "okay";
> @@ -96,6 +109,11 @@ usb3-0 {
> status = "okay";
> };
>
> + usb3-2 {
> + nvidia,usb2-companion = <0>;
> + status = "okay";
> + };
> +
> usb3-3 {
> nvidia,usb2-companion = <3>;
> maximum-speed = "super-speed";
> @@ -107,11 +125,13 @@ usb3-3 {
> usb@3610000 {
> status = "okay";
>
> - phys = <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-1}>,
> + phys = <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-0}>,
> + <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-1}>,
> <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-3}>,
> <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-0}>,
> + <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-2}>,
> <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-3}>;
> - phy-names = "usb2-1", "usb2-3", "usb3-0", "usb3-3";
> + phy-names = "usb2-0", "usb2-1", "usb2-3", "usb3-0", "usb3-2", "usb3-3";
> };
>
> pwm@c340000 {
>

Thanks. Works for me.

Acked-by: Jon Hunter <[email protected]>
Tested-by: Jon Hunter <[email protected]>

Cheers
Jon

--
nvpublic

2021-01-21 19:33:38

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH] arm64: tegra: Enable Jetson-Xavier J512 USB host

On Tue, Jan 19, 2021 at 10:23:49AM +0800, JC Kuo wrote:
> This commit enables USB host mode at J512 type-C port of Jetson-Xavier.
>
> Signed-off-by: JC Kuo <[email protected]>
> ---
> .../arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 8 +++++++
> .../boot/dts/nvidia/tegra194-p2972-0000.dts | 24 +++++++++++++++++--
> 2 files changed, 30 insertions(+), 2 deletions(-)

Applied, thanks.

Thierry


Attachments:
(No filename) (410.00 B)
signature.asc (849.00 B)
Download all attachments