We have a MINIPCIE connector on our custom JETSON TX2 carrier board.
It work well with a PCIE bus based card.But when with a USB bus based card(a LTE module card) it can not work.
The cause of the problem is the PEX_RST is low after system boot complete.The USB bus based card use the PEX_RST signal as a reset input.
I found that the system power off the pcie controllor when there is no pcie device in the pci-tegra.c
if (!pcie->num_ports) {
dev_info(pcie->dev, "PCIE: no end points detected\n");
err = -ENODEV;
goto fail_power_off;
}
Please give me some suggustions how to let the PEX_RST keep high when thers is no PCIE end points deteted.
I don’t know if this is the case for USB based expansions, but I suspect you are seeing a lack of CONFIG_HOTPLUG_PCI being enabled in the kernel config. Check this:
But we don’t need the HOTPLUG ablilty of the PCIE,and our hardware don’t support the HOT PLUG too.
I connect the PEX1_RST#(pin E50 of the TX2) to the PERST#(PIN 22 of the MINIPCIE socket).
The PEX1_RST# signal set to high when the PCIE controller detect any end point device on the PCIE bus,but set the PEX1_RST# signal to low when there is no end point device can be detected.
When I connect the 4G LTE module (using only the USB bus) to the mini PCIe socket. At this point the PEX1_RST# signal is set to a low level because it does not detect any end-point device. 4G LTE module uses PEX1_RST# as the reset input signal , because the PEX1_RST# has been low level, so the 4G LTE module can not start work normally.
Sorry, I can’t help on the custom part. One possibility I can think of is that perhaps a configuration has not been set up at the moment it needs to be in place…but later on the correct configuration won’t matter because detection attempts already occurred. With hot plug it may be that you can retrigger at a later time…the device plugged in would not need to support hot plug, this would (so far as the device is concerned) be cold plug (you aren’t removing and adding the card).
I suggest first adding the HOTPLUG_PCI if for no other reason than to see what happens if you rescan after boot…and look for what the dmesg debug shows up as. This is the easiest thing to test and won’t harm anything or require any device tree change.
Someone else may have a better idea since neither the slot nor the card are used hotplug. I can’t answer the PEX1_RST# question, I lack the knowledge.
You can have a patch like below and add “nvidia,disable-power-down” to PCIe node DT entry. This would leave PCIe root port without powering it down when there are no end points detected. Since pex_rst has a pull-up resistor and PCIe is still active, you won’t see pex_rst being driven to ‘0’
Note:- The patch may not cleanly apply, but, basically, this is the idea.