IMX8MP PCIE endpoint mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8MP PCIE endpoint mode

5,151 Views
pete_sensoray
Contributor II

We are using IMX8MP in PCIe Endpoint configuration.

# uname -a
Linux ucm-imx8m-plus 5.10.72-00018-g63479fd7af5b-dirty #51 SMP PREEMPT Fri Aug 12 12:00:12 PDT 2022 aarch64 aarch64 aarch64 GNU/Linux

The IMX8MP is connected through the CompuLab development board through a PCIe cable
to the host PC 1-lane wide PCIe slot. The development board is booted first and the PCIe PLL is verified:

$ dmesg | grep pci
[ 0.176414] imx8-pcie-phy 32f00000.pcie-phy: failed to get imx pcie phy clock
[ 2.374044] imx6q-pcie 33800000.pcie_ep: supply epdev_on not found, using dummy regulator
[ 2.390547] imx6q-pcie 33800000.pcie_ep: PLL REF_CLK is used!.
[ 2.397023] imx6q-pcie 33800000.pcie_ep: PCIe PHY PLL clock is locked.
[ 2.431731] imx6q-pcie 33800000.pcie_ep: PCIe PLL locked after 0 us.
[ 2.611260] imx6q-pcie 33800000.pcie_ep: invalid resource
[ 2.611263] imx6q-pcie 33800000.pcie_ep: iATU unroll: enabled

The pci endpoint configuration script is run:

set -ex

PCIE_EP=`ls /sys/class/pci_epc/`
ls /sys/kernel/config/pci_ep/controllers
ls /sys/bus/pci-epf/drivers
ls /sys/kernel/config/pci_ep/functions

cd /sys/kernel/config/pci_ep/

echo 0 > controllers/${PCIE_EP}/start

mkdir -p functions/pci_epf_test/func1
ls functions/pci_epf_test/func1
cat functions/pci_epf_test/func1/vendorid
cat functions/pci_epf_test/func1/interrupt_pin
echo 0x1957 > functions/pci_epf_test/func1/vendorid
echo 0x81c0 > functions/pci_epf_test/func1/deviceid
echo 16 > functions/pci_epf_test/func1/msi_interrupts
echo 8 > functions/pci_epf_test/func1/msix_interrupts

rm -f controllers/${PCIE_EP}/func1
ln -s functions/pci_epf_test/func1 controllers/${PCIE_EP}/
echo 1 > controllers/${PCIE_EP}/start

 

The host computer is booted and the device appears on lspci:

$ sudo lspci -vxxx -d 0x1957:0x81c0
01:00.0 Unassigned class [ff00]: Freescale Semiconductor Inc Device 81c0
Flags: fast devsel, IRQ 27
Memory at feaf0000 (64-bit, non-prefetchable) [disabled] [size=64K]
[virtual] Expansion ROM at feae0000 [disabled] [size=64K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/16 Maskable+ 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] #19
Capabilities: [158] L1 PM Substates
Kernel driver in use: pci-endpoint-test
00: 57 19 c0 81 00 00 10 00 00 00 00 ff 00 00 00 00
10: 04 00 af fe 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 00 00
40: 01 50 c3 db 00 00 00 00 00 00 00 00 00 00 00 00
50: 05 70 88 01 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 10 00 02 00 00 80 28 00 10 20 11 00 13 cc 41 00
80: 00 00 11 10 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 1f 00 00 00 00 00 00 00 0e 00 00 00
a0: 03 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


When loading the pci_endpoint_test driver on the host system,
which calls pci_enable_device() and pci_set_master(), we see the bus
master bit and memory access bit in the command register (offset 0x04) are set:

sudo insmod ./pci_endpoint_test.ko
sudo lspci -vxxx -d 0x1957:0x81c0
01:00.0 Unassigned class [ff00]: Freescale Semiconductor Inc Device 81c0
Flags: bus master, fast devsel, latency 0, IRQ 27
Memory at feaf0000 (64-bit, non-prefetchable) [size=64K]
[virtual] Expansion ROM at feae0000 [disabled] [size=64K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable+ Count=1/16 Maskable+ 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] #19
Capabilities: [158] L1 PM Substates
Kernel driver in use: pci-endpoint-test
00: 57 19 c0 81 06 04 10 00 00 00 00 ff 00 00 00 00
10: 04 00 af fe 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 00 00
40: 01 50 c3 db 00 00 00 00 00 00 00 00 00 00 00 00
50: 05 70 89 01 04 80 e0 fe 00 00 00 00 21 40 00 00
60: fe ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 10 00 02 00 00 80 28 00 1f 20 11 00 13 cc 41 00
80: 00 00 11 10 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 1f 00 00 00 00 00 00 00 0e 00 00 00
a0: 03 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

sleep 2
sudo lspci -vxxx -d 0x1957:0x81c0
01:00.0 Unassigned class [ff00]: Freescale Semiconductor Inc Device 81c0
Flags: fast devsel, IRQ 27
Memory at feaf0000 (64-bit, non-prefetchable) [disabled] [size=64K]
[virtual] Expansion ROM at feae0000 [disabled] [size=64K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/16 Maskable+ 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] #19
Capabilities: [158] L1 PM Substates
Kernel driver in use: pci-endpoint-test
00: 57 19 c0 81 00 00 10 00 00 00 00 ff 00 00 00 00
10: 04 00 af fe 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 00 00
40: 01 50 c3 db 00 00 00 00 00 00 00 00 00 00 00 00
50: 05 70 88 01 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 10 00 02 00 00 80 28 00 10 20 11 00 13 cc 41 00
80: 00 00 11 10 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 1f 00 00 00 00 00 00 00 0e 00 00 00
a0: 03 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


Mysteriously the command register is cleared. Since the PCI_COMMAND MEMORY access bit is cleared,
any reads from the memory mapped BAR0 space return 0xFFs.

I've traced the host PC kernel and verified that nothing is calling the pci_bus_write_config_(byte|word|dword) functions after exiting the driver probe function.


On the device I can check the HSIO registers to see the PCIe error and status registers:

After the driver module load:

# ./hsio
00: 00000033
04: 00002023 PLL_LOCK=1 PCIE_CTRL_PM_DSTATE=0 SMLH_LTSSM_STATE=0x11 PM_EN_CORE_CLK=1
08: 1fccc80c
0c: 80021000
10: 00000000
14: 00000000
18: 00000000
1c: 00000000
20: 00000000
24: 00000000

A few seconds later:

# ./hsio
00: 00000033
04: 0000201b PLL_LOCK=1 PCIE_CTRL_PM_DSTATE=0 SMLH_LTSSM_STATE=0x0d PM_EN_CORE_CLK=1
08: 1fccc80c
0c: 80021000
10: 00000000
14: 00000000
18: 00000000
1c: 00000000
20: 00000000
24: 00000000

Again immediately after that:

# ./hsio
00: 00000033
04: 00003023 PLL_LOCK=1 PCIE_CTRL_PM_DSTATE=4 SMLH_LTSSM_STATE=0x11 PM_EN_CORE_CLK=1
08: 1fccc80c
0c: 80021000
10: 00000003 LDD=1 LUD=1
14: 00000000
18: 00000000
1c: 00000000
20: 00000000
24: 00000000

The HSIO BLK_CTRL register PCIE controller status (GPR_REG1 0x04) changes when the problem occurs:  The SMLH_LTSSM_STATE goes from 0x11 to 0x0d and back to 0x11. According to pcie-designware.h, the PORT_LOGIC_LTSSM_STATE_L0 is 0x11, and PORT_LOGIC_LTSSM_STATE_L2 is 0x15. Not sure what 0x0d could be.
The IMX8MPRM says merely "SMLH_LTSSM_STATE: PCIE link state".
The PCIE_CTRL_PM_DSTATE goes from 0 to 4, and stays there.
The IMX8MPRM says merely "PCIE_CTRL_PM_DSTATE: PCIE ctrl's pm dstate".

The register PCIE PME message and error detect register (GPR_REG4 0x10) also shows that the Link also appears to have gone down and back up, being both Link Down Detected (LDD) and Link Up Detected (LUD) are set. 

Can anyone tell me what is going on here? What could be triggering the linkdown/linkup? What does SMLH_LTSSM_STATE=0x0d and PCIE_CTRL_PM_DSTATE=4 mean?

0 Kudos
20 Replies

5,101 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @pete_sensoray ,

I hope you are doing well
 
PCIe cannot be configured to enter LTSSM L2. This function is not supported by PCIe Phy IP.
for more detail, you can look into Mask Set Errata for Mask 1P33A ERR050717 & ERR051128.
 
Please add pcie_cz_enabled=yes to the kernel command line. as suggested by i.MX Linux Release Notes.
 
Thanks & Regards
Sanket Parekh
0 Kudos

5,062 Views
pete_sensoray
Contributor II

Hi @Sanket_Parekh ,

I have added pcie_cz_enabled=yes to the kernel command line, but it did not solve the problem.

# dmesg|grep command
[ 0.000000] Kernel command line: console=ttymxc1,115200 console=tty1 root=/dev/mmcblk2p2 rootwait rw pcie_cz_enabled=yes

I do not believe this issue to be related to LTSSM L2 state. I've modified my register display program to continuously print the register any time one changes, so that I can track the changes in the LTSSM. Here is a trace of the registers when connected to a PC:

# make pcie && ./pcie
make: 'pcie' is up to date.
opening /dev/mem
doing mmap
mmap returned 0xffff873bc000
doing mmap
mmap returned 0xffff873bb000
pcie 00: 57 19 c0 81 00 00 10 00 00 00 00 ff 00 00 00 00
pcie 10: 04 00 af fe 00 00 00 00 00 00 00 00 00 00 00 00
pcie 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie 30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 00 00
pcie 40: 01 50 c3 db 00 00 00 00 00 00 00 00 00 00 00 00
Version=3 PMEClock=0 ImmRdyRetD0=0 DSI=0 AuxCur=7 D1sup=1 D2sup=0 PMEsup=1b
PowerState=D0 NoSoftRst=0 DataSelect=0 DataScale=0 PMEstatus=0
pcie 50: 05 70 88 01 00 00 00 00 00 00 00 00 00 00 00 00
pcie 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie 70: 10 00 02 00 00 80 28 00 10 20 11 00 13 cc 41 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=10 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=1 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=3 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
pcie 80: 00 00 11 10 00 00 00 00 00 00 00 00 00 00 00 00
ASPMCtl=0 RCB=0 LnkDis=0 RTrnLnk=0 ComClkCfg=0 ExtSync=0 EnClkPM=0 HWAutoWidthDis=0 LnkBWMgmtIntEn=0 LnkAutoBWIntEn=0 DRS=0
CurLnkSpd=1 NegLnkWidth=1 LnkTrn=0 SltClkCfg=0 DatLnkLyrLnkAct=1 LnkBWMgmtStat=0 LnkAutoBWStat=0
AttnButPrsnt=0 PwrCtlrPrsnt=0 MRLSenPrsnt=0 AttnIdcPrsnt=0 PwrIdcPrsnt=0 HotPlgSprs=0 HotPlgCap=0
SltPwrLmtVal=0 SltPwrLmtScl=0 EleMchIntlckPrsnt=0 NoCmdCmpltSup=0 PhysSltNum=0
pcie 90: 00 00 00 00 1f 00 00 00 00 00 00 00 0e 00 00 00
pcie a0: 03 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
hsio 00: 00000033 crs_clear=0 cfg_ready=0 usb_phy_ref_clk_sel=0 usb_clock_module_en=1 pcie_clock_module_en=1
hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
hsio 08: 1fccc80c
hsio 0c: 80021000
hsio 10: 0000000b intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=1 hrd=0 ldd=1 lud=1
Clearing LUD LDD
hsio 14: 00000000
hsio 18: 00000000
hsio 1c: 00000000
hsio 20: 00000000
hsio 24: 00000000
0.000002 hsio 10: 00000008 intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=1 hrd=0 ldd=0 lud=0
0.825998 hsio 04: 0000301b pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0d en_core_clk=1 (Recovery.Lock)
0.826110 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
0.826196 hsio 04: 0000301b pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0d en_core_clk=1 (Recovery.Lock)
0.826272 hsio 04: 0000301f pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
0.826349 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
0.826496 hsio 04: 0000301f pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
0.826574 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
0.839996 hsio 04: 0000301f pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
0.840080 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
0.840157 hsio 04: 0000301f pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)


... Loading the pci_endpoint_test driver on the PC here:


5.544265 hsio 04: 0000301f pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
5.544341 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
5.546389 hsio 04: 0000301b pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0d en_core_clk=1 (Recovery.Lock)
5.546416 pcie 00: 57 19 c0 81 02 00 10 00 00 00 00 ff 00 00 00 00
5.546499 hsio 04: 00002023 pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
5.546515 pcie 00: 57 19 c0 81 06 00 10 00 00 00 00 ff 00 00 00 00
5.546598 hsio 04: 0000201f pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
5.546612 pcie 00: 57 19 c0 81 06 04 10 00 00 00 00 ff 00 00 00 00
5.546646 pcie 50: 05 70 89 01 04 10 e0 fe 00 00 00 00 ef 40 00 00
5.546662 pcie 60: ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5.546714 hsio 04: 00002023 pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
5.546751 pcie 50: 05 70 89 01 04 40 e0 fe 00 00 00 00 23 40 00 00
5.546767 pcie 60: fe ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5.546825 hsio 04: 0000201f pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
5.546868 pcie 70: 10 00 02 00 00 80 28 00 1f 20 11 00 13 cc 41 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=10 FuncLvlRstCap=0
CoErrRepEn=1 NFErrRepEn=1 FatErrRepEn=1 UnsupReqRepEn=1 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=1 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=3 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
5.546951 hsio 04: 0000201b pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x0d en_core_clk=1 (Recovery.Lock)
5.547036 hsio 04: 00002023 pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
5.547121 hsio 04: 0000201f pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)


... and a couple seconds later the Recovery state goes to Detect->Poll->(Config not shown)->L0 and dstate=4:


6.995622 hsio 04: 00002023 pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
6.996395 hsio 04: 0000201b pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x0d en_core_clk=1 (Recovery.Lock)
6.996473 hsio 04: 00002023 pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
6.996812 hsio 04: 0000201f pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
6.996901 hsio 04: 00002023 pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
6.996980 hsio 04: 0000201f pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
6.997056 hsio 04: 00002023 pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
6.997780 hsio 04: 0000201f pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
6.997860 hsio 04: 00002023 pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
6.997937 hsio 04: 00002021 pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x10 en_core_clk=1 (Recovery.Idle)
6.999981 hsio 04: 0000201f pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
7.000062 hsio 04: 00002021 pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x10 en_core_clk=1 (Recovery.Idle)
7.002080 hsio 04: 0000200b pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x05 en_core_clk=1 (Pre-Detect.Quiet)
7.002092 hsio 10: 0000000a intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=1 hrd=0 ldd=1 lud=0
Clearing LDD
7.002111 pcie 00: 57 19 c0 81 00 00 10 00 00 00 00 ff 00 00 00 00
7.002147 pcie 50: 05 70 88 01 00 00 00 00 00 00 00 00 00 00 00 00
7.002163 pcie 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7.002180 pcie 70: 10 00 02 00 00 80 00 00 10 20 10 00 13 cc 41 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=0 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=0 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=3 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
7.002260 hsio 04: 00003005 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x02 en_core_clk=1 (Poll.Active)
7.002269 hsio 10: 00000008 intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=1 hrd=0 ldd=0 lud=0
7.027270 hsio 04: 00003007 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x03 en_core_clk=1 (Poll.Compliance)
7.042589 hsio 04: 00003005 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x02 en_core_clk=1 (Poll.Active)
7.042672 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
7.042682 hsio 10: 00000009 intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=1 hrd=0 ldd=0 lud=1
Clearing LUD
7.042728 pcie 70: 10 00 02 00 00 80 28 00 10 20 10 00 13 cc 41 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=10 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=0 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=3 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
7.042810 hsio 10: 00000008 intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=1 hrd=0 ldd=0 lud=0
7.545968 hsio 04: 0000301f pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
7.546036 pcie 70: 10 00 02 00 00 80 28 00 10 20 11 00 13 cc 41 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=10 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=1 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=3 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
7.546130 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
7.546217 hsio 04: 0000301f pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
7.546293 hsio 04: 0000301b pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0d en_core_clk=1 (Recovery.Lock)
7.546372 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
7.546448 hsio 04: 0000301f pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
7.546530 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
7.546617 hsio 04: 0000301b pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0d en_core_clk=1 (Recovery.Lock)
7.546711 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
7.560089 hsio 04: 0000301f pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
7.560174 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)


I had a suspicion that the constant bouncing between L0 and Recovery state might not be normal, so I tried connecting the IMX8MP development board to another IMX8MM development board. The register changes look like this:

pcie 00: 57 19 c0 81 00 00 10 00 00 00 00 ff 00 00 00 00
pcie 10: 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
pcie 20: 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie 30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 00 00
pcie 40: 01 50 c3 db 00 00 00 00 00 00 00 00 00 00 00 00
Version=3 PMEClock=0 ImmRdyRetD0=0 DSI=0 AuxCur=7 D1sup=1 D2sup=0 PMEsup=1b
PowerState=D0 NoSoftRst=0 DataSelect=0 DataScale=0 PMEstatus=0
pcie 50: 05 70 88 01 00 00 00 00 00 00 00 00 00 00 00 00
pcie 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie 70: 10 00 02 00 00 80 00 00 10 20 10 00 13 cc 41 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=0 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=0 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=3 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
pcie 80: 00 00 11 10 00 00 00 00 00 00 00 00 00 00 00 00
ASPMCtl=0 RCB=0 LnkDis=0 RTrnLnk=0 ComClkCfg=0 ExtSync=0 EnClkPM=0 HWAutoWidthDis=0 LnkBWMgmtIntEn=0 LnkAutoBWIntEn=0 DRS=0
CurLnkSpd=1 NegLnkWidth=1 LnkTrn=0 SltClkCfg=0 DatLnkLyrLnkAct=1 LnkBWMgmtStat=0 LnkAutoBWStat=0
AttnButPrsnt=0 PwrCtlrPrsnt=0 MRLSenPrsnt=0 AttnIdcPrsnt=0 PwrIdcPrsnt=0 HotPlgSprs=0 HotPlgCap=0
SltPwrLmtVal=0 SltPwrLmtScl=0 EleMchIntlckPrsnt=0 NoCmdCmpltSup=0 PhysSltNum=0
pcie 90: 00 00 00 00 1f 00 00 00 00 00 00 00 0e 00 00 00
pcie a0: 03 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
hsio 00: 00000033 crs_clear=0 cfg_ready=0 usb_phy_ref_clk_sel=0 usb_clock_module_en=1 pcie_clock_module_en=1
hsio 04: 00003001 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x00 en_core_clk=1 (Detect.Quiet)
hsio 08: 1fccc80c
hsio 0c: 80021000
hsio 10: 00000000 intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=0 hrd=0 ldd=0 lud=0
hsio 14: 00000000
hsio 18: 00000000
hsio 1c: 00000000
hsio 20: 00000000
hsio 24: 00000000
0.046131 hsio 04: 00003003 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x01 en_core_clk=1 (Detect.Active)
0.046252 hsio 04: 00003001 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x00 en_core_clk=1 (Detect.Quiet)

... lots of the same while powering on the IMX8M mini board ...

12.642193 hsio 04: 00003003 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x01 en_core_clk=1 (Detect.Active)
12.642288 hsio 04: 00003001 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x00 en_core_clk=1 (Detect.Quiet)
12.780612 hsio 04: 00003003 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x01 en_core_clk=1 (Detect.Active)
12.780725 hsio 04: 00003001 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x00 en_core_clk=1 (Detect.Quiet)
12.793195 hsio 04: 00003005 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x02 en_core_clk=1 (Poll.Active)
12.793279 hsio 04: 0000301f pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
12.793293 hsio 10: 00000001 intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=0 hrd=0 ldd=0 lud=1
Clearing LUD
12.793340 pcie 80: 00 00 12 10 00 00 00 00 00 00 00 00 00 00 00 00
ASPMCtl=0 RCB=0 LnkDis=0 RTrnLnk=0 ComClkCfg=0 ExtSync=0 EnClkPM=0 HWAutoWidthDis=0 LnkBWMgmtIntEn=0 LnkAutoBWIntEn=0 DRS=0
CurLnkSpd=2 NegLnkWidth=1 LnkTrn=0 SltClkCfg=0 DatLnkLyrLnkAct=1 LnkBWMgmtStat=0 LnkAutoBWStat=0
AttnButPrsnt=0 PwrCtlrPrsnt=0 MRLSenPrsnt=0 AttnIdcPrsnt=0 PwrIdcPrsnt=0 HotPlgSprs=0 HotPlgCap=0
SltPwrLmtVal=0 SltPwrLmtScl=0 EleMchIntlckPrsnt=0 NoCmdCmpltSup=0 PhysSltNum=0
12.793387 pcie a0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
12.793415 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
12.793425 hsio 10: 00000000 intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=0 hrd=0 ldd=0 lud=0
12.887882 hsio 04: 0000301f pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
12.887947 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
12.991200 hsio 04: 00002023 pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
12.991525 hsio 04: 0000201f pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
12.991564 pcie 70: 10 00 02 00 00 80 00 00 10 20 10 00 13 cc 43 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=0 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=0 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=7 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
12.991634 pcie 80: 40 00 12 10 00 00 00 00 00 00 00 00 00 00 00 00
ASPMCtl=0 RCB=0 LnkDis=0 RTrnLnk=0 ComClkCfg=1 ExtSync=0 EnClkPM=0 HWAutoWidthDis=0 LnkBWMgmtIntEn=0 LnkAutoBWIntEn=0 DRS=0
CurLnkSpd=2 NegLnkWidth=1 LnkTrn=0 SltClkCfg=0 DatLnkLyrLnkAct=1 LnkBWMgmtStat=0 LnkAutoBWStat=0
AttnButPrsnt=0 PwrCtlrPrsnt=0 MRLSenPrsnt=0 AttnIdcPrsnt=0 PwrIdcPrsnt=0 HotPlgSprs=0 HotPlgCap=0
SltPwrLmtVal=0 SltPwrLmtScl=0 EleMchIntlckPrsnt=0 NoCmdCmpltSup=0 PhysSltNum=0
12.991702 hsio 04: 00002023 pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)

And nothing changes after this - L0 state is steady, and doesn't go into Recovery or Detect+Poll. So apparently the validation test can be used with another IMX8 as the host, but not a PC.

Is there anyone who has connected IMX8M PCIe to a Intel/AMD PC with any success?

(I am in contact with FAE but I want to update community as well.)

0 Kudos

4,952 Views
pete_sensoray
Contributor II

I've made a little progress.  I found some discussion about the external OSC in this thread and decided to validate the pcie ext_ref_clkp/n signals near the m.2 connector on the development board.  The clock should have been 100MHz but I measured 97MHz, and when the host PC is powered off, the clock was still present!  The IMX8MP development board was also providing the ref clk from the SOC PLL, due to my device tree having "ext_osc=<0>". With both the host PC root complex and the IMX8MP endpoint providing the ref clk, if they were even a little bit out of sync then the LTSSM would be unstable.  I'm surprised L0 was stable with an IMX8MM board as the root complex, perhaps both boards are using the same type of oscillator and stayed well enough in sync.

I had tried "ext_osc=<1>" before but assumed it wasn't working because saw this timeout message in the dmesg log:

[ 0.000000] Kernel command line: console=ttymxc1,115200 console=tty1 root=/dev/mmcblk2p2 rootwait rw pcie_cz_enabled=yes
[ 0.000000] imx6q-pcie: Enable the i.MX PCIe compliance tests mode.
[ 0.177925] imx8-pcie-phy 32f00000.pcie-phy: failed to get imx pcie phy clock
[ 2.320981] imx6q-pcie 33800000.pcie_ep: supply epdev_on not found, using dummy regulator
[ 2.329445] imx6q-pcie 33800000.pcie_ep: EXT REF_CLK is used!.
[ 2.343684] imx6q-pcie 33800000.pcie_ep: PCIe PHY PLL clock is locked.
[ 2.398055] pcie phy pipe clk is not ready
[ 2.411195] phy phy-32f00000.pcie-phy.2: phy init failed --> -110
[ 2.423218] imx6q-pcie 33800000.pcie_ep: Waiting for PHY PLL ready timeout!
[ 2.456008] imx6q-pcie 33800000.pcie_ep: PCIe PLL lock timeout

This are my changes to the device tree:

/* Switch PCIE to endpoint mode */
&pcie {
status = "disabled";
};

&pcie_ep {
ext_osc = <1>;
status = "okay";
};

&pcie_phy {
ext_osc = <1>;
status = "okay";
};

But now the LTSSM state is stable in L0, and the memory access bit stays on the command register, and I'm able to run the pci_endpoint_test driver and program on the host PC... except that this only works on one of the two desktop PCs I have.

On the non-working desktop PC, an AMD Ryzen 5 CPU, the BIOS appears to probe the PCIe endpoint device and the LTSSM state goes to L0(0x11) and then back to Recovery.Lock/Speed before the host PC enters the bootloader (grub) and when Linux boots, the IMX8 endpoint device never shows up in 'lspci', and the LTSSM state never leaves Recovery.Lock.  If I try to read the PCIe register space 3380_0000, then the IMX8MP locks up, completely frozen.

The same problem occurs when working desktop PC is rebooted, an older Intel Core2 Quad CPU.  My pcie program log is as follows:

+ ./pcie
opening /dev/mem
GPR12 = 00000000
GPR_PCIE_DIAG_BUS_SEL=0
GPR_PCIE1_CTRL_DIAG_CTRL_BUS=0
GPR_PCIE1_CTRL_DIAG_STATUS_BUS_SELECT=0
GPR_PCIE1_CTRL_DEVICE_TYPE=0
GPR14 = 024c0400
GPR_PCIE_PHY_PLL_REF_CLK_SEL=IO (ext_ref_clkp/n)
GPR_PCIE_PHY_CTRL_BUS=12
GPR_PCIE_CLKREQ_B_OVERRIDE=0
GPR_PCIE_CLKREQ_B_OVERRIDE_EN=1
GPR_PCIE_REF_USE_PAD=0
GPR_PCIE_APP_CLK_PM_EN=0
pcie 00: 57 19 c0 81 00 00 10 00 00 00 00 ff 00 00 00 00
pcie 10: 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
pcie 20: 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie 30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 00 00
pcie 40: 01 50 c3 db 00 00 00 00 00 00 00 00 00 00 00 00
Version=3 PMEClock=0 ImmRdyRetD0=0 DSI=0 AuxCur=7 D1sup=1 D2sup=0 PMEsup=1b
PowerState=D0 NoSoftRst=0 DataSelect=0 DataScale=0 PMEstatus=0
pcie 50: 05 70 88 01 00 00 00 00 00 00 00 00 00 00 00 00
pcie 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie 70: 10 00 02 00 00 80 00 00 10 20 10 00 13 cc 41 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=0 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=0 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=3 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
pcie 80: 00 00 11 10 00 00 00 00 00 00 00 00 00 00 00 00
ASPMCtl=0 RCB=0 LnkDis=0 RTrnLnk=0 ComClkCfg=0 ExtSync=0 EnClkPM=0 HWAutoWidthDis=0 LnkBWMgmtIntEn=0 LnkAutoBWIntEn=0 DRS=0
CurLnkSpd=1 NegLnkWidth=1 LnkTrn=0 SltClkCfg=0 DatLnkLyrLnkAct=1 LnkBWMgmtStat=0 LnkAutoBWStat=0
AttnButPrsnt=0 PwrCtlrPrsnt=0 MRLSenPrsnt=0 AttnIdcPrsnt=0 PwrIdcPrsnt=0 HotPlgSprs=0 HotPlgCap=0
SltPwrLmtVal=0 SltPwrLmtScl=0 EleMchIntlckPrsnt=0 NoCmdCmpltSup=0 PhysSltNum=0
pcie 90: 00 00 00 00 1f 00 00 00 00 00 00 00 0e 00 00 00
pcie a0: 03 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
hsio 00: 00000033 crs_clear=0 cfg_ready=0 usb_phy_ref_clk_sel=0 usb_clock_module_en=1 pcie_clock_module_en=1
hsio 04: 00003000 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x00 en_core_clk=0 (Detect.Quiet)
hsio 08: 1fccc80c
hsio 0c: 80021000
hsio 10: 00000000 intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=0 hrd=0 ldd=0 lud=0
hsio 14: 00000000
hsio 18: 00000000
hsio 1c: 00000000
hsio 20: 00000000
hsio 24: 00000000
5.316399 hsio 04: 00003001 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x00 en_core_clk=1 (Detect.Quiet)
5.429923 hsio 04: 00003005 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x02 en_core_clk=1 (Poll.Active)
5.443983 hsio 04: 00003009 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x04 en_core_clk=1 (Poll.Config)
5.444048 hsio 04: 00003013 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x09 en_core_clk=1 (Config.Lanenum_Wait)
5.444061 hsio 10: 00000001 intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=0 hrd=0 ldd=0 lud=1
Clearing LUD
5.444087 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
5.444099 hsio 10: 00000000 intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=0 hrd=0 ldd=0 lud=0
5.444159 pcie 80: 00 00 12 10 00 00 00 00 00 00 00 00 00 00 00 00
ASPMCtl=0 RCB=0 LnkDis=0 RTrnLnk=0 ComClkCfg=0 ExtSync=0 EnClkPM=0 HWAutoWidthDis=0 LnkBWMgmtIntEn=0 LnkAutoBWIntEn=0 DRS=0
CurLnkSpd=2 NegLnkWidth=1 LnkTrn=0 SltClkCfg=0 DatLnkLyrLnkAct=1 LnkBWMgmtStat=0 LnkAutoBWStat=0
AttnButPrsnt=0 PwrCtlrPrsnt=0 MRLSenPrsnt=0 AttnIdcPrsnt=0 PwrIdcPrsnt=0 HotPlgSprs=0 HotPlgCap=0
SltPwrLmtVal=0 SltPwrLmtScl=0 EleMchIntlckPrsnt=0 NoCmdCmpltSup=0 PhysSltNum=0
5.444216 pcie a0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5.459470 pcie 70: 10 00 02 00 00 80 00 00 10 20 11 00 13 cc 41 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=0 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=1 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=3 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
8.844764 pcie 70: 10 00 02 00 00 80 28 00 10 20 11 00 13 cc 41 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=10 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=1 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=3 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
10.654075 hsio 04: 00002023 pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
10.661940 pcie 10: 04 00 af fe 00 00 00 00 04 00 ae fe 00 00 00 00
10.661968 pcie 20: 04 fc ad fe 00 00 00 00 00 00 00 00 00 00 00 00
10.661988 pcie 30: 00 00 ac fe 40 00 00 00 00 00 00 00 ff 01 00 00
10.665915 pcie 70: 10 00 02 00 00 80 28 00 10 20 11 00 13 cc 43 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=10 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=1 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=7 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
10.665982 pcie 80: 40 00 12 10 00 00 00 00 00 00 00 00 00 00 00 00
ASPMCtl=0 RCB=0 LnkDis=0 RTrnLnk=0 ComClkCfg=1 ExtSync=0 EnClkPM=0 HWAutoWidthDis=0 LnkBWMgmtIntEn=0 LnkAutoBWIntEn=0 DRS=0
CurLnkSpd=2 NegLnkWidth=1 LnkTrn=0 SltClkCfg=0 DatLnkLyrLnkAct=1 LnkBWMgmtStat=0 LnkAutoBWStat=0
AttnButPrsnt=0 PwrCtlrPrsnt=0 MRLSenPrsnt=0 AttnIdcPrsnt=0 PwrIdcPrsnt=0 HotPlgSprs=0 HotPlgCap=0
SltPwrLmtVal=0 SltPwrLmtScl=0 EleMchIntlckPrsnt=0 NoCmdCmpltSup=0 PhysSltNum=0
10.720495 pcie 10: 04 00 af fe fe ff ff ff 04 00 ae fe 00 00 00 00
10.720516 pcie 20: 04 ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00
10.720600 pcie 00: 57 19 c0 81 06 01 10 00 00 00 00 ff 08 00 00 00
10.720620 pcie 10: 04 00 af fe 00 00 00 00 04 00 ae fe 00 00 00 00
10.720641 pcie 20: 04 fc ad fe 00 00 00 00 00 00 00 00 00 00 00 00
10.720662 pcie 30: 00 00 ac fe 40 00 00 00 00 00 00 00 0a 01 00 00
10.720742 pcie 00: 57 19 c0 81 06 00 10 00 00 00 00 ff 08 00 00 00
19.707396 pcie 70: 10 00 02 00 00 80 28 00 10 20 19 00 13 cc 43 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=10 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=1 NFErrDet=0 FatErrDet=0 UnsReqDet=1 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=7 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0

<Intel host PC is rebooted>

87.639156 hsio 04: 0000201b pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x0d en_core_clk=1 (Recovery.Lock)
87.664385 hsio 04: 0000201d pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x0e en_core_clk=1 (Recovery.Speed)
87.664408 hsio 04: 0000201b pll_lock=1 dstate=0 l0s=0 l1=0 l1sub=0 ltssm_state=0x0d en_core_clk=1 (Recovery.Lock)
87.664471 pcie 80: 40 00 11 10 00 00 00 00 00 00 00 00 00 00 00 00
ASPMCtl=0 RCB=0 LnkDis=0 RTrnLnk=0 ComClkCfg=1 ExtSync=0 EnClkPM=0 HWAutoWidthDis=0 LnkBWMgmtIntEn=0 LnkAutoBWIntEn=0 DRS=0
CurLnkSpd=1 NegLnkWidth=1 LnkTrn=0 SltClkCfg=0 DatLnkLyrLnkAct=1

<IMX8MP is locked up here, and the host PC cannot see it on 'lspci'>

 

The pcie log from connected to the AMD Ryzen host PC:

+ ./pcie
opening /dev/mem
GPR12 = 00000000
GPR_PCIE_DIAG_BUS_SEL=0
GPR_PCIE1_CTRL_DIAG_CTRL_BUS=0
GPR_PCIE1_CTRL_DIAG_STATUS_BUS_SELECT=0
GPR_PCIE1_CTRL_DEVICE_TYPE=0
GPR14 = 024c0400
GPR_PCIE_PHY_PLL_REF_CLK_SEL=IO (ext_ref_clkp/n)
GPR_PCIE_PHY_CTRL_BUS=12
GPR_PCIE_CLKREQ_B_OVERRIDE=0
GPR_PCIE_CLKREQ_B_OVERRIDE_EN=1
GPR_PCIE_REF_USE_PAD=0
GPR_PCIE_APP_CLK_PM_EN=0
pcie 00: 57 19 c0 81 00 00 10 00 00 00 00 ff 00 00 00 00
pcie 10: 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
pcie 20: 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie 30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 00 00
pcie 40: 01 50 c3 db 00 00 00 00 00 00 00 00 00 00 00 00
Version=3 PMEClock=0 ImmRdyRetD0=0 DSI=0 AuxCur=7 D1sup=1 D2sup=0 PMEsup=1b
PowerState=D0 NoSoftRst=0 DataSelect=0 DataScale=0 PMEstatus=0
pcie 50: 05 70 88 01 00 00 00 00 00 00 00 00 00 00 00 00
pcie 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie 70: 10 00 02 00 00 80 00 00 10 20 10 00 13 cc 41 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=0 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=0 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=3 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
pcie 80: 00 00 11 10 00 00 00 00 00 00 00 00 00 00 00 00
ASPMCtl=0 RCB=0 LnkDis=0 RTrnLnk=0 ComClkCfg=0 ExtSync=0 EnClkPM=0 HWAutoWidthDis=0 LnkBWMgmtIntEn=0 LnkAutoBWIntEn=0 DRS=0
CurLnkSpd=1 NegLnkWidth=1 LnkTrn=0 SltClkCfg=0 DatLnkLyrLnkAct=1 LnkBWMgmtStat=0 LnkAutoBWStat=0
AttnButPrsnt=0 PwrCtlrPrsnt=0 MRLSenPrsnt=0 AttnIdcPrsnt=0 PwrIdcPrsnt=0 HotPlgSprs=0 HotPlgCap=0
SltPwrLmtVal=0 SltPwrLmtScl=0 EleMchIntlckPrsnt=0 NoCmdCmpltSup=0 PhysSltNum=0
pcie 90: 00 00 00 00 1f 00 00 00 00 00 00 00 0e 00 00 00
pcie a0: 03 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
pcie f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
hsio 00: 00000033 crs_clear=0 cfg_ready=0 usb_phy_ref_clk_sel=0 usb_clock_module_en=1 pcie_clock_module_en=1
hsio 04: 00003000 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x00 en_core_clk=0 (Detect.Quiet)
hsio 08: 1fccc80c
hsio 0c: 80021000
hsio 10: 00000000 intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=0 hrd=0 ldd=0 lud=0
hsio 14: 00000000
hsio 18: 00000000
hsio 1c: 00000000
hsio 20: 00000000
hsio 24: 00000000

<AMD Ryzen PC powered on>

3.880166 hsio 04: 00003001 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x00 en_core_clk=1 (Detect.Quiet)
3.892774 hsio 04: 00003005 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x02 en_core_clk=1 (Poll.Active)
3.917982 hsio 04: 00003007 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x03 en_core_clk=1 (Poll.Compliance)
4.587264 hsio 04: 00003005 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x02 en_core_clk=1 (Poll.Active)
4.587327 hsio 04: 00003009 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x04 en_core_clk=1 (Poll.Config)
4.587383 hsio 04: 00003013 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x09 en_core_clk=1 (Config.Lanenum_Wait)
4.587402 hsio 04: 0000301f pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
4.587429 hsio 04: 0000301b pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0d en_core_clk=1 (Recovery.Lock)
4.587444 pcie a0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
4.587462 hsio 04: 0000301f pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0f en_core_clk=1 (Recovery.Rcvrcfg)
4.587493 hsio 04: 00003023 pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x11 en_core_clk=1 (L0)
4.587504 hsio 10: 00000001 intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=0 hrd=0 ldd=0 lud=1
Clearing LUD
4.587532 hsio 10: 00000000 intm=0 inte=0 me=0 pct=0 pcac=0 cdnsc=0 urep=0 pto=0 hrd=0 ldd=0 lud=0
4.587581 pcie 70: 10 00 02 00 00 80 68 00 10 20 10 00 13 cc 41 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=26 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=0 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=3 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
4.587655 pcie 80: 00 00 12 10 00 00 00 00 00 00 00 00 00 00 00 00
ASPMCtl=0 RCB=0 LnkDis=0 RTrnLnk=0 ComClkCfg=0 ExtSync=0 EnClkPM=0 HWAutoWidthDis=0 LnkBWMgmtIntEn=0 LnkAutoBWIntEn=0 DRS=0
CurLnkSpd=2 NegLnkWidth=1 LnkTrn=0 SltClkCfg=0 DatLnkLyrLnkAct=1 LnkBWMgmtStat=0 LnkAutoBWStat=0
AttnButPrsnt=0 PwrCtlrPrsnt=0 MRLSenPrsnt=0 AttnIdcPrsnt=0 PwrIdcPrsnt=0 HotPlgSprs=0 HotPlgCap=0
SltPwrLmtVal=0 SltPwrLmtScl=0 EleMchIntlckPrsnt=0 NoCmdCmpltSup=0 PhysSltNum=0
4.643051 pcie 70: 10 00 02 00 00 80 68 00 10 20 11 00 13 cc 41 00
CapVer=2 Dev/PortType=0 SlotImp=0 IntrMsgNum=0
MaxPaySize=0 PhanFunc=0 ExtTagFld=0 EPL0sAccLat=0 EPL1AccLat=0 RBErrRpt=1 CapSlotPwrLmtVal=0 Scl=26 FuncLvlRstCap=0
CoErrRepEn=0 NFErrRepEn=0 FatErrRepEn=0 UnsupReqRepEn=0 EnRlxOrd=1 MaxPldSiz=0
ExtTagFldEn=0 PhanFuncEn=0 AuxPwrPMEn=0 EnNoSnoop=0 MaxRdReqSiz=2 BCREn/IFLRst=0
CorErrDet=1 NFErrDet=0 FatErrDet=0 UnsReqDet=0 AuxPwrDet=1 TxactPend=0 EmgPwrRdcDet=0
MaxLnkSpd=3 MaxLnkWidth=1 ASPMSup=3 L0sExtLat=4 L1ExtLat=3 ClkPowMgt=0 SprDnErrRepCap=0
DatLnkLyrLnkActRepCap=0 LnkBWNotCap=0 ASPMOptCmpLnkBWNotCap=1 PortNum=0
4.643125 hsio 04: 0000301b pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0d en_core_clk=1 (Recovery.Lock)
4.668322 hsio 04: 0000301d pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0e en_core_clk=1 (Recovery.Speed)
4.668345 hsio 04: 0000301b pll_lock=1 dstate=4 l0s=0 l1=0 l1sub=0 ltssm_state=0x0d en_core_clk=1 (Recovery.Lock)
4.668440 pcie 80: 00 00 11 10 00 00 00 00 00 00 00 00 00 00 00 00
ASPMCtl=0 RCB=0 LnkDis=0 RTrnLnk=0 ComClkCfg=0 ExtSync=0 EnClkPM=0 HWAutoWidthDis=0 LnkBWMgmtIntEn=0 LnkAutoBWIntEn=0 DRS=0
CurLnkSpd=1 NegLnkWidth=1 LnkTrn=0 SltClkCfg=0 DatLnkLyrLnkAct=1 LnkBWMgmtStat=0 LnkAutoBWStat=0
AttnButPrsnt=0 PwrCtlrPrsnt=0 MRLSenPrsnt=0 AttnIdcPrsnt=0 PwrIdcPrsnt=0 HotPlgSprs=0 HotPlgCap=0
SltPwrLmtVal=0 SltPwrLmtScl=0 EleMchIntlckPrsnt=0 NoCmdCmpltSup=0 PhysSltNum=0
4.668498 pcie a0: 03 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00

<IMX8MP is locked up here, and the host PC cannot see it on 'lspci'>

 

0 Kudos

4,921 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @pete_sensoray 

I hope you are doing well.

Please accept my apologies for delayed response.

After lots of verification, We found like this issue of went PCIE into recovery mode is a known limitation of Intel PCIE which is used in PC. Please find the reference link.

Thanks & Regards

Sanket Parekh

0 Kudos

4,917 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @pete_sensoray 

As a workaround, you can change the max link speed (Gen) of the PCIe slot from Gen3 to Gen2 in your Host PC's BIOS Advanced Configurations.

Thanks & Regards

Sanket Parekh

0 Kudos

5,142 Views
pete_sensoray
Contributor II

Alternatively, is it possible to get access to the documentation for the Synopsis Designware PCIE used in the IMX8MP?

0 Kudos

3,923 Views
lm_8086
Contributor I
@pete_sensorayhow you managed to resolve this dmesg message: [ 2.611260] imx6q-pcie 33800000.pcie_ep: invalid resource I see this on my case on my embedded Linux configured as PCIe Endpoint device.
0 Kudos

3,906 Views
pete_sensoray
Contributor II

I did not resolve this message.  It is not fatal, so I ignore it for now.  I did a little sleuthing, and it is coming from this line in drivers/pci/controller/dwc/pcie-designware.c:dw_pcie_setup()

		if (!pci->atu_base)
			pci->atu_base =
			    devm_platform_ioremap_resource_byname(pdev, "atu");
		if (IS_ERR(pci->atu_base))
			pci->atu_base = pci->dbi_base + DEFAULT_DBI_ATU_OFFSET;

Seems to me that it is looking for "atu" in the device tree, but if it cannot find it, the devm_platform_ioremap_resource_byname prints "invalid resource".  The next line checks the error in that case and uses the base plus the default offset.  So it seems fine, just annoying when looking at the kernel log.

0 Kudos

3,876 Views
lm_8086
Contributor I

I have added log message if resource (res) is null, and got the log line on dmesg:

[ 2.539342] imx6q-pcie 33800000.pcie_ep: supply epdev_on not found, using dummy regulator
[ 2.542931] imx-cpufreq-dt imx-cpufreq-dt: cpu speed grade 2 mkt segment 2 supported-hw 0x4 0x4
[ 2.551247] imx6q-pcie 33800000.pcie_ep: PLL REF_CLK is used!.
[ 2.563955] imx-drm 32c00000.bus:display-subsystem: bound imx-lcdif-crtc.0 (ops 0xffffffc011013c08)
[ 2.566354] imx6q-pcie 33800000.pcie_ep: PCIe PLL locked after 20 us.
[ 2.574948] imx_sec_dsim_drv 32e10000.mipi_dsi: version number is 0x1060200
[ 2.581163] imx6q-pcie 33800000.pcie_ep: res is null!
[ 2.588034] imx_sec_dsim_drv 32e10000.mipi_dsi: Failed to attach bridge: 32e10000.mipi_dsi
[ 2.593057] imx6q-pcie 33800000.pcie_ep: invalid resource

and it relates to pci-imx6.c in dwc:

lm_8086_0-1688677404363.png

I did not found IS_ERR macro definition (maybe it is a function?) but found in Documentation.

It seems it returns TRUE if pci->dbi_base is above ((unsigned long)(-1000)) so if it is NULL (0) then it will not return with PTR_ERROR.

Thanks for quick answer - now I am fighting why my device with IMX8MM uC is in D3 and not D0.

 

0 Kudos

3,871 Views
pete_sensoray
Contributor II

IS_ERR lives in "include/linux/err.h" as an inline function, which calls the macro IS_ERR_VALUE().  It uses a different value than the documentation (-1000) but uses the same scheme.

/*
 * Kernel pointers have redundant information, so we can use a
 * scheme where we can return either an error code or a normal
 * pointer with the same return value.
 *
 * This should be a per-architecture thing, to allow different
 * error and pointer decisions.
 */
#define MAX_ERRNO       4095

#ifndef __ASSEMBLY__

#define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)

<snip>

static inline bool __must_check IS_ERR(__force const void *ptr)
{
        return IS_ERR_VALUE((unsigned long)ptr);
}

 

What are you using for your the PCI config registers? Please let me know if you find a solution to the D3 state.  I think that is what is preventing me from using the IMX8MP endpoint in my AMD system.

0 Kudos

3,836 Views
lm_8086
Contributor I

Windows 10 Pro show error code 28 (1C) which means driver is not installed. I have assumption that driver sets Power Management Control and Status Registers bitfield to D0:

6.6. Power Management Capability Structure (intel.com)

I will try to write such driver, and as starting point I chosen book:

Mastering Linux Device Driver Development | Packt (packtpub.com)

(Chapter 11: Writing PCI Device Drivers)

0 Kudos

3,825 Views
lm_8086
Contributor I

Actually this fragment will return in following fragment:

lm_8086_0-1688715499795.png

so pcie_probe will not be fully executed ((unsigned long) -EINVAL >= (unsigned long) -MAX_ERRNO) since MAX_ERRNO > EINVAL.

 

0 Kudos

3,816 Views
pete_sensoray
Contributor II

Are you using the correct DTS file?  On mine, it includes the arch/arm64/boot/dts/freescale/imx8mp.dtsi (yours is probably using imx8mm.dtsi) which has this node:

 

		pcie_ep: pcie_ep@33800000 {
			compatible = "fsl,imx8mp-pcie-ep";
			reg = <0x33800000 0x000400000>, <0x18000000 0x08000000>;
			reg-names = "regs", "addr_space";

 

This is what gets read for platform_get_resource(pdev, IORESOURCE_MEM, 0) and the dbi_base->start and dbi_base->end correspond to the first pair on the "reg = " line.  You could print the values using

pr_info("dbi_base=%p start=%llx end=%llx\n", dbi_base, dbi_base ? dbi_base->start : 0, dbi_base ? dbi_base->end : 0);

between the platform_get_resource and devm_ioremap_resource calls.

 

0 Kudos

3,574 Views
lm_8086
Contributor I

Ok got to the point where my device is seen via lspci but /dev node is not created. What shall I do to see device in /dev subtree? Output of lspci -vxxxx -d 0x1957:0x0809:

02:00.0 Unassigned class [ff00]: Freescale Semiconductor Inc Device 0809
Physical Slot: 1-1
Flags: fast devsel, IRQ 255
Memory at df200000 (32-bit, non-prefetchable) [disabled] [size=64K]
Memory at df210000 (32-bit, non-prefetchable) [disabled] [size=64K]
Memory at df240000 (32-bit, non-prefetchable) [disabled] [size=256]
Memory at df220000 (32-bit, non-prefetchable) [disabled] [size=64K]
Expansion ROM at df230000 [virtual] [disabled] [size=64K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/16 Maskable+ 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] L1 PM Substates
00: 57 19 09 08 00 00 10 00 00 00 00 ff 00 00 00 00
10: 00 00 20 df 00 00 00 00 00 00 21 df 00 00 00 00
20: 00 00 24 df 00 00 22 df 00 00 00 00 00 00 00 00
30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 00 00
40: 01 50 c3 db 00 00 00 00 00 00 00 00 00 00 00 00
50: 05 70 88 01 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 10 00 02 00 00 80 e8 07 10 20 11 00 12 cc 43 00
80: 40 00 11 10 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 1f 00 00 00 00 00 00 00 06 00 00 00
a0: 02 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
100: 01 00 82 14 00 00 00 00 00 00 40 00 30 20 46 00
110: 01 00 00 00 00 e0 00 00 a0 00 00 00 00 00 00 00
120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
140: 00 00 00 00 00 00 00 00 1e 00 01 00 1b 0a 28 00
150: 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00
160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
410: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
4a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
4b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
4c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
4d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
4e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
4f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
610: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
630: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
640: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
700: 3b 00 b1 00 ff ff ff ff 04 00 00 00 00 2c 2c 1b
710: 20 01 01 00 00 00 00 00 00 c0 00 00 40 01 00 00
720: 00 00 00 00 01 00 00 00 11 e2 41 03 10 00 00 08
730: c0 00 03 00 01 00 02 00 ff ff 0f 00 00 00 00 00
740: 0f 00 00 00 00 00 00 00 19 c0 20 45 03 c0 20 05
750: 00 00 80 05 00 00 00 00 00 00 00 00 00 00 00 00
760: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
800: 00 00 00 00 00 00 00 00 00 00 00 00 2c 01 00 00
810: 00 00 00 00 00 00 00 00 00 00 00 00 7f 00 00 00
820: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
840: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
860: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
870: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
880: 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00
890: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
8a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
8b0: 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
8c0: 00 00 00 00 37 02 00 00 00 00 00 00 01 00 00 ff
8d0: 00 9c 00 00 32 00 00 00 00 00 00 00 00 00 00 00
8e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
8f0: 00 00 00 00 00 00 00 00 2a 30 30 35 2a 2a 61 67
900: ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00
910: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
920: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
930: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
940: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
950: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
960: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
970: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
990: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
9a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
9b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
9c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
9d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
9e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
9f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a60: 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff
a70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
aa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ab0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ac0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ad0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ae0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
af0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b40: 0a 00 00 00 d2 00 00 00 00 00 00 00 00 00 00 00
b50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ba0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
bb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
bc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
bd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
be0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
bf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ca0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
cb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
cc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
cd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ce0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
cf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
da0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
db0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
dc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
dd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
de0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
df0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ea0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
eb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ef0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
fa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0 Kudos

3,805 Views
lm_8086
Contributor I

I will do that test but not today. Thanks for input. I am using imx8mm.dtsi files which has:

pcie0_ep: pcie_ep@33800000 {
compatible = "fsl,imx8mm-pcie-ep";
reg = <0x33800000 0x000400000>,
<0x18000000 0x08000000>;
reg-names = "regs", "addr_space";
num-lanes = <1>;
interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; /* eDMA */
interrupt-names = "dma";
fsl,max-link-speed = <2>;
power-domains = <&pcie_pd>;
resets = <&src IMX8MQ_RESET_PCIEPHY>,
<&src IMX8MQ_RESET_PCIE_CTRL_APPS_EN>,
<&src IMX8MQ_RESET_PCIE_CTRL_APPS_CLK_REQ>,
<&src IMX8MQ_RESET_PCIE_CTRL_APPS_TURNOFF>;
reset-names = "pciephy", "apps", "clkreq", "turnoff";
fsl,imx7d-pcie-phy = <&pcie_phy>;
num-ib-windows = <4>;
num-ob-windows = <4>;
status = "disabled";
};

in original dts file I do:

&pcie_phy {
#phy-cells = <0>;
ext_osc = <0>;
status = "okay";
};

&pcie0_ep {
/* pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pcie0>;
*/
clocks = <&clk IMX8MM_CLK_PCIE1_ROOT>,
<&clk IMX8MM_CLK_PCIE1_AUX>,
<&clk IMX8MM_CLK_PCIE1_PHY>,
<&pcie0_refclk>;
clock-names = "pcie", "pcie_aux", "pcie_phy", "pcie_bus";
assigned-clocks = <&clk IMX8MM_CLK_PCIE1_AUX>,
<&clk IMX8MM_CLK_PCIE1_PHY>,
<&clk IMX8MM_CLK_PCIE1_CTRL>;
assigned-clock-rates = <10000000>, <100000000>, <250000000>;
assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_50M>,
<&clk IMX8MM_SYS_PLL2_100M>,
<&clk IMX8MM_SYS_PLL2_250M>;
ext_osc = <0>;
l1ss-disabled;
status = "okay";
};

Anything wrong with both files? Hints kindly appreciated.

0 Kudos

3,758 Views
lm_8086
Contributor I

I have added following loggers to pci-imx6.c:


    u32 i;
    dev_info(dev, "Num resources %d\n", pdev->num_resources);
    for (i = 0; i < pdev->num_resources; i++) {
        struct resource *r = &pdev->resource[i];
        dev_info(dev, "Resource type = %llx\n", resource_type(r));
        dev_info(dev, "Resource ptr = %p start=%llx end=%llx\n", r, r->start, r->end);
    }

    dbi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
    pci->dbi_base = devm_ioremap_resource(dev, dbi_base);
    if (IS_ERR(pci->dbi_base))
        return PTR_ERR(pci->dbi_base);
 
[ 2.541013] SoC: i.MX8MM revision 1.0
[ 2.541360] imx6q-pcie 33800000.pcie_ep: Num resources 3
[ 2.544996] imx-cpufreq-dt imx-cpufreq-dt: cpu speed grade 2 mkt segment 2 supported-hw 0x4 0x4
[ 2.550022] imx6q-pcie 33800000.pcie_ep: Resource type = 200
[ 2.550030] imx6q-pcie 33800000.pcie_ep: Resource ptr = 000000008bb02703 start=33800000 end=33bfffff
[ 2.563663] imx-drm 32c00000.bus:display-subsystem: bound imx-lcdif-crtc.0 (ops 0xffffffc011060f68)
[ 2.564427] imx6q-pcie 33800000.pcie_ep: Resource type = 200
[ 2.573951] imx_sec_dsim_drv 32e10000.mipi_dsi: version number is 0x1060200
[ 2.582630] imx6q-pcie 33800000.pcie_ep: Resource ptr = 00000000ad1c6142 start=18000000 end=1fffffff
[ 2.588355] imx_sec_dsim_drv 32e10000.mipi_dsi: Failed to attach bridge: 32e10000.mipi_dsi
[ 2.595286] imx6q-pcie 33800000.pcie_ep: Resource type = 400
[ 2.604414] imx_sec_dsim_drv 32e10000.mipi_dsi: failed to bind sec dsim bridge: -517
[ 2.608514] pps pps0: new PPS source ptp0
[ 2.612727] imx6q-pcie 33800000.pcie_ep: Resource ptr = 00000000275e800e start=3e end=3e
[ 2.638664] imx6q-pcie 33800000.pcie_ep: supply epdev_on not found, using dummy regulator
[ 2.639138] fec 30be0000.ethernet: Invalid MAC address: 00:00:00:00:00:00
[ 2.647264] imx6q-pcie 33800000.pcie_ep: PLL REF_CLK is used!.
[ 2.653715] fec 30be0000.ethernet: Using random MAC address: ee:e9:b9:10:f9:7d
[ 2.660439] imx6q-pcie 33800000.pcie_ep: PCIe PLL locked after 20 us.
[ 2.667963] libphy: fec_enet_mii_bus: probed
[ 2.673375] imx6q-pcie 33800000.pcie_ep: invalid resource
 
Now I will add your proposed logger, but it seems that invalid resource is coming out of probe function (I assume it is in deassert level).
Tags (1)
0 Kudos

3,655 Views
lm_8086
Contributor I

I had two problems:

1) my vendorid:deviceid was not handled by pci_endpoint_test driver (vendor was OK as NXP 0x1957 but device id was 0x0809 and pci_endpoint_test_driver was assuming 0x81c0).

2) ext_osc = <0> - this was a problem also that moved my device to D3, Changed it to ext_osc = <1> and created systemd service which sets all necessary parameters like deviceid, msi_interrups and msxi_interrupts and baseclass_code since (vendorid was set in pci-epf-test since I modified it):

 

[ 47.662400] pci-endpoint-test 0000:02:00.0: enabling device (0000 -> 0002)
lukasz@lukasz-Precision-T1700:~$ sudo lspci -vxxx -d 0x1957:0x81c0
02:00.0 Unassigned class [ff00]: Freescale Semiconductor Inc Device 81c0
Physical Slot: 1-1
Flags: bus master, fast devsel, latency 0, IRQ 35
Memory at df200000 (32-bit, non-prefetchable) [size=64K]
Memory at df210000 (32-bit, non-prefetchable) [size=64K]
Memory at df240000 (32-bit, non-prefetchable) [size=256]
Memory at df220000 (32-bit, non-prefetchable) [size=64K]
Expansion ROM at df230000 [virtual] [disabled] [size=64K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable+ Count=16/16 Maskable+ 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] L1 PM Substates
Kernel driver in use: pci-endpoint-test
00: 57 19 c0 81 06 04 10 00 00 00 00 ff 00 00 00 00
10: 00 00 20 df 00 00 00 00 00 00 21 df 00 00 00 00
20: 00 00 24 df 00 00 22 df 00 00 00 00 00 00 00 00
30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 00 00
40: 01 50 c3 db 00 00 00 00 00 00 00 00 00 00 00 00
50: 05 70 c9 01 18 04 e0 fe 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 10 00 02 00 00 80 e8 07 10 20 11 00 12 cc 43 00
80: 40 00 11 10 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 1f 00 00 00 00 00 00 00 06 00 00 00
a0: 02 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

lukasz@lukasz-Precision-T1700:~$ sudo -E hw-probe -probe
Probe for hardware ... Ok
Reading logs ... grep: (standard input): binary file matches
Ok
Local probe path: /root/HW_PROBE/LATEST/hw.info
lukasz@lukasz-Precision-T1700:~$ sudo hw-probe --show --verbose

Host Info
=========

System: ubuntu-22.04
Arch: x86_64
Kernel: 5.19.17
Vendor: Dell Inc.
Model: 0TDG4V A01
Year: 2017
Type: space-saving
Hwaddr: 556ad18fac78ffa9708bdf4de5b14dcb


Devices (43)
============

+------+---------------------+----------+------------------+-------------------------------------+--------------+------------+----------+
| Bus | ID | Class | Vendor | Device | Type | Driver | Status |
+------+---------------------+----------+------------------+-------------------------------------+--------------+------------+----------+
| PCI | 8086-041a-1028-05a6 | 03-00 | Intel Corpora... | Xeon E3-1200 v3 Processor Integr... | graphics ... | i915 | works |
| PCI | 8086-0c0c-1028-05a6 | 04-03 | Intel Corpora... | Xeon E3-1200 v3/4th Gen Core Pro... | sound | snd_hda... | detected |
| PCI | 8086-8c20-1028-05a6 | 04-03 | Intel Corpora... | 8 Series/C220 Series Chipset Hig... | sound | snd_hda... | detected |
| PCI | 8086-153a-1028-05a6 | 02-00 | Intel Corpora... | Ethernet Connection I217-LM | network | e1000e | works |
| PCI | 8086-8c02-1028-05a6 | 01-06-01 | Intel Corpora... | 8 Series/C220 Series Chipset Fam... | storage | ahci | works |
| PCI | 8086-0c08-1028-05a6 | 06-00 | Intel Corpora... | Xeon E3-1200 v3 Processor DRAM C... | bridge | ie31200... | detected |
| PCI | 8086-8c10-1028-05a6 | 06-04 | Intel Corpora... | 8 Series/C220 Series Chipset Fam... | bridge | pcieport | detected |
| PCI | 8086-8c18-1028-05a6 | 06-04 | Intel Corpora... | 8 Series/C220 Series Chipset Fam... | bridge | pcieport | detected |
| PCI | 8086-8c56-1028-05a6 | 06-01 | Intel Corpora... | C226 Series Chipset Family Serve... | bridge | lpc_ich | detected |
| PCI | 8086-8c3a-1028-05a6 | 07-80 | Intel Corpora... | 8 Series/C220 Series Chipset Fam... | communica... | mei_me | detected |
| PCI | 8086-8c3d-1028-05a6 | 07-00-02 | Intel Corpora... | 8 Series/C220 Series Chipset Fam... | serial co... | serial | detected |
| PCI | 8086-8c22-1028-05a6 | 0c-05 | Intel Corpora... | 8 Series/C220 Series Chipset Fam... | smbus | i2c_i801 | detected |
| PCI | 1957-81c0 | ff-00 | Freescale Sem... | | unassigne... | pci_end... | detected |
| PCI | 8086-8c26-1028-05a6 | 0c-03-20 | Intel Corpora... | 8 Series/C220 Series Chipset Fam... | usb contr... | ehci_pci | detected |
| PCI | 8086-8c2d-1028-05a6 | 0c-03-20 | Intel Corpora... | 8 Series/C220 Series Chipset Fam... | usb contr... | ehci_pci | detected |
| PCI | 8086-8c31-1028-05a6 | 0c-03-30 | Intel Corpora... | 8 Series/C220 Series Chipset Fam... | usb contr... | xhci_pci | detected |
| USB | 0bda-5453 | 11-00-00 | Realtek Semic... | BillBoard Device | | | failed |
| USB | 045b-0209 | 09-00-00 | Hitachi, Ltd | Hub | hub | hub | detected |
| USB | 045b-0210 | 09-00-00 | Hitachi, Ltd | Hub | hub | hub | detected |
| USB | 1d6b-0002 | 09-00-00 | Linux Foundation | 2.0 root hub | hub | hub | detected |
| USB | 1d6b-0002 | 09-00-00 | Linux Foundation | 2.0 root hub | hub | hub | detected |
| USB | 1d6b-0002 | 09-00-00 | Linux Foundation | 2.0 root hub | hub | hub | detected |
| USB | 1d6b-0003 | 09-00-00 | Linux Foundation | 3.0 root hub | hub | hub | detected |
| USB | 8087-8000 | 09-00-00 | Intel Corp. | Integrated Rate Matching Hub | hub | hub | detected |
| USB | 8087-8008 | 09-00-00 | Intel Corp. | Integrated Rate Matching Hub | hub | hub | detected |
| USB | 046d-c534 | 03-01-01 | Logitech, Inc. | Unifying Receiver | keyboard | usbhid | detected |
| USB | 2341-0061 | 02-02-01 | Arduino SA | Portenta X8 | modem | | failed |
| EISA | benq-bnq802e | | BenQ | PD2700U BNQ802E 3840x2160 597x33... | monitor | | works |
| SYS | dell-a22-05-05-2017 | | Dell Inc. | BIOS A22 05/05/2017 | bios | | works |
| SYS | intel-6-60-3-xeo... | | Intel | Xeon CPU E3-1246 v3 @ 3.50GHz | cpu | | works |
| SYS | intel-6-60-3-xeo... | | Intel | Xeon CPU E3-1246 v3 @ 3.50GHz | cpu | | works |
| SYS | intel-6-60-3-xeo... | | Intel | Xeon CPU E3-1246 v3 @ 3.50GHz | cpu | | works |
| SYS | intel-6-60-3-xeo... | | Intel | Xeon CPU E3-1246 v3 @ 3.50GHz | cpu | | works |
| SYS | intel-6-60-3-xeo... | | Intel | Xeon CPU E3-1246 v3 @ 3.50GHz | cpu | | works |
| SYS | intel-6-60-3-xeo... | | Intel | Xeon CPU E3-1246 v3 @ 3.50GHz | cpu | | works |
| SYS | intel-6-60-3-xeo... | | Intel | Xeon CPU E3-1246 v3 @ 3.50GHz | cpu | | works |
| SYS | intel-6-60-3-xeo... | | Intel | Xeon CPU E3-1246 v3 @ 3.50GHz | cpu | | works |
| SYS | hynix-hyundai-hm... | | Hynix/Hyundai | RAM HMT451U7BFR8A-PB 4GB DIMM DD... | memory | | works |
| SYS | hynix-hyundai-hm... | | Hynix/Hyundai | RAM HMT451U7BFR8A-PB 4GB DIMM DD... | memory | | works |
| SYS | nanya-nt4gc64b8h... | | Nanya | RAM NT4GC64B8HG0NF-DI 4GB DIMM D... | memory | | works |
| SYS | samsung-m378b527... | | Samsung | RAM M378B5273DH0-CK0 4GB DIMM DD... | memory | | works |
| SYS | dell-0tdg4v-a01 | | Dell Inc. | Motherboard 0TDG4V A01 | motherboard | | works |
| IDE | goodram-ssdpr-cx... | | GOODRAM | SSDPR-CX400-512-G2 512GB | disk | ahci, sd | works |
+------+---------------------+----------+------------------+-------------------------------------+--------------+------------+----------+

0 Kudos

3,581 Views
pete_sensoray
Contributor II

Looks like you are making progress faster than I did almost a year ago.  Sorry for the slow replies; it has been quite some time since I've worked on the PCIe component. Very soon I will need to get back up to speed and finish our product that uses the IMX8MP.  The ext_osc=<1> is very important for using PCIe endpoint mode, since the root/host provides the clock.  When both ends are trying to provide the clock, weird behavior will result that makes debugging very difficult!

Let me know if you are planning to use PCIe DMA.  I will clean up and share a patch that I made to add a DMA function.

0 Kudos

3,347 Views
lm_8086
Contributor I

Pete I am interested in DMA mode over PCIe. If you can please share a patches or send me directly on my email: lmatuszews@gmail.com

0 Kudos

3,561 Views
lm_8086
Contributor I

The test program has a option to enable dma but it does not work. Without this switch -d I successfully run some tests. When I run pcitest.sh couple of times (pcitest elf binary has u+s mode so it runs on root) on my user account kernel panic happens at 5th to 10th successful run of pcitest.sh. Did you had similar issue? My Endpoint device works and I can ssh to it and nothing wrong with it happens I guess.

0 Kudos