How to control PCIE_12V_EN_N(GPIO05)?

I am trying to control the PCIE_12V_EN_N(GPIO05) such as pull up or down as following piece of CVM CONNECTOR 2 in schematic diagram in the AGX Xavier developer kit.
1

the gpio pin(PCIE_12V_EN_N) in the device tree is as following:

p2822_vdd_12v_pcie: regulator@116 {
                        compatible = "regulator-fixed";
                        reg = <116>;
                        regulator-name = "vdd-12v-pcie";
                        regulator-min-microvolt = <1200000>;
                        regulator-max-microvolt = <1200000>;
                        gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(A, 1) 1>;
                        regulator-boot-off;
                        enable-active-low;
                        status = "disabled";
                };
pcie@141a0000 {                                                                                                                                                        
                vddio-pex-ctl-supply = <&p2888_spmic_sd3>;
                vpcie3v3-supply = <&p2822_vdd_3v3_pcie>;
                vpcie12v-supply = <&p2822_vdd_12v_pcie>;
        };                  

From the above device-tree node i can see PCIE_12V_EN_N pin is include in p2822_vdd_12v_pcie and p2822_vdd_12v_pcie is include in pcie@141a0000 .by the way the compatible of pcie@141a0000 is “nvidia,tegra194-pcie”, “snps,dw-pcie”.
I search pcie driver file in L4T by the compatible keyword

$ grep -rn "snps,dw-pcie" *
pci/host/pcie-designware-plat.c:115:    { .compatible = "snps,dw-pcie", },
pci/dwc/pcie-designware-plat.c:131:     { .compatible = "snps,dw-pcie", },

not find by “nvidia,tegra194-pcie” keyword.is it OK to modify the two files as above? Or other?

next is log about pcie dmesg:

$ dmesg|grep pcie
[    0.818102] iommu: Adding device 14180000.pcie to group 0
[    0.818856] iommu: Adding device 14100000.pcie to group 1
[    0.819569] iommu: Adding device 14140000.pcie to group 2
[    0.820255] iommu: Adding device 141a0000.pcie to group 3
[    0.910275] vdd-3v3-pcie: 3300 mV 
[    0.910843] vdd-12v-pcie: 1200 mV 
[    4.225820] tegra-pcie-dw 14180000.pcie: Setting init speed to max speed
[    4.226635] OF: PCI: host bridge /pcie@14180000 ranges:
[    4.739503] tegra-pcie-dw 14180000.pcie: link is down
[    4.739700] tegra-pcie-dw 14180000.pcie: PCI host bridge to bus 0000:00
[    4.740655] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
[    4.740662] pcie_pme 0000:00:00.0:pcie001: service driver pcie_pme loaded
[    4.740758] aer 0000:00:00.0:pcie002: service driver aer loaded
[    4.740897] pcie_pme 0000:00:00.0:pcie001: unloading service driver pcie_pme
[    4.740969] aer 0000:00:00.0:pcie002: unloading service driver aer
[    4.742726] tegra-pcie-dw 14180000.pcie: PCIe link is not up...!
[    4.743221] tegra-pcie-dw 14100000.pcie: Setting init speed to max speed
[    4.743959] OF: PCI: host bridge /pcie@14100000 ranges:
[    4.851972] tegra-pcie-dw 14100000.pcie: link is up
[    4.852218] tegra-pcie-dw 14100000.pcie: PCI host bridge to bus 0001:00
[    4.866353] pcieport 0001:00:00.0: Signaling PME through PCIe PME interrupt
[    4.866362] pcie_pme 0001:00:00.0:pcie001: service driver pcie_pme loaded
[    4.866483] aer 0001:00:00.0:pcie002: service driver aer loaded
[    4.868280] tegra-pcie-dw 14140000.pcie: Setting init speed to max speed
[    4.869109] OF: PCI: host bridge /pcie@14140000 ranges:
[    5.379694] tegra-pcie-dw 14140000.pcie: link is down
[    5.379862] tegra-pcie-dw 14140000.pcie: PCI host bridge to bus 0003:00
[    5.380708] pcieport 0003:00:00.0: Signaling PME through PCIe PME interrupt
[    5.380714] pcie_pme 0003:00:00.0:pcie001: service driver pcie_pme loaded
[    5.380815] aer 0003:00:00.0:pcie002: service driver aer loaded
[    5.380958] pcie_pme 0003:00:00.0:pcie001: unloading service driver pcie_pme
[    5.381030] aer 0003:00:00.0:pcie002: unloading service driver aer
[    5.382831] tegra-pcie-dw 14140000.pcie: PCIe link is not up...!
[    5.383384] tegra-pcie-dw 141a0000.pcie: Setting init speed to max speed
[    5.492591] OF: PCI: host bridge /pcie@141a0000 ranges:
[    6.004049] tegra-pcie-dw 141a0000.pcie: link is down
[    6.004210] tegra-pcie-dw 141a0000.pcie: PCI host bridge to bus 0005:00
[    6.005028] pcieport 0005:00:00.0: Signaling PME through PCIe PME interrupt
[    6.005035] pcie_pme 0005:00:00.0:pcie001: service driver pcie_pme loaded
[    6.005167] aer 0005:00:00.0:pcie002: service driver aer loaded
[    6.005311] pcie_pme 0005:00:00.0:pcie001: unloading service driver pcie_pme
[    6.005364] aer 0005:00:00.0:pcie002: unloading service driver aer
[    6.006992] tegra-pcie-dw 141a0000.pcie: PCIe link is not up...!
[   38.234452] vdd-3v3-pcie: disabling
[   38.234458] vdd-12v-pcie: disabling

Contrary to it,i find the default status of pcie@141a0000 node in device-tree is “disabled” when decompile device-tree in jeston agx xavier.
In general,i can’t find the corresponding pcie driver file for that.Where is it?
Regards.

Hi sdz_2011,

What’s the current Jetpack version in use?

Could you help to provide the pinmux spreadsheet for further check?
Or you are just using the default configuration?

Please also share the result of the following command on your board.

$sudo busybox devmem 0x02432010

Hi KevinFFF:
$ cat /etc/nv_tegra_release
R32 (release), REVISION: 7.3, GCID: 31982016, BOARD: t186ref, EABI: aarch64, DATE: Tue Nov 22 17:32:54 UTC 2022
$ sudo busybox devmem 0x02432010
0x0000C002
I use default pinmux spreadsheet from https://developer.nvidia.com/embedded/dlc/jetson-agx-series-devkit-pinmux-configuration-template
Regards.

You can enable it manualy in tegra194-soc-pcie.dtsi.

You could configure it in pinmux spreadsheet with configure the Drive 0/1 in the row ofReq. Initial State

You could configure it in pinmux spreadsheet with configure the Drive 0/1 in the row ofReq. Initial State
[sdz_2011] But i need to control the PCIE_12V_EN_N(GPIO05) dynamically,how to do it?

Hi,

The reason why this regulator is written in the PCIe driver is because this is in use by PCIe driver. Your “i need to control the PCIE_12V_EN_N(GPIO05) dynamically,how to do it” is achieved by PCIe driver.

Also, it looks like you misunderstood something. It is not “I need to enable the regulator so that PCIe would work”. The logic is revered. It is more like because your PCIe device cannot be detected, so kernel disable the unused regulator to save power.

1 Like

Hi WayneWWW:
I agree your option.Before there is no pcie device in pcie slot,but when i add it to slot,i can see that pcie driver load ok as following:

nvidia@ubuntu:~$ dmesg |grep pcie
[    0.822594] iommu: Adding device 14180000.pcie to group 0
[    0.823310] iommu: Adding device 14100000.pcie to group 1
[    0.824039] iommu: Adding device 14140000.pcie to group 2
[    0.824747] iommu: Adding device 141a0000.pcie to group 3
[    0.918087] vdd-3v3-pcie: 3300 mV 
[    0.918580] vdd-12v-pcie: 1200 mV 
[    4.140745] tegra-pcie-dw 14180000.pcie: Setting init speed to max speed
[    4.141692] OF: PCI: host bridge /pcie@14180000 ranges:
[    4.656344] tegra-pcie-dw 14180000.pcie: link is down
[    4.656542] tegra-pcie-dw 14180000.pcie: PCI host bridge to bus 0000:00
[    4.657570] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
[    4.657577] pcie_pme 0000:00:00.0:pcie001: service driver pcie_pme loaded
[    4.657690] aer 0000:00:00.0:pcie002: service driver aer loaded
[    4.657855] pcie_pme 0000:00:00.0:pcie001: unloading service driver pcie_pme
[    4.657898] aer 0000:00:00.0:pcie002: unloading service driver aer
[    4.659796] tegra-pcie-dw 14180000.pcie: PCIe link is not up...!
[    4.660347] tegra-pcie-dw 14100000.pcie: Setting init speed to max speed
[    4.661082] OF: PCI: host bridge /pcie@14100000 ranges:
[    4.771047] tegra-pcie-dw 14100000.pcie: link is up
[    4.771305] tegra-pcie-dw 14100000.pcie: PCI host bridge to bus 0001:00
[    4.785453] pcieport 0001:00:00.0: Signaling PME through PCIe PME interrupt
[    4.785464] pcie_pme 0001:00:00.0:pcie001: service driver pcie_pme loaded
[    4.785572] aer 0001:00:00.0:pcie002: service driver aer loaded
[    4.787626] tegra-pcie-dw 14140000.pcie: Setting init speed to max speed
[    4.788492] OF: PCI: host bridge /pcie@14140000 ranges:
[    4.899065] tegra-pcie-dw 14140000.pcie: link is up
[    4.899284] tegra-pcie-dw 14140000.pcie: PCI host bridge to bus 0003:00
[    4.912317] pcieport 0003:00:00.0: Signaling PME through PCIe PME interrupt
[    4.912328] pcie_pme 0003:00:00.0:pcie001: service driver pcie_pme loaded
[    4.912450] aer 0003:00:00.0:pcie002: service driver aer loaded
[    4.912933] tegra-pcie-dw 141a0000.pcie: Setting init speed to max speed
[    5.019342] OF: PCI: host bridge /pcie@141a0000 ranges:
[    5.127038] tegra-pcie-dw 141a0000.pcie: link is up
[    5.127276] tegra-pcie-dw 141a0000.pcie: PCI host bridge to bus 0005:00
[    5.141076] pcieport 0005:00:00.0: Signaling PME through PCIe PME interrupt
[    5.141087] pcie_pme 0005:00:00.0:pcie001: service driver pcie_pme loaded
[    5.141192] aer 0005:00:00.0:pcie002: service driver aer loaded
[   22.776822] input: USB V/A Streaming as /devices/141a0000.pcie/pci0005:00/0005:00:00.0/0005:01:00.0/usb2/2-2/2-2:1.0/input/input8
[   22.796678] input: USB V/A Streaming as /devices/141a0000.pcie/pci0005:00/0005:00:00.0/0005:01:00.0/usb2/2-1/2-1:1.0/input/input9

But even so that,i want to control the regulator low or high dynamic by TEGRA194_MAIN_GPIO(A, 1) to control pcie device powerup, not just a fix regulator.How to ?Is there some regulator API to do it?

Actually, for any kind of host controller (not only PCIe), the regulator should be controlled by the driver. If any end user wants to control the device power on/off, they should use the interface provided by the driver.

For example, if you are using usb device, then it is usb driver’s duty to control the regulator (except always-on design). PCIe is same as this case too.

If you really want to manually control by yourself, maybe try to use the regulator sysfs to see if you can control it. This is linux standard driver interface.

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