PCIe-USB bridge can't be detected by TX2

Hi Sir/Madam,

I had tested TI TUSB7340 EVM board on TX2 pcie bus and it worked well.
Now I mount TUSB7340 chip on our custom board but there is no any devices can be detected.

root@tegra-ubuntu:/sys/bus/pci/slots# dmesg | grep pci
[    0.142857] node /plugin-manager/fragment-500-pcie-config match with board >=3310-1000-500
[    0.143575] node /plugin-manager/fragment-500-e3325-pcie match with board >=3310-1000-500
[    0.264996] iommu: Adding device 10003000.pcie-controller to group 50
[   14.697444] tegra-pcie 10003000.pcie-controller: 4x1, 1x1 configuration
[   14.707856] tegra-pcie 10003000.pcie-controller: PCIE: Enable power rails
[   14.848555] tegra-pcie 10003000.pcie-controller: probing port 0, using 4 lanes
[   14.850769] tegra-pcie 10003000.pcie-controller: probing port 2, using 1 lanes
[   15.273071] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[   15.675071] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[   16.078488] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[   16.080501] tegra-pcie 10003000.pcie-controller: link 0 down, ignoring
[   16.482501] tegra-pcie 10003000.pcie-controller: link 2 down, retrying
[   16.885646] tegra-pcie 10003000.pcie-controller: link 2 down, retrying
[   17.290227] tegra-pcie 10003000.pcie-controller: link 2 down, retrying
[   17.292246] tegra-pcie 10003000.pcie-controller: link 2 down, ignoring
[   17.292253] tegra-pcie 10003000.pcie-controller: PCIE: no end points detected
[   17.292433] tegra-pcie 10003000.pcie-controller: PCIE: Disable power rails

I’m not sure if it is power sequence issue.
Should I need to control PERST (PCIe reset pin) which connect to TX2 C49 (PEX0_RST) by myself?

Thanks
BR,
Jason

Hi JasonFan, can you share full boot log via dmesg? Do you run r28.1?

Hi DaneLLL,

Here you are. Thanks a lot.
I run r28.1
dmesg.log (72.4 KB)

Please apply
https://devtalk.nvidia.com/default/topic/1024105/jetson-tx2/tx2-usb2-0-not-working-how-to-fix-it/post/5210056/#5210056

to fix the error and try again

[   17.819295] xhci-tegra 3530000.xhci: can't get usb3-0 phy (-517)

After applying your suggestion, PCie still can’t work

nvidia@tegra-ubuntu:~$ dmesg | grep pci
[    0.142328] node /plugin-manager/fragment-500-pcie-config match with board >=3310-1000-500
[    0.143046] node /plugin-manager/fragment-500-e3325-pcie match with board >=3310-1000-500
[    0.264128] iommu: Adding device 10003000.pcie-controller to group 50
[    0.430673] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    0.430700] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    0.432449] tegra-pcie 10003000.pcie-controller: 4x1, 1x1 configuration
[    0.434498] tegra-pcie 10003000.pcie-controller: PCIE: Enable power rails
[    0.435130] tegra-pcie 10003000.pcie-controller: probing port 0, using 4 lanes
[    0.436679] tegra-pcie 10003000.pcie-controller: probing port 2, using 1 lanes
[    0.862318] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[    1.266647] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[    1.670988] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[    1.673006] tegra-pcie 10003000.pcie-controller: link 0 down, ignoring
[    2.075342] tegra-pcie 10003000.pcie-controller: link 2 down, retrying
[    2.479673] tegra-pcie 10003000.pcie-controller: link 2 down, retrying
[    2.720979] ehci-pci: EHCI PCI platform driver
[    2.882730] tegra-pcie 10003000.pcie-controller: link 2 down, retrying
[    2.884279] tegra-pcie 10003000.pcie-controller: link 2 down, ignoring
[    2.884289] tegra-pcie 10003000.pcie-controller: PCIE: no end points detected
[    2.885103] tegra-pcie 10003000.pcie-controller: PCIE: Disable power rails

But from log, USB3 seems has different behaviors.
Please help check attachment “dmesg1.log”

Thank you
dmesg1.log (66.9 KB)

Hi JasonFan,
PLease check the setting via dvmem2 and share it
https://devtalk.nvidia.com/default/topic/1023160/jetson-tx2/tx2-using-pcix1-instead-of-usb3-default-config-1-/post/5208608/#5208608

Hi DaneLLL,

I got the following error
any idea?

nvidia@tegra-ubuntu:~$ sudo devmem2 0x02520284
/dev/mem opened.
Memory mapped at[  429.679610] Unhandled fault: alignment fault (0x92000021) at 0x0000007f7dfa5284
 address 0x7f7dfa5000.
Bus error (core dumped)

BTW, I use default ODMDATA=0x1090000. Currently our custom board use usn3.01, usb2.02, usb-otg(for flash image), and one pcie-usb bridge(4 ports usb2.0). I think default configuration #2 of USB lane mapping is okay for us, right?

USB3.01 and USB2.02 can work well now. just PCIe doesn’t work

Thank you

Hi JasonFan,
Can you check https://developer.nvidia.com/embedded/dlc/jetson-tx2-oem-product-designguide ?

If you get USB31 and USB22 working, it looks like SW is OK. Probably can check mounting.

Hi DaneLLL,

Thank you for your time.

Is it possible that I can control TX2 C49 (PEX0_RST) that is connected to PCIe-USB bridge chip (PERST)?
Because this reset pin should be high after PCIe-USB bridge chip works.
Previously, on TX2 kit + PCie-USB bridge EMV board, this reset pin actives high automatically.

So I want to control this pin manually if it is possible can control it.

Thanks

I’m not sure what you meant by “controlling PERST manually”?
We have a register that controls PERST.
BTW, don’t we have PERST routing on your board? If yes, then it is expected that end point didn’t receive any reset from root port and hence link is not coming up.

DeneLLL, vidyas,

Thank you both. It was HW issue and it is fixed. PCIe can be detected now.

For the usb fix previously.

Could I know what different between these two setting is?

- ./common/kernel-dts/t18x-common-platforms/tegra186-quill-power-tree-p3310-1000-a00-00.dtsi:             vbus-2-supply = <&vdd_usb2_5v>;
+ ./common/kernel-dts/t18x-common-platforms/tegra186-quill-power-tree-p3310-1000-a00-00.dtsi:             vbus-2-supply = <&battery_reg>;

Thanks again

Hi JasonFan,
It is WAR to custom boards which mostly don’t have the gpio expander 0x74

vdd_usb2_5v: regulator@17 {
			compatible = "regulator-fixed-sync";
			reg = <17>;
			regulator-name = "vdd-usb2-5v";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
			gpio = <&gpio_i2c_0_74 0 0>;
		};

Hi vidyas,

For the previous PERST question, according to PCIe-USB bridge spec, PERST should be pulled up after CLK 100us and Power on 100ms. Currently PERST and CLK trigger at the same time. Is it possible that TX2 can fit this requirement by modifying driver or registers?

Thanks

you can have following change to delay applying reset to end point by 100ms after refclk started flowing into it

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 35d63342cabd..10243cab2c38 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -2033,6 +2033,7 @@ static void tegra_pcie_port_enable(struct tegra_pcie_port *port)
 
     afi_writel(port->pcie, value, ctrl);
 
+    mdelay(100);
     tegra_pcie_port_reset(port);
 
     /* On platforms where MXM is not directly connected to Tegra root port,

Hi Vidyas,

PCIe works well now.

Thank you!

Hi vidyas,

Could you teach me how to pull down “PERST” pin(C49 PEX0_RST) permanently in driver?

Thx
Yen

You can program ‘AFI_PEX[0/1/2]_CTRL_0’ register’s PEX[0/1/2]_RST_L field to ‘0’ to pull PERST# line to low.
You can refer to pci-tegra.c file to see how is this done to apply fundamental reset to PCIe end point device

Hi vidyas,

We would like to use Sierra AirPrime EM7430 4G module via mini pcie.
But it can’t work and show some error messages as below.

[    8.392313] usbcore: registered new interface driver GobiSerial
[    8.398417] usbserial: USB Serial support registered for GobiSerial
[    8.405223] GobiSerial: 2018-04-25/SWI_2.32:GobiSerial
[   19.758024] GobiSerial 1-3.1:1.0: GobiSerial converter detected
[   19.764144] usb 1-3.1: GobiSerial converter now attached to ttyUSB0
[   20.866986] GobiSerial driver ttyUSB0: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[   20.916430] GobiSerial driver ttyUSB0: usb_serial_generic_submit_read_urb - usb_submit_urb failed: -19
[   20.925806] GobiSerial driver ttyUSB0: usb_serial_generic_submit_read_urb - usb_submit_urb failed: -19
[   20.935538] GobiSerial driver ttyUSB0: GobiSerial converter now disconnected from ttyUSB0
[   20.943801] GobiSerial 1-3.1:1.0: device disconnected
[   21.834127] GobiSerial 1-3.1:1.0: GobiSerial converter detected
[   21.840312] usb 1-3.1: GobiSerial converter now attached to ttyUSB0
[   23.077259] GobiSerial driver ttyUSB0: usb_serial_generic_submit_read_urb - usb_submit_urb failed: -19
[   23.086639] GobiSerial driver ttyUSB0: usb_serial_generic_submit_read_urb - usb_submit_urb failed: -19
[   23.096331] GobiSerial driver ttyUSB0: GobiSerial converter now disconnected from ttyUSB0
[   23.104687] GobiSerial 1-3.1:1.0: device disconnected
[   37.099954] GobiSerial 1-3.1:1.0: GobiSerial converter detected
[   37.106567] usb 1-3.1: GobiSerial converter now attached to ttyUSB0
[   38.203416] GobiSerial driver ttyUSB0: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[   38.213077] GobiSerial driver ttyUSB0: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[   38.256958] GobiSerial driver ttyUSB0: usb_serial_generic_submit_read_urb - usb_submit_urb failed: -19
[   38.266392] GobiSerial driver ttyUSB0: usb_serial_generic_submit_read_urb - usb_submit_urb failed: -19
[   38.276643] GobiSerial driver ttyUSB0: GobiSerial converter now disconnected from ttyUSB0
[   38.285123] GobiSerial 1-3.1:1.0: device disconnected
nvidia@tegra-ubuntu:~$

Do you know how to fix this problem?

We saw “PERST” pin(C49 PEX0_RST) had a pulse when the board boot up and we don’t want it happen.
Please advise where to set “PERST” pin(C49 PEX0_RST) to low at the beginning of the driver in pci-tegra.c.

Thx
Yen

If possible, could you please start a different thread as the original issue discussed in this thread got resolved already?
Also, when you start the new thread, please do attach the output of ‘sudo lspci -vvvv’.