Hi all,
I'm testing PCIe in End Point mode on an imx8mm. Linux kernel is 4.19. I cannot find a way to make it work. Please comment if anything seems wrong. Any advice could be useful.
Following kernel documentation, I should be able to play with pcie endpoint controller in /sys/class/pci_epc and test the interface with lspci and pcitest on the root complex side (x86).
https://www.kernel.org/doc/html/latest/PCI/endpoint/pci-test-howto.html
The thing is, PCIe endpoint controller device does not exist (nothing in /sys/class/pci_epc). It should be created by a driver activated in the kernel (drivers/pci/controller/dwc/pcie-designware-ep.c ?). Is it created after pcie link is brought up ?
PCIe link is never established (timeout !). Are we talking about a link between RC and EP (see logs below) ? Or is it a phy link between two modules inside the iMX ? I tried to power up the x86 RC connected to the iMX when it is waiting, but nothing happened.
imx kernel logs :
[ 2.266698] imx6q-pcie 33800000.pcie: host bridge /hsio/pcie@33800000 ranges:
[ 2.273869] imx6q-pcie 33800000.pcie: No bus range found for /hsio/pcie@33800000, using [bus 00-ff]
[ 2.283110] imx6q-pcie 33800000.pcie: IO 0x1ff80000..0x1ff8ffff -> 0x00000000
[ 2.290521] imx6q-pcie 33800000.pcie: MEM 0x18000000..0x1fefffff -> 0x18000000
[ 2.297926] imx6q-pcie 33800000.pcie: try to initialize pcie ep.
[ 2.304036] imx6q-pcie 33800000.pcie: Initialize PHY with PLL REfCLK!.
[ 2.310951] imx6q-pcie 33800000.pcie: PHY Initialization End!.
[ 2.317119] imx6q-pcie 33800000.pcie: iATU unroll: enabled
[ 2.322617] imx6q-pcie 33800000.pcie: ddr_test_region is 0xb8200000.
[ 2.328982] imx6q-pcie 33800000.pcie: PCIe EP: waiting for link up...
[timeout]
[ 302.268463] imx6q-pcie 33800000.pcie: PCIe EP: link down.
device tree pcie node (including kernel 4.19 fsl-imx8mm.dtsi) :
&pcie0{
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pcie0>;
//disable-gpio = <&gpio1 5 GPIO_ACTIVE_LOW>;
//reset-gpio = <&gpio4 21 GPIO_ACTIVE_LOW>;
ext_osc = <0>; // use external clk or internal pll if 0
status = "okay";
};
Here's a diff of my kernel .config :
+CONFIG_PCIEPORTBUS=y
+CONFIG_HOTPLUG_PCI_PCIE=y
+CONFIG_PCIEAER=y
+CONFIG_PCIEASPM=y
+CONFIG_PCIEASPM_DEFAULT=y
+CONFIG_PCIE_PME=y
CONFIG_PCI_MSI=y
CONFIG_PCI_MSI_IRQ_DOMAIN=y
CONFIG_PCI_QUIRKS=y
CONFIG_PCIE_DW=y
CONFIG_PCIE_DW_HOST=y
+CONFIG_PCIE_DW_EP=y
+CONFIG_PCIE_DW_PLAT=y
# CONFIG_PCIE_DW_PLAT_HOST is not set
+CONFIG_PCIE_DW_PLAT_EP=y
CONFIG_PCI_IMX6=y
# CONFIG_PCI_IMX6_COMPLIANCE_TEST is not set
+CONFIG_EP_MODE_IN_EP_RC_SYS=y
# CONFIG_PCI_LAYERSCAPE is not set
CONFIG_PCI_HISI=y
# CONFIG_PCIE_QCOM is not set
+CONFIG_PCI_ENDPOINT=y
+CONFIG_PCI_ENDPOINT_CONFIGFS=y
+CONFIG_PCI_EPF_TEST=y
+CONFIG_PCI_ENDPOINT_TEST=y