VxWorks BSP Reference : cpv3060

sysLib [cpv3060]

NAME

sysLib [cpv3060] - Motorola CPV3060 board system-dependent library

ROUTINES

pciConfigLibInit( ) - initialize the configuration access-method and addresses
pciFindDevice( ) - find the nth device with the given device & vendor ID
pciFindClass( ) - find the nth occurence of a device by PCI class code.
pciDevConfig( ) - configure a device on a PCI bus
pciConfigBdfPack( ) - pack parameters for the Configuration Address Register
pciConfigExtCapFind( ) - find extended capability in ECP linked list
pciConfigInByte( ) - read one byte from the PCI configuration space
pciConfigInWord( ) - read one word from the PCI configuration space
pciConfigInLong( ) - read one longword from the PCI configuration space
pciConfigOutByte( ) - write one byte to the PCI configuration space
pciConfigOutWord( ) - write one 16-bit word to the PCI configuration space
pciConfigOutLong( ) - write one longword to the PCI configuration space
pciConfigModifyLong( ) - Perform a masked longword register update
pciConfigModifyWord( ) - Perform a masked longword register update
pciConfigModifyByte( ) - Perform a masked longword register update
pciSpecialCycle( ) - generate a special cycle with a message
pciConfigForeachFunc( ) - check condition on specified bus
pciConfigReset( ) - disable cards for warm boot
pciDeviceShow( ) - print information about PCI devices
pciHeaderShow( ) - print a header of the specified PCI device
pciFindDeviceShow( ) - find a device by deviceId, then print an information.
pciFindClassShow( ) - find a device by 24-bit class code
pciConfigStatusWordShow( ) - show the decoded value of the status word
pciConfigCmdWordShow( ) - show the decoded value of the command word
pciConfigFuncShow( ) - show configuration details about a function
pciConfigTopoShow( ) - show PCI topology
pciAutoConfigLibInit( ) - initialize PCI autoconfig library.
pciAutoCfg( ) - Automatically configure all nonexcluded PCI headers.
pciAutoCfgCtl( ) - set or get pciAutoConfigLib options.
pciAutoDevReset( ) - Quiesce a PCI device and reset all writeable status bits.
pciAutoBusNumberSet( ) - Set the primary, secondary, and subordinate bus number.
pciAutoFuncDisable( ) - Disable a specific PCI function.
pciAutoFuncEnable( ) - Perform final configuration and enable a function.
pciAutoGetNextClass( ) - find the next device of specific type from probe list.
pciAutoRegConfig( ) - Assign PCI space to a single PCI base address register.
pciAutoAddrAlign( ) - Align a PCI address and check boundary conditions.
pciAutoConfig( ) - Automatically configure all nonexcluded PCI headers. Obsolete.
sysPciAutoConfig( ) - PCI autoConfig support routine
sysSerialHwInit( ) - initialize the BSP serial devices to a quiesent state
sysSerialHwInit2( ) - connect BSP serial device interrupts
sysSerialChanGet( ) - get the SIO_CHAN device associated with a serial channel
sysSerialReset( ) - reset the serial device
ppc860IntrInit( ) - initialize the interrupt manager for the PowerPC 860 series
ppc860IntrInit2( ) - initialize the interrupt manager for the PowerPC 860 series
ppc860IntConnect( ) - connect a routine to an interrupt
ppc860IntrDeMux( ) - SIU level interrupt demultiplexer
ppc860CpmIntrDeMux( ) - CPM interrupt demultiplexer
ppc860IntEnable( ) - enable one of the Level or IRQ interrupts into the SIU
ppc860IntDisable( ) - disable one of the Level or IRQ interrupts into the SIU
sysClkConnect( ) - connect a routine to the system clock interrupt
sysClkEnable( ) - turn on system clock interrupts
sysClkDisable( ) - turn off system clock interrupts
sysClkRateGet( ) - get the system clock rate
sysClkRateSet( ) - set the system clock rate
sysNvRamGet( ) - get the contents of non-volatile RAM
sysNvRamSet( ) - write to non-volatile RAM
cpvI2cEepromRead( ) - read EEPROM for DRAM information
cpvI2cSromRead( ) - read SROM for DRAM information
qspanHostInit( ) - initialize the QSpan PCIBus bridge controller
qspanRegMap( ) - map QSPAN registers
qspanSlaveImageSet( ) - setup a PCI slave image
qspanTargetImageSet( ) - setup a PCI target image
qspanHostEnable( ) - enable the bridge
qspanHostReset( ) - reset the QSpan PCIBus bridge controller
cpvMemcConfig( ) - configure the MEMC registers
sysCpvMsDelay( ) - delay for the specified amount of time (MS)
sysGetBusSpd( ) - routine to get the speed of the 60x processor bus
sysGetPciSpd( ) - routine to get the speed of the PCI bus
sysGetMpuSpd( ) - routine to get the speed of the 60x processor bus
sysVpdInit( ) - initialize the board vital product data structures.
sysProdConfigGet( ) - initialize the board vital product data structures.
i2cMcp( ) - download RISC microcode patch
sysDec2155xInit( ) - initialize registers of the Dec2155x (Drawbridge) chip
sysDec2155xInit2( ) - perform phase 2 Dec2155x initialization
sysIntDisable( ) - disable a bus interrupt level (vector)
sysIntEnable( ) - enable a Compact PCI bus interrupt level (vector)
sysBusIntAck( ) - acknowledge a bus interrupt
sysBusIntGen( ) - generate a bus interrupt
sysDec2155xIntDisable( ) - disable a Dec2155x internal interrupt
sysDec2155xIntEnable( ) - Enable a Dec2155x internal interrupt
sysMailboxConnect( ) - connect a routine to the mailbox interrupt
sysMailboxEnable( ) - enable the mailbox interrupt
sysMailboxDisable( ) - disable the mailbox interrupt
sysDec2155xErrClr( ) - Dec2155x Error Clear routine
sysDec2155xIntr( ) - Dec2155x (Drawbridge) PCI-to-PCI interrupt handler
sysDec2155xChkEnables( ) - check the originating and target bus enables
sysModel( ) - return the model name of the CPU board
sysBspRev( ) - return the bsp version with the revision eg 1.0/x
sysClkRateAdjust( ) - Adjust the clock frequency
sysHwInit( ) - initialize the system hardware
sysPciCfgRead( ) - read longword from PCI configuration space
sysPciCfgWrite( ) - write longword to PCI configuration space
sysPhysMemTop( ) - get the address of the top of physical memory
sysMemTop( ) - get the address of the top of VxWorks memory
sysToMonitor( ) - transfer control to the ROM monitor
sysProcNumGet( ) - get the processor number
sysProcNumSet( ) - set the processor number
sysLocalToBusAdrs( ) - convert a local CPU address to a PCI bus address
sysBusToLocalAdrs( ) - convert a PCI bus address to a local CPU address
sysBusTas( ) - test and set a location across the bus
sysBusTasClear( ) - clear a location set by sysBusTas( )
sysFecEnetEnable( ) - enable the MII interface of the Fast Ethernet controller
sysFecEnetDisable( ) - disable MII interface to the Fast Ethernet controller
sysFecEnetAddrGet( ) - get the hardware Ethernet address
sysPciTrap( ) - trap handler for PCI exception
sysMsDelay( ) - delay for the specified amount of time (MS)
sysIntEnablePIC( ) - enable an ISA/PCI interrupt
sysDelay( ) - delay for approx. 1ms
sysCpvIntEnable( ) - enable a CPV3060 interrupt level
sysCpvIntDisable( ) - disable a CPV3060 interrupt level
sysInByteString( ) - reads a string of bytes from an io address.
sysOutByteString( ) - writes a string of bytes to an io address.
sysInWordString( ) - reads a string of words from an io address.
sysInWordStringRev( ) - byte reversed word read.
sysOutWordString( ) - writes a string of words to an io address.
sysInLongString( ) - reads a string of longwords from an io address.
sysOutLongString( ) - writes a string of longwords to an io address.
sysLedUpdate( ) - turn on or off specified LEDs
sysPciInsertLong( ) - Insert field into PCI data long
sysPciInsertWord( ) - Insert field into PCI data word
sysPciInsertByte( ) - Insert field into PCI data byte
sysPciOutByteConfirm( ) - Byte out to PCI memory space and flush buffers.
sysPciOutWordConfirm( ) - Word out to PCI memory space and flush buffers.
sysPciOutLongConfirm( ) - Long word out to PCI memory space and flush buffers.
sysQspanCapt( ) - capture QSPAN window information
sysQspanTransAdrs( ) - translate an address that passes through the qspan.
sysCpuToPciAdrs( ) - translate a cpu address to a pci bus address
sysPciToCpuAdrs( ) - translate a pci bus address to a cpu address
sysDebugMsg( ) - print a debug string to the console in polled mode.

DESCRIPTION

This library provides board-specific routines. The chip drivers included are:

    ppcDecTimer.c       - PowerPC Decrementer Timer library
    byteNvRam.c         - NVRAM access routines
    cpvI2c.c            - I2C bus access
    qspanPci.c          - QSPAN PCI bus bridge device
    i2cMcp.c            - I2C micro-chip patch
    if_fec.obj          - Fast Ethernet Controller driver
    pciAutoConfigLib.c  - PCI device auto-configuration library

INCLUDE FILES

sysLib.h

SEE ALSO

VxWorks Programmer's Guide: Configuration


cpv3060 : Routines

pciConfigLibInit( )

NAME

pciConfigLibInit( ) - initialize the configuration access-method and addresses

SYNOPSIS

STATUS pciConfigLibInit
    (
    int   mechanism,          /* configuration mechanism: 0, 1, 2 */
    ULONG addr0,              /* config-addr-reg / CSE-reg */
    ULONG addr1,              /* config-data-reg / Forward-reg */
    ULONG addr2               /* none / Base-address */
    )

DESCRIPTION

This routine initializes the configuration access-method and addresses.

Configuration mechanism one utilizes two 32-bit IO ports located at addresses 0x0cf8 and 0x0cfc. These two ports are:

P"
32-bit configuration address port, at 0x0cf8
P"
32-bit configuration data port, at 0x0cfc

Accessing a PCI function's configuration port is two step process.

P"
Write the bus number, physical device number, function number and register number to the configuration address port.
P"
Perform an IO read from or an write to the configuration data port.

Configuration mechanism two uses following two single-byte IO ports.

P"
Configuration space enable, or CSE, register, at 0x0cf8
P"
Forward register, at 0x0cfa

To generate a PCI configuration transaction, the following actions are performed.

-
Write the target bus number into the forward register.
-
Write a one byte value to the CSE register at 0x0cf8. The bit pattern written to this register has three effects: disables the generation of special cycles; enables the generation of configuration transactions; specifies the target PCI functional device.
-
Perform a one, two or four byte IO read or write transaction within the IO range 0xc000 through 0xcfff.
* Configuration mechanism zero is for non-PC/PowerPC environments where an area of address space produces PCI configuration transactions. No support for special cycles is included.

RETURNS

OK, or ERROR if a mechanism is not 0, 1, or 2.

SEE ALSO

sysLib


cpv3060 : Routines

pciFindDevice( )

NAME

pciFindDevice( ) - find the nth device with the given device & vendor ID

SYNOPSIS

STATUS pciFindDevice
    (
    int   vendorId,           /* vendor ID */
    int   deviceId,           /* device ID */
    int   index,              /* desired instance of device */
    int * pBusNo,             /* bus number */
    int * pDeviceNo,          /* device number */
    int * pFuncNo             /* function number */
    )

DESCRIPTION

This routine finds the nth device with the given device & vendor ID.

RETURNS

OK, or ERROR if the deviceId and vendorId didn't match.

SEE ALSO

sysLib


cpv3060 : Routines

pciFindClass( )

NAME

pciFindClass( ) - find the nth occurence of a device by PCI class code.

SYNOPSIS

STATUS pciFindClass
    (
    int   classCode,          /* 24-bit class code */
    int   index,              /* desired instance of device */
    int * pBusNo,             /* bus number */
    int * pDeviceNo,          /* device number */
    int * pFuncNo             /* function number */
    )

DESCRIPTION

This routine finds the nth device with the given 24-bit PCI class code (class subclass prog_if).

The classcode arg of must be carfully constructed from class and sub-class macros.

Example : To find an ethernet class device, construct the classcode arg as follows:

    ((PCI_CLASS_NETWORK_CTLR << 16 | PCI_SUBCLASS_NET_ETHERNET << 8))

RETURNS

OK, or ERROR if the class didn't match.

SEE ALSO

sysLib


cpv3060 : Routines

pciDevConfig( )

NAME

pciDevConfig( ) - configure a device on a PCI bus

SYNOPSIS

STATUS pciDevConfig
    (
    int    pciBusNo,          /* PCI bus number */
    int    pciDevNo,          /* PCI device number */
    int    pciFuncNo,         /* PCI function number */
    UINT32 devIoBaseAdrs,     /* device IO base address */
    UINT32 devMemBaseAdrs,    /* device memory base address */
    UINT32 command            /* command to issue */
    )

DESCRIPTION

This routine configures a device that is on a Peripheral Component Interconnect (PCI) bus by writing to the configuration header of the selected device.

It first disables the device by clearing the command register in the configuration header. It then sets the I/O and/or memory space base address registers, the latency timer value and the cache line size. Finally, it re-enables the device by loading the command register with the specified command.

NOTE

This routine is designed for Type 0 PCI Configuration Headers ONLY. It is NOT usable for configuring, for example, a PCI-to-PCI bridge.

RETURNS

OK always.

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigBdfPack( )

NAME

pciConfigBdfPack( ) - pack parameters for the Configuration Address Register

SYNOPSIS

int pciConfigBdfPack
    (
    int busNo,                /* bus number */
    int deviceNo,             /* device number */
    int funcNo                /* function number */
    )

DESCRIPTION

This routine packs three parameters into one integer for accessing the Configuration Address Register

RETURNS

packed integer encoded version of bus, device, and function numbers.

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigExtCapFind( )

NAME

pciConfigExtCapFind( ) - find extended capability in ECP linked list

SYNOPSIS

STATUS pciConfigExtCapFind
    (
    UINT8   extCapFindId,     /* Extended capabilities ID to search for */
    int     bus,              /* PCI bus number */
    int     device,           /* PCI device number */
    int     function,         /* PCI function number */
    UINT8 * pOffset           /* returned config space offset */
    )

DESCRIPTION

This routine searches for an extended capability in the linked list of capabilities in config space. If found, the offset of the first byte of the capability of interest in config space is returned via pOffset.

RETURNS

OK if Extended Capability found, ERROR otherwise

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigInByte( )

NAME

pciConfigInByte( ) - read one byte from the PCI configuration space

SYNOPSIS

STATUS pciConfigInByte
    (
    int     busNo,            /* bus number */
    int     deviceNo,         /* device number */
    int     funcNo,           /* function number */
    int     offset,           /* offset into the configuration space */
    UINT8 * pData             /* data read from the offset */
    )

DESCRIPTION

This routine reads one byte from the PCI configuration space

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigInWord( )

NAME

pciConfigInWord( ) - read one word from the PCI configuration space

SYNOPSIS

STATUS pciConfigInWord
    (
    int      busNo,           /* bus number */
    int      deviceNo,        /* device number */
    int      funcNo,          /* function number */
    int      offset,          /* offset into the configuration space */
    UINT16 * pData            /* data read from the offset */
    )

DESCRIPTION

This routine reads one word from the PCI configuration space

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigInLong( )

NAME

pciConfigInLong( ) - read one longword from the PCI configuration space

SYNOPSIS

STATUS pciConfigInLong
    (
    int      busNo,           /* bus number */
    int      deviceNo,        /* device number */
    int      funcNo,          /* function number */
    int      offset,          /* offset into the configuration space */
    UINT32 * pData            /* data read from the offset */
    )

DESCRIPTION

This routine reads one longword from the PCI configuration space

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigOutByte( )

NAME

pciConfigOutByte( ) - write one byte to the PCI configuration space

SYNOPSIS

STATUS pciConfigOutByte
    (
    int   busNo,              /* bus number */
    int   deviceNo,           /* device number */
    int   funcNo,             /* function number */
    int   offset,             /* offset into the configuration space */
    UINT8 data                /* data written to the offset */
    )

DESCRIPTION

This routine writes one byte to the PCI configuration space.

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigOutWord( )

NAME

pciConfigOutWord( ) - write one 16-bit word to the PCI configuration space

SYNOPSIS

STATUS pciConfigOutWord
    (
    int    busNo,             /* bus number */
    int    deviceNo,          /* device number */
    int    funcNo,            /* function number */
    int    offset,            /* offset into the configuration space */
    UINT16 data               /* data written to the offset */
    )

DESCRIPTION

This routine writes one 16-bit word to the PCI configuration space.

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigOutLong( )

NAME

pciConfigOutLong( ) - write one longword to the PCI configuration space

SYNOPSIS

STATUS pciConfigOutLong
    (
    int    busNo,             /* bus number */
    int    deviceNo,          /* device number */
    int    funcNo,            /* function number */
    int    offset,            /* offset into the configuration space */
    UINT32 data               /* data written to the offset */
    )

DESCRIPTION

This routine writes one longword to the PCI configuration space.

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigModifyLong( )

NAME

pciConfigModifyLong( ) - Perform a masked longword register update

SYNOPSIS

STATUS pciConfigModifyLong
    (
    int    busNo,             /* bus number */
    int    deviceNo,          /* device number */
    int    funcNo,            /* function number */
    int    offset,            /* offset into the configuration space */
    UINT32 bitMask,           /* Mask which defines field to alter */
    UINT32 data               /* data written to the offset */
    )

DESCRIPTION

This function writes a field into a PCI configuration header without altering any bits not present in the field. It does this by first doing a PCI configuration read (into a temporary location) of the PCI configuration header word which contains the field to be altered. It then alters the bits in the temporary location to match the desired value of the field. It then writes back the temporary location with a configuration write. All configuration accesses are long and the field to alter is specified by the "1" bits in the bitMask parameter.

Be careful to using pciConfigModifyLong for updating the Command and status register. The status bits must be written back as zeroes, else they will be cleared. Proper use involves including the status bits in the mask value, but setting their value to zero in the data value.

The following example will set the PCI_CMD_IO_ENABLE bit without clearing any status bits. The macro PCI_CMD_MASK includes all the status bits as part of the mask. The fact that PCI_CMD_MASTER doesn't include these bits, causes them to be written back as zeroes, therefore they aren't cleared.

   pciConfigModifyLong (b,d,f,PCI_CFG_COMMAND,
                (PCI_CMD_MASK | PCI_CMD_IO_ENABLE), PCI_CMD_IO_ENABLE);
Use of explicit longword read and write operations for dealing with any register containing "write 1 to clear" bits is sound policy.

RETURNS

OK if operation succeeds, ERROR if operation fails.

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigModifyWord( )

NAME

pciConfigModifyWord( ) - Perform a masked longword register update

SYNOPSIS

STATUS pciConfigModifyWord
    (
    int    busNo,             /* bus number */
    int    deviceNo,          /* device number */
    int    funcNo,            /* function number */
    int    offset,            /* offset into the configuration space */
    UINT16 bitMask,           /* Mask which defines field to alter */
    UINT16 data               /* data written to the offset */
    )

DESCRIPTION

This function writes a field into a PCI configuration header without altering any bits not present in the field. It does this by first doing a PCI configuration read (into a temporary location) of the PCI configuration header word which contains the field to be altered. It then alters the bits in the temporary location to match the desired value of the field. It then writes back the temporary location with a configuration write. All configuration accesses are long and the field to alter is specified by the "1" bits in the bitMask parameter.

Do not use this routine to modify any register that contains write 1 to clear type of status bits in the same longword. This specifically applies to the command register. Modify byte operations could potentially be implemented as longword operations with bit shifting and masking. This could have the effect of clearing status bits in registers that aren't being updated. Use pciConfigInLong and pciConfigOutLong, or pciModifyLong, to read and update the entire longword.

RETURNS

OK if operation succeeds. ERROR if operation fails.

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigModifyByte( )

NAME

pciConfigModifyByte( ) - Perform a masked longword register update

SYNOPSIS

STATUS pciConfigModifyByte
    (
    int   busNo,              /* bus number */
    int   deviceNo,           /* device number */
    int   funcNo,             /* function number */
    int   offset,             /* offset into the configuration space */
    UINT8 bitMask,            /* Mask which defines field to alter */
    UINT8 data                /* data written to the offset */
    )

DESCRIPTION

This function writes a field into a PCI configuration header without altering any bits not present in the field. It does this by first doing a PCI configuration read (into a temporary location) of the PCI configuration header word which contains the field to be altered. It then alters the bits in the temporary location to match the desired value of the field. It then writes back the temporary location with a configuration write. All configuration accesses are long and the field to alter is specified by the "1" bits in the bitMask parameter.

Do not use this routine to modify any register that contains write 1 to clear type of status bits in the same longword. This specifically applies to the command register. Modify byte operations could potentially be implemented as longword operations with bit shifting and masking. This could have the effect of clearing status bits in registers that aren't being updated. Use pciConfigInLong and pciConfigOutLong, or pciModifyLong, to read and update the entire longword.

RETURNS

OK if operation succeeds, ERROR if operation fails.

SEE ALSO

sysLib


cpv3060 : Routines

pciSpecialCycle( )

NAME

pciSpecialCycle( ) - generate a special cycle with a message

SYNOPSIS

STATUS pciSpecialCycle
    (
    int    busNo,             /* bus number */
    UINT32 message            /* data driven onto AD[31:0] */
    )

DESCRIPTION

This routine generates a special cycle with a message.

RETURNS

OK, or ERROR if this library is not initialized

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigForeachFunc( )

NAME

pciConfigForeachFunc( ) - check condition on specified bus

SYNOPSIS

STATUS pciConfigForeachFunc
    (
    UINT8            bus,          /* bus to start on */
    BOOL             recurse,      /* if TRUE, do subordinate busses */
    PCI_FOREACH_FUNC funcCheckRtn, /* routine to call for each PCI func */
    void *           pArg          /* argument to funcCheckRtn */
    )

DESCRIPTION

pciConfigForeachFunc( ) discovers the PCI functions present on the bus and calls a specified C-function for each one. If the function returns ERROR, further processing stops.

pciConfigForeachFunc( ) does not affect any HOST<->PCI bridge on the system.

ERRNO

not set

RETURNS

OK normally, or ERROR if funcCheckRtn( ) doesn't return OK.

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigReset( )

NAME

pciConfigReset( ) - disable cards for warm boot

SYNOPSIS

STATUS pciConfigReset
    (
    int startType             /* for reboot hook, ignored */
    )

DESCRIPTION

pciConfigReset( ) goes through the list of PCI functions at the top-level bus and disables them, preventing them from writing to memory while the system is trying to reboot.

ERRNO

Not set

RETURNS

OK, always

SEE ALSO

sysLib


cpv3060 : Routines

pciDeviceShow( )

NAME

pciDeviceShow( ) - print information about PCI devices

SYNOPSIS

STATUS pciDeviceShow
    (
    int busNo                 /* bus number */
    )

DESCRIPTION

This routine prints information about PCI devices There are two ways to find out an empty device.

-
check Master Abort bit after the access.
-
check whether the read value is 0xffff.
* It uses the second method, since I didn't see the Master Abort bit of the host/PCI bridge changing.

RETURNS

OK, or ERROR if the library is not initialized.

SEE ALSO

sysLib


cpv3060 : Routines

pciHeaderShow( )

NAME

pciHeaderShow( ) - print a header of the specified PCI device

SYNOPSIS

STATUS pciHeaderShow
    (
    int busNo,                /* bus number */
    int deviceNo,             /* device number */
    int funcNo                /* function number */
    )

DESCRIPTION

This routine prints a header of the PCI device specified by busNo, deviceNo, and funcNo.

RETURNS

OK, or ERROR if this library is not initialized.

SEE ALSO

sysLib


cpv3060 : Routines

pciFindDeviceShow( )

NAME

pciFindDeviceShow( ) - find a device by deviceId, then print an information.

SYNOPSIS

STATUS pciFindDeviceShow
    (
    int vendorId,             /* vendor ID */
    int deviceId,             /* device ID */
    int index                 /* desired instance of device */
    )

DESCRIPTION

This routine finds a device by deviceId, then print an information.

RETURNS

OK, or ERROR if this library is not initialized.

SEE ALSO

sysLib


cpv3060 : Routines

pciFindClassShow( )

NAME

pciFindClassShow( ) - find a device by 24-bit class code

SYNOPSIS

STATUS pciFindClassShow
    (
    int classCode,            /* 24-bit class code */
    int index                 /* desired instance of device */
    )

DESCRIPTION

This routine finds a device by its 24-bit PCI class code, then prints its information.

RETURNS

OK, or ERROR if this library is not initialized.

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigStatusWordShow( )

NAME

pciConfigStatusWordShow( ) - show the decoded value of the status word

SYNOPSIS

STATUS pciConfigStatusWordShow
    (
    int    bus,               /* bus */
    int    device,            /* device */
    int    function,          /* function */
    void * pArg               /* ignored */
    )

DESCRIPTION

This routine reads the value of the status word for the specified bus,device,function and prints the value in a human-readable format.

RETURNS

OK, always.

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigCmdWordShow( )

NAME

pciConfigCmdWordShow( ) - show the decoded value of the command word

SYNOPSIS

STATUS pciConfigCmdWordShow
    (
    int    bus,               /* bus */
    int    device,            /* device */
    int    function,          /* function */
    void * pArg               /* ignored */
    )

DESCRIPTION

This routine reads the value of the command word for the specified bus,device,function and prints the value in a human-readable format.

RETURNS

OK, always.

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigFuncShow( )

NAME

pciConfigFuncShow( ) - show configuration details about a function

SYNOPSIS

STATUS pciConfigFuncShow
    (
    int    bus,               /* bus */
    int    device,            /* device */
    int    function,          /* function */
    void * pArg               /* ignored */
    )

DESCRIPTION

This routine reads various information from the specified bus,device,function, and prints the information in a human-readable format.

RETURNS

OK, always.

SEE ALSO

sysLib


cpv3060 : Routines

pciConfigTopoShow( )

NAME

pciConfigTopoShow( ) - show PCI topology

SYNOPSIS

void pciConfigTopoShow ()

DESCRIPTION

This routine traverses the PCI bus and prints assorted information about every device found. The information is intended to present the topology of the PCI bus. In includes: (1) the device type, (2) the command and status words, (3) for PCI to PCI bridges the memory and I/O space configuration, and (4) the values of all implemented BARs.

RETURNS

N/A.

SEE ALSO

sysLib


cpv3060 : Routines

pciAutoConfigLibInit( )

NAME

pciAutoConfigLibInit( ) - initialize PCI autoconfig library.

SYNOPSIS

void * pciAutoConfigLibInit
    (
    void * pArg               /* reserved for future use */
    )

DESCRIPTION

pciAutoConfigLib initialization function.

ERRNO

not set

RETURNS

A cookie for use by subsequent pciAutoConfigLib function
      calls.

SEE ALSO

sysLib


cpv3060 : Routines

pciAutoCfg( )

NAME

pciAutoCfg( ) - Automatically configure all nonexcluded PCI headers.

SYNOPSIS

STATUS pciAutoCfg
    (
    void * pCookie            /* cookie returned by pciAutoConfigLibInit() */
    )

DESCRIPTION

Top level function in the PCI configuration process.

CALLING SEQUENCE

pCookie = pciAutoConfigLibInit(NULL);
pciAutoCfgCtl(pCookie, COMMAND, VALUE);
...
pciAutoCfgCtl(pCookie, COMMAND, VALUE);
pciAutoCfg(pCookie);
For ease in converting from the old interface to the new one, a pciAutoCfgCtl( ) command PCI_PSYSTEM_STRUCT_COPY has been implemented. This can be used just like any other pciAutoCfgCtl( ) command, and it will initialize all the values in pSystem. If used, it should be the first call to pciAutoCfgCtl( ).

For a description of the COMMANDs and VALUEs to pciAutoCfgCtl( ), see the pciAutoCfgCtl( ) documentation.

For all nonexcluded PCI functions on all PCI bridges, this routine will automatically configure the PCI configuration headers for PCI devices and subbridges. The fields that are programmed are:

1. Status register.
2. Command Register.
3. Latency timer.
4. Cache Line size.
5. Memory and/or I/O base address and limit registers.
6. Primary, secondary, subordinate bus number (for PCI-PCI bridges).
7. Expansion ROM disable.
8. Interrupt Line.

ALGORITHM

Probe PCI config space and create a list of available PCI functions. Call device exclusion function, if registered, to exclude/include device. Disable all devices before we initialize any. Allocate and assign PCI space to each device. Calculate and set interrupt line value. Initialize and enable each device.

RETURNS

N/A.

SEE ALSO

sysLib


cpv3060 : Routines

pciAutoCfgCtl( )

NAME

pciAutoCfgCtl( ) - set or get pciAutoConfigLib options.

SYNOPSIS

STATUS pciAutoCfgCtl
    (
    void * pCookie,           /* system configuration information */
    int    cmd,               /* command word */
    void * pArg               /* argument for the cmd */
    )

DESCRIPTION

pciAutoCfgCtl( ) can be considered analogous to ioctl( ) calls: the call takes arguments of (1) a pCookie, returned by pciAutoConfigLibInit( ). (2) A command, macros for which are defined in pciAutoConfigLib.h. And, (3) an argument, the type of which depends on the specific command, but will always fit in a pointer variable. Currently, only globally effective commands are implemented.

The commands available are:

PCI_FBB_ENABLE - BOOL * pArg
PCI_FBB_DISABLE - void
PCI_FBB_UPDATE - BOOL * pArg
PCI_FBB_STATUS_GET - BOOL * pArg
Enable and disable the functions which check Fast Back To Back functionality. PCI_FBB_UPDATE is for use with dynamic/HA applications. It will first disable FBB on all functions, then enable FBB on all functions, if appropriate. In HA applications, it should be called any time a card is added or removed. The BOOL pointed to by pArg for PCI_FBB_ENABLE and PCI_FBB_UPDATE will be set to TRUE if all cards allow FBB functionality and FALSE if either any card does not allow FBB functionality or if FBB is disabled. The BOOL pointed to by pArg for PCI_FBB_STATUS_GET will be set to TRUE if PCI_FBB_ENABLE has been called and FBB is enabled, even if FBB is not activated on any card. It will be set to FALSE otherwise.

Note that in the current implementation, FBB will be enabled or disabled on the entire bus. If any device anywhere on the bus cannot support FBB, then it is not enabled, even if specific sub-busses could support it.

PCI_MAX_LATENCY_FUNC_SET - FUNCPTR * pArg
This routine will be called for each function present on the bus when discovery takes place. The routine must accept four arguments, specifying bus, device, function, and a user-supplied argument of type void *. See PCI_MAX_LATENCY_ARG_SET. The routine should return a UINT8 value, which will be put into the MAX_LAT field of the header structure. The user supplied routine must return a valid value each time it is called. There is no mechanism for any ERROR condition, but a default value can be returned in such a case. Default = NULL.

PCI_MAX_LATENCY_ARG_SET - void * pArg
When the routine specified in PCI_MAX_LATENCY_FUNC_SET is called, this will be passed to it as the fourth argument.

PCI_MAX_LAT_ALL_SET - int pArg
Specifies a constant max latency value for all cards, if no function has been specified with PCI_MAX_LATENCY_FUNC_SET..

PCI_MAX_LAT_ALL_GET - UINT * pArg
Retrieves the value of max latency for all cards, if no function has been specified with PCI_MAX_LATENCY_FUNC_SET. Otherwise, the integer pointed to by pArg is set to the value 0xffffffff.

PCI_MSG_LOG_SET - FUNCPTR * pArg
The argument specifies a routine will be called to print warning or error messages from pciAutoConfigLib if logMsg( ) has not been initialized at the time pciAutoConfigLib is used. The specified routine must accept arguments in the same format as logMsg( ), but it does not necessarily need to print the actual message. An example of this routine is presented below, which saves the message into a safe memory space and turns on an LED. This command is useful for BSPs which call pciAutoCfg( ) before message logging is enabled. Note that after logMsg( ) is configured, output will go to logMsg( ) even if this command has been called. Default = NULL.

/* sample PCI_MSG_LOG_SET function */
int pciLogMsg(char *fmt,int a1,int a2,int a3,int a4,int a5,int a6)
    {
    sysLedOn(4);
    return(sprintf(sysExcMsg,fmt,a1,a2,a3,a4,a5,a6));
    }
PCI_MAX_BUS_GET - int * pArg
During autoconfiguration, the library will maintain a counter with the highest numbered bus. This can be retrieved by
pciAutoCfgCtl(pCookie, PCI_MAX_BUS_GET, &maxBus)
PCI_CACHE_SIZE_SET - int pArg
Sets the pci cache line size to the specified value. See CONFIGURATION SPACE PARAMETERS in the pciAutoConfigLib documentation for more details.

PCI_CACHE_SIZE_GET - int * pArg
Retrieves the value of the pci cache line size.

PCI_AUTO_INT_ROUTE_SET - BOOL pArg
Enables or disables automatic interrupt routing across bridges during the autoconfig process. See "INTERRUPT ROUTING ACROSS PCI-TO-PCI BRIDGES" in the pciAutoConfigLib documentation for more details.

PCI_AUTO_INT_ROUTE_GET - BOOL * pArg
Retrieves the status of automatic interrupt routing.

PCI_MEM32_LOC_SET - UINT32 pArg
Sets the base address of the PCI 32-bit memory space. Normally, this is given by the BSP constant PCI_MEM_ADRS.

PCI_MEM32_SIZE_SET - UINT32 pArg
Sets the maximum size to use for the PCI 32-bit memory space. Normally, this is given by the BSP constant PCI_MEM_SIZE.

PCI_MEM32_SIZE_GET - UINT32 * pArg
After autoconfiguration has been completed, this retrieves the actual amount of space which has been used for the PCI 32-bit memory space.

PCI_MEMIO32_LOC_SET - UINT32 pArg
Sets the base address of the PCI 32-bit non-prefetch memory space. Normally, this is given by the BSP constant PCI_MEMIO_ADRS.

PCI_MEMIO32_SIZE_SET - UINT32 pArg
Sets the maximum size to use for the PCI 32-bit non-prefetch memory space. Normally, this is given by the BSP constant PCI_MEMIO_SIZE.

PCI_MEMIO32_SIZE_GET - UINT32 * pArg
After autoconfiguration has been completed, this retrieves the actual amount of space which has been used for the PCI 32-bit non-prefetch memory space.

PCI_IO32_LOC_SET - UINT32 pArg
Sets the base address of the PCI 32-bit I/O space. Normally, this is given by the BSP constant PCI_IO_ADRS.

PCI_IO32_SIZE_SET - UINT32 pArg
Sets the maximum size to use for the PCI 32-bit I/O space. Normally, this is given by the BSP constant PCI_IO_SIZE.

PCI_IO32_SIZE_GET - UINT32 * pArg
After autoconfiguration has been completed, this retrieves the actual amount of space which has been used for the PCI 32-bit I/O space.

PCI_IO16_LOC_SET - UINT32 pArg
Sets the base address of the PCI 16-bit I/O space. Normally, this is given by the BSP constant PCI_ISA_IO_ADRS

PCI_IO16_SIZE_SET - UINT32 pArg
Sets the maximum size to use for the PCI 16-bit I/O space. Normally, this is given by the BSP constant PCI_ISA_IO_SIZE

PCI_IO16_SIZE_GET - UINT32 * pArg
After autoconfiguration has been completed, this retrieves the actual amount of space which has been used for the PCI 16-bit I/O space.

PCI_INCLUDE_FUNC_SET - FUNCPTR * pArg
The device inclusion routine is specified by assigning a function pointer with the PCI_INCLUDE_FUNC_SET pciAutoCfgCtl( ) command:
pciAutoCfgCtl(pSystem, PCI_INCLUDE_FUNC_SET,sysPciAutoconfigInclude);
This optional user-supplied routine takes as input both the bus-device-function tuple, and a 32-bit quantity containing both the PCI vendorID and deviceID of the function. The function prototype for this function is shown below:
STATUS sysPciAutoconfigInclude
    (
    PCI_SYSTEM *pSys,
    PCI_LOC *pLoc,
    UINT devVend
    );
This optional user-specified routine is called by PCI AutoConfig for each and every function encountered in the scan phase. The BSP developer may use any combination of the input data to ascertain whether a device is to be excluded from the autoconfig process. The exclusion routine then returns ERROR if a device is to be excluded, and OK if a device is to be included in the autoconfiguration process.

Note that PCI-to-PCI Bridges may not be excluded, regardless of the value returned by the BSP device inclusion routine. The return value is ignored for PCI-to-PCI bridges.

The Bridge device will be always be configured with proper primary, secondary, and subordinate bus numbers in the device scanning phase and proper I/O and Memory aperture settings in the configuration phase of autoconfig regardless of the value returned by the BSP device inclusion routine.

PCI_INT_ASSIGN_FUNC_SET - FUNCPTR * pArg
The interrupt assignment routine is specified by assigning a function pointer with the PCI_INCLUDE_FUNC_SET pciAutoCfgCtl( ) command:
pciAutoCfgCtl(pCookie, PCI_INT_ASSIGN_FUNC_SET, sysPciAutoconfigIntrAssign);
This optional user-specified routine takes as input both the bus-device-function tuple, and an 8-bit quantity containing the contents of the interrupt Pin register from the PCI configuration header of the device under consideration. The interrupt pin register specifies which of the four PCI Interrupt request lines available are connected. The function prototype for this function is shown below:
UCHAR sysPciAutoconfigIntrAssign
    (
    PCI_SYSTEM *pSys,
    PCI_LOC *pLoc,
    UCHAR pin
    );
This routine may use any combination of these data to ascertain the interrupt level. This value is returned from the function, and will be programmed into the interrupt line register of the function's PCI configuration header. In this manner, device drivers may subsequently read this register in order to calculate the appropriate interrupt vector which to attach an interrupt service routine.

PCI_BRIDGE_PRE_CONFIG_FUNC_SET - FUNCPTR * pArg
The bridge pre-configuration pass initialization routine is provided so that the BSP Developer can initialize a bridge device prior to the configuration pass on the bus that the bridge implements. This routine is specified by calling pciAutoCfgCtl( ) with the PCI_BRIDGE_PRE_CONFIG_FUNC_SET command:
pciAutoCfgCtl(pCookie, PCI_BRIDGE_PRE_CONFIG_FUNC_SET,
        sysPciAutoconfigPreEnumBridgeInit);
This optional user-specified routine takes as input both the bus-device-function tuple, and a 32-bit quantity containing both the PCI deviceID and vendorID of the device. The function prototype for this function is shown below:
STATUS sysPciAutoconfigPreEnumBridgeInit
    (
    PCI_SYSTEM *pSys,
    PCI_LOC *pLoc,
    UINT devVend
    );
This routine may use any combination of these input data to ascertain any special initialization requirements of a particular type of bridge at a specified geographic location.

PCI_BRIDGE_POST_CONFIG_FUNC_SET - FUNCPTR * pArg
The bridge post-configuration pass initialization routine is provided so that the BSP Developer can initialize the bridge device after the bus that the bridge implements has been enumerated. This routine is specified by calling pciAutoCfgCtl( ) with the PCI_BRIDGE_POST_CONFIG_FUNC_SET command
pciAutoCfgCtl(pCookie, PCI_BRIDGE_POST_CONFIG_FUNC_SET,
        sysPciAutoconfigPostEnumBridgeInit);
This optional user-specified routine takes as input both the bus-device-function tuple, and a 32-bit quantity containing both the PCI deviceID and vendorID of the device. The function prototype for this function is shown below:
STATUS sysPciAutoconfigPostEnumBridgeInit
    (
    PCI_SYSTEM *pSys,
    PCI_LOC *pLoc,
    UINT devVend
    );
This routine may use any combination of these input data to ascertain any special initialization requirements of a particular type of bridge at a specified geographic location.

PCI_ROLLCALL_FUNC_SET - FUNCPTR * pArg
The specified routine will be configured as a roll call routine.

If a roll call routine has been configured, before any configuration is actually done, the roll call routine is called repeatedly until it returns TRUE. A return value of TRUE indicates that either (1) the specified number and type of devices named in the roll call list have been found during PCI bus enumeration or (2) the timeout has expired without finding all of the specified number and type of devices. In either case, it is assumed that all of the PCI devices which are going to appear on the busses have appeared and we can proceed with PCI bus configuration.

PCI_TEMP_SPACE_SET - char * pArg
This command is not currently implemented. It allows the user to set aside memory for use during pciAutoConfigLib execution, e.g. memory set aside using USER_RESERVED_MEM. After PCI configuration has been completed, the memory can be added to the system memory pool using memAddToPool( ).

PCI_MINIMIZE_RESOURCES
This command is not currently implemented. It specifies that pciAutoConfigLib minimize requirements for memory and I/O space.

PCI_PSYSTEM_STRUCT_COPY - PCI_SYSTEM * pArg
This command has been added for ease of converting from the old interface to the new one. This will set each value as specified in the pSystem structure. If the PCI_SYSTEM structure has already been filled, the pciAutoConfig(pSystem) call can be changed to:
void *pCookie;
pCookie = pciAutoConfigLibInit(NULL);
pciAutoCfgCtl(pCookie, PCI_PSYSTEM_STRUCT_COPY, (void *)pSystem);
pciAutoCfgFunc(pCookie);
The fields of the PCI_SYSTEM structure are defined below. For more information about each one, see the paragraphs above and the documentation for pciAutoConfigLib.

pciMem32
Specifies the 32-bit prefetchable memory pool base address.

pciMem32Size
Specifies the 32-bit prefetchable memory pool size.

pciMemIo32
Specifies the 32-bit non-prefetchable memory pool base address.

pciMemIo32Size
Specifies the 32-bit non-prefetchable memory pool size

pciIo32
Specifies the 32-bit I/O pool base address.

pciIo32Size
Specifies the 32-bit I/O pool size.

pciIo16
Specifies the 16-bit I/O pool base address.

pciIo16Size
Specifies the 16-bit I/O pool size.

includeRtn
Specifies the device inclusion routine.

intAssignRtn
Specifies the interrupt assignment routine.

autoIntRouting
Can be set to TRUE to configure pciAutoConfig( ) only to call the BSP interrupt routing routine for devices on bus number 0. Setting autoIntRoutine to FALSE will configure pciAutoConfig( ) to call the BSP interrupt routing routine for every device regardless of the bos on which the device resides.

bridgePreInit
Specifies the bridge initialization routine to call before initializing devices on the bus that the bridge implements.

bridgePostInit
Specifies the bridge initialization routine to call after initializing devices on the bus that the bridge implements.

ERRNO

     EINVAL if pCookie is not NULL or cmd is not recognized

RETURNS

OK, or ERROR if the command or argument is invalid.

SEE ALSO

sysLib


cpv3060 : Routines

pciAutoDevReset( )

NAME

pciAutoDevReset( ) - Quiesce a PCI device and reset all writeable status bits.

SYNOPSIS

STATUS pciAutoDevReset
    (
    PCI_LOC * pPciLoc         /* device to be reset */
    )

DESCRIPTION

This routine turns off a PCI device by disabling the Memory decoders, I/O decoders, and Bus Master capability. The routine also resets all writeable status bits in the status word that follows the command word sequentially in PCI config space by performing a longword access.

RETURNS

OK, always.

SEE ALSO

sysLib


cpv3060 : Routines

pciAutoBusNumberSet( )

NAME

pciAutoBusNumberSet( ) - Set the primary, secondary, and subordinate bus number.

SYNOPSIS

STATUS pciAutoBusNumberSet
    (
    PCI_LOC * pPciLoc,        /* device affected */
    UINT      primary,        /* primary bus specification */
    UINT      secondary,      /* secondary bus specification */
    UINT      subordinate     /* subordinate bus specification */
    )

DESCRIPTION

This routine sets the primary, secondary, and subordinate bus numbers for a device that implements the Type 1 PCI Configuration Space Header.

This routine has external visibility to enable it to be used by BSP Developers for initialization of PCI Host Bridges that may implement registers similar to those found in the Type 1 Header.

RETURNS

OK, always.

SEE ALSO

sysLib


cpv3060 : Routines

pciAutoFuncDisable( )

NAME

pciAutoFuncDisable( ) - Disable a specific PCI function.

SYNOPSIS

void pciAutoFuncDisable
    (
    PCI_LOC * pPciFunc        /* input: Pointer to PCI function struct */
    )

DESCRIPTION

This routine clears the I/O, mem, master, & ROM space enable bits for a single PCI function.

The PCI spec says that devices should normally clear these by default after reset but in actual practice, some PCI devices do not fully comply. This routine ensures that the devices have all been disabled before configuration is started.

RETURNS

N/A.

SEE ALSO

sysLib


cpv3060 : Routines

pciAutoFuncEnable( )

NAME

pciAutoFuncEnable( ) - Perform final configuration and enable a function.

SYNOPSIS

void pciAutoFuncEnable
    (
    PCI_SYSTEM * pSys,        /* for backwards compatibility */
    PCI_LOC *    pFunc        /* input: Pointer to PCI function structure */
    )

DESCRIPTION

Depending upon whether the device is included, this routine initializes a single PCI function as follows:

Initialize the cache line size register Initialize the PCI-PCI bridge latency timers Enable the master PCI bit for non-display devices Set the interrupt line value with the value from the BSP.

RETURNS

N/A.

SEE ALSO

sysLib


cpv3060 : Routines

pciAutoGetNextClass( )

NAME

pciAutoGetNextClass( ) - find the next device of specific type from probe list.

SYNOPSIS

STATUS pciAutoGetNextClass
    (
    PCI_SYSTEM * pSys,        /* for backwards compatibility */
    PCI_LOC *    pPciFunc,    /* output: Contains the BDF of the device found */
    UINT *       index,       /* Zero-based device instance number */
    UINT         pciClass,    /* class code field from the PCI header */
    UINT         mask         /* mask is ANDed with the class field */
    )

DESCRIPTION

The function uses the probe list which was built during the probing process. Using configuration accesses, it searches for the occurrence of the device subject to the class and mask restrictions outlined below. Setting class to zero and mask to zero allows searching the entire set of devices found regardless of class.

RETURNS

TRUE if a device was found, else FALSE.

SEE ALSO

sysLib


cpv3060 : Routines

pciAutoRegConfig( )

NAME

pciAutoRegConfig( ) - Assign PCI space to a single PCI base address register.

SYNOPSIS

UINT pciAutoRegConfig
    (
    PCI_SYSTEM * pSys,        /* backwards compatibility */
    PCI_LOC *    pPciFunc,    /* Pointer to function in device list */
    UINT         baseAddr,    /* Offset of base PCI address */
    UINT         nSize,       /* Size and alignment requirements */
    UINT         addrInfo     /* PCI address type information */
    )

DESCRIPTION

This routine allocates and assigns PCI space (either memory or I/O) to a single PCI base address register.

RETURNS

Returns (1) if BAR supports mapping anywhere in 64-bit address space. Returns (0) otherwise.

SEE ALSO

sysLib


cpv3060 : Routines

pciAutoAddrAlign( )

NAME

pciAutoAddrAlign( ) - Align a PCI address and check boundary conditions.

SYNOPSIS

STATUS pciAutoAddrAlign
    (
    UINT32   base,            /* base of available memory */
    UINT32   limit,           /* last addr of available memory */
    UINT32   reqSize,         /* required size */
    UINT32 * pAlignedBase     /* output: aligned address put here */
    )

DESCRIPTION

RETURNS

OK, or ERROR if available memory has been exceeded.

SEE ALSO

sysLib


cpv3060 : Routines

pciAutoConfig( )

NAME

pciAutoConfig( ) - Automatically configure all nonexcluded PCI headers. Obsolete.

SYNOPSIS

void pciAutoConfig
    (
    PCI_SYSTEM * pSystem      /* PCI system to configure */
    )

DESCRIPTION

This routine is obsolete. It is included for backward compatibility only. It is recommended that you use the pciAutoCfg( ) interface instead of this one.

Top level function in the PCI configuration process.

For all nonexcluded PCI functions on all PCI bridges, this routine will automatically configure the PCI configuration headers for PCI devices and subbridges. The fields that are programmed are:

1. Status register.
2. Command Register.
3. Latency timer.
4. Cache Line size.
5. Memory and/or I/O base address and limit registers.
6. Primary, secondary, subordinate bus number (for PCI-PCI bridges).
7. Expansion ROM disable.
8. Interrupt Line.
*

ALGORITHM

Probe PCI config space and create a list of available PCI functions. Call device exclusion function, if registered, to exclude/include device. Disable all devices before we initialize any. Allocate and assign PCI space to each device. Calculate and set interrupt line value. Initialize and enable each device.

RETURNS

N/A.

SEE ALSO

sysLib


cpv3060 : Routines

sysPciAutoConfig( )

NAME

sysPciAutoConfig( ) - PCI autoConfig support routine

SYNOPSIS

void sysPciAutoConfig (void)

DESCRIPTION

This routine instantiates the PCI_SYSTEM structure needed to configure the system. This consists of assigning address ranges to each category of PCI system resource: Prefetchable and Non-Prefetchable 32-bit Memory, and 16- and 32-bit I/O. Global values for the Cache Line Size and Maximum Latency are also specified. Finally, the four supplemental routines for device inclusion/exclusion, interrupt assignment, and pre- and post-enumeration bridge initialization are specified.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysSerialHwInit( )

NAME

sysSerialHwInit( ) - initialize the BSP serial devices to a quiesent state

SYNOPSIS

void sysSerialHwInit (void)

DESCRIPTION

This routine initializes the BSP serial device descriptors and puts the devices in a quiesent state. It is called from sysHwInit( ) with interrupts locked.

Data Parameter Ram layout:

-----------------------------
|                           | DPRAM base (address = 0x2000)
|                           |
|                           |
|---------------------------|
| 8 bytes per descriptor    | Tx Buffer Descriptor (0x2200)
|---------------------------|
|                           |
|---------------------------|
| 16 descriptors @          | Rx Buffer Descriptors (0x2210)
| 8 bytes per descriptor    | 
|                           |
|---------------------------|
|                           | end Rx BDs (0x2290)
|                           |
|                           |
|---------------------------|
| 80 bytes allowed          | Tx Buffer (0x2300)
|---------------------------|
| one receive char/buffer   | Rx Buffer (0x2380)
|---------------------------|
|                           |
|                           |
|                           |
|---------------------------|
| 66 hex bytes of parameter | SCC2 Parameter Area (0x3d00)
| info including Rx and Tx  |
| BD pointers, func codes   |
| etc...                    |
|---------------------------|
|                           |
|---------------------------|
| 3A hex bytes of parameter | SMC1 Parameter Area (0x3e80)
| info including Rx and Tx  | 
| BD pointers, func codes   |
| etc...                    |
|---------------------------|

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysSerialHwInit2( )

NAME

sysSerialHwInit2( ) - connect BSP serial device interrupts

SYNOPSIS

void sysSerialHwInit2 (void)

DESCRIPTION

This routine connects the BSP serial device interrupts. It is called from sysHwInit2( ). Serial device interrupts could not be connected in sysSerialHwInit( ) because the kernel memory allocator was not initialized at that point, and intConnect( ) calls malloc( ).

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysSerialChanGet( )

NAME

sysSerialChanGet( ) - get the SIO_CHAN device associated with a serial channel

SYNOPSIS

SIO_CHAN * sysSerialChanGet
    (
    int channel               /* serial channel */
    )

DESCRIPTION

This routine gets the SIO_CHAN device associated with a specified serial channel.

RETURNS

A pointer to the SIO_CHAN structure for the channel, or ERROR if the channel is invalid.

SEE ALSO

sysLib


cpv3060 : Routines

sysSerialReset( )

NAME

sysSerialReset( ) - reset the serial device

SYNOPSIS

void sysSerialReset (void)

DESCRIPTION

This function calls sysSerialHwInit( ) to reset the serial device

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

ppc860IntrInit( )

NAME

ppc860IntrInit( ) - initialize the interrupt manager for the PowerPC 860 series

SYNOPSIS

void ppc860IntrInit ()

DESCRIPTION

This routine connects the default demultiplexer, ppc860IntrDeMux( ) to the external interrupt vector and associates all interrupt sources with the default interrupt handler. This routine is called by sysHwInit( ) in sysLib.c.

NOTE

All interrupt from the SIU and CPM unit are enabled, CICR is setup so that SCC1 has the highest relative interrupt priority, through SCC4 with the lowest.

RETURN

OK or ERROR if the SUI interrupt level to connect the CPM interrupt contoller is wrong.

SEE ALSO

sysLib


cpv3060 : Routines

ppc860IntrInit2( )

NAME

ppc860IntrInit2( ) - initialize the interrupt manager for the PowerPC 860 series

SYNOPSIS

STATUS ppc860IntrInit2
    (
    VOIDFUNCPTR * cpmIntrVec  /* Intr level of the CPM Intr ctrl */
    )

DESCRIPTION

This routine connects the ppc860CpmIntrDeMux demultiplexer to the
 ppc860IntrDeMux( ).  This routine is called by sysHwInit2( ) in sysLib.c.

NOTE

All interrupts from the CPM unit are enabled.

RETURN

OK or ERROR if the SUI interrupt level to connect the CPM interrupt contoller is wrong.

SEE ALSO

sysLib


cpv3060 : Routines

ppc860IntConnect( )

NAME

ppc860IntConnect( ) - connect a routine to an interrupt

SYNOPSIS

STATUS ppc860IntConnect
    (
    VOIDFUNCPTR * vector,     /* interrupt vector to attach to */
    VOIDFUNCPTR   routine,    /* routine to be called */
    int           parameter   /* parameter to be passed to routine */
    )

DESCRIPTION

This routine connects any C or assembly routine to one of the multiple sources of interrupts.

The connected routine can be any normal C code, except that it must not invoke certain operating system functions that may block or perform I/O operations.

This board supports PCI interrupts, so interrupt chaining is implemented by this routine.

Standard vector types are defined in h/drv/intrClt/ppc860Intr.h, additional interrupt vectors are defined in the "board".h file in the BSP directory.

RETURNS

OK, or ERROR if vector is unknown.

SEE ALSO

sysLib, ppc860Intr.h


cpv3060 : Routines

ppc860IntrDeMux( )

NAME

ppc860IntrDeMux( ) - SIU level interrupt demultiplexer

SYNOPSIS

void ppc860IntrDeMux (void)

DESCRIPTION

This routine is bound to external interrupt exception (vector 0x500). It handles all external interrupts routed through the SIU, including additional support devices for the board (e.g. PCI ). It calls the appropriate handler(s) with its argument when an interrupt occurs to the SIU.

NOTE

when this function is called the interrupts are still locked. It's this function responsibility to unlock the interrupt.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

ppc860CpmIntrDeMux( )

NAME

ppc860CpmIntrDeMux( ) - CPM interrupt demultiplexer

SYNOPSIS

void ppc860CpmIntrDeMux
    (
    int simaskLevel           /* mask out lower level CPM intrs */
    )

DESCRIPTION

This routine must be bound to one of the SIU interrupts, which will cause the ppc860IntrDeMux handler to call this handler when a CPM interrupt is received.

It is used to call the appropriate handler with its argument when a CPM interrupt occurs. Since CPM interrupts cannot be chained, we only make a single handler call and then exit.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

ppc860IntEnable( )

NAME

ppc860IntEnable( ) - enable one of the Level or IRQ interrupts into the SIU

SYNOPSIS

int ppc860IntEnable
    (
    int intNum                /* interrupt level to enable */
    )

DESCRIPTION

or one of the CPM interrupts

This routine will unmask the bit in the SIMASK register corresponding to the requested interrupt level for SIU interrupts, or unmask the appropriate bit in the CIMR register for the CPM. The interrupt level must be in the range of 0 - 31 for SIU interrupts, and 32 - 63 for CPM interrupts.

RETURNS

OK, or ERROR if intNum is out of range

SEE ALSO

sysLib


cpv3060 : Routines

ppc860IntDisable( )

NAME

ppc860IntDisable( ) - disable one of the Level or IRQ interrupts into the SIU

SYNOPSIS

int ppc860IntDisable
    (
    int intNum                /* interrupt level to disable */
    )

DESCRIPTION

or one of the CPM interrupts

This routine will mask the bit in the SIMASK register corresponding to the requested interrupt level for SIU interrupts, or mask the appropriate bit in the CIMR register for the CPM. The interrupt level must be in the range of 0 - 31 for SIU interrupts, and 32 - 63 for CPM interrupts.

RETURNS

OK, or ERROR if intNum is out of range

SEE ALSO

sysLib


cpv3060 : Routines

sysClkConnect( )

NAME

sysClkConnect( ) - connect a routine to the system clock interrupt

SYNOPSIS

STATUS sysClkConnect
    (
    FUNCPTR routine,          /* routine to connect */
    int     arg               /* argument for the routine */
    )

DESCRIPTION

This routine specifies the interrupt service routine to be called at each clock interrupt. Normally, it is called from usrRoot( ) in usrConfig.c to connect usrClock( ) to the system clock interrupt.

RETURNS

OK, or ERROR if the routine cannot be connected to the interrupt.

SEE ALSO

sysLib, intConnect( ), usrClock( ), sysClkEnable( )


cpv3060 : Routines

sysClkEnable( )

NAME

sysClkEnable( ) - turn on system clock interrupts

SYNOPSIS

void sysClkEnable (void)

DESCRIPTION

This routine enables system clock interrupts.

RETURNS

N/A

SEE ALSO

sysLib, sysClkConnect( ), sysClkDisable( ), sysClkRateSet( )


cpv3060 : Routines

sysClkDisable( )

NAME

sysClkDisable( ) - turn off system clock interrupts

SYNOPSIS

void sysClkDisable (void)

DESCRIPTION

This routine disables system clock interrupts.

RETURNS

N/A

SEE ALSO

sysLib, sysClkEnable( )


cpv3060 : Routines

sysClkRateGet( )

NAME

sysClkRateGet( ) - get the system clock rate

SYNOPSIS

int sysClkRateGet (void)

DESCRIPTION

This routine returns the system clock rate.

RETURNS

The number of ticks per second of the system clock.

SEE ALSO

sysLib, sysClkEnable( ), sysClkRateSet( )


cpv3060 : Routines

sysClkRateSet( )

NAME

sysClkRateSet( ) - set the system clock rate

SYNOPSIS

STATUS sysClkRateSet
    (
    int ticksPerSecond        /* number of clock interrupts per second */
    )

DESCRIPTION

This routine sets the interrupt rate of the system clock. It is called by usrRoot( ) in usrConfig.c.

RETURNS

OK, or ERROR if the tick rate is invalid or the timer cannot be set.

SEE ALSO

sysLib, sysClkEnable( ), sysClkRateGet( )


cpv3060 : Routines

sysNvRamGet( )

NAME

sysNvRamGet( ) - get the contents of non-volatile RAM

SYNOPSIS

STATUS sysNvRamGet
    (
    char * string,            /* where to copy non-volatile RAM */
    int    strLen,            /* maximum number of bytes to copy */
    int    offset             /* byte offset into non-volatile RAM */
    )

DESCRIPTION

This routine copies the contents of non-volatile memory into a specified string. The string is terminated with an EOS.

RETURNS

OK, or ERROR if access is outside the non-volatile RAM range.

SEE ALSO

sysLib, sysNvRamSet( )


cpv3060 : Routines

sysNvRamSet( )

NAME

sysNvRamSet( ) - write to non-volatile RAM

SYNOPSIS

STATUS sysNvRamSet
    (
    char * string,            /* string to be copied into non-volatile RAM */
    int    strLen,            /* maximum number of bytes to copy */
    int    offset             /* byte offset into non-volatile RAM */
    )

DESCRIPTION

This routine copies a specified string into non-volatile RAM.

RETURNS

OK, or ERROR if access is outside the non-volatile RAM range.

SEE ALSO

sysLib, sysNvRamGet( )


cpv3060 : Routines

cpvI2cEepromRead( )

NAME

cpvI2cEepromRead( ) - read EEPROM for DRAM information

SYNOPSIS

UINT cpvI2cEepromRead
    (
    UINT    i2cDevAdrs,       /* I2C device address */
    UCHAR * pBuf,             /* buffer pointer (>= 32 bytes) */
    UINT    epromType         /* EEPROM type: 0 = IBM, 1 = MOT */
    )

DESCRIPTION

This function's purpose is to retrieve the serial presence detect data (need the first 32 bytes) from the specified EEPROM. These EEPROMs are located on the I2C bus.

This routine is responsible for determining the size of the on-board SDRAM. It uses values read from the serial presence detect data to perform the sizing. The following fields are used in the sizing algorithm:
   rows - number of row address lines per bank (byte 3)
   cols - number of column address lines per bank (byte 4)
   pBanks - number of physical banks (byte 5)
   dBanks - number of logical banks per device (byte 17)
   dWidth - data width, in bits of memory (byte 6)

The algorithm for determining the size of the SDRAM is:

total size in bytes =
   (2**rows * 2**cols) * (dWidth / 4) * (pBanks * dBanks)

RETURNS

size of DRAM array in bytes if OK or -1 if I2C device access error, -2 if data failed sanity check

SEE ALSO

sysLib


cpv3060 : Routines

cpvI2cSromRead( )

NAME

cpvI2cSromRead( ) - read SROM for DRAM information

SYNOPSIS

UINT cpvI2cSromRead
    (
    UINT    i2cDevAdrs,       /* I2C device address */
    UCHAR * pBuf,             /* buffer pointer (>= 16 bytes) */
    UINT    devOffset,        /* I2C address offset */
    UINT    byteCount         /* I2C bytes to read */
    )

DESCRIPTION

This function's purpose is to retrieve the serial presence detect data (the first 16 bytes) from the specified EEPROM. These EEPROMs are located on the I2C bus.

RETURNS

size of DRAM array in bytes if OK or -1 if I2C device access error, -2 if data failed sanity check

SEE ALSO

sysLib


cpv3060 : Routines

qspanHostInit( )

NAME

qspanHostInit( ) - initialize the QSpan PCIBus bridge controller

SYNOPSIS

void qspanHostInit
    (
    UINT32 qspanAdr           /* base address of the QSpan device regs. */
    )

DESCRIPTION

This function's purpose is to initialize the QSpan device. This device spans the QBus to PCIBus.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

qspanRegMap( )

NAME

qspanRegMap( ) - map QSPAN registers

SYNOPSIS

STATUS qspanRegMap
    (
    UINT32 qspanAdr,          /* base address of the QSpan device regs. */
    UINT32 pciSpace,          /* determines which PCI space to map */
    UINT32 baseAdr            /* QSPAN base address */
    )

DESCRIPTION

This function will map a 4KB block in either PCI memory of I/O space to allow access to the QSPAN register set.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

qspanSlaveImageSet( )

NAME

qspanSlaveImageSet( ) - setup a PCI slave image

SYNOPSIS

void qspanSlaveImageSet
    (
    UINT32 qspanAdr,          /* base address of the QSpan device regs. */
    UINT32 image,             /* slave image number 0 or 1 */
    UINT32 cntrlRegValue,     /* value to be stored in the slave image */
                              /* control register */ 
    UINT32 adrRegValue        /* value to be stored in the slave image */
                              /* address translation register */ 
    )

DESCRIPTION

This function will program one of the QSPAN PCI slave images (CPU to PCI mapping).

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

qspanTargetImageSet( )

NAME

qspanTargetImageSet( ) - setup a PCI target image

SYNOPSIS

void qspanTargetImageSet
    (
    UINT32 qspanAdr,          /* base address of the QSpan device regs. */
    UINT32 image,             /* target image number 0 or 1 */
    UINT32 pciBaseAdr,        /* base address of the target image */
    UINT32 translateAdr,      /* base address for translation of target adr */
    UINT32 cntrlRegValue      /* value to be stored in the target image */
                              /* control register */ 
    )

DESCRIPTION

This function will program the selected QSPAN PCI target image (mapping the address space from the point of view of the PCI bus). It is used mostly for mapping access from PCI memory space to the local DRAM.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

qspanHostEnable( )

NAME

qspanHostEnable( ) - enable the bridge

SYNOPSIS

void qspanHostEnable
    (
    UINT32 qspanAdr           /* base address of the QSpan device regs. */
    )

DESCRIPTION

This function enables I/O-space, memory-space, and bus mastering on the host.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

qspanHostReset( )

NAME

qspanHostReset( ) - reset the QSpan PCIBus bridge controller

SYNOPSIS

void qspanHostReset
    (
    UINT32 qspanAdr           /* base address of the QSpan device regs. */
    )

DESCRIPTION

This function's purpose is to reset the QSpan device.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

cpvMemcConfig( )

NAME

cpvMemcConfig( ) - configure the MEMC registers

SYNOPSIS

void cpvMemcConfig (void)

DESCRIPTION

This routine will perform the final adjustments to the Memory Controller Bank/Option registers.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysCpvMsDelay( )

NAME

sysCpvMsDelay( ) - delay for the specified amount of time (MS)

SYNOPSIS

void sysCpvMsDelay
    (
    UINT delay                /* length of time in MS to delay */
    )

DESCRIPTION

This routine will delay for the specified amount of time by counting decrementer ticks.

This routine is not dependent on a particular rollover value for the decrementer, it should work no matter what the rollover value is.

A small amount of count may be lost at the rollover point resulting in the sysCpvMsDelay( ) causing a slightly longer delay than requested.

This routine will produce incorrect results if the delay time requested requires a count larger than 0xffffffff to hold the decrementer elapsed tick count. For a System Bus Speed of 67 MHZ this amounts to about 258 seconds.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysGetBusSpd( )

NAME

sysGetBusSpd( ) - routine to get the speed of the 60x processor bus

SYNOPSIS

UINT sysGetBusSpd (void)

DESCRIPTION

This routine returns the speed (in Hz) of the 60x system bus.

RETURNS

The bus speed (inHz).

SEE ALSO

sysLib


cpv3060 : Routines

sysGetPciSpd( )

NAME

sysGetPciSpd( ) - routine to get the speed of the PCI bus

SYNOPSIS

UINT sysGetPciSpd (void)

DESCRIPTION

This routine returns the speed (in Hz) of the PCI bus.

RETURNS

The bus speed (inHz).

SEE ALSO

sysLib


cpv3060 : Routines

sysGetMpuSpd( )

NAME

sysGetMpuSpd( ) - routine to get the speed of the 60x processor bus

SYNOPSIS

UINT sysGetMpuSpd (void)

DESCRIPTION

This routine returns the speed (in Hz) of the 60x system bus.

RETURNS

The bus speed (inHz).

SEE ALSO

sysLib


cpv3060 : Routines

sysVpdInit( )

NAME

sysVpdInit( ) - initialize the board vital product data structures.

SYNOPSIS

STATUS sysVpdInit (void)

DESCRIPTION

This routine reads the VPD and extracts the commonly used data.

RETURNS

OK, if successful or ERROR if unsuccessful.

SEE ALSO

sysLib, N/A( )


cpv3060 : Routines

sysProdConfigGet( )

NAME

sysProdConfigGet( ) - initialize the board vital product data structures.

SYNOPSIS

BOOL sysProdConfigGet
    (
    UINT32 optionId           /* packet type to match */
    )

DESCRIPTION

This routine tests the presence of a caller specified product configuration option using the contents of the product configuration option vpd packet.

RETURNS

TRUE if the option is present or FALSE if the product configuration option is not present or if the product configuration option packet is missing.

SEE ALSO

sysLib, N/A


cpv3060 : Routines

i2cMcp( )

NAME

i2cMcp( ) - download RISC microcode patch

SYNOPSIS

void i2cMcp ()

DESCRIPTION

This function's purpose is to install the RISC microcode patch.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysDec2155xInit( )

NAME

sysDec2155xInit( ) - initialize registers of the Dec2155x (Drawbridge) chip

SYNOPSIS

STATUS sysDec2155xInit (void)

DESCRIPTION

This routine initializes registers of the DEC 2155x PCI-to-PCI bridge and maps access to the Compact PCI bus.

RETURNS

OK on success, else ERROR (Dec2155x not in correct state).

SEE ALSO

sysLib


cpv3060 : Routines

sysDec2155xInit2( )

NAME

sysDec2155xInit2( ) - perform phase 2 Dec2155x initialization

SYNOPSIS

void sysDec2155xInit2 (void)

DESCRIPTION

This routine performs the initialization that must be performed after PCI auto-configuration.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysIntDisable( )

NAME

sysIntDisable( ) - disable a bus interrupt level (vector)

SYNOPSIS

STATUS sysIntDisable
    (
    int intLevel              /* interrupt level (vector) */
    )

DESCRIPTION

This routine disables reception of a specified Compact PCI interrupt level.

Since Compact PCI interrupts are routed directly to the interrupt controller, this function simply passes the caller's parameter through to the standard intDisable function (which will eventually end up at the interrupt controller's intDisable function).

RETURNS

The results of intDisable.

SEE ALSO

sysLib, sysIntEnable( )


cpv3060 : Routines

sysIntEnable( )

NAME

sysIntEnable( ) - enable a Compact PCI bus interrupt level (vector)

SYNOPSIS

STATUS sysIntEnable
    (
    int intLevel              /* interrupt level (vector) */
    )

DESCRIPTION

This routine enables reception of a specified Compact PCI interrupt level.

Since Compact PCI interrupts are routed directly to the interrupt controller, this function simply passes the caller's parameter through to the standard intEnable function (which will eventually end up at the interrupt controller's intEnable function).

RETURNS

The results of intEnable.

SEE ALSO

sysLib, sysIntDisable( )


cpv3060 : Routines

sysBusIntAck( )

NAME

sysBusIntAck( ) - acknowledge a bus interrupt

SYNOPSIS

int sysBusIntAck
    (
    int intLevel              /* interrupt level to acknowledge */
    )

DESCRIPTION

This routine acknowledges a specified Compact PCI bus interrupt level.

NOTE

This routine is included for BSP compliance only. Since Compact PCI bus interrupts are routed directly to the interrupt controller, interrupts are re-enabled in the interrupt controller's handler and this routine is a no-op.

RETURNS

NULL.

SEE ALSO

sysLib, sysBusIntGen( )


cpv3060 : Routines

sysBusIntGen( )

NAME

sysBusIntGen( ) - generate a bus interrupt

SYNOPSIS

STATUS sysBusIntGen
    (
    int level,                /* interrupt level to generate (not used) */
    int vector                /* interrupt vector for interrupt */
    )

DESCRIPTION

This routine generates a Compact PCI backpanel interrupt by setting one of the 16 bits in the 2155x Primary Set IRQ register. The bit is set regardless of the current state of the bit and whether the interrupt has been enabled by the host processor. Because the Compact PCI bus does not have interrupt levels or vectors, the caller's interrupt level parameter is ignored and the caller's vector number is used to select the bit to set in the Primary Set IRQ Register. The symbol DEC2155X_DOORBELL0_INT_VEC corresponds to bit 0 (LSB) and the remaining bits are mapped in sequence.

RETURNS

OK, or ERROR if vector is out of range.

SEE ALSO

sysLib, sysBusIntAck( )


cpv3060 : Routines

sysDec2155xIntDisable( )

NAME

sysDec2155xIntDisable( ) - disable a Dec2155x internal interrupt

SYNOPSIS

STATUS sysDec2155xIntDisable
    (
    int vector                /* interrupt vector for interrupt */
    )

DESCRIPTION

This routine disables the specified internal Dec2155x interrupt.

RETURNS

OK, or ERROR if invalid interrupt vector.

SEE ALSO

sysLib, sysDec2155xIntEnable( )


cpv3060 : Routines

sysDec2155xIntEnable( )

NAME

sysDec2155xIntEnable( ) - Enable a Dec2155x internal interrupt

SYNOPSIS

STATUS sysDec2155xIntEnable
    (
    int vector                /* interrupt vector for interrupt */
    )

DESCRIPTION

This routine enables the specified internal Dec2155x interrupt.

RETURNS

OK, or ERROR if invalid interrupt vector.

SEE ALSO

sysLib, sysDec2155xIntDisable( )


cpv3060 : Routines

sysMailboxConnect( )

NAME

sysMailboxConnect( ) - connect a routine to the mailbox interrupt

SYNOPSIS

STATUS sysMailboxConnect
    (
    FUNCPTR routine,          /* routine called at each mailbox interrupt */
    int     arg               /* argument with which to call routine */
    )

DESCRIPTION

This routine specifies the interrupt service routine to be called at each mailbox interrupt.

NOTE

The mailbox interrupt is DEC2155X_MAILBOX_INT_VEC.

RETURNS

OK, or ERROR if the routine cannot be connected to the interrupt.

SEE ALSO

sysLib, intConnect( ), sysMailboxEnable( )


cpv3060 : Routines

sysMailboxEnable( )

NAME

sysMailboxEnable( ) - enable the mailbox interrupt

SYNOPSIS

STATUS sysMailboxEnable
    (
    char * mailboxAdrs        /* address of mailbox (ignored) */
    )

DESCRIPTION

This routine enables the mailbox interrupt.

NOTE

The mailbox interrupt is DEC2155X_MAILBOX_INT_VEC.

RETURNS

OK, always.

SEE ALSO

sysLib, sysMailboxConnect( ), sysMailboxDisable( )


cpv3060 : Routines

sysMailboxDisable( )

NAME

sysMailboxDisable( ) - disable the mailbox interrupt

SYNOPSIS

STATUS sysMailboxDisable
    (
    char * mailboxAdrs        /* address of mailbox (ignored) */
    )

DESCRIPTION

This routine disables the mailbox interrupt.

NOTE

The mailbox interrupt is DEC2155X_MAILBOX_INT_VEC.

RETURNS

OK, always.

SEE ALSO

sysLib, sysMailboxConnect( ), sysMailboxEnable( )


cpv3060 : Routines

sysDec2155xErrClr( )

NAME

sysDec2155xErrClr( ) - Dec2155x Error Clear routine

SYNOPSIS

void sysDec2155xErrClr (void)

DESCRIPTION

This is the Error clear routine for the Dec21554x PCI to PCI Bridge. The following error bits are cleared:

Secondary Status Register: Data Parity Detected Signaled Target Abort Received Target Abort Received Master Abort Signaled System Error Detected Parity Error

Primary Status Register: Received Master Abort

Chip Status Register: Upstream Delayed Transaction Master Timeout Upstream Delayed Read Transaction Discarded Upstream Delayed Write Transaction Discarded Upstream Posted Write Data Discarded

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysDec2155xIntr( )

NAME

sysDec2155xIntr( ) - Dec2155x (Drawbridge) PCI-to-PCI interrupt handler

SYNOPSIS

void sysDec2155xIntr (void)

DESCRIPTION

This is the interrupt handler for the Dec2155x PCI-to-PCI Bridge. It is connected to the single Dec2155x interrupt from the interrupt controller and examines the Dec2155x chip to determine the interrupt number of the interrupt source. Having obtained the interrupt number, this routine then indexes into the system vector table and dispatches the specified interrupt handling routine(s).

NOTE

The Dec2155x does not present a vector number. Each interrupt source within the chip is examined to determine the interrupt source and a logical interrupt vector number is synthesized as a result of that search. The search order is as follows:

Power Management Transition to D0 (due to response time requirements) Secondary doorbell interrupts I20 interrupt Upstream Memory 2 BAR page crossing interrupts.

This handler will clear all interrupt sources except the Upstream Memory 2 BAR page crossing interrupts. Since there are 64 of these interrupts, it is left to the page crossing handler to clear the interrupts it services. This policy eliminates races in determining which page crossing interrupts were presented in time for the handler to see them vs. those that arrived too late for processing. The only exception to this policy in the case of a page crossing interrupt arriving without a registered handler. This is a programming error, but to protect itself, the interrupt handler will clear any pending page crossing interrupts before reporting the un-handled interrupt.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysDec2155xChkEnables( )

NAME

sysDec2155xChkEnables( ) - check the originating and target bus enables

SYNOPSIS

STATUS sysDec2155xChkEnables
    (
    UINT32 origOffset,
    UINT32 trgtOffset,
    UINT32 adrsSpace
    )

DESCRIPTION

This routine examines the states of the I/O or Memory enables on the originating bus and the Master Enable on the target bus. Both must be enabled before the Dec2155x can pass a transaction across to the opposite bus.

RETURNS

OK if the bridge is active, else ERROR

SEE ALSO

sysLib, sysLocalToBusAdrs( ), sysBusToLocalAdrs( ), sysDec2155xCnvrtAdrs( )


cpv3060 : Routines

sysModel( )

NAME

sysModel( ) - return the model name of the CPU board

SYNOPSIS

char * sysModel (void)

DESCRIPTION

This routine returns the model name of the CPU board.

RETURNS

A pointer to the string.

SEE ALSO

sysLib


cpv3060 : Routines

sysBspRev( )

NAME

sysBspRev( ) - return the bsp version with the revision eg 1.0/x

SYNOPSIS

char * sysBspRev (void)

DESCRIPTION

This function returns a pointer to a bsp version with the revision. for eg. 1.0/x. BSP_REV defined in config.h is concatanated to BSP_VERSION and returned.

RETURNS

A pointer to the BSP version/revision string.

SEE ALSO

sysLib


cpv3060 : Routines

sysClkRateAdjust( )

NAME

sysClkRateAdjust( ) - Adjust the clock frequency

SYNOPSIS

void sysClkRateAdjust
    (
    int * sysDecClkFreq       /* adjusted clock frequency returned */
    )

DESCRIPTION

This function recalculates the decrementer clock frequency value based on the actual system clock speed.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysHwInit( )

NAME

sysHwInit( ) - initialize the system hardware

SYNOPSIS

void sysHwInit (void)

DESCRIPTION

This routine initializes various features of the MPC860 boards. It sets up the control registers, initializes various devices if they are present.

NOTE

This routine should not be called directly by the user.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysPciCfgRead( )

NAME

sysPciCfgRead( ) - read longword from PCI configuration space

SYNOPSIS

STATUS sysPciCfgRead
    (
    int      busNo,           /* PCI bus number to access */
    int      deviceNo,        /* PCI device number to read from */
    int      funcNo,          /* function number of the PCI device */
    int      offset,          /* offset into configuration space header */
    UINT32 * pResult          /* address to put the result in */
    )

DESCRIPTION

This does a QSPAN style PCI read. This function is passed as a pointer during initialization of PCI mechanism 0 in pciConfigLibInit. This function has the machine check handler support included in.

RETURNS

OK always.

SEE ALSO

sysLib


cpv3060 : Routines

sysPciCfgWrite( )

NAME

sysPciCfgWrite( ) - write longword to PCI configuration space

SYNOPSIS

STATUS sysPciCfgWrite
    (
    int    busNo,             /* PCI bus number to access */
    int    deviceNo,          /* PCI device number to read from */
    int    funcNo,            /* function number of the PCI device */
    int    offset,            /* offset into configuration space header */
    UINT32 data               /* data to be stored in config space */
    )

DESCRIPTION

This does a QSPAN style PCI write. This function is passed as a pointer during initialization of PCI mechanism 0 in pciConfigLibInit. This function has the machine check handler support included in.

RETURNS

OK always

SEE ALSO

sysLib


cpv3060 : Routines

sysPhysMemTop( )

NAME

sysPhysMemTop( ) - get the address of the top of physical memory

SYNOPSIS

char * sysPhysMemTop (void)

DESCRIPTION

This routine returns the address of the first missing byte of memory, which indicates the top of memory.

RETURNS

The address of the top of physical memory.

SEE ALSO

sysLib, sysMemTop( )


cpv3060 : Routines

sysMemTop( )

NAME

sysMemTop( ) - get the address of the top of VxWorks memory

SYNOPSIS

char * sysMemTop (void)

DESCRIPTION

This routine returns a pointer to the first byte of memory not controlled or used by VxWorks.

The user can reserve memory space by defining the macro USER_RESERVED_MEM in config.h. This routine returns the address of the reserved memory area. The value of USER_RESERVED_MEM is in bytes.

RETURNS

The address of the top of VxWorks memory.

SEE ALSO

sysLib


cpv3060 : Routines

sysToMonitor( )

NAME

sysToMonitor( ) - transfer control to the ROM monitor

SYNOPSIS

STATUS sysToMonitor
    (
    int startType             /* parameter passed to ROM to tell it how */
                              /* to boot */ 
    )

DESCRIPTION

This routine transfers control to the ROM monitor. Normally, it is called only by reboot( )--which services ^X--and bus errors at interrupt level. However, in some circumstances, the user may wish to introduce a startType to enable special boot ROM facilities.

RETURNS

Does not return.

SEE ALSO

sysLib


cpv3060 : Routines

sysProcNumGet( )

NAME

sysProcNumGet( ) - get the processor number

SYNOPSIS

int sysProcNumGet (void)

DESCRIPTION

This routine returns the processor number for the CPU board, which is set with sysProcNumSet( ).

RETURNS

The processor number for the CPU board.

SEE ALSO

sysLib, sysProcNumSet( )


cpv3060 : Routines

sysProcNumSet( )

NAME

sysProcNumSet( ) - set the processor number

SYNOPSIS

void sysProcNumSet
    (
    int procNum               /* processor number */
    )

DESCRIPTION

This routine sets the processor number for the CPU board. Processor numbers should be unique on a single backplane.

Not applicable for the busless 860Ads.

RETURNS

N/A

SEE ALSO

sysLib, sysProcNumGet( )


cpv3060 : Routines

sysLocalToBusAdrs( )

NAME

sysLocalToBusAdrs( ) - convert a local CPU address to a PCI bus address

SYNOPSIS

STATUS sysLocalToBusAdrs
    (
    int      adrsSpace,       /* bus address space where busAdrs resides */
    char *   localAdrs,       /* local address to convert */
    char * * pBusAdrs         /* where to return bus address */
    )

DESCRIPTION

Given a CPU address, this routine returns a corresponding local PCI bus or Compact (backpanel) PCI bus address provided that such an address exists. The target PCI bus (local or backpanel) is selected by the adrsSpace parameter. Legal values for this parameter are found in "pci.h". If a transparent bridge is used to access the Compact PCI bus, the local PCI bus and the backpanel PCI bus share the same address space. In this case, the local and backpanel address space designators are synonomous.

RETURNS

OK, or ERROR if the address space is unknown or the mapping is not possible.

SEE ALSO

sysLib, sysBusToLocalAdrs( )


cpv3060 : Routines

sysBusToLocalAdrs( )

NAME

sysBusToLocalAdrs( ) - convert a PCI bus address to a local CPU address

SYNOPSIS

STATUS sysBusToLocalAdrs
    (
    int      adrsSpace,       /* bus address space where busAdrs resides */
    char *   busAdrs,         /* bus address to convert */
    char * * pLocalAdrs       /* where to return local address */
    )

DESCRIPTION

Given a local or Compact (backpanel) PCI address, this routine returns a corresponding local CPU bus address provided such an address exists. The originating PCI bus (local or backpanel) is selected by the adrsSpace parameter. Legal values for this parameter are found in "pci.h". If a transparent bridge is used to access the Compact PCI bus, the local PCI bus and the Compact PCI bus share the same address space. In this case, the local and backpanel address space designators are synonomous.

RETURNS

OK, or ERROR if the address space is unknown or the mapping is not possible.

SEE ALSO

sysLib, sysLocalToBusAdrs( )


cpv3060 : Routines

sysBusTas( )

NAME

sysBusTas( ) - test and set a location across the bus

SYNOPSIS

BOOL sysBusTas
    (
    char * adrs               /* address to be tested and set */
    )

DESCRIPTION

The cPCI bridge chips do not support PCI target locking, therefore there is no atomic RMW operation. This routine performs a software-based mutual exclusion algorithm in place of a true test and set.

NOTE

This algorithm is performed through a PCI-to-PCI bridge to a shared location that is subject to unprotected access by multiple simultaneous processors. There is the possibility that the bridge will deliver a delayed read completion to a PCI bus master which was not the original initiator of the delayed read. The bridge delivers the delayed read completion to the new requestor because it believes that the new delayed read request is actually the original master performing a delayed read retry as required by the PCI spec. When the original master comes back with the genuine retry, the bridge treats it as a new request. When this "aliasing" occurs, a read performed after a write can appear to complete ahead of the write, which is in violation of PCI transaction ordering rules. Since this algorithm depends on a strict time-ordered sequence of operations, it can deadlock under this condition. To prevent the deadlock, a throw-away read must be performed after the initial write. Since the bridge only remembers once instance of a queued delayed read request, the throw-away read will "consume" the results of a mis-directed read completion and subsequent read requests are guaranteed to be queued and completed after the write.

RETURNS

TRUE if lock acquired.
         FALSE if lock not acquired.

SEE ALSO

sysLib, sysBusTasClear( )


cpv3060 : Routines

sysBusTasClear( )

NAME

sysBusTasClear( ) - clear a location set by sysBusTas( )

SYNOPSIS

void sysBusTasClear
    (
    volatile char * address   /* address to be tested-and-cleared */
    )

DESCRIPTION

This routine clears a bus test and set location. This routine is only required if the sysBusTas( ) routine uses special semaphore techniques (such as bus locking). Since the sysBusTas routine doesn't use any special semaphore techniques, this routine is a no-op.

If used, the BSP activates this routine by placing its address into the global variable smUtilTasClearRtn.

RETURNS

N/A

SEE ALSO

sysLib, sysBusTas( )


cpv3060 : Routines

sysFecEnetEnable( )

NAME

sysFecEnetEnable( ) - enable the MII interface of the Fast Ethernet controller

SYNOPSIS

STATUS sysFecEnetEnable
    (
    UINT32 motCpmAddr         /* base address of the on-chip RAM */
    )

DESCRIPTION

This routine is expected to perform any target specific functions required to enable the Ethernet device and the MII interface of the Fast Ethernet controller. These functions include setting the MII-compliant signals on Port D and disabling the IRQ7 signal.

RETURNS

OK, or ERROR if the Fast Ethernet controller cannot be enabled.

SEE ALSO

sysLib


cpv3060 : Routines

sysFecEnetDisable( )

NAME

sysFecEnetDisable( ) - disable MII interface to the Fast Ethernet controller

SYNOPSIS

STATUS sysFecEnetDisable
    (
    UINT32 motCpmAddr         /* base address of the on-chip RAM */
    )

DESCRIPTION

This routine is expected to perform any target specific functions required to disable the Ethernet device and the MII interface to the Fast Ethernet controller. This involves restoring the default values for all the Port D signals.

RETURNS

OK, always.

SEE ALSO

sysLib


cpv3060 : Routines

sysFecEnetAddrGet( )

NAME

sysFecEnetAddrGet( ) - get the hardware Ethernet address

SYNOPSIS

STATUS sysFecEnetAddrGet
    (
    UINT32  motCpmAddr,       /* base address of the on-chip RAM */
    UCHAR * address           /* where to put the ethernet address bytes */
    )

DESCRIPTION

This routine provides the six byte Ethernet hardware address that will be used by each individual Ethernet device unit. This routine must copy the six byte address to the space provided by addr.

RETURNS

OK, or ERROR if the Ethernet address cannot be returned.

SEE ALSO

sysLib


cpv3060 : Routines

sysPciTrap( )

NAME

sysPciTrap( ) - trap handler for PCI exception

SYNOPSIS

void sysPciTrap
    (
    ESFPPC * pEsf             /* pointer to exception stack frame */
    )

DESCRIPTION

This routine is called from the excConnectCode stub if the PCI configuration access generates an exception. By default, sysIn... returns the value read. This code changes the PC to sysPciErr which sets the return value to -1.
 NOTE:  The QSpan PCI Bridge causes machine check exceptions to
 occur when a non-present device address is put into the
 configuration register.  This is why the sysPciTrap routine
 is essential.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysMsDelay( )

NAME

sysMsDelay( ) - delay for the specified amount of time (MS)

SYNOPSIS

void sysMsDelay
    (
    UINT delay                /* length of time in MS to delay */
    )

DESCRIPTION

This routine will delay for the specified amount of time by counting decrementer ticks.

This routine is not dependent on a particular rollover value for the decrementer, it should work no matter what the rollover value is.

A small amount of count may be lost at the rollover point resulting in the sysMsDelay( ) causing a slightly longer delay than requested.

This routine will produce incorrect results if the delay time requested requires a count larger than 0xffffffff to hold the decrementer elapsed tick count. For an CPV3060 40MHz board that amounts to about 1716 seconds (thus not considered too severe a restriction).

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysIntEnablePIC( )

NAME

sysIntEnablePIC( ) - enable an ISA/PCI interrupt

SYNOPSIS

STATUS sysIntEnablePIC
    (
    int intNum                /* interrupt level to enable */
    )

DESCRIPTION

This function call is used by certain vxWorks device drivers. It calls the system routine intConnect.

RETURNS

OK or ERROR

SEE ALSO

sysLib


cpv3060 : Routines

sysDelay( )

NAME

sysDelay( ) - delay for approx. 1ms

SYNOPSIS

void sysDelay (void)

DESCRIPTION

This implements an unsupported system call to support drivers ported from Intel platforms.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysCpvIntEnable( )

NAME

sysCpvIntEnable( ) - enable a CPV3060 interrupt level

SYNOPSIS

int sysCpvIntEnable
    (
    int intLevel              /* interrupt level to enable */
    )

DESCRIPTION

This routine enables a specified CPV3060 interrupt level.

RETURNS

OK or ERROR if interrupt level not supported

SEE ALSO

sysLib


cpv3060 : Routines

sysCpvIntDisable( )

NAME

sysCpvIntDisable( ) - disable a CPV3060 interrupt level

SYNOPSIS

int sysCpvIntDisable
    (
    int (intLevel)            /* interrupt level to disable */
    )

DESCRIPTION

This routine disables a specified CPV3060 interrupt level.

RETURNS

OK or ERROR if interrupt level not supported

SEE ALSO

sysLib


cpv3060 : Routines

sysInByteString( )

NAME

sysInByteString( ) - reads a string of bytes from an io address.

SYNOPSIS

void sysInByteString
    (
    UINT32 * ioAddr,          /* I/O address */
    char *   bufPtr,          /* pointer to data buffer */
    int      nBytes           /* number of bytes to read */
    )

DESCRIPTION

This function reads a byte string from a specified io address.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysOutByteString( )

NAME

sysOutByteString( ) - writes a string of bytes to an io address.

SYNOPSIS

void sysOutByteString
    (
    UINT32 * ioAddr,          /* I/O address */
    char *   bufPtr,          /* pointer to data buffer */
    int      nBytes           /* number of bytes to write */
    )

DESCRIPTION

This function writes a byte string to a specified io address.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysInWordString( )

NAME

sysInWordString( ) - reads a string of words from an io address.

SYNOPSIS

void sysInWordString
    (
    ULONG    ioAddr,          /* I/O address */
    UINT16 * bufPtr,          /* pointer to data buffer */
    int      nWords           /* number of 2 byte words to read */
    )

DESCRIPTION

This function reads a word string from a specified io address.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysInWordStringRev( )

NAME

sysInWordStringRev( ) - byte reversed word read.

SYNOPSIS

void sysInWordStringRev
    (
    UINT32  ioAddr,           /* I/O address */
    short * bufPtr,           /* pointer to data buffer */
    int     nWords            /* number of 2 byte words to read */
    )

DESCRIPTION

This function reads a byte reversed word string from a specified io address.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysOutWordString( )

NAME

sysOutWordString( ) - writes a string of words to an io address.

SYNOPSIS

void sysOutWordString
    (
    ULONG    ioAddr,          /* I/O address */
    UINT16 * bufPtr,          /* pointer to data buffer */
    int      nWords           /* number of 2 byte words to write */
    )

DESCRIPTION

This function writes a word string from a specified io address.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysInLongString( )

NAME

sysInLongString( ) - reads a string of longwords from an io address.

SYNOPSIS

void sysInLongString
    (
    ULONG   ioAddr,           /* I/O address */
    ULONG * bufPtr,           /* pointer to data buffer */
    int     nLongs            /* number of 4 byte words to read */
    )

DESCRIPTION

This function reads a longword string from a specified io address.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysOutLongString( )

NAME

sysOutLongString( ) - writes a string of longwords to an io address.

SYNOPSIS

void sysOutLongString
    (
    ULONG   ioAddr,           /* I/O address */
    ULONG * bufPtr,           /* pointer to data buffer */
    int     nLongs            /* number of 4 byte words to write */
    )

DESCRIPTION

This function writes a longword string from a specified io address.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysLedUpdate( )

NAME

sysLedUpdate( ) - turn on or off specified LEDs

SYNOPSIS

void sysLedUpdate
    (
    UINT8 ledNumber,          /* LED to turn on/off */
    UINT8 ledAction           /* desired action to perform */
    )

DESCRIPTION

This function is responsible for turning on or off 1 or more of the boards LEDs. The defines LED_ON and LED_OFF should be used as values for the parameter ledAction.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysPciInsertLong( )

NAME

sysPciInsertLong( ) - Insert field into PCI data long

SYNOPSIS

void sysPciInsertLong
    (
    UINT32 adrs,              /* PCI address */
    UINT32 bitMask,           /* Mask which defines field to alter */
    UINT32 data               /* data written to the offset */
    )

DESCRIPTION

This function writes a field into a PCI data long without altering any bits not present in the field. It does this by first doing a PCI long read (into a temporary location) of the PCI data long which contains the field to be altered. It then alters the bits in the temporary location to match the desired value of the field. It then writes back the temporary location with a PCI long write. All PCI accesses are byte and the field to alter is specified by the "1" bits in the bitMask parameter.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysPciInsertWord( )

NAME

sysPciInsertWord( ) - Insert field into PCI data word

SYNOPSIS

void sysPciInsertWord
    (
    UINT32 adrs,              /* PCI address */
    UINT16 bitMask,           /* Mask which defines field to alter */
    UINT16 data               /* data written to the offset */
    )

DESCRIPTION

This function writes a field into a PCI data word without altering any bits not present in the field. It does this by first doing a PCI word read (into a temporary location) of the PCI data word which contains the field to be altered. It then alters the bits in the temporary location to match the desired value of the field. It then writes back the temporary location with a PCI word write. All PCI accesses are word and the field to alter is specified by the "1" bits in the bitMask parameter.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysPciInsertByte( )

NAME

sysPciInsertByte( ) - Insert field into PCI data byte

SYNOPSIS

void sysPciInsertByte
    (
    UINT32 adrs,              /* PCI address */
    UINT8  bitMask,           /* Mask which defines field to alter */
    UINT8  data               /* data written to the offset */
    )

DESCRIPTION

This function writes a field into a PCI data byte without altering any bits not present in the field. It does this by first doing a PCI byte read (into a temporary location) of the PCI data byte which contains the field to be altered. It then alters the bits in the temporary location to match the desired value of the field. It then writes back the temporary location with a PCI byte write. All PCI accesses are byte and the field to alter is specified by the "1" bits in the bitMask parameter.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysPciOutByteConfirm( )

NAME

sysPciOutByteConfirm( ) - Byte out to PCI memory space and flush buffers.

SYNOPSIS

void sysPciOutByteConfirm
    (
    UINT32 adrs,              /* PCI address */
    UINT8  data               /* data to be written */
    )

DESCRIPTION

This function outputs a byte to PCI memory space and then flushes the PCI write posting buffers by reading from the target address. Since the PCI spec requires the completion of posted writes before the completion of delayed reads, when the read completes, the write posting buffers have been flushed.

NOTE

If the write is performed through a PCI-to-PCI bridge to a shared location that is subject to unprotected access by multiple simultaneous processors, there is the possibility that the bridge will deliver a delayed read completion to a PCI bus master which was not the original initiator of the delayed read. When this occurs, it appears as if a PCI delayed read had passed a posted write, which would violate PCI transaction ordering rules. If this is a concern, an additional read must be performed outside of this routine to guarantee that the confirming read performed in this routine was not aliased.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysPciOutWordConfirm( )

NAME

sysPciOutWordConfirm( ) - Word out to PCI memory space and flush buffers.

SYNOPSIS

void sysPciOutWordConfirm
    (
    UINT32 adrs,              /* PCI address */
    UINT16 data               /* data to be written */
    )

DESCRIPTION

This function outputs a word to PCI memory space and then flushes the PCI write posting buffers by reading from the target address. Since the PCI spec requires the completion of posted writes before the completion of delayed reads, when the read completes, the write posting buffers have been flushed.

NOTE

If the write is performed through a PCI-to-PCI bridge to a shared location that is subject to unprotected access by multiple simultaneous processors, there is the possibility that the bridge will deliver a delayed read completion to a PCI bus master which was not the original initiator of the delayed read. When this occurs, it appears as if a PCI delayed read had passed a posted write, which would violate PCI transaction ordering rules. If this is a concern, an additional read must be performed outside of this routine to guarantee that the confirming read performed in this routine was not aliased.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysPciOutLongConfirm( )

NAME

sysPciOutLongConfirm( ) - Long word out to PCI memory space and flush buffers.

SYNOPSIS

void sysPciOutLongConfirm
    (
    UINT32 adrs,              /* PCI address */
    UINT32 data               /* data to be written */
    )

DESCRIPTION

This function outputs a long word to PCI memory space and then flushes the PCI write posting buffers by reading from the target address. Since the PCI spec requires the completion of posted writes before the completion of delayed reads, when the read completes, the write posting buffers have been flushed.

NOTE

If the write is performed through a PCI-to-PCI bridge to a shared location that is subject to unprotected access by multiple simultaneous processors, there is the possibility that the bridge will deliver a delayed read completion to a PCI bus master which was not the original initiator of the delayed read. When this occurs, it appears as if a PCI delayed read had passed a posted write, which would violate PCI transaction ordering rules. If this is a concern, an additional read must be performed outside of this routine to guarantee that the confirming read performed in this routine was not aliased.

RETURNS

N/A

SEE ALSO

sysLib


cpv3060 : Routines

sysQspanCapt( )

NAME

sysQspanCapt( ) - capture QSPAN window information

SYNOPSIS

void sysQspanCapt (void)

DESCRIPTION

This routine captures the configuration of the QSPAN PPC and PCI slave registers. This information is used to perform address translations from CPU to PCI addresses and vice versa.

RETURNS

N/A

SEE ALSO

sysLib, sysBusToLocalAdrs( ), sysLocalToBusAdrs( )


cpv3060 : Routines

sysQspanTransAdrs( )

NAME

sysQspanTransAdrs( ) - translate an address that passes through the qspan.

SYNOPSIS

STATUS sysQspanTransAdrs
    (
    UINT32             adrsSpace,  /* address space (memory or i/o ) */
    UINT32             adrs,       /* known address */
    UINT32 *           pTransAdrs, /* pointer to the translated address */
    UINT32             winCnt,     /* number of open windows */
    QSPAN_WIN_STRUCT * pSrc,       /* pointer to the source windows */
    QSPAN_WIN_STRUCT * pDest       /* pointer to the destination windows */
    )

DESCRIPTION

This routine converts an address from a cpu to pci address or vice versa. It uses a pair of window arrays built during hardware init2 to guide the translation. The adrs parameter is the address to convert.

RETURNS

OK, or ERROR if the address space is unknown or the mapping is not possible.

SEE ALSO

sysLib, sysPci( )


cpv3060 : Routines

sysCpuToPciAdrs( )

NAME

sysCpuToPciAdrs( ) - translate a cpu address to a pci bus address

SYNOPSIS

STATUS sysCpuToPciAdrs
    (
    int      adrsSpace,       /* bus address space where busAdrs resides */
    char *   localAdrs,       /* local address to convert */
    char * * pBusAdrs         /* where to return bus address */
    )

DESCRIPTION

This routine converts an address as seen from the cpu to the equivalent pci address, if it exists. The input address is the address as seen by the cpu.

RETURNS

OK, or ERROR if the address space is unknown or the mapping is not possible.

SEE ALSO

sysLib, sysPciToCpuAdrs( )


cpv3060 : Routines

sysPciToCpuAdrs( )

NAME

sysPciToCpuAdrs( ) - translate a pci bus address to a cpu address

SYNOPSIS

STATUS sysPciToCpuAdrs
    (
    int      adrsSpace,       /* bus address space where busAdrs resides */
    char *   localAdrs,       /* local address to convert */
    char * * pBusAdrs         /* where to return bus address */
    )

DESCRIPTION

This routine converts an address as seen from the pci bus to the equivalent cpu address, if it exists. The input address is the address as seen by the pci bus.

RETURNS

OK, or ERROR if the address space is unknown or the mapping is not possible.

SEE ALSO

sysLib, sysCpuToPciAdrs( )


cpv3060 : Routines

sysDebugMsg( )

NAME

sysDebugMsg( ) - print a debug string to the console in polled mode.

SYNOPSIS

void sysDebugMsg
    (
    char * str,               /* meesage to be output */
    UINT32 recovery           /* continue or exit to monitor */
    )

DESCRIPTION

This routine prints a message to the system console in polled mode and optionally exits to the monitor.

RETURNS

N/A

SEE ALSO

sysLib