When I tried to set lx2160 in pcie endpoint mode, pci_epf_test driver cannot setup.
Using LSDK 21.08.
my reference:
https://community.nxp.com/t5/QorIQ-Knowledge-Base/LS1046A-RDB-in-PCIe-Endpoint-Mode/ta-p/1107415
Detal steps as below:
1. RCW config: set HOST_AGT_PEX1 to HOST_AGT_PEX6 as 1.
2. kenel dts:
pcie_ep5: pcie_ep@3800000 { compatible = "fsl,lx2160a-pcie-ep"; reg = <0x00 0x03800000 0x0 0x00100000 0xa0 0x00000000 0x8 0x00000000>; reg-names = "regs", "addr_space"; interrupts = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>, /* AER interrupt */ <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>, /* PME interrupt */ <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>; /* controller interrupt */ interrupt-names = "aer", "pme", "intr"; apio-wins = <256>; num-lanes = <8>; num-ib-windows = <24>; num-ob-windows = <256>; max-functions = /bits/ 8 <2>; status = "disabled"; }; |
3. kconfig:
# # PCI Endpoint # CONFIG_PCI_ENDPOINT=y CONFIG_PCI_ENDPOINT_CONFIGFS=y CONFIG_PCI_EPF_TEST=y |
4. add pci_epf_test device.
cd /sys/kernel/config/pci_ep/ mkdir functions/pci_epf_test/func1 echo 0x1957 > functions/pci_epf_test/func1/vendorid echo 0x8d80> functions/pci_epf_test/func1/deviceid echo 16 > functions/pci_epf_test/func1/msi_interrupts echo 8 > functions/pci_epf_test/func1/msix_interrupts echo 0 > functions/pci_epf_test/func1/revid ln -s functions/pci_epf_test/func1 controllers/3800000.pcie_ep echo 1 > controllers/3800000.pcie_ep/start |
After that, in RC side, cannot find EP driver via lspci command.
Maybe the reason is EPF DMA channel init faild, beacuse dma_request_chan_by_mask returned with "-EPROBE_DEFER" error. The dma_device_list is empty.
Can someone show me how to set lx2160 pcie as endpoint mode?
Is this verified with LX2160ARDB ? if so,pls refer to the LSDK user guide below
"7.2.8.4 PCIe Endpoint Mode Linux driver"