What are 'mem' and 'preMem' in the output of pciConfigTopoShow(), for P2P BRIDGE's?
Here's the output of my target...
[1,0,0] type=P2P BRIDGE to [2,0,0] base/limit: mem= 0xa0000000/0x9fffffff preMem=0x0000000080000000/0x00000000800fffff I/O= 0xe8000000/0xe7ffffff status=0x0010 ( CAP DEVSEL=0 ) command=0x0007 ( IO_ENABLE MEM_ENABLE MASTER_ENABLE ) [2,1,0] type=P2P BRIDGE to [3,0,0] base/limit: mem= 0xa0000000/0x9fffffff preMem=0x0000000080000000/0x00000000800fffff I/O= 0xe8000000/0xe7ffffff status=0x0010 ( CAP DEVSEL=0 ) command=0x0007 ( IO_ENABLE MEM_ENABLE MASTER_ENABLE ) [3,0,0] type=P2P BRIDGE to [4,0,0] base/limit: mem= 0xa0000000/0x9fffffff preMem=0x80100000/0x800fffff I/O= 0x0000/0xffff status=0x0010 ( CAP DEVSEL=0 ) command=0x0007 ( IO_ENABLE MEM_ENABLE MASTER_ENABLE ) bar0 in prefetchable 64-bit mem space @ 0x80000000
The “mem” and preMem” values are produced from the pciConfigTopoShow() function by several layers of function calls. The “mem” is for the normal memory window that be mapped for the Bridge showing the memory base and the memory limit respectively, separated by “/”.
The “preMem” is for the pre-fetch-able Memory window if the device supports it, showing the memory base and memory limit for this device. If it is a 64-bit machine, then these values are shown as 64-bit quantities .
Ultimately, the pciConfigForeachShow() function found in the file WIND_BASE/target/src/drv/pci/pciConfigShow.c produces the output that shown with your question in the following code snippet:
if ( cmdReg & PCI_CMD_MEM_ENABLE )
{
pciConfigInWord(bus,device,function,
PCI_CFG_MEM_BASE, &memBase);
pciConfigInWord(bus,device,function,
PCI_CFG_MEM_LIMIT, &memLimit);
printf("\tbase/limit:\n");
printf("\t mem= 0x%04x0000/0x%04xffff\n",
memBase & 0xfff0, memLimit | 0x000f);
pciConfigInWord(bus,device,function,
PCI_CFG_PRE_MEM_BASE, &memBase);
pciConfigInWord(bus,device,function,
PCI_CFG_PRE_MEM_LIMIT, &memLimit);
if ( ( memBase & 0x000f ) == 0x0001 )
{
/* 64-bit memory */
pciConfigInLong(bus,device,function,
PCI_CFG_PRE_MEM_BASE_U,
&memBaseU);
pciConfigInLong(bus,device,function,
PCI_CFG_PRE_MEM_LIMIT_U,
&memLimitU);
printf("\t preMem=0x%08x%04x0000/"
"0x%08x%04xffff\n",
memBaseU, memBase & 0xfff0,
memLimitU, memLimit | 0x000f);
}
else
printf("\t preMem=0x%04x0000/0x%04xffff\n",
memBase & 0xfff0, memLimit | 0x000f);
}