GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > VXW / V7-1-1

Constituent: vxw_flight     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

sysLib.c.vx-ppc-rad750 File Reference

RAD750 & Power PCI system-dependent library. More...

#include "vxWorks.h"
#include "pci.h"
#include "memLib.h"
#include "cacheLib.h"
#include "sysLib.h"
#include "config.h"
#include "string.h"
#include "stdio.h"
#include "intLib.h"
#include "esf.h"
#include "excLib.h"
#include "logLib.h"
#include "taskLib.h"
#include "vxLib.h"
#include "tyLib.h"
#include "rebootLib.h"
#include "tffs/tffsDrv.h"
#include "arch/ppc/archPpc.h"
#include "arch/ppc/mmu603Lib.h"
#include "arch/ppc/vxPpcLib.h"
#include "arch/ppc/excPpcLib.h"
#include "arch/ppc/esfPpc.h"
#include "private/vmLibP.h"
#include "Memmap.h"
#include "BootDiagnostics.h"
#include "drv/ppci/asmFns.h"
#include "timer/ppcDecTimer.c"

Include dependency graph for sysLib.c.vx-ppc-rad750:


Defines

#define BOOT_DIAGS_ADDR()   ((BOOT_Diagnostics*) MEMMAP_BOOT_DIAGS_ADDR)
#define WDOG_TIMEOUT_SECS   600

Functions

LOCAL STATUS connectPciInt (VOIDFUNCPTR *vector, VOIDFUNCPTR routine, int parameter)
LOCAL void excHandler (int task, int vecNum, ESFPPC *pEsf)
char * sysModel (void)
 Return the model name of the CPU board.
char * sysBspRev (void)
 Return the BSP version and revision number.
BOOT_DiagnosticssysDiagsGet (void)
 Return a pointer to the RAD750 boot diagnostics area.
void sysHwInit (void)
 Initialize the system hardware.
char * sysPhysMemTop (void)
 Get the address of the top of physical memory.
char * sysMemTop (void)
 Get the address of the top of VxWorks memory.
STATUS sysToMonitor (int startType)
 Transfer control to the ROM monitor.
void sysHwInit2 (void)
 Initialize additional system hardware.
int sysProcNumGet (void)
 Get the processor number.
void sysProcNumSet (int procNum)
 set the processor number
int sysGetBusSpd (void)
 Get the speed of the 60x processor bus.
STATUS sysLocalToPciAdrs (int adrsSpace, char *localAdrs, char **pBusAdrs)
 Convert a local address to a PCI address.
STATUS sysPciToLocalAdrs (int adrsSpace, char *busAdrs, char **pLocalAdrs)
 Convert a PCI address to a local address.
STATUS sysNvRamGet (char *string, int strLen, int offset)
 Get the contents of non-volatile RAM.
STATUS sysNvRamSet (char *string, int strLen, int offset)
 Write to non-volatile RAM.

Variables

UINT32 sysBatDesc [2 *(_MMU_NUM_IBAT+_MMU_NUM_DBAT)]
PHYS_MEM_DESC sysPhysMemDesc []
int sysPhysMemDescNumEnt = NELEMENTS (sysPhysMemDesc)
int sysCpu = CPU
int sysProcNum
char * sysBootLine = BOOT_LINE_ADRS
char * sysExcMsg = EXC_MSG_ADRS
int sysFlags
char sysBootHost [BOOT_FIELD_LEN]
char sysBootFile [BOOT_FIELD_LEN]
IMPORT STATUS(* _func_intConnectRtn )(VOIDFUNCPTR *, VOIDFUNCPTR, int)
IMPORT int(* _func_intEnableRtn )(int)
IMPORT int(* _func_intDisableRtn )(int)
char sysModelStr [] = "BAE SYSTEMS - RAD750"

Detailed Description

RAD750 & Power PCI system-dependent library.


Define Documentation

 
#define BOOT_DIAGS_ADDR  )     ((BOOT_Diagnostics*) MEMMAP_BOOT_DIAGS_ADDR)
 

A macro to get the address of the boot diagnostics area

WDOG_TIMEOUT_SECS   600
 

The 10 minute watchdog timeout period, in terms of seconds.


Function Documentation

LOCAL STATUS connectPciInt VOIDFUNCPTR *  vector,
VOIDFUNCPTR  routine,
int  parameter
 

This routine connects an ISR to a PCI interrupt line wired to a PPCI input PID. It is called indirectly when intConnect() is called. When SUPPORT_SHARED_PCI_INTERRUPTS is defined, there is another level of indirection as intConnect() calls pciIntConnect() which calls this routine. This indirection is set-up via _func_intConnectRtn and #PCI_INT_HANDLER_BIND.

Parameters:
vector This is a PID (0-31) to which a PCI interrupt line is wired.
routine The ISR to call when the PID goes active.
parameter A parameter to pass to the ISR.
Returns:
OK or ERROR.

LOCAL void excHandler int  task,
int  vecNum,
ESFPPC *  pEsf
 

This routine is hooked into the standard VxWorks exception handling path (see excLib). In the case of a machine check exception, we clear the condition in the Power PCI bridge. For development configurations, VxWorks will suspend the task executing at the time the exception occured. For flight builds, the exception handler will store relevant information in the boot diagnostics region and reboot.

Parameters:
task executing when exception occurred.
vecNum The exception vector number.
pEsf Pointer to the exception stack frame.
Note:
Various shell/debug facilities (e.g., d Addr) replace the standard VxWorks exception handling.

char * sysBspRev void   ) 
 

Return the BSP version and revision number.

This routine returns a pointer to a BSP version and revision number, for example, 1.1/0. BSP_REV is concatenated to BSP_VERSION and returned.

Returns:
A pointer to the BSP version/revision string.

BOOT_Diagnostics * sysDiagsGet void   ) 
 

Return a pointer to the RAD750 boot diagnostics area.

This routine returns a pointer to the RAD750 boot diagnostics structure in SDRAM. This structure is used to pass information back and forth between the BSP and the PBC boot code.

Returns:
A pointer to the boot diagnostics structure.

int sysGetBusSpd void   ) 
 

Get the speed of the 60x processor bus.

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

Returns:
The bus speed (inMHz).

void sysHwInit void   ) 
 

Initialize the system hardware.

This routine initializes various features of the CPU board. It is called by usrInit() in usrConfig.c. This routine sets up the control registers and initializes various devices if they are present.

Note:
This routine should not be called directly by the user application. It cannot be used to initialize interrupt vectors.

void sysHwInit2 void   ) 
 

Initialize additional system hardware.

This routine connects system interrupt vectors and configures any required features not configured by sysHwInit().

STATUS sysLocalToPciAdrs int  adrsSpace,
char *  localAdrs,
char **  pBusAdrs
 

Convert a local address to a PCI address.

This routine returns the address of a local CPU memory resource as it would be seen on the PCI bus. The local address that is passed into this routine is the address of the local resource as seen by the CPU.

Parameters:
adrsSpace Bus address space where busAdrs resides.
localAdrs Local address to convert.
pBusAdrs Where to return bus address.
Return values:
OK Success.
ERROR The address space is unknown or the mapping is not possible.
See also:
sysPciToLocalAdrs()

char * sysMemTop void   ) 
 

Get the address of the top of VxWorks memory.

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 SYS_MEM_TOP_ADRS in config.h. This routine returns the address of the reserved memory area. The value of SYS_MEM_TOP_ADRS is in first address of the reserved area. The system memory pool resides below this address.

Returns:
The address of the top of VxWorks memory.

char * sysModel void   ) 
 

Return the model name of the CPU board.

This routine returns the model name of the CPU board. The returned string depends on the board model and CPU version being used, for example, "Motorola MTX - MPC 604e".

Returns:
A pointer to the string.

STATUS sysNvRamGet char *  string,
int  strLen,
int  offset
 

Get the contents of non-volatile RAM.

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

Parameters:
string Place to store read data.
strLen Number of bytes to read.
offset NVRAM offset to start read at.
Return values:
OK Success.
ERROR Access is outside the non-volatile RAM range.
See also:
sysNvRamSet()

STATUS sysNvRamSet char *  string,
int  strLen,
int  offset
 

Write to non-volatile RAM.

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

Parameters:
string Data to write.
strLen Number of bytes to write.
offset NVRAM offset to start write at.
Return values:
OK Success.
ERROR Access is outside the non-volatile RAM range.
See also:
sysNvRamGet()

STATUS sysPciToLocalAdrs int  adrsSpace,
char *  busAdrs,
char **  pLocalAdrs
 

Convert a PCI address to a local address.

This routine returns a local address that is used to access the PCI bus. The bus address that is passed into this routine is the PCI bus address as it would be seen on the bus.

Parameters:
adrsSpace Bus address space where busAdrs resides.
busAdrs Bus address to convert.
pLocalAdrs Where to return local address.
Return values:
OK Success.
ERROR The address space is unknown or the mapping is not possible.
See also:
sysLocalToPciAdrs()

char * sysPhysMemTop void   ) 
 

Get the address of the top of physical memory.

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

Normally, the user specifies the amount of physical memory with the macro LOCAL_MEM_SIZE in config.h. BSPs that support run-time memory sizing do so only if the macro LOCAL_MEM_AUTOSIZE is defined. If not defined, then LOCAL_MEM_SIZE is assumed to be, and must be, the true size of physical memory.

Note:
Do no adjust LOCAL_MEM_SIZE to reserve memory for application use. See sysMemTop() for more information on reserving memory.
Returns:
The address of the top of physical memory.
See also:
sysMemTop()

int sysProcNumGet void   ) 
 

Get the processor number.

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:
sysProcNumSet()

void sysProcNumSet int  procNum  ) 
 

set the processor number

This routine sets the processor number for the CPU board. Processor numbers should be unique on a single backplane. It also maps local resources onto the VMEbus.

Parameters:
procNum Processor number.
See also:
sysProcNumGet()

STATUS sysToMonitor int  startType  ) 
 

Transfer control to the ROM monitor.

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

The RAD750 version of sysToMonitor() makes sure that the boot diagnostics region is setup properly for the primary boot code, event when called from an internal VxWorks location.

Parameters:
startType Parameter passed to ROM to tell it how to boot.
Returns:
Should not return.


Variable Documentation

_func_intConnectRtn
 

Callback address for system interrupt connect function.

_func_intDisableRtn
 

Callback address for system interrupt disable function.

_func_intEnableRtn
 

Callback address for system interrupt enable function.

sysBatDesc
 

sysBatDesc[] is used to initialize the block address translation (BAT) registers within the PowerPC 603/604/750 MMU. BAT hits take precedence over Page Table Entry (PTE) hits and are faster. Overlap of memory coverage by BATs and PTEs is permitted in cases where either the IBATs or the DBATs do not provide the necessary mapping (PTEs apply to both instruction AND data space, without distinction).

The primary means of memory control for VxWorks is the MMU PTE support provided by vmLib and cacheLib. Use of BAT registers will conflict with vmLib support. User's may use BAT registers for i/o mapping and other purposes but are cautioned that conflicts with cacheing and mapping through vmLib may arise. Be aware that memory spaces mapped through a BAT are not mapped by a PTE and any vmLib() or cacheLib() operations on such areas will not be effective, nor will they report any error conditions.

Note: BAT registers CANNOT be disabled - they are always active. For example, setting them all to zero will yield four identical data and instruction memory spaces starting at local address zero, each 128KB in size, and each set as write-back and cache-enabled. Hence, the BAT regs MUST be configured carefully.

With this in mind, it is recommended that the BAT registers be used to map LARGE memory areas external to the processor if possible. If not possible, map sections of high RAM and/or PROM space where fine grained control of memory access is not needed. This has the beneficial effects of reducing PTE table size (8 bytes per 4k page) and increasing the speed of access to the largest possible memory space. Use the PTE table only for memory which needs fine grained (4KB pages) control or which is too small to be mapped by the BAT regs.

The BAT configuration for 4xx/6xx-based PPC boards is as follows: All BATs point to PROM/FLASH memory so that end customer may configure them as required.

[Ref: chapter 7, PowerPC Microprocessor Family: The Programming Environments]

sysBootFile
 

Name of file from which we booted.

sysBootHost
 

Name of host from which we booted.

sysBootLine = BOOT_LINE_ADRS
 

Address of boot line.

sysCpu = CPU
 

System CPU type (e.g. PPC604).

sysExcMsg = EXC_MSG_ADRS
 

Catastrophic message area.

sysFlags
 

Boot flags.

sysModelStr = "BAE SYSTEMS - RAD750"
 

String describing target board model.

sysPhysMemDesc
 

Initial value:

  {
    {
    

    (void *) LOCAL_MEM_LOCAL_ADRS,
    (void *) LOCAL_MEM_LOCAL_ADRS,
    RAM_LOW_ADRS,
    VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE |
    VM_STATE_MASK_MEM_COHERENCY,
    VM_STATE_VALID      | VM_STATE_WRITABLE      | VM_STATE_CACHEABLE |
    VM_STATE_MEM_COHERENCY
    },

    {
    

    (void *) RAM_LOW_ADRS,
    (void *) RAM_LOW_ADRS,
    LOCAL_MEM_SIZE -  RAM_LOW_ADRS,
    VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE |
    VM_STATE_MASK_MEM_COHERENCY,
    VM_STATE_VALID      | VM_STATE_WRITABLE      | VM_STATE_CACHEABLE |
    VM_STATE_MEM_COHERENCY
    }
  }
sysPhysMemDesc[] is used to initialize the Page Table Entry (PTE) array used by the MMU to translate addresses with single page (4k) granularity. PTE memory space should not, in general, overlap BAT memory space but may be allowed if only Data or Instruction access is mapped via BAT.

Address translations for local RAM, is set here.

PTEs are held, strangely enough, in a Page Table. Page Table sizes are integer powers of two based on amount of memory to be mapped and a minimum size of 64 kbytes. The MINIMUM recommended Page Table sizes for 32-bit PowerPCs are:

Total mapped memory Page Table size ------------------- --------------- 8 Meg 64 K 16 Meg 128 K 32 Meg 256 K 64 Meg 512 K 128 Meg 1 Meg . . . . . .

[Ref: chapter 7, PowerPC Microprocessor Family: The Programming Environments]

sysPhysMemDescNumEnt = NELEMENTS (sysPhysMemDesc)
 

The number of entries in the sysPhysMemDesc table.

sysProcNum
 

The processor number for this target.


Generated on Sat Feb 2 01:36:38 2008 by  doxygen 1.4.4