Hi All,
When I learn EPICS device support, I encounter
a question about PCI memory mapping on vxworks.
In my vxworks5.5.1 BSP for mvme5100, there is
no sysPciToCpuAdrs function in sysLib.c, and the function sysBusToLocalAdrs
does not support PCI space, for example, the base address of universe II bridge
is got like this:
if (pciFindDevice ((PCI_ID_UNIVERSE
&
0xFFFF),
(PCI_ID_UNIVERSE >> 16) & 0xFFFF,
0,
&pciBusNo, &pciDevNo, &pciFuncNo) !=
ERROR)
{ pciConfigInLong(pciBusNo,
pciDevNo,
pciFuncNo,
PCI_CFG_BASE_ADDRESS_0,
&univBaseAdrs); if
(univBaseAdrs &
PCI_BAR_SPACE_IO)
{
univBaseAdrs = (univBaseAdrs & PCI_IOBASE_MASK) -
PCI_MSTR_IO_BUS
+
PCI_MSTR_IO_LOCAL;
}
else
{
univBaseAdrs = (univBaseAdrs & PCI_MEMBASE_MASK) -
PCI_MSTR_MEM_BUS
+
PCI_MSTR_MEM_LOCAL;
}
While the BSP for mvme5500 and mvme6100 have
such support, the base address of universe II bridge in mv5500
is got like this:
if (pciFindDevice
((PCI_ID_UNIVERSE &
0xFFFF),
(PCI_ID_UNIVERSE >> 16) & 0xFFFF,
0, &pciBusNo,
&pciDevNo, &pciFuncNo) !=
ERROR)
{ pciConfigInLong(pciBusNo,
pciDevNo,
pciFuncNo,
PCI_CFG_BASE_ADDRESS_0, ®1);
(void)sysBusToLocalAdrs (PCI_SPACE_MEM_PRI, (char
*)reg1,
&baseAddr);
So, if I use mvme5100 to access PCI
or PMC devices, what should I do for the memory mapping? Add or
modify functions
like sysPciToCpuAdrs and sysBusToLocalAdrs as in
mv5500 and mv6100, or calculate the address manually? Is your BSP for mvme5100
the same as mine? If so, when you use mvme5100, how do you map the PCI address
to local CPU?
Thanks,
Lin Wang
|