PCIe C4 in endpoint mode for AGX Xavier

Hello, Nvidia community.
We developed custom carrier board for AGX Xavier and want to connect two Xaviers via PCIe. We used C4 controller (UPHY 8 & 9, PEX_CLK4, PEX_C4_CLKREQ, PEX_C4_RST) for that purpose. However we have an issue on how to enable endpoint mode for C4 of one of Xaviers using ODMDATA. What I tried is setting ODMDATA=0x9191000; but according to /sys/firmware/devicetree/base/chosen/plugin-manager/odm-data it only sets c5 and not c4 in endpoint mode.

... disable-pcie-c4-endpoint  enable-pcie-c5-endpoint ...

What bit of ODMDATA should I set to enable C4 in endpoint mode?

This is how I test the set up. I enable pci_epf_nv_test on EP device and reboot RP device. Here is the dmesg I see on EP:

dmesg | grep pcie
[    1.144971] iommu: Adding device 14160000.pcie_ep to group 0
[    1.145775] iommu: Adding device 14180000.pcie to group 1
[    1.149366] iommu: Adding device 14140000.pcie to group 2
[    3.603025] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    4.649387] tegra-pcie-dw 14160000.pcie_ep: Setting init speed to max speed
[    4.656206] tegra-pcie-dw 14160000.pcie_ep: Disabling advertisement of all ASPM states
[    4.665791] tegra-pcie-dw 14180000.pcie: Setting init speed to max speed
[    4.671674] OF: PCI: host bridge /pcie@14180000 ranges:
[    4.802354] tegra-pcie-dw 14180000.pcie: link is up
[    4.802657] tegra-pcie-dw 14180000.pcie: PCI host bridge to bus 0000:00
[    4.811857] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
[    4.824757] pcie_pme 0000:00:00.0:pcie001: service driver pcie_pme loaded
[    4.824825] aer 0000:00:00.0:pcie002: service driver aer loaded
[    4.829875] tegra-pcie-dw 14140000.pcie: Setting init speed to max speed
[    4.830700] OF: PCI: host bridge /pcie@14140000 ranges:
[    4.938319] tegra-pcie-dw 14140000.pcie: link is up
[    4.938651] tegra-pcie-dw 14140000.pcie: PCI host bridge to bus 0003:00
[    4.993207] pcieport 0003:00:00.0: Signaling PME through PCIe PME interrupt
[    5.006251] pcie_pme 0003:00:00.0:pcie001: service driver pcie_pme loaded
[    5.006376] aer 0003:00:00.0:pcie002: service driver aer loaded
[  297.054522] tegra-pcie-dw 14160000.pcie_ep: UPHY init failed for PCIe EP:-22

I also get the same error tegra-pcie-dw 14160000.pcie_ep: UPHY init failed for PCIe EP:-22 if I flap RST with

busybox devmem 0x14160000 w 0x00001804
busybox devmem 0x14160000 w 0x00001805

And I see interrupts on pex_rst:

cat /proc/interrupts | grep pex_rst
 259:          3          0          0          0          0          0          0          0  tegra-gpio   89 Edge      pex_rst

My current dts settings:
Root port:

	pcie@14160000 {
		compatible = "nvidia,tegra194-pcie";
		nvidia,device-id = /bits/ 16 <0x1AD5>;
		nvidia,disable-aspm-states = <0xf>;
		nvidia,disable-clock-request;
		status = "okay";
		nvidia,max-speed = <1>;
		phys = <&p2u_8>, <&p2u_9>;
		phy-names = "pcie-p2u-0", "pcie-p2u-1";
		num-lanes = <2>;
		vddio-pex-ctl-supply = <&p2888_spmic_sd3>;
		nvidia,host1x = <&host1x>;
	};

EP:

	pcie_ep@14160000 {
		compatible = "nvidia,tegra194-pcie-ep";
		status = "okay";
		phys = <&p2u_8>, <&p2u_9>;
		phy-names = "pcie-p2u-0", "pcie-p2u-1";
		nvidia,pex-rst-gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(L, 1)
			GPIO_ACTIVE_LOW>;
		vddio-pex-ctl-supply = <&p2888_spmic_sd3>;
		nvidia,host1x = <&host1x>;
		num-lanes = <2>;
		nvidia,max-speed = <1>;
	};

Please give me some useful information on how to make this configuration work.
Thank you!

Sorry for the late response, is this still an issue to support? Thanks

Hello kayccc,
Yes, this is still an issue for us.
We performed similar experiment using C5 and RX/TX swap module on Xavier AGX DevKit.
However we are still unabe to use C4 on our custom carrier board.

Hi,

PCIe controller can work in either root port or endpoint, we shouldn’t enable both nodes at the same time.
For configuring PCIe C4 as endpoint add following settings.

  1. DT
	pcie_ep@14160000 {
		status = "okay";
		phys = <&p2u_8>, <&p2u_9>;
		phy-names = "pcie-p2u-0", "pcie-p2u-1";
		nvidia,pex-rst-gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(L, 1)
			GPIO_ACTIVE_LOW>;
		vddio-pex-ctl-supply = <&p2888_spmic_sd3>;
		nvidia,host1x = <&host1x>;
		num-lanes = <2>;
		nvidia,max-speed = <1>;
	};

ODMDATA=0x4B191000;

Thanks,
Manikanta

Hi Manikanta, thanks for your reply

I tried ODMDATA setting, that you suggested and found that my board now hangs on boot with the following log:

[0007.443] I> ########## NVME (3) boot ##########
[0007.448] I> Initializing nvme device instance 3
[0007.452] I> Initializing nvme controller
[0007.457] I> tegrabl_locate_pcie_ctrl_in_dt: found match at 0x14140000
[0007.462] I> vpcie3v3-supply not found
[0007.466] I> vpcie12v-supply not found
[0007.470] W> Failed to get nvidia,plat-gpios
[0007.474] I> tegrabl_pcie_soc_preinit: (3):
[0007.478] I> Unpowergate
[0007.480] I> tegrabl_car_clk_disable(3) ...
[0007.484] I> tegrabl_car_rst_set(CORE, 3) ...
[0007.488] I> tegrabl_car_rst_set(APB, 3) ...
[0007.493] I> tegrabl_car_clk_enable(3) ...
[0007.496] I> tegrabl_car_rst_clear(APB, 3) ...
[0007.501] I> tegrabl_set_ctrl_state(3)
[0007.504] I> CLR PCIE_APB:6
[0007.507] I> tegrabl_pcie_soc_init: (3):
[0007.511] I> APPL initialization ...
[0007.514] I> poweron phys
[0007.517] I> tegrabl_locate_pcie_ctrl_in_dt: found match at 0x14140000
[0007.523] I> tegrabl_power_on_phy: power on phy @0x3e80000
��safereg_poll_timer_cb: poll interval 130 above target 100 

I compared this with normal boot log and noticed that boot hangs on theese lines (from good boot log):

[0007.315] I> PCIe controller-3 link is up
[0007.315] I> tegra_pcie_info[3].cfg0_base = 0x34000000
[0007.316] I> tegra_pcie_info[3].cfg1_base = 0x34020000
[0007.316] I> tegra_pcie_info[3].atu_dma_base = 0x34040000
[0007.317] I> tegra_pcie_bus[3].mem = 0x34200000

So my current question is, what exactly this ODMDATA (ODMDATA=0x4B191000;) corresponds to? This ODMDATA contains 3 additional bits set (while enabling C5 requires only 1 bit). Is it possible that this ODMDATA enables some features (e.g. some PCI C3 manipulations) that are not supported in our hardware design?
Both logs are in attachments.

Thanks in advance!
normal_boot_log.txt (34.9 KB)
odmdata_boot_log.txt (25.2 KB)

Please share your PCIe DT nodes in platform DTSI files.

	pcie0: pcie@14180000 {
		/delete-property/ nvidia,enable-power-down;
		status = "okay";
	};

	pcie1: pcie@14100000 {
		status = "disabled";
	};

	pcie2: pcie@14120000 {
		status = "disabled";
	};

	/* Ext connector */
	pcie4: pcie@14160000 {
		/delete-property/ nvidia,enable-power-down;
		status = "disabled";
	};

	pcie_ep@14160000 {
		status = "okay";
		phys = <&p2u_8>, <&p2u_9>;
		phy-names = "pcie-p2u-0", "pcie-p2u-1";
		nvidia,pex-rst-gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(L, 1)
			GPIO_ACTIVE_LOW>;
		vddio-pex-ctl-supply = <&p2888_spmic_sd3>;
		nvidia,host1x = <&host1x>;
		num-lanes = <2>;
		nvidia,max-speed = <1>;
	};

	pcie5: pcie@141a0000 {
		status = "disabled";
	};

	pcie3: pcie@14140000 {
		/delete-property/ nvidia,enable-power-down;

		linux,pci-domain = <3>;

		pcie@0,0 {
			/* 0003:00:00.00 0604: 10de:1ad2 root host-bridge */
			#address-cells = <3>;
			#size-cells = <2>;
			device_type = "pci";
			reg = <0x0 0 0 0 0>;
			status = "okay";

			eth0: pci@0,0 {
				/* 0003:01:00.0 0200: 8086:1531 Intel i210 */
				#address-cells = <3>;
				#size-cells = <2>;
				device_type = "pci";

				reg = <0x00010000 0 0 0 0>;
				compatible = "intel,i210";
				nvm-default-cfg;
				status = "okay";
			};
		};
	};

Disable pcie@14140000 node

Hello Manikanta,
Sorry for long response. I tried the same experiment with disabled pcie@14140000 node and got the same results.
Here is the full boot log:

[0002.625] I> Hit any key to stop autoboot:     4       3       2       1
[0004.633] initializing target
[0004.633] calling apps_init()
[0004.634] starting app kernel_boot_app
[0004.653] I> found decompressor handler: lz4-legacy
[0004.654] I> decompressing BMP blob ...
[0004.665] I> Kernel type = Normal
[0004.666] I> ########## SD (0) boot ##########
[0004.666] I> No sdcard
[0004.666] I> -0 params source = 
[0004.666] E> Blockdev open: exit error
[0004.667] E> SD boot failed, err: 724238353
[0004.667] I> ########## USB (0) boot ##########
[0004.678] I> Validate XUSB-FW ...
[0004.679] I> T19x: Authenticate XUSB-FW (bin_type: 11), max size 0x28000
[0004.680] I> RSA PSS signature check: OK
[0004.681] I> Encryption fuse is not ON
[0004.682] I> USB Firmware Version: 60.09 release
[0004.742] I> regulator of usb2-0 already enabled
[0004.750] I> regulator of usb2-1 already enabled
[0004.757] I> regulator of usb2-2 already enabled
[0004.767] I> enabling 'vdd-5v-sata' regulator
[0005.836] I> USB 2.0 port 2 new high-speed USB device detected
[0005.937] I> Start to enumerate device
[0005.942] I> This device is non-MSD, skip enumeration
[0005.942] E> Failed to enumerate USB device
[0005.943] E> failed to start xhci controller
[0005.943] E> Error in init of XUSB host driver, err: 7979000d
[0005.943] W> Failed to initialize device 5-0
[0005.944] E> USB boot failed, err: 2037973005
[0005.944] I> ########## NVME (0) boot ##########
[0005.948] I> Initializing nvme device instance 0
[0005.953] I> Initializing nvme controller
[0005.957] I> tegrabl_locate_pcie_ctrl_in_dt: found match at 0x14180000
[0005.963] I> vpcie3v3-supply not found
[0005.967] I> vpcie12v-supply not found
[0005.970] W> Failed to get nvidia,plat-gpios
[0005.974] I> tegrabl_pcie_soc_preinit: (0):
[0005.978] I> Unpowergate
[0005.981] I> tegrabl_car_clk_disable(0) ...
[0005.985] I> tegrabl_car_rst_set(CORE, 0) ...
[0005.989] I> tegrabl_car_rst_set(APB, 0) ...
[0005.993] I> tegrabl_car_clk_enable(0) ...
[0005.997] I> tegrabl_car_rst_clear(APB, 0) ...
[0006.001] I> tegrabl_set_ctrl_state(0)
[0006.005] I> CLR PCIE_APB:6
[0006.008] I> tegrabl_pcie_soc_init: (0):
[0006.011] I> APPL initialization ...
[0006.015] I> poweron phys
[0006.017] I> tegrabl_locate_pcie_ctrl_in_dt: found match at 0x14180000
[0006.024] I> tegrabl_power_on_phy: power on phy @0x3e30000
[0006.029] I> tegrabl_power_on_phy: power on phy @0x3e40000
[0006.034] I> tegrabl_power_on_phy: power on phy @0x3e50000
[0006.040] I> tegrabl_power_on_phy: power on phy @0x3e60000
[0006.175] I> PCIe controller-0 link is up
[0006.175] I> tegra_pcie_info[0].cfg0_base = 0x38000000
[0006.176] I> tegra_pcie_info[0].cfg1_base = 0x38020000
[0006.176] I> tegra_pcie_info[0].atu_dma_base = 0x38040000
[0006.176] I> tegra_pcie_bus[0].mem = 0x38200000
[0006.177] I> Scanning busnr: 0 devfn: 0
[0006.177] I> PCIe IDs: 0x1ad010de
[0006.180] I> PCIe RID_CC: 0x60400a1
[0006.183] I> Scanning busnr: 1 devfn: 0
[0006.187] I> PCIe IDs: 0xfaf08086
[0006.190] I> PCIe RID_CC: 0x1080203
[0006.194] I> PCI Config: I/O=0x38100000, Memory=0x38200000
[0006.199] I> MEM64 bar_num=0 bar=0x38200000
[0006.203] I> Number of PCIe devices detected: 2
[0006.207] I> NVME page size: 4096
[0006.212] I> NVMe serial number: BTNR01331TCZ1P0B    
[0006.215] I> NVMe model number: INTEL SSDPEKNW010T9                     
[0006.222] I> NVMe firmware revision: 001C    
[0006.226] I> block_count: 2000409264
[0006.230] I> supported_lba: 0
[0006.232] I> block_size_log2: 0x9
[0006.236] I> tegrabl_create_io_queue_cmd: queue size: 2
[0006.241] I> tegrabl_create_io_queue_cmd: queue size: 2
[0006.246] I> nvme device id 000a0000
[0006.249] I> nvme-0 params source = 
[0006.253] W> Cannot find any partition table for 000a0000
[0006.258] I> Detect filesystem
[0006.261] I> fs_detect:173: Unsupported or no filesystem present
[0006.267] I> Loading kernel-bootctrl from partition
[0006.271] I> Loading partition kernel-bootctrl at 0xa4b30000 from device(0x1)
[0006.284] W> tegrabl_get_kernel_bootctrl: magic number(0x00000000) is invalid
[0006.285] W> tegrabl_get_kernel_bootctrl: use default dummy boot control data
[0006.298] I> removable_boot_load_kernel_and_dtb: force NVME bdev to close !!!
[0006.300] E> NVME (0) boot failed, err: 0x2b2b000d
[0006.304] I> ########## NVME (1) boot ##########
[0006.308] I> Initializing nvme device instance 1
[0006.313] I> Initializing nvme controller
[0006.317] I> tegrabl_locate_pcie_ctrl_in_dt: found match at 0x14100000
[0006.323] I> vpcie3v3-supply not found
[0006.327] I> vpcie12v-supply not found
[0006.330] W> Failed to get nvidia,plat-gpios
[0006.334] I> tegrabl_pcie_soc_preinit: (1):
[0006.338] I> Unpowergate
[0006.341] I> tegrabl_car_clk_disable(1) ...
[0006.345] I> tegrabl_car_rst_set(CORE, 1) ...
[0006.349] I> tegrabl_car_rst_set(APB, 1) ...
[0006.353] I> tegrabl_car_clk_enable(1) ...
[0006.357] I> tegrabl_car_rst_clear(APB, 1) ...
[0006.361] I> tegrabl_set_ctrl_state(1)
[0006.365] I> CLR PCIE_APB:6
[0006.368] I> tegrabl_pcie_soc_init: (1):
[0006.371] I> APPL initialization ...
[0006.375] I> poweron phys
[0006.377] I> tegrabl_locate_pcie_ctrl_in_dt: found match at 0x14100000
[0006.384] I> tegrabl_power_on_phy: power on phy @0x3e10000
[0007.489] C> Failed to link up controller-1
[0007.490] W> Failed tegrabl_pcie_soc_init(), error=0x12
[0007.490] I> Failed to initialize SoC Host PCIe controller
[0007.490] E> tegrabl_nvme_init: Failed tegrabl_pcie_init(1); error=0x12
[0007.491] W> tegrabl_nvme_bdev_open: Failed NVME INIT; error=0x80800612
[0007.491] W> Failed to open NVME-1, err = 80800612
[0007.496] W> Failed to initialize device 10-1
[0007.500] E> NVME (1) boot failed, err: 0x80800612
[0007.505] I> ########## NVME (2) boot ##########
[0007.509] I> Initializing nvme device instance 2
[0007.514] I> Initializing nvme controller
[0007.518] I> tegrabl_locate_pcie_ctrl_in_dt: found match at 0x14120000
[0007.524] I> vpcie3v3-supply not found
[0007.528] I> vpcie12v-supply not found
[0007.531] W> Failed to get nvidia,plat-gpios
[0007.535] I> tegrabl_pcie_soc_preinit: (2):
[0007.539] I> Unpowergate
[0007.542] I> tegrabl_car_clk_disable(2) ...
[0007.546] I> tegrabl_car_rst_set(CORE, 2) ...
[0007.550] I> tegrabl_car_rst_set(APB, 2) ...
[0007.554] I> tegrabl_car_clk_enable(2) ...
[0007.558] I> tegrabl_car_rst_clear(APB, 2) ...
[0007.562] I> tegrabl_set_ctrl_state(2)
[0007.566] I> CLR PCIE_APB:6
[0007.569] I> tegrabl_pcie_soc_init: (2):
[0007.572] I> APPL initialization ...
[0007.576] I> poweron phys
[0007.578] I> tegrabl_locate_pcie_ctrl_in_dt: found match at 0x14120000
[0007.584] I> tegrabl_power_on_phy: controller 2 not available
[0007.590] E> Failed to power on phy on controller-2
[0007.595] W> Failed tegrabl_pcie_soc_init(), error=0x1
[0007.600] I> Failed to initialize SoC Host PCIe controller
[0007.605] E> tegrabl_nvme_init: Failed tegrabl_pcie_init(2); error=0x1
[0007.611] W> tegrabl_nvme_bdev_open: Failed NVME INIT; error=0x80800601
[0007.618] W> Failed to open NVME-2, err = 80800601
[0007.623] W> Failed to initialize device 10-2
[0007.627] E> NVME (2) boot failed, err: 0x80800601
[0007.631] I> ########## NVME (3) boot ##########
[0007.636] I> Initializing nvme device instance 3
[0007.640] I> Initializing nvme controller
[0007.645] I> tegrabl_locate_pcie_ctrl_in_dt: found match at 0x14140000
[0007.651] I> vpcie3v3-supply not found
[0007.654] I> vpcie12v-supply not found
[0007.658] W> Failed to get nvidia,plat-gpios
[0007.662] I> tegrabl_pcie_soc_preinit: (3):
[0007.666] I> Unpowergate
[0007.668] I> tegrabl_car_clk_disable(3) ...
[0007.672] I> tegrabl_car_rst_set(CORE, 3) ...
[0007.677] I> tegrabl_car_rst_set(APB, 3) ...
[0007.681] I> tegrabl_car_clk_enable(3) ...
[0007.685] I> tegrabl_car_rst_clear(APB, 3) ...
[0007.689] I> tegrabl_set_ctrl_state(3)
[0007.692] I> CLR PCIE_APB:6
[0007.695] I> tegrabl_pcie_soc_init: (3):
[0007.699] I> APPL initialization ...
[0007.702] I> poweron phys
[0007.705] I> tegrabl_locate_pcie_ctrl_in_dt: found match at 0x14140000
[0007.711] I> tegrabl_power_on_phy: power on phy @0x3e80000

Are there any other possible issues in my configuration?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.