I have a c6657 pcie EP connected to a dm8148 pcie RC. I can successfully read and write to memory using BAR1..3 (mapped to L2, MSMC, and DDR). I'm using RBL with 6657 configured for PCIe boot (no IBL).
I'm trying to understand how to get access to pcie configuration registers beyond offset 0x1000 (such as MSI_CAP) so that I can configure the EP for MSI operations.
From the linux driver I'm using I get "Unhandled fault: Precise External Abort on non-linefetch ..." which I think is related to having BAR0 set up with a length of only 0x1000. Output from the code below is:
Bar[0] 0x2a000000, 0x1000
<< code snippet follows>>
barStart [0] = pci_resource_start (ti81xx_pci_dev, 0); /* BAR0 4K for PCIE application registers */
barLen [0] = pci_resource_len (ti81xx_pci_dev, 0);
barFlags [0] = pci_resource_flags (ti81xx_pci_dev, 0);
printk(" Bar[%d] 0x%x, 0x%x\n", 0, barStart[0], barLen[0]);
...
if (barFlags[0] & IORESOURCE_MEM) {
regBase = barStart[0];
/* Map the memory region. */
request_mem_region(regBase, barLen[0], "DSPLINK");
}
else {
/* Map the memory region. */
request_region(regBase, barLen[0], "DSPLINK");
}
if (regBase > 0) {
regVirt = ioremap(barStart[0], barLen[0]*4);
}