can't open PCI Endpoint Test device

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

can't open PCI Endpoint Test device

8,403 Views
muaxi8
Contributor V

 

I have two lX2080A custom boards, one of which is rc and the other is EP.

Currently, ep devices can be discovered at the RC side.

But the PCITest failed: can't open PCI Endpoint Test device: No such file or directory.

Ep Device log and  RC Device log is in the attachment.

my reference:

https://community.nxp.com/t5/QorIQ-Knowledge-Base/LS1046A-RDB-in-PCIe-Endpoint-Mode/ta-p/1107415

linux\linux\Documentation\PCI\endpoint\pci-test-howto.txt

The lspci -v information is as follows:

root@localhost:~# lspci -v
0000:00:00.0 PCI bridge: Freescale Semiconductor Inc Device 8d82 (rev 20) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 369
Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/32 Maskable+ 64bit+
Capabilities: [70] Express Root Port (Slot-), MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] #19
Kernel driver in use: pcieport

0001:00:00.0 PCI bridge: Freescale Semiconductor Inc Device 8d82 (rev 20) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 370
Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/32 Maskable+ 64bit+
Capabilities: [70] Express Root Port (Slot-), MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] #19
Kernel driver in use: pcieport

......

.......

0004:00:00.0 PCI bridge: Freescale Semiconductor Inc Device 8d82 (rev 20) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 373
Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
Memory behind bridge: 40000000-417fffff
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/32 Maskable+ 64bit+
Capabilities: [70] Express Root Port (Slot-), MSI 00
Capabilities: [b0] MSI-X: Enable- Count=8 Masked-
Capabilities: [100] Advanced Error Reporting
Capabilities: [158] #19
Kernel driver in use: pcieport

0004:01:00.0 Unassigned class [ff00]: Freescale Semiconductor Inc Device 8d82
Flags: bus master, fast devsel, latency 0, IRQ 255
Memory at a041020600 (32-bit, non-prefetchable) [size=256]
Memory at a041020400 (32-bit, non-prefetchable) [size=512]
Memory at a041020000 (64-bit, non-prefetchable) [size=1K]
Memory at a041000000 (64-bit, non-prefetchable) [size=128K]
Expansion ROM at a040000000 [disabled] [size=16M]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/2 Maskable+ 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] #19
Capabilities: [168] Address Translation Service (ATS)

0005:00:00.0 PCI bridge: Freescale Semiconductor Inc Device 8d82 (rev 20) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 374
Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/32 Maskable+ 64bit+
Capabilities: [70] Express Root Port (Slot-), MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] #19
Kernel driver in use: pcieport

 

root@localhost:~# ./pcitest
can't open PCI Endpoint Test device: No such file or directory
root@localhost:~#

 

Does this device "/dev/pci-endpoint-test.0" exist?  If it exists, is it on the RC side or ep side? I did not

find this device on either side.

0 Kudos
7 Replies

8,395 Views
yipingwang
NXP TechSupport
NXP TechSupport

/dev/pci-endpoint-test.0 is on the RC side, please check whether you configured "CONFIG_PCI_ENDPOINT_TEST" in RC Kernel configuration file.

Please refer to section "7.2.8.4 PCIe Endpoint Mode Linux driver" in LSDK 21.08 user manual to do testing.

Please refer to the following procedure.

1. Kernel configuration.

RC:

CONFIG_PCI=y

CONFIG_PCI_ENDPOINT_TEST=y

EP:

CONFIG_PCI=y

CONFIG_PCI_ENDPOINT=y

CONFIG_PCI_ENDPOINT_CONFIGFS=y

CONFIG_PCI_EPF_TEST=y

CONFIG_PCI_LAYERSCAPE_EP=y

2. Please configure the following in PCIe EP RCW file.

HOST_AGT_PEX1=1

3. Boot up Linux on EP board and execute the following ommands.

# cd /sys/kernel/config/pci_ep/
# mkdir functions/pci_epf_test/func1
# echo 0x1957 > functions/pci_epf_test/func1/vendorid
# echo 0x80c0 > functions/pci_epf_test/func1/deviceid
# echo 2 > functions/pci_epf_test/func1/msi_interrupts
# echo 8 > functions/pci_epf_test/func1/msix_interrupts
# ln -s functions/pci_epf_test/func1 controllers/3400000.pcie_ep

4. Boot up Linux on RC board and run the functionality tests.

Please get pcitest application and script and Run pcitest.sh.

 

0 Kudos

8,391 Views
muaxi8
Contributor V

I have modified RCW. In the Uboot, devices can be discovered on the EP side and RC side.

But the test case failed, can't open PCI Endpoint Test device: No such file or directory

EP:

uboot log:

muaxi8_1-1639039348509.png

kernel configure:

root@TinyLinux:~#zcat /proc/config.gz |grep -i pci_endpoint
CONFIG_PCI_ENDPOINT=y
CONFIG_PCI_ENDPOINT_CONFIGFS=y
CONFIG_PCI_ENDPOINT_TEST=y

RC:

uboot log:

muaxi8_0-1639039291276.png

kernel configure:

root@TinyLinux:~# zcat /proc/config.gz |grep -i pci_endpoint
# CONFIG_PCI_ENDPOINT is not set
CONFIG_PCI_ENDPOINT_TEST=y

But the /dev/pcixxx device could not be found :

root@TinyLinux:~# ls /dev/p
port pts/ ptyp1 ptyp3 ptyp5 ptyp7 ptyp9 ptypb ptypd ptypf
ptmx ptyp0 ptyp2 ptyp4 ptyp6 ptyp8 ptypa ptypc ptype

Ensure that  "/dev/pci-endpoint-test.0" is displayed on the RC side ?

0 Kudos

8,387 Views
yipingwang
NXP TechSupport
NXP TechSupport

Have you also configure the following configuration in EP Kernel?

CONFIG_PCI_EPF_TEST=y

CONFIG_PCI_LAYERSCAPE_EP=y

Have you booted up EP to Linux first then type the following commands, then booted up RC to Linux?

# cd /sys/kernel/config/pci_ep/
# mkdir functions/pci_epf_test/func1
# echo 0x1957 > functions/pci_epf_test/func1/vendorid
# echo 0x80c0 > functions/pci_epf_test/func1/deviceid
# echo 2 > functions/pci_epf_test/func1/msi_interrupts
# echo 8 > functions/pci_epf_test/func1/msix_interrupts
# ln -s functions/pci_epf_test/func1 controllers/3800000.pcie_ep

0 Kudos

8,366 Views
muaxi8
Contributor V

"/dev/pci-endpoint-test.0"  is ready to be found  because the memory space allocated on the RC side is too large.

 But how to change the pcie memory size。

0 Kudos

7,868 Views
peiqiongye
Contributor II

Hi muaxi8,

Can you show more detail about how to change the pcie memory size to create pci-endpoint-test.0 device. I have the same issue as yours, "/dev/pci-endpoint-test.0" not found, and dmesg reports " can't open PCI Endpoint Test device: No such file or directory". 

0 Kudos

7,858 Views
muaxi8
Contributor V

first bring up ep, then bring up RC

0 Kudos

8,383 Views
muaxi8
Contributor V

Pcie Connection

muaxi8_2-1639044140045.png

EP:

root@localhost:~# zcat /proc/config.gz |grep -i CONFIG_PCI_EPF
CONFIG_PCI_EPF_TEST=y
root@localhost:~# zcat /proc/config.gz |grep -i pci_layer
CONFIG_PCI_LAYERSCAPE=y
CONFIG_PCI_LAYERSCAPE_EP=y

 then type the following commands

# cd /sys/kernel/config/pci_ep/
#mkdir functions/pci_epf_test/func6
#echo 0x1957 > functions/pci_epf_test/func6/vendorid
#echo 0x8d82 > functions/pci_epf_test/func6/deviceid
#echo 2 > functions/pci_epf_test/func6/msi_interrupts
#echo 8 > functions/pci_epf_test/func6/msix_interrupts
#ln -s functions/pci_epf_test/func6 controllers/3900000.pcie_ep
#echo 1 > controllers/3900000.pcie_ep/start

then reboot RC to Linux:

root@TinyLinux:~# zcat /proc/config.gz |grep -i pci_endpo
# CONFIG_PCI_ENDPOINT is not set
CONFIG_PCI_ENDPOINT_TEST=y
root@TinyLinux:~# zcat /proc/config.gz |grep -i pci_layer
CONFIG_PCI_LAYERSCAPE=y
root@TinyLinux:~#

root@TinyLinux:~# ls /dev/p
port ptmx pts/ ptyp1 ptyp3 ptyp5 ptyp7 ptyp9 ptypb ptypd ptypf
pps0 ptp0 ptyp0 ptyp2 ptyp4 ptyp6 ptyp8 ptypa ptypc ptype

Can EP and RC communicate normally without this endpoint test device?

0 Kudos