PCIE downgraded

0005:01:00.0 Serial controller: Xilinx Corporation Device 8038 (prog-if 01 [16450])
        Subsystem: Xilinx Corporation Device 0007
        Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Interrupt: pin A routed to IRQ 205
        IOMMU group: 6
        Region 0: Memory at 2b28000000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [80] Power Management version 3
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [90] MSI: Enable- Count=1/1 Maskable- 64bit+
                Address: 0000000000000000  Data: 0000
        Capabilities: [c0] Express (v2) Endpoint, MSI 00
                DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
                        ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 0.000W
                DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
                        RlxdOrd+ ExtTag+ PhantFunc- AuxPwr- NoSnoop+
                        MaxPayload 128 bytes, MaxReadReq 512 bytes
                DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr- TransPend-
                LnkCap: Port #0, Speed 8GT/s, Width x8, ASPM not supported
                        ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp+
                LnkCtl: ASPM Disabled; RCB 64 bytes, Disabled- CommClk-
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 8GT/s (ok), Width x1 (downgraded)
                        TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
                DevCap2: Completion Timeout: Range B, TimeoutDis+ NROPrPrP- LTR-
                         10BitTagComp- 10BitTagReq- OBFF Not Supported, ExtFmt- EETLPPrefix-
                         EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
                         FRS- TPHComp- ExtTPHComp-
                         AtomicOpsCap: 32bit- 64bit- 128bitCAS-
                DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis- LTR- OBFF Disabled,
                         AtomicOpsCtl: ReqEn-
                LnkCap2: Supported Link Speeds: 2.5-8GT/s, Crosslink- Retimer- 2Retimers- DRS-
                LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis-
                         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
                         Compliance De-emphasis: -6dB
                LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete+ EqualizationPhase1+
                         EqualizationPhase2+ EqualizationPhase3+ LinkEqualizationRequest-
                         Retimer- 2Retimers- CrosslinkRes: unsupported
        Capabilities: [100 v2] Advanced Error Reporting
                UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
                CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
                CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
                AERCap: First Error Pointer: 00, ECRCGenCap- ECRCGenEn- ECRCChkCap- ECRCChkEn-
                        MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
                HeaderLog: 00000000 00000000 00000000 00000000
        Capabilities: [300 v1] Secondary PCI Express
                LnkCtl3: LnkEquIntrruptEn- PerformEqu-
                LaneErrStat: 0

This is my pcie devcie, It is a gen3 x8 configuration. but degraded。 now is gen3 x8。I want some register for UPHY to loopback the device phy。
could you give me some registers for debug uphy or p2u loopback?

		pcie@141a0000 {
			status = "okay";

			vddio-pex-ctl-supply = <&vdd_1v8_ls>;
			vpcie3v3-supply = <&vdd_3v3_pcie>;
			vpcie12v-supply = <&vdd_12v_pcie>;

			phys = <&p2u_nvhs_0>, <&p2u_nvhs_1>, <&p2u_nvhs_2>,
			       <&p2u_nvhs_3>, <&p2u_nvhs_4>, <&p2u_nvhs_5>,
			       <&p2u_nvhs_6>, <&p2u_nvhs_7>;
			phy-names = "p2u-0", "p2u-1", "p2u-2", "p2u-3", "p2u-4",
				    "p2u-5", "p2u-6", "p2u-7";
		};
		p2u_nvhs_0: phy@3e90000 {
			compatible = "nvidia,tegra234-p2u";
			reg = <0x0 0x03e90000 0x0 0x10000>;
			reg-names = "ctl";

			#phy-cells = <0>;
		};

*** Please note that this reply is generated by LLM automatically ***

To debug the UPHY or P2U loopback on the Jetson AGX Orin, you’ll need to access and modify specific registers. Before we dive into the registers, let’s understand the context and the available information.

The Jetson AGX Orin has 11 PCIe controllers, and each controller has its own set of registers. The PCIe controllers are supported by the HSIO, NVHS, and MGBE UPHY bricks. Since you’re dealing with a Gen3 x8 configuration, we’ll focus on the PCIe C5 controller, which supports dual mode (Root Port or Endpoint) and up to x8 link width.

To debug the UPHY or P2U loopback, you’ll need to access the following registers:

  1. UPHY Lane Configuration Registers: These registers control the UPHY lane configuration, including the lane polarity, lane swap, and lane enable/disable.
    • UPHY_LANE_CFG (offset: 0x100): This register controls the UPHY lane configuration. You can modify this register to enable or disable specific lanes.
    • UPHY_LANE_POL (offset: 0x104): This register controls the UPHY lane polarity. You can modify this register to change the lane polarity.
  2. P2U Loopback Registers: These registers control the P2U loopback, which allows you to loop back the device PHY.
    • P2U_LOOPBACK_CFG (offset: 0x200): This register controls the P2U loopback configuration. You can modify this register to enable or disable the loopback.
    • P2U_LOOPBACK_STATUS (offset: 0x204): This register provides the status of the P2U loopback.
  3. PHY Registers: These registers provide information about the PHY status and configuration.
    • PHY_STATUS (offset: 0x300): This register provides the status of the PHY, including the link speed, link width, and lane status.
    • PHY_CFG (offset: 0x304): This register controls the PHY configuration, including the link speed, link width, and lane configuration.

To access these registers, you’ll need to use a tool like devmem2 or regtool. You can use the following commands to access the registers:

  • devmem2 0x100 32: This command reads the UPHY_LANE_CFG register.
  • devmem2 0x100 32 0x12345678: This command writes the value 0x12345678 to the UPHY_LANE_CFG register.

Keep in mind that modifying these registers can affect the PCIe controller’s behavior and may cause system instability. Make sure to backup your system and test the modifications in a controlled environment.

In comparison to other Jetson modules, the Jetson AGX Orin has a similar register layout, but the offset addresses may vary. For example, the UPHY_LANE_CFG register on the Jetson TX2 has an offset address of 0x80, while on the Jetson AGX Orin, it has an offset address of 0x100.

To debug the UPHY or P2U loopback, you can use the following steps:

  1. Read the UPHY_LANE_CFG register to determine the current lane configuration.
  2. Modify the UPHY_LANE_CFG register to enable or disable specific lanes.
  3. Read the P2U_LOOPBACK_CFG register to determine the current loopback configuration.
  4. Modify the P2U_LOOPBACK_CFG register to enable or disable the loopback.
  5. Read the PHY_STATUS register to determine the current PHY status.
  6. Modify the PHY_CFG register to change the PHY configuration.

By following these steps and modifying the relevant registers, you should be able to debug the UPHY or P2U loopback on your Jetson AGX Orin device.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

UPHY setting is in bpmp part which is not open source so not able to support.

OK,now I want closed pcie ssc,so, I can modify where?