PCIe adoptation

There is nothing like that.

Could you attach your full boot up serial console log?

Did you disable the bpmp debugfs?

boot_log.txt (69.0 KB)

Did you change device tree or something there that is related to PCIe?

In pinmux, in kernel_tegra234-p3737-0000+p3701-0004-nv.dtb, and tegra234-bpmp-3701-0004-3737-0000.dtb.

What are you trying to do here?

Why bpmp change is mentioned here?

I already mentioned this multiple times

  1. If you want to enable EP, then you donā€™t need to do anything to device tree. Just modify the ODMDATA and donā€™t need to do anything else. The original device tree overlay will handle thisā€¦

  2. SRNS is not supported or working on rel-36 yetā€¦ changing that may not work. That could be the reason you are reporting an error here.

Happened. Putty breaks on long lines and I lost output.

jetson@ubuntu:~$ sudo cat /sys/kernel/debug/bpmp/debug/uphy/config
[sudo] password for jetson:
0x00d84400

please go back revert everything you modifiedā€¦ just update the ODMDATA and dump the log againā€¦

root@ubuntu:/sys/kernel/config/pci_ep# sudo dmesg | tail
[   23.033923] tegra-xudc 3550000.usb: EP 6 (type: bulk, dir: out) enabled
[   23.037067] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready
[   23.902276] l4tbr0: port 1(usb0) entered blocking state
[   23.902289] l4tbr0: port 1(usb0) entered forwarding state
[   24.115253] IPv6: ADDRCONF(NETDEV_CHANGE): l4tbr0: link becomes ready
[   35.807537] VDD_3V3_PCIE: disabling
[   35.807616] VDD_12V_PCIE: disabling
[  141.466445] tegra194-pcie 141a0000.pcie-ep: iATU unroll: enabled
[  141.466477] tegra194-pcie 141a0000.pcie-ep: Detected iATU regions: 8 outbound, 2 inbound
[  141.466634] pcie_dma_epf tegra_pcie_dma_epf.0: BAR0 phy_addr: f0000000 size: 10000000

I removed all the changes, now everything seems to be fine.
Iā€™ll try 35.5

Hello.
I try 35.5
The result is wrong:

root@ubuntu:/sys/kernel/config/pci_ep# [  532.781474] tegra194-pcie 141a0000.pcie_ep: Failed to init UPHY for PCIe EP: -22

root@ubuntu:/sys/kernel/config/pci_ep# sudo dmesg | tail
[   25.918224] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   25.918472] nvethernet 2310000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   42.415729] vdd-12v-sys: disabling
[   42.415751] vdd-3v3-ftdi: disabling
[   42.415760] vdd-3v3-pcie: disabling
[   42.415781] vdd-12v-pcie: disabling
[  523.092271] pci_epf_nv_test pci_epf_nv_test.0: BAR0 RAM phys: 0x1428be000
[  523.092313] pci_epf_nv_test pci_epf_nv_test.0: BAR0 RAM IOVA: 0xffff0000
[  523.092385] pci_epf_nv_test pci_epf_nv_test.0: BAR0 RAM virt: 0x000000007205e5d3
[  532.781474] tegra194-pcie 141a0000.pcie_ep: Failed to init UPHY for PCIe EP: -22

root@ubuntu:/sys/kernel/config/pci_ep# cat /sys/kernel/debug/bpmp/debug/uphy/config
0x00800400

Here are the steps I followed:

In /Jetson_35/Linux_for_Tegra/bootloader/t186ref i modifed tegra234-bpmp-3701-0004-3737-0000.dts:

add folowing :

clocks {
...
               clock@pllnvhs {
                       clk-id = <0xf3>;
                       disable-spread = <0x1>;
               };
};

	uphy {
		status = "okay";
		hsio-uphy-config = <0x00>;
		hsstp-lane-map = <0x03>;
		nvhs-uphy-config = <0x00>;
		gbe-uphy-config = <0x16>;
		gbe0-enable-10g;
		pcie-c5-endpoint-use-int-refclk;
	};

in /home/jetson/Jetson_35/Linux_for_Tegra/bootloader/kernel_tegra234-p3701-0004-p3737-0000.dtb:

pcie_ep@141a0000 {
   ...
   /*nvidia,enable-ext-refclk;*/
   nvidia,enable-srns
   ...
};

In pinmux located in
/home/jetson/Jetson_35/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-pinmux-p3701-0000-a04.dtsi

			pex_l5_clkreq_n_paf0 {
				nvidia,pins = "pex_l5_clkreq_n_paf0";
				nvidia,function = "pe5";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
				nvidia,io-high-voltage = <TEGRA_PIN_ENABLE>;
				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
			};

			pex_l5_rst_n_paf1 {
				nvidia,pins = "pex_l5_rst_n_paf1";
				nvidia,function = "pe5";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
				nvidia,io-high-voltage = <TEGRA_PIN_ENABLE>;
				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
			};

In jetson-agx-orin-devkit.conf, added at the end of the file:

ODMDATA="gbe-uphy-config-0,hsstp-lane-map-3,nvhs-uphy-config-1,hsio-uphy-config-0";

What is not clear to me and what I did not complete:

In

Enable PCIe in a Customer CVB Designļƒ

  1. Enable the appropriate PCIe node listed under topic ā€œHere are the PCIe controller DT nodes:ā€:

In which file should I make changes?

  1. Add the pipe2uphy phandle entries as a phy property in the PCIe controller DT node.

pipe2uphy DT nodes are defined in SoC DT in the /hardware/nvidia/soc/t23x/kernel-dts/tegra234-soc/tegra234-soc-pcie.dtsi file.

Each pipe2uphy node is a 1:1 map to the UPHY lanes that are defined in UPHY Lane Configuration.

I donā€™t understand at all what I need to add, please if you can give an example

  1. If the Tegra PCIe is operated in the endpoint mode, add the ā€œreset-gpiosā€ property with the gpio phandle, the gpio number connected to PERST# and flags(GPIO_ACTIVE_LOW).

I also donā€™t understand which file and what to add.

Back to the first thing ā€¦ you can just modify the ODMDATA first and flash. It will enable PCIe EP without SRNSā€¦ please try if this thing works firstā€¦

The pinmux does not need to get updated. Please do not change anything on it.

I returned everything back, and so did pinmux:

root@ubuntu:/sys/kernel/config/pci_ep# sudo dmesg | tail
[   20.245686] nvidia-modeset: Loading NVIDIA UNIX Open Kernel Mode Setting Driver for aarch64  35.5.0  Release Build  (buildbrain@mobile-u64-6519-d7000)  Mon Feb 19 20:34:14 PST 20                             24
[   20.512134] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[   24.647608] pwm-tegra-tachometer 39c0000.tachometer: Tachometer Overflow is detected
[   42.423799] vdd-12v-sys: disabling
[   42.423817] vdd-3v3-ftdi: disabling
[   42.423824] vdd-3v3-pcie: disabling
[   42.423843] vdd-12v-pcie: disabling
[  104.019867] pci_epf_nv_test pci_epf_nv_test.0: BAR0 RAM phys: 0x155a1c000
[  104.019914] pci_epf_nv_test pci_epf_nv_test.0: BAR0 RAM IOVA: 0xffff0000
[  104.020006] pci_epf_nv_test pci_epf_nv_test.0: BAR0 RAM virt: 0x0000000054e92c26
root@ubuntu:/sys/kernel/config/pci_ep# cat /sys/kernel/debug/bpmp/debug/uphy/config
0x00800000

Ok.
Could you modify the bpmp dtb and kernel dtb with only the info from document " Enabling SRNS for PCIe Endpoint" then?

Still the same error:

root@ubuntu:~# cd /sys/kernel/config/pci_ep/
root@ubuntu:/sys/kernel/config/pci_ep# mkdir functions/pci_epf_nv_test/func1
root@ubuntu:/sys/kernel/config/pci_ep# echo 0x10de > functions/pci_epf_nv_test/func1/vendorid
root@ubuntu:/sys/kernel/config/pci_ep# echo 0x0001 > functions/pci_epf_nv_test/func1/deviceid
root@ubuntu:/sys/kernel/config/pci_ep# ln -s functions/pci_epf_nv_test/func1 controllers/141a0000.pcie_ep/
root@ubuntu:/sys/kernel/config/pci_ep# echo 1 > controllers/141a0000.pcie_ep/start
root@ubuntu:/sys/kernel/config/pci_ep# [  114.374598] tegra194-pcie 141a0000.pcie_ep: Failed to init UPHY for PCIe EP: -22

root@ubuntu:/sys/kernel/config/pci_ep# sudo dmesg | tail
[   18.047923] nvethernet 2310000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   23.728972] pwm-tegra-tachometer 39c0000.tachometer: Tachometer Overflow is detected
[   42.412608] vdd-12v-sys: disabling
[   42.412656] vdd-3v3-ftdi: disabling
[   42.412677] vdd-3v3-pcie: disabling
[   42.412725] vdd-12v-pcie: disabling
[   97.741001] pci_epf_nv_test pci_epf_nv_test.0: BAR0 RAM phys: 0x10d18a000
[   97.741041] pci_epf_nv_test pci_epf_nv_test.0: BAR0 RAM IOVA: 0xffff0000
[   97.741172] pci_epf_nv_test pci_epf_nv_test.0: BAR0 RAM virt: 0x0000000072071c6f
[  114.374598] tegra194-pcie 141a0000.pcie_ep: Failed to init UPHY for PCIe EP: -22

root@ubuntu:/sys/kernel/config/pci_ep# cat /sys/kernel/debug/bpmp/debug/uphy/config
0x00800400
root@ubuntu:/sys/kernel/config/pci_ep#

I check PCIE5_RST_N signal in carier board. Root port setup after power up low level 750 us duration.
Clk_req and wake_up not chaned and have high level.

Iā€™m using x1 pcie, perhaps I need to indicate the number of lines used?

Also, on my board there is a DS80PCI102 equalizer which I have not tuned yet. Could this be the reason?
Also, in the board installed UPHY_REFCLK0 clock generator.

There are still previous errors:

root@ubuntu:/sys/kernel/config/pci_ep# dmesg | grep pcie
[    5.963822] tegra194-pcie 141a0000.pcie_ep: Adding to iommu group 9
[    5.976506] tegra194-pcie 141a0000.pcie_ep: Failed to get PERST GPIO: -517
[    5.976516] tegra194-pcie 141a0000.pcie_ep: Failed to parse device tree: -517
[    5.976715] tegra194-pcie 14100000.pcie: Adding to iommu group 10
[    5.988909] tegra194-pcie 14100000.pcie: Using GICv2m MSI allocator
[    5.997562] tegra194-pcie 14160000.pcie: Adding to iommu group 11
[    6.009979] tegra194-pcie 14160000.pcie: Using GICv2m MSI allocator
[    7.279243] tegra194-pcie 141a0000.pcie_ep: Using GICv2m MSI allocator
[    7.285982] tegra194-pcie 141a0000.pcie_ep: Failed to get slot regulators: -517
[    7.291873] tegra194-pcie 14100000.pcie: Using GICv2m MSI allocator
[    7.299011] tegra194-pcie 14100000.pcie: host bridge /pcie@14100000 ranges:
[    7.306193] tegra194-pcie 14100000.pcie:       IO 0x0030100000..0x00301fffff -> 0x0030100000
[    7.317478] tegra194-pcie 14100000.pcie:      MEM 0x20a8000000..0x20afffffff -> 0x0040000000
[    7.317480] tegra194-pcie 14100000.pcie:      MEM 0x2080000000..0x20a7ffffff -> 0x2080000000
[    8.456841] tegra194-pcie 14100000.pcie: Phy link never came up
[    8.462999] tegra194-pcie 14100000.pcie: PCI host bridge to bus 0001:00
[    8.539036] pcieport 0001:00:00.0: Adding to iommu group 10
[    8.545049] pcieport 0001:00:00.0: PME: Signaling with IRQ 65
[    8.551235] pcieport 0001:00:00.0: AER: enabled with IRQ 65
[    8.577039] tegra194-pcie 14160000.pcie: Using GICv2m MSI allocator
[    8.584453] tegra194-pcie 14160000.pcie: host bridge /pcie@14160000 ranges:
[    8.591629] tegra194-pcie 14160000.pcie:       IO 0x0036100000..0x00361fffff -> 0x0036100000
[    8.600322] tegra194-pcie 14160000.pcie:      MEM 0x2428000000..0x242fffffff -> 0x0040000000
[    8.608999] tegra194-pcie 14160000.pcie:      MEM 0x2140000000..0x2427ffffff -> 0x2140000000
[    9.724994] tegra194-pcie 14160000.pcie: Phy link never came up
[    9.731152] tegra194-pcie 14160000.pcie: PCI host bridge to bus 0004:00
[    9.807056] pcieport 0004:00:00.0: Adding to iommu group 11
[    9.813024] pcieport 0004:00:00.0: PME: Signaling with IRQ 67
[    9.819208] pcieport 0004:00:00.0: AER: enabled with IRQ 67
[    9.844230] vdd-3v3-pcie: supplied by vdd-3v3-sys
[    9.901943] tegra194-pcie 141a0000.pcie_ep: Using GICv2m MSI allocator
[   42.419537] vdd-3v3-pcie: disabling
[   42.419579] vdd-12v-pcie: disabling
[  130.318107] tegra194-pcie 141a0000.pcie_ep: Failed to init UPHY for PCIe EP: -22

I ckecked interrupts caled pex_rst_n:

root@ubuntu:/sys/kernel/config/pci_ep# cat /proc/interrupts | grep pex_rst
302:          5          0          0          0          0          0          0          0      gpio 153 Edge      tegra_pcie_5_pex_rst_irq
root@ubuntu:/sys/kernel/config/pci_ep#

pex_rst_n passes, Orin reacts to him.
I donā€™t understand this error:

tegra194-pcie 141a0000.pcie_ep: Failed to get PERST GPIO: -517

Please share what did you update there.

tegra234-bpmp-3701-0004-3737-0000.dts.txt (429.0 KB)
kernel_tegra234-p3701-0004-p3737-0000.dts.txt (550.8 KB)

in bpmp i add:

disable-spread,
pcie-c5-endpoint-use-int-refclk.

In kernel:

/nvidia,enable-ext-refclk;/
nvidia,enable-srns

I tried not uninstalling nvidia,enable-ext-refclk,
since this is not written in the manual, but still the same errors.

Just to clarify. I believe ā€œFailed to get PERST GPIO: -517ā€ was there even when you didnā€™t try to enable SRNS. Please double confirm.

If so, then this error could be ignored.

I returned everything to its original state

Yes, Failed to get PERST GPIO: -517 present in both cases.

root@ubuntu:/sys/kernel/config/pci_ep# mkdir functions/pci_epf_nv_test/func1
root@ubuntu:/sys/kernel/config/pci_ep# echo 0x10de > functions/pci_epf_nv_test/func1/vendorid
root@ubuntu:/sys/kernel/config/pci_ep# echo 0x0001 > functions/pci_epf_nv_test/func1/deviceid
root@ubuntu:/sys/kernel/config/pci_ep# ln -s functions/pci_epf_nv_test/func1 controllers/141a0000.pcie_ep/
root@ubuntu:/sys/kernel/config/pci_ep# echo 1 > controllers/141a0000.pcie_ep/start
root@ubuntu:/sys/kernel/config/pci_ep#
root@ubuntu:/sys/kernel/config/pci_ep#

After root power up:

root@ubuntu:/sys/kernel/config/pci_ep# sudo dmesg | tail
[   17.581993] nvidia-modeset: Loading NVIDIA UNIX Open Kernel Mode Setting Driver for aarch64  35.5.0  Release Build  (buildbrain@mobile-u64-6519-d7000)  Mon Feb 19 20:34:14 PST 2024
[   17.842632] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[   23.982944] pwm-tegra-tachometer 39c0000.tachometer: Tachometer Overflow is detected
[   42.412251] vdd-12v-sys: disabling
[   42.412284] vdd-3v3-ftdi: disabling
[   42.412360] vdd-3v3-pcie: disabling
[   42.412411] vdd-12v-pcie: disabling
[   76.794976] pci_epf_nv_test pci_epf_nv_test.0: BAR0 RAM phys: 0x14d5fa000
[   76.795014] pci_epf_nv_test pci_epf_nv_test.0: BAR0 RAM IOVA: 0xffff0000
[   76.795099] pci_epf_nv_test pci_epf_nv_test.0: BAR0 RAM virt: 0x000000000198abd7
root@ubuntu:/sys/kernel/config/pci_ep# dmesg | grep pcie
[    5.820698] tegra194-pcie 141a0000.pcie_ep: Adding to iommu group 9
[    5.833354] tegra194-pcie 141a0000.pcie_ep: Failed to get PERST GPIO: -517
[    5.833359] tegra194-pcie 141a0000.pcie_ep: Failed to parse device tree: -517
[    5.833575] tegra194-pcie 14100000.pcie: Adding to iommu group 10
[    5.845874] tegra194-pcie 14100000.pcie: Using GICv2m MSI allocator
[    5.854383] tegra194-pcie 14160000.pcie: Adding to iommu group 11
[    5.866651] tegra194-pcie 14160000.pcie: Using GICv2m MSI allocator
[    7.127744] tegra194-pcie 141a0000.pcie_ep: Using GICv2m MSI allocator
[    7.134481] tegra194-pcie 141a0000.pcie_ep: Failed to get slot regulators: -517
[    7.144109] tegra194-pcie 14100000.pcie: Using GICv2m MSI allocator
[    7.159046] tegra194-pcie 14100000.pcie: host bridge /pcie@14100000 ranges:
[    7.179853] tegra194-pcie 14100000.pcie:       IO 0x0030100000..0x00301fffff -> 0x0030100000
[    7.188540] tegra194-pcie 14100000.pcie:      MEM 0x20a8000000..0x20afffffff -> 0x0040000000
[    7.197217] tegra194-pcie 14100000.pcie:      MEM 0x2080000000..0x20a7ffffff -> 0x2080000000
[    8.313218] tegra194-pcie 14100000.pcie: Phy link never came up
[    8.319374] tegra194-pcie 14100000.pcie: PCI host bridge to bus 0001:00
[    8.395305] pcieport 0001:00:00.0: Adding to iommu group 10
[    8.401313] pcieport 0001:00:00.0: PME: Signaling with IRQ 65
[    8.407337] pcieport 0001:00:00.0: AER: enabled with IRQ 65
[    8.432984] tegra194-pcie 14160000.pcie: Using GICv2m MSI allocator
[    8.440266] tegra194-pcie 14160000.pcie: host bridge /pcie@14160000 ranges:
[    8.447443] tegra194-pcie 14160000.pcie:       IO 0x0036100000..0x00361fffff -> 0x0036100000
[    8.456132] tegra194-pcie 14160000.pcie:      MEM 0x2428000000..0x242fffffff -> 0x0040000000
[    8.464817] tegra194-pcie 14160000.pcie:      MEM 0x2140000000..0x2427ffffff -> 0x2140000000
[    9.581374] tegra194-pcie 14160000.pcie: Phy link never came up
[    9.587528] tegra194-pcie 14160000.pcie: PCI host bridge to bus 0004:00
[    9.663317] pcieport 0004:00:00.0: Adding to iommu group 11
[    9.669283] pcieport 0004:00:00.0: PME: Signaling with IRQ 67
[    9.675304] pcieport 0004:00:00.0: AER: enabled with IRQ 67
[    9.700331] vdd-3v3-pcie: supplied by vdd-3v3-sys
[    9.754223] tegra194-pcie 141a0000.pcie_ep: Using GICv2m MSI allocator
[   42.412360] vdd-3v3-pcie: disabling
[   42.412411] vdd-12v-pcie: disabling

Could you modify your device tree and do full flash? I guess your current method to update device tree is not full flash. Please also confirm.

Also, please attach the full log from uart. Stop pasting such snippet log anymore. Always share full log.