TX2 USB 3.0 OTG as host Error Message

Do anyone know why usb3.0 otg as host show these message when storage insert?
I am using customer carrier board, using usb2 port(0) + usb3 port(0) to be usb 3.0 otg
Here is my settings:

    usb_cd {
	status = "okay";
	phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>;
	phy-names = "otg-phy";
};

xotg {
	status = "okay";
	phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>;
	phy-names = "otg-usb2";
};

xudc@3550000 {
	status = "okay";
	phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>,
	       <&tegra_xusb_padctl TEGRA_PADCTL_PHY_USB3_P(0)>;
	phy-names = "usb2", "usb3";
	emc-frequency = <150000000>;
};

xhci@3530000 {
	status = "okay";
	phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>,
		<&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(1)>,
		<&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(2)>,
		<&tegra_xusb_padctl TEGRA_PADCTL_PHY_USB3_P(0)>,
		<&tegra_xusb_padctl TEGRA_PADCTL_PHY_USB3_P(2)>;
	phy-names = "utmi-0", "utmi-1", "utmi-2","usb3-0", "usb3-2";
	nvidia,boost_cpu_freq = <800>;
};

    pinctrl@3520000 {
	status = "okay";
	pinctrl-0 = <&tegra_xusb_padctl_pinmux_default>;
	pinctrl-1 = <&vbus_en0_sfio_tristate_state>;
	pinctrl-2 = <&vbus_en1_sfio_tristate_state>;
	pinctrl-3 = <&vbus_en0_sfio_passthrough_state>;
	pinctrl-4 = <&vbus_en1_sfio_passthrough_state>;
	pinctrl-5 = <&vbus_en0_default_state>;
	pinctrl-6 = <&vbus_en1_default_state>;
	pinctrl-names = "default",
		"vbus_en0_sfio_tristate", "vbus_en1_sfio_tristate",
		"vbus_en0_sfio_passthrough", "vbus_en1_sfio_passthrough",
		"vbus_en0_default", "vbus_en1_default";
	tegra_xusb_padctl_pinmux_default: pinmux {
		/* Quill does not support usb3-micro AB */
		usb2-micro-AB {
			nvidia,lanes = "otg-0";
			nvidia,function = "xusb";
			nvidia,port-cap = <TEGRA_PADCTL_PORT_OTG_CAP>;
			nvidia,oc-pin = <0>;
			status = "okay";
		};
		usb2-std-A-port2 {
			nvidia,lanes = "otg-1";
			nvidia,function = "xusb";
			nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
			nvidia,oc-pin = <1>;
			status = "okay";
		};
		usb2-std-A-port1 {
			nvidia,lanes = "otg-2";
			nvidia,function = "xusb";
			nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
			status = "okay";
		};
		usb3-std-A-port0 {
			nvidia,lanes = "usb3-0";
			nvidia,port-cap = <TEGRA_PADCTL_PORT_OTG_CAP>;
			nvidia,oc-pin = <1>;
			status = "okay";
		};			
		usb3-std-A-port2 {
			nvidia,lanes = "usb3-2";
			nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
			nvidia,oc-pin = <1>;
			status = "okay";
		};
            };
    };

=========================================================================

[ 508.893172] extcon-gpio-states external-connection:extcon@1: Cable state 2
[ 508.900118] tegra-xotg xotg: update_id_state: ID grounded
[ 508.905683] xhci-tegra 3530000.xhci: exiting ELPG
[ 508.933348] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[ 508.947235] xhci-tegra 3530000.xhci: exiting ELPG done
[ 508.947336] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 6
[ 508.969188] extcon-gpio-states external-connection:extcon@1: Cable state 2
[ 510.592105] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 5
[ 510.599148] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work ignore firmware MBOX_CMD_DEC_SSPI_CLOCK request
[ 511.141367] xhci-tegra 3530000.xhci: entering ELPG
[ 511.150928] xhci-tegra 3530000.xhci: entering ELPG done
[ 511.156330] xhci-tegra 3530000.xhci: exiting ELPG
[ 511.185311] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[ 511.199181] xhci-tegra 3530000.xhci: exiting ELPG done
[ 511.199294] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 6
[ 513.796941] xhci-tegra 3530000.xhci: entering ELPG
[ 513.806719] xhci-tegra 3530000.xhci: entering ELPG done
[ 513.826903] xhci-tegra 3530000.xhci: exiting ELPG
[ 513.853316] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[ 513.867183] xhci-tegra 3530000.xhci: exiting ELPG done
[ 513.867291] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 6
[ 516.173317] xhci-tegra 3530000.xhci: entering ELPG
[ 516.183203] xhci-tegra 3530000.xhci: entering ELPG done
[ 516.188525] xhci-tegra 3530000.xhci: exiting ELPG
[ 516.217314] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[ 516.231210] xhci-tegra 3530000.xhci: exiting ELPG done
[ 516.231317] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 6
[ 518.085200] extcon-gpio-states external-connection:extcon@1: Cable state 2
[ 518.796992] xhci-tegra 3530000.xhci: entering ELPG
[ 518.806702] xhci-tegra 3530000.xhci: entering ELPG done
[ 518.993169] extcon-gpio-states external-connection:extcon@1: Cable state 2
[ 519.365459] xhci-tegra 3530000.xhci: exiting ELPG
[ 519.393319] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[ 519.407196] xhci-tegra 3530000.xhci: exiting ELPG done
[ 519.407302] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 6
[ 521.485165] extcon-gpio-states external-connection:extcon@1: Cable state 0
[ 521.492113] tegra-xotg xotg: update_id_state: ID floating
[ 521.645167] extcon-gpio-states external-connection:extcon@1: Cable state 0
[ 521.796935] xhci-tegra 3530000.xhci: entering ELPG
[ 521.806500] xhci-tegra 3530000.xhci: entering ELPG done
[ 522.497794] xhci-tegra 3530000.xhci: exiting ELPG
[ 522.525336] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[ 522.539238] xhci-tegra 3530000.xhci: exiting ELPG done
[ 522.539320] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 6
[ 524.184099] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 5
[ 524.191131] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work ignore firmware MBOX_CMD_DEC_SSPI_CLOCK request
[ 524.788979] xhci-tegra 3530000.xhci: entering ELPG
[ 524.797745] xhci-tegra 3530000.xhci: entering ELPG done

Here is a post to enable it on devkit:
https://devtalk.nvidia.com/default/topic/1014096/jetson-tx2/how-to-set-tx2-otg-usb-as-device-mode-/post/5205500/#5205500

Please try it on TX2 developer kit first and then apply to your custom board.

Hi DaneLLL,

My problem is USB3.0 with otg shows error message. My TX2 should be treat as HOST
And We found USB0_EN_OC_N (A17) pull-up and pull-down in loop.

Hi,
Please remove all nvidia,oc-pin = <0>; and nvidia,oc-pin = <1>; in your device tree and try again.

And do you use A36 as ID pin?

Hi DaneLLL,
to remove nvidia,oc-pin = <0>; and nvidia,oc-pin = <1> still not workable for USB 3.0.
Yes , we are useing A36 as ID pin.

Hi,
The device tree looks wrong:

usb2-micro-AB {
nvidia,lanes = "otg-0";
nvidia,function = "xusb";
nvidia,port-cap = <TEGRA_PADCTL_PORT_OTG_CAP>;
nvidia,oc-pin = <0>;
status = "okay";
};
(...)
usb3-std-A-port0 {
nvidia,lanes = "usb3-0";
nvidia,port-cap = <TEGRA_PADCTL_PORT_OTG_CAP>;
nvidia,oc-pin = <1>;
status = "okay";
};

Please refer to device tree in https://devtalk.nvidia.com/default/topic/1014096/jetson-tx2/how-to-set-tx2-otg-usb-as-device-mode-/post/5205500/#5205500

Here is my current device tree source, USB3 not workable

tegra_xusb_padctl_pinmux_default: pinmux {
			/* Quill does not support usb3-micro AB */
			usb2-micro-AB {
				nvidia,lanes = "otg-0";
				nvidia,function = "xusb";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_OTG_CAP>;
				nvidia,oc-pin = <0>;
				status = "okay";
			};
			usb3-micro-AB {
				nvidia,lanes = "usb3-0";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_OTG_CAP>;
				nvidia,oc-pin = <0>;
				status = "okay";
			};
			usb2-std-A-port2 {
				nvidia,lanes = "otg-1";
				nvidia,function = "xusb";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				nvidia,oc-pin = <1>;
				status = "okay";
			};
			usb3-std-A-port2 {
				nvidia,lanes = "usb3-2";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				nvidia,oc-pin = <1>;
				status = "okay";
			};
			usb2-std-A-port1 {
				nvidia,lanes = "otg-2";
				nvidia,function = "xusb";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				status = "okay";
			};
						
						
		};

By the way, USB3 works fine with 2.0 and OTG. Just only when USB3.0 storage insert to carrier board will drop down and up A17 power

Hi,
Is the issue also seen if you configure all to TEGRA_PADCTL_PORT_HOST_ONLY?

Hi DaneLLL,
Yes, even config all to TEGRA_PADCTL_PORT_HOST_ONLY

Hi,
Do you also modify usb_cd, xotg, xudc like hardware-nvidia-platform-t18x-quill.patch ?

Hi DaneLLL,
Here is my device tree for usb_cd, xotg, xudc

usb_cd {
status = "okay";
phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>;
phy-names = "otg-phy";
};

xotg {
status = "okay";
phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>;
phy-names = "otg-usb2";
};

xudc@3550000 {
status = "okay";
phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>,
<&tegra_xusb_padctl TEGRA_PADCTL_PHY_USB3_P(0)>;
phy-names = "usb2", "usb3";
emc-frequency = <150000000>;
};

xhci@3530000 {
status = "okay";
phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>,
<&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(1)>,
<&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(2)>,
<&tegra_xusb_padctl TEGRA_PADCTL_PHY_USB3_P(0)>,
<&tegra_xusb_padctl TEGRA_PADCTL_PHY_USB3_P(2)>;
phy-names = "utmi-0", "utmi-1", "utmi-2","usb3-0", "usb3-2";
nvidia,boost_cpu_freq = <800>;
};

Hi yi-chia.lan,
so on your custom board:
utmi-1, utmi-2, usb3-2 work in host mode.
utmi-0, usb3-0 work in device mode but not good in host mode.

Hi DaneLLL,

YES, 3.0 OTG mode is fine, but 3.0 USB abnormal.

Hi yi-chia.lan,
Your device tree looks all right. Can you share HW schematics?

Hi DaneLLL
Here is my usb schematic

Hi, can you confirm the loop pull up/down is not from OC output of TPS2061?
BTW, the pull-up of R39, R45 are unnecessary as there are pull-up in module.

Hi Trumany,
R39/R45 is NI, no resistors on PCB.
And we tried to remove R40, and offer 3V3 to TPS206 FLT seprately by R40 right side, then measure R40 left side, loop pull up/down happened.

Hi Hi yi-chia.lan,
Does utim-0(USB2.0) work in both host and device mode?

Hi DaneLLL,
Yes, utim-0(USB2.0) works in both host and device mode.