Xavier usb3.0 port issue

hi, my designed xavier board,2 usb port, usb2-1 for otg function,another usb3( UPHY_RX6/TX6 and usb2-1), refer to “Tegra_Linux_Driver_Package_AGX_Xavier_Adaptation_Guide.pdf” modify dtb,hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2888-0001-p2822-0000-common.dtsi. usb3 abnormal.


[usb3 device tree](https://usb3 device tree)

tegra194-p2888-0001-p2822-0000-common.dtsi (9.0 KB)

,2 usb port, usb2-1 for otg function,another usb3( UPHY_RX6/TX6 and usb2-1)

請問你這個是在講什麼…? 為何兩個usb2-1 port?

板子引出2个usb口,一个是usb2.0,一个usb3,其中usb2.0口使用的是(USB0_DN/USB0_DP),usb3.0口使用(UPHY_RX6_N/P和USB1_DN/DP).

Hi,

ok, 所以是一個usb2-0 跟一個usb3-0+usb2-1.

你的device tree有跟著改嗎? 預設的device tree是2個type C port, 那部份必須要先移除掉,並且改成你在用的

tegra194-p2888-0001-p2822-0000-common.dtsi (9.0 KB)
请帮忙确认一下dtb配置是否有问题?

/*

  • Common include DTS file for CVM:P2888-0001 and CVB:P2822-0000 variants.
  • Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
  • This program is free software; you can redistribute it and/or modify
  • it under the terms of the GNU General Public License as published by
  • the Free Software Foundation; version 2 of the License.
  • This program is distributed in the hope that it will be useful, but WITHOUT
  • ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  • FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  • more details.
    */

#include “dt-bindings/extcon-ids.h”
#include “dt-bindings/gpio/tegra194-gpio.h”
#include “tegra194-p2888-0000-a00.dtsi”
#include <t19x-common-platforms/tegra194-platforms-eqos.dtsi>
#include “tegra194-p2822-0000-a00.dtsi”
#include “tegra194-power-tree-p2888-0001-p2822-1000.dtsi”
#include <t19x-common-platforms/tegra194-comms.dtsi>
#include “tegra194-thermal-p2888.dtsi”
#include “tegra194-plugin-manager-p2888-0000.dtsi”
#include “tegra194-plugin-manager-p2822-0000.dtsi”
#include “tegra194-super-module-e2614-p2888-0000.dtsi”
#include <t19x-common-platforms/tegra194-no-pll-aon-clock.dtsi>

/ {
nvidia,dtsfilename = FILE;
nvidia,dtbbuildtime = DATE, TIME;
nvidia,fastboot-usb-vid = <0x0955>;
nvidia,fastboot-usb-pid = <0xee1e>;
model = “Jetson-AGX”;
compatible = “nvidia,galen”, “nvidia,jetson-xavier”, “nvidia,p2822-0000+p2888-0001”, “nvidia,tegra194”;

chosen {
	bootargs ="console=ttyTCU0,115200";
	board-has-eeprom;
};

firmware {
	android {
		compatible = "android,firmware";
		hardware = "jetson-xavier";
		vbmeta {
			compatible = "android,vbmeta";
			parts = "vbmeta,kernel,kernel-dtb,APP,vendor,SOS";
		};
		fstab {
			compatible = "android,fstab";
			vendor {
				compatible = "android,vendor";
				dev = "/dev/block/platform/3460000.sdhci/by-name/vendor";
				type = "ext4";
				mnt_flags = "ro";
				fsmgr_flags = "wait,avb";
			};
			odm {
				compatible = "android,odm";
				dev = "/dev/block/platform/3460000.sdhci/by-name/odm";
				type = "ext4";
				mnt_flags = "ro";
				fsmgr_flags = "wait,avb";
			};
		};
	};
};

bluedroid_pm {
	compatible = "nvidia,tegra-bluedroid_pm";
	bluedroid_pm,reset-gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(M, 6) 0>;
	bluedroid_pm,host-wake-gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Y, 0) 0>;
	bluedroid_pm,ext-wake-gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(M, 7) 0>;
	interrupt-parent = <&tegra_main_gpio>;
	interrupts = <TEGRA194_MAIN_GPIO(Y, 0) IRQ_TYPE_EDGE_FALLING>;
};

spi@c260000 {
	status = "disabled";
};

spi@3210000 {
	status = "okay";
	spi@0 {
		compatible = "tegra-spidev";
		reg = <0x0>;
		spi-max-frequency = <33000000>;
		controller-data {
			nvidia,enable-hw-based-cs;
			nvidia,rx-clk-tap-delay = <0x11>;
		};
	};
	spi@1 {
		compatible = "tegra-spidev";
		reg = <0x1>;
		spi-max-frequency = <33000000>;
		controller-data {
			nvidia,enable-hw-based-cs;
			nvidia,rx-clk-tap-delay = <0x11>;
		};
	};
};

spi@3270000 {
	status = "disabled";
};

spi@3300000 {
	status = "disabled";
};

pmc@c370000 {
	nvidia,invert-interrupt;
};

hdr40_i2c0: i2c@c240000 {
	bmi160@69 {
		compatible = "bmi,bmi160";
		reg = <0x69>;
		interrupt-parent = <&tegra_aon_gpio>;
		interrupts = <TEGRA194_AON_GPIO(AA, 2) GPIO_ACTIVE_LOW>;
		accelerometer_matrix    = [01 00 00 00 01 00 00 00 01];
		gyroscope_matrix        = [01 00 00 00 01 00 00 00 01];
		accelerometer_delay_us_min = <1250>;
		gyroscope_delay_us_min = <1250>;
		status = "disabled";
	};
	ucsi_ccg: ucsi_ccg@8 {
		status = "disable";
		typec-extcon {
			typec_port0: port-0 {
				status = "disable";
				#extcon-cells = <1>;
			};
			typec_port1: port-1 {
				status = "disable";
				#extcon-cells = <1>;
			};
		};
		typec-pd {
			typec_pd: pd {
				status = "disable";
				#extcon-cells = <1>;
			};
		};
	};
};

#if TEGRA_XUSB_PADCONTROL_VERSION >= DT_VERSION_2

xusb_padctl: xusb_padctl@3520000 {
	status = "okay";

	pads {
		usb2 {
			lanes {
				usb2-0 {
					nvidia,function = "xusb";
					status = "okay";
				};
				usb2-1 {
					nvidia,function = "xusb";
					status = "okay";
				};
				usb2-2 {
					nvidia,function = "xusb";
					status = "okay";
				};
				usb2-3 {
					nvidia,function = "xusb";
					status = "okay";
				};
			};
		};
		usb3 {
			lanes {
				usb3-0 {
					nvidia,function = "xusb";
					status = "okay";
				};
				usb3-2 {
					nvidia,function = "xusb";
					status = "okay";
				};
				usb3-3 {
					nvidia,function = "xusb";
					status = "okay";
				};
			};
		};
	};

            /*vdd_usb21_5v0: regulator@115 {
                    compatible = "regulator-fixed";
                    reg = <115>;
                    regulator-name = "vdd-usb21-5v0";
                    regulator-min-microvolt = <5000000>;
                    regulator-max-microvolt = <5000000>;
                    enable-active-high;
                    gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Z, 1) 0>;
                    vin-supply = <&battery_reg>;
            };*/

	ports {
		usb2-0 {
			mode = "host";
			status = "okay";
		};
		usb2-1 {
			mode = "host";
			status = "okay";
		};
		usb2-2 {
			mode = "host";
			status = "okay";
		};
		usb2-3 {
			mode = "host";
			status = "okay";
		};
		usb3-0 {
			nvidia,usb2-companion = <1>;
                            nvidia,usb3-gen1-only = <1>;
			status = "okay";
		};
		usb3-2 {
			nvidia,usb2-companion = <3>;
                            nvidia,usb3-gen1-only = <1>;
			status = "okay";
		};
		usb3-3 {
			nvidia,usb2-companion = <2>;
			nvidia,usb3-gen1-only= <1>;
			status = "okay";
		};
	};
};

#endif

tegra_xudc: xudc@3550000 {
	#extcon-cables = <&typec_port0 0>;
	#extcon-cable-names = "vbus";
	#extcon-cells = <1>;

#if TEGRA_XUSB_PADCONTROL_VERSION >= DT_VERSION_2
phys = <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-0}>,
<&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-2}>;
phy-names = “usb2”, “usb3”;
nvidia,xusb-padctl = <&xusb_padctl>;
#endif
nvidia,boost_cpu_freq = <1200>;
status = “disabled”;
};

tegra_xhci: xhci@3610000 {
	#extcon-cables = <&typec_port0 1>;
	#extcon-cable-names = "id";
	#extcon-cells = <1>;

#if TEGRA_XUSB_PADCONTROL_VERSION >= DT_VERSION_2
phys = <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-0}>,
<&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-1}>,
<&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-3}>,
<&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-2}>,
<&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-2}>,
<&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-0}>,
<&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-3}>;
phy-names = “usb2-0”, “usb2-1”, “usb2-3”, “usb2-2”,
“usb3-2”, “usb3-0”, “usb3-3”;
nvidia,xusb-padctl = <&xusb_padctl>;
#endif
status = “okay”;
};

arm-pmu {
	status = "okay";
};

power-domain {
	status = "disabled";
};

interrupt-controller {
	status = "disabled";
};

mods-simple-bus {
	status = "disabled";
};

eeprom-manager {
	status = "disabled";
};

cpuidle {
	compatible = "nvidia,tegra19x-cpuidle";
	status = "okay";
};

thermal-zones {
	status = "disabled";
};

reserved-memory {
	ramoops_carveout {
		status = "okay";
	};
};

mttcan@c310000 {
	status = "okay";
};

mttcan@c320000 {
	status = "okay";
};

serial@3110000 {
	status = "okay";
};

pwm@3280000 {
	status = "okay";
};

pwm@32c0000 {
	status = "okay";
};

pwm@32f0000 {
	status = "okay";
};

hdr40_i2c1: i2c@31e0000 {
	pinctrl-names = "default";
	pinctrl-0 = <&dpaux_default>;
	bmi160@69 {
		compatible = "bmi,bmi160";
		reg = <0x69>;
		accelerometer_matrix    = [01 00 00 00 01 00 00 00 01];
		gyroscope_matrix        = [01 00 00 00 01 00 00 00 01];
		status = "disabled";
	};
};

host1x {
	dpaux@155F0000 {
		status = "okay";
		compatible = "nvidia,tegra194-dpaux3-padctl";
		/delete-property/ power-domains;
		dpaux_default: pinmux@0 {
			dpaux3_pins {
				pins = "dpaux3-3";
				function = "i2c";
			};
		};
	};
};

ufshci@2450000 {
	status = "disabled";
	nvidia,enable-hs-mode;
	nvidia,cd-gpios = <&tegra_aon_gpio TEGRA194_AON_GPIO(EE, 0) GPIO_ACTIVE_HIGH>;
	nvidia,cd-wakeup-capable;
};
pfsd {
	pwm_polarity= <PWM_POLARITY_NORMAL>;
	suspend_state = <0>;
};
clocks-init {
	compatible = "nvidia,clocks-config";
	status = "okay";
	disable {
		clocks = <&aon_clks TEGRA194_CLK_PLLAON>,
			<&bpmp_clks TEGRA194_CLK_CAN1>,
			<&bpmp_clks TEGRA194_CLK_CAN2>;
	};
};

};

&head0 {
extcon-cables = <&typec_port0 2 &typec_port1 2>;
extcon-cable-names = “typec0”, “typec1”;
#extcon-cells = <1>;
};

&head1 {
extcon-cables = <&typec_port0 2 &typec_port1 2>;
extcon-cable-names = “typec0”, “typec1”;
#extcon-cells = <1>;
};

&head2 {
extcon-cables = <&typec_port0 2 &typec_port1 2>;
extcon-cable-names = “typec0”, “typec1”;
#extcon-cells = <1>;
};

&sor0 {
nvidia,typec-port = /bits/ 8 <0>;
};

&sor1 {
nvidia,typec-port = /bits/ 8 <1>;
};

#if LINUX_VERSION >= 414
#include <tegra194-linux-4.14.dtsi>
#endif

請你把完整的dtb 用dtc tool轉回dts之後再附上來

另外, 請你用附上的. 不要用貼上的

tegra194-p2888-0008-p2822-0000.dts (358.7 KB)
请帮忙看看

麻煩先讀個文件好了 看起來xhci, xudc, xusb_padctl 都還沒改過

https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3273/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/adaptation_and_bringup_xavier.html#wwpID0E0MK0HA

哪些地方没有修改?

hi WayneWWW, 我们设计的板子usb3口,通过GPIO22(这个口用作GPIO,输出高电平实现供电),但是按照官方 Pinmux Changes教程,修改后烧入板子,查看状态不对:


我该怎么修改GPIO22、GPIO23口?

There are some reference code to refer to.

  1. tegra194-power-tree-p2888-0001-p2822-1000.dtsi
    → usb2-3 is using “vbus-supply = <&p2822_vdd_5v_sata>”

  2. hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-fixed-regulator-p2822-1000.dtsi has the definition of “p2822_vdd_5v_sata” regulator.

vbus-supply 是不是添加到usb2-0? 一个是修改配置后的dts,一个是板子上dtc编译出来的
dtc-tegra194-p2888-0008-p2822-0000.dts (358.7 KB)
tegra194-p2888-0001-p2822-0000-common.dtsi (7.9 KB)

首先要先講一下… 我不認識你也不知道你的板子. 問我vbus-supply是不是加到usb2-0, 坦白說我不知道
如果你想要我能給出答案, 麻煩你把線路圖附上


如果是給USB1用的話那是usb2-1…


GPIO22 GPIO23 是配置成GPIO模式还是USB_VBUS_EN模式?

please set it to GPIO mode.