PCIe 1x1 2x1 on custom board

I have 2 PCIe on my custom board and need it to works as config 6 on table 1 from Platform
Adaptation and Bring-Up Guide.
I was set ODMDATA = 0x03090000 and changed tegra186-quill-p3310-1000-c03-00-base.dts PCI part to:

pcie-controller@10003000 {
	pci@1,0 {
		nvidia,num-lanes = <2>;
		nvidia,disable-clock-request;
	};
	pci@2,0 {
		nvidia,num-lanes = <0>;
	};
	pci@3,0 {
		nvidia,num-lanes = <1>;
	};
};

But the dmesg says the kernel is trying to configure PCI0 as 4 lanes:

[    0.461434] iommu: Adding device 10003000.pcie-controller to group 48
[    0.461456] arm-smmu: forcing sodev map for 10003000.pcie-controller
[    1.033926] tegra-pcie 10003000.pcie-controller: 4x1, 1x1 configuration
[    1.035091] tegra-pcie 10003000.pcie-controller: PCIE: Enable power rails
[    1.035505] tegra-pcie 10003000.pcie-controller: probing port 0, using 4 lanes
[    1.038915] tegra-pcie 10003000.pcie-controller: probing port 2, using 1 lanes
[    1.149899] ehci-pci: EHCI PCI platform driver
[    1.149964] ohci-pci: OHCI PCI platform driver
[    1.470434] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[    1.883211] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[    2.289937] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[    2.291965] tegra-pcie 10003000.pcie-controller: link 0 down, ignoring
[    2.696682] tegra-pcie 10003000.pcie-controller: link 2 down, retrying
[    3.103363] tegra-pcie 10003000.pcie-controller: link 2 down, retrying
[    3.518454] tegra-pcie 10003000.pcie-controller: link 2 down, retrying
[    3.520513] tegra-pcie 10003000.pcie-controller: link 2 down, ignoring
[    3.725015] tegra-pcie 10003000.pcie-controller: PCIE: no end points detected
[    3.725323] tegra-pcie 10003000.pcie-controller: PCIE: Disable power rails

The plugin-manager is disabled from DT.
I’v extracted the DT from /proc/device-tree and I’m sharing it here.

Here can I modify the num-lanes to the correct value?
Is there anything else I have to do to put these PCI to work?

Thanks

device-tree.dts.txt (461 KB)

Hi,

  1. A method to check your runtime device tree is check the node under /proc/device-tree.

  2. the bootloader log can tell which plugin-manager is enabled. Please also check your bootloader log.

  3. There is no “2,0,1” configuration in driver. But only (4,0,1), (2,1,1). Even 3x1 case is using 2,1,1 config but different ODMDATA and specific lane disabled.

Hi Wayne, the file I sent was extracted from /proc/device-tree, so I believe it’s have the information needed, and for pcie-controller@10003000 it’s show:

pci@2,0 {
		nvidia,afi-ctl-offset = <0x118>;
		assigned-addresses = <0x82001000 0x0 0x10001000 0x0 0x1000>;
		device_type = "pci";
		nvidia,num-lanes = <0x0>;
		ranges;
		status = "disabled";
		#address-cells = <0x3>;
		#size-cells = <0x2>;
		reg = <0x1000 0x0 0x0 0x0 0x0>;
		nvidia,disable-aspm-states = <0xf>;
	};
		pci@1,0 {
		nvidia,afi-ctl-offset = <0x110>;
		assigned-addresses = <0x82000800 0x0 0x10000000 0x0 0x1000>;
		device_type = "pci";
		nvidia,num-lanes = <0x4>;
		nvidia,disable-clock-request;
		ranges;
		status = "okay";
		#address-cells = <0x3>;
		#size-cells = <0x2>;
		reg = <0x800 0x0 0x0 0x0 0x0>;
		nvidia,disable-aspm-states = <0xf>;
	};
		pci@3,0 {
		nvidia,afi-ctl-offset = <0x19c>;
		assigned-addresses = <0x82001800 0x0 0x10004000 0x0 0x1000>;
		device_type = "pci";
		nvidia,num-lanes = <0x1>;
		ranges;
		status = "okay";
		#address-cells = <0x3>;
		#size-cells = <0x2>;
		reg = <0x1800 0x0 0x0 0x0 0x0>;
		nvidia,disable-aspm-states = <0xf>;
	};

But on my tegra186-quill-p3310-1000-c03-00-base.dts it is:

pcie-controller@10003000 {
		pci@1,0 {
			nvidia,num-lanes = <2>;
			nvidia,disable-clock-request;
		};
		pci@2,0 {
			nvidia,num-lanes = <0>;
		};
		pci@3,0 {
			nvidia,num-lanes = <1>;
		};
	};

So, what is wrong?

I’ll take a look on bootloader logs.

For such case, I think you should check bootloader log for plugin-manager.

Hi alfredosalvarani,

Have you managed to get issue resolved?
Any result can be shared?

Yes.
The plugin manager was modifying my settings and there was an error in the hardware RX / TX lines, we fixed it and added it to the Device Tree:

pcie-controller@10003000 {
		pci@1,0 {
			nvidia,num-lanes = <2>;
			nvidia,disable-clock-request;
		};
		pci@2,0 {
			nvidia,num-lanes = <1>;
			status = "okay";
		};
		pci@3,0 {
			nvidia,num-lanes = <1>;
			status = "disabled";
		};
	};

	plugin-manager {
		/delete-node/ fragment-500-pcie-config;
	};

In addition, we found that our actual configuration (because of the USB 3.0 hardware connection) should be 4 in Table 1 of the “Platform Adaptation and Bring-Up Guide”. So I changed the ODMDATA to 0x7090000 and now I have 3 USB3.0 ports (only 2 connected), 2 USB2.0 ports and 2 PCIE (1 line) working on my custom board.

Great! Glad to know issue resolved, thanks for the sharing!