Experimental Physics and Industrial Control System
[email protected] wrote:
I have BSP compile errors, when the added univDma.c.
c:\Tornado2.2\target\proj\Prj_sis3301\default\C:\Tornado2.2\target\config\mv5100\univDma.c
:240: undefined reference to `sysLocalToPciAdrs'
Oops, I didn't realize I was using that routine here - add this function
somewhere, I have it in sysLib.c:
/******************************************************************************
*
* sysLocalToPciAdrs - convert a local address to a pci address
*
* This routine returns a PCIbus address as it would be seen on the bus.
* The local address that is passed into this routine is the address of
* the local resource as seen by the CPU.
*
* RETURNS: OK, or ERROR if the mapping is not possible.
*
* SEE ALSO: sysPciToLocalAdrs()
*/
STATUS sysLocalToPciAdrs
(
int adrsSpace, /* whether I/O or Memory address */
void *adrs, /* local address to convert */
UINT32 *pPciAdrs /* where to return pci address */
)
{
if (adrsSpace & PCI_BAR_SPACE_IO)
{
if ((adrs >= (void *) PCI_MSTR_IO_LOCAL) &&
(adrs < (void *) (PCI_MSTR_IO_LOCAL + PCI_MSTR_IO_SIZE)))
{
adrs += PCI_MSTR_IO_BUS - PCI_MSTR_IO_LOCAL;
}
else
return ERROR;
}
else /* PCI Memory space */
{
if ((adrs >= (void *) LOCAL_MEM_LOCAL_ADRS) &&
(adrs < (void *) sysPhysMemTop()))
{
adrs += PCI_SLV_MEM_LOCAL - LOCAL_MEM_LOCAL_ADRS;
}
else if ((adrs >= (void *) PCI_MSTR_MEM_LOCAL) &&
(adrs < (void *) (PCI_MSTR_MEM_LOCAL + PCI_MSTR_MEM_SIZE)))
{
adrs += PCI_MSTR_MEM_BUS - PCI_MSTR_MEM_LOCAL;
}
else
return ERROR;
}
*pPciAdrs = (UINT32) adrs;
return OK;
}
For completeness (although it's not needed by univDma.c) there is a
companion function to the above which I also provide in my BSPs:
/******************************************************************************
*
* sysPciToLocalAdrs - convert a pci address to a local address
*
* This routine returns a local address that is used to access the PCIbus.
* The bus address that is passed into this routine is the PCIbus address
* as it would be seen on the bus.
*
* RETURNS: OK, or ERROR if the mapping is not possible.
*
* SEE ALSO: sysLocalToPciAdrs()
*/
STATUS sysPciToLocalAdrs
(
int adrsSpace, /* whether I/O or Memory address */
UINT32 adrs, /* pci address to convert */
void **pLocalAdrs /* where to return local address */
)
{
if (adrsSpace & PCI_BAR_SPACE_IO)
{
if ((adrs >= PCI_MSTR_IO_BUS) &&
(adrs < (PCI_MSTR_IO_BUS + PCI_MSTR_IO_SIZE)))
{
adrs += PCI_MSTR_IO_LOCAL - PCI_MSTR_IO_BUS;
}
else
return ERROR;
}
else /* PCI Memory space */
{
if ((adrs >= PCI2DRAM_BASE_ADRS) &&
(adrs < (PCI2DRAM_BASE_ADRS + DRAM_SIZE)))
{
adrs += LOCAL_MEM_LOCAL_ADRS - PCI2DRAM_BASE_ADRS;
}
else if ((adrs >= PCI_MSTR_MEM_BUS) &&
(adrs < (PCI_MSTR_MEM_BUS + PCI_MSTR_MEM_SIZE)))
{
adrs += PCI_MSTR_MEM_LOCAL - PCI_MSTR_MEM_BUS;
}
else
return ERROR;
}
*pLocalAdrs = (void *) adrs;
return OK;
}
- Andrew
--
Dear God, I didn't think orange went with purple until I saw
the sunset you made last night. That was really cool. - Caro
- Navigate by Date:
- Prev:
Re: print from interrupt Allan Honey
- Next:
Problem running edm (EPICS extension) Gaudenz Jud
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
<2004>
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
- Navigate by Thread:
- Prev:
Re: gtr1-2 for SIS3301. Andrew Johnson
- Next:
OMS VX2-006 motor controller problem Ronald L. Sluiter
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
<2004>
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025