Hello,
First off, my actual problem:
When using Linux's pci-epf-test driver on an iMX8MM, I can't seem to collect the right BARs configuration from the host side (also Linux on an x86, I tried several hardwares in 32 and 64 bits).
Actually, my host pci_endpoint_test module gets the respective flags:
On the endpoint side, the test driver tries to allocate BARs 0, 2, 4 and 5, avoiding the ones declared reserved by the iMX driver.
As much of the reconnoissance by the host is performed by its BIOS, I don't have much visibility there, so I tried to follow the BAR configuration code on the endpoint to check everything was right on that side.
Such configuration is performed by the more generic Designware layer. It consists of 2 parts:
It gets ugly for 2 reasons:
Wonderful, we access DBI through the AXI bridge, so remains only to locate the CS2 address bit.
It appears the imx6-pci driver uses bit 20 for iMX8 MM, MP and MQ, and bit 12 for all other families.
Indeed, the iMX6DQ RM mentions once in passing: "The BAR Mask registers are accessible through the same address as the corresponding BAR registers, but requires dbi_cs2 assertions instead i.e. bit address 12 must be set."
For iMX8MM no such precision, but the iMX8DQXP RM gives us something a bit more... complex, through a handful of tables. Page 8392 we find:
But on the next page: "Bit position is based on CX_NFUNC and not on device_type", and
But I have no idea as to how these internal signals are set. Am I to understand that my using PCIe as endpoint implies [CX_SRIOV_ENABLE=1 or CX_ARI_ENABLE=1]?
If so, how am I to refer to the resulting addresses, when they fall into RAM address space?
And even then, the base offset used by the Designware layer to address register BARx on db1 (respectively BARx_MASK on dbi2) is 0x10+4*x. But those addresses are either undocumented (0x10, 0x14) or used for something else entirely (and writable or becoming so on the same condition as the BAR registers, by setting DBI_RO_WR_EN in MISC_CONTROL_1):
So, I'm lost. How am I to access the BAR registers?
Best regards
We're using Yocto Zeus with a kernel based on rel_imx_5.4.70_2.3.2 from CodeAurora.
However, though my post presents observations made with that BSP and read from this kernel code, the question itself is solely on the hardware implementation of the PCIe IP for iMX8MM.