GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > PBC / V4-5-0

Constituent: pbc_bootshell     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

bootshell.h File Reference

PBC private definitions and prototypes. More...

#include <vxWorks.h>
#include "BootDiagnostics.h"
#include "EE_boot.h"
#include "pbc_memmap.h"
#include "MEM/MEM_dump.h"
#include "MEM/MEM_load.h"

Include dependency graph for bootshell.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Data Structures

struct  _Pbc_GlobalStateData
 Global state information for PBC. More...

struct  _Pbc_UplinkCountSet
 A set of uplink counts. More...

struct  _Pbc_UplinkStatus
 Uplink status. More...


Defines

#define GLOBAL   extern
 Global allocation symbol.

#define INITIAL(initializer)
 Global symbol initializer.

#define PBC_CMD_DELAY_MSEC   (10)
 Inter-command delay in milliseconds.

#define PBC_CMD_DELAY_USEC   (1000 * PBC_CMD_DELAY_MSEC)
 Inter-command delay in microseconds.

#define PBC_CMD_DELAY_NSEC   (1000 * PBC_CMD_DELAY_USEC)
 Inter-command delay in nanoseconds.

#define PBC_AUTOBOOT_MIN   (10)
 Initial delay before autoboot, in minutes.

#define PBC_AUTOBOOT_SEC   (60 * PBC_AUTOBOOT_MIN)
 Initial delay before autoboot, in seconds.

#define PBC_AUTOBOOT_MSEC   (1000 * PBC_AUTOBOOT_SEC)
 Initial delay before autoboot, in milliseconds.

#define PBC_AUTOBOOT_NSEC   ((unsigned long long)1000000 * (unsigned long long)PBC_AUTOBOOT_MSEC)
 Initial delay before autoboot, in nanoseconds.

#define PBC_WATCHDOG_LOOP_SECONDS   (600)
 Command loop watchdog timer value.

#define PBC_WATCHDOG_SBC_SECONDS   (600)
 Secondary boot watchdog timer value.

#define Pbc_MODULE_PAD
 Module trailing padding.

#define Pbc_MODULE_PAD_14
 Module trailing padding (2^14 boundary).


Typedefs

typedef _Pbc_UplinkCountSet Pbc_UplinkCountSet
typedef _Pbc_UplinkStatus Pbc_UplinkStatus
typedef _Pbc_GlobalStateData Pbc_GlobalStateData

Functions

unsigned int Pbc_ProcessScBroadcast (const unsigned short apid, const unsigned short funcCode, const void *scBroadcast, const unsigned int pktSize)
 Process spacecraft broadcast telecommand.

unsigned int Pbc_ProcessLatBoot (const unsigned short apid, const unsigned short funcCode, const void *latBoot, const unsigned int pktSize)
 Process LAT boot telecommands.

unsigned int Pbc_ProcessFileLoad (const unsigned short apid, const unsigned short funcCode, const void *fileLoad, const unsigned int pktSize)
 Process LAT file load telecommands.

void Pbc_InitFileLoad ()
 Initialize file upload command handling.

void Pbc_GetFileLoadTlm (unsigned short *fileUploadState, unsigned short *fileUploadPktCnt, unsigned long *fileUploadError)
 Get file load telemetry.

void Pbc_ResetFileLoad ()
 Reset FILE upload state machine.

unsigned int Pbc_MemLoadService (void)
 Service the Memory Load operation.

unsigned int Pbc_ProcessMemLoad (const void *memLoad, const unsigned int pktSize)
 Process Memory Write commands.

unsigned int Pbc_ProcessPciLoad (const void *pciLoad, const unsigned int pktSize)
 Process Memory PCI Device Header Write commands.

unsigned int Pbc_ProcessRegLoad (const void *regLoad, const unsigned int pktSize)
 Process Memory Processor Register Write commands.

unsigned int Pbc_ProcessMemDump (const unsigned short funcCode, const void *memDump, const unsigned int pktSize)
 Process LAT MEMORY DUMP telecommands.

unsigned int Pbc_TlmCreateHkp (unsigned short seqCount, void *pkt_p, unsigned int *size_p, size_t pktSize)
 Create boot housekeeping telemetry packet.

void PBC_reboot (unsigned int cause, unsigned int pri_boot_flags)
 Warm reboot the RAD750.

int PBC_init_ram (unsigned int start_addr, unsigned int num_bytes)
 Use the PPCI hardware to initialize a region of RAM to 0.

void PBC_icache_disable (void)
 Disable the instruction cache.

int pciBusInit (void)
 Initialized PCI bus for PBC.

int Pbc_ExecuteSecondary (const int rtosArg, const unsigned long sbcFlags)
 Load, possibly inflate and execute secondary boot code.

void Pbc_TimeInit ()
 Init boot time.

void Pbc_TimeGet (unsigned long *seconds, unsigned long *subSeconds)
 Get boot time.

void Pbc_TimeSetSeconds (unsigned long seconds)
 Set boot time seconds.

void Pbc_ResetWatchdog (unsigned long seconds)
 Set watchdog timer.

void Pbc_CommitInit ()
 Initialize commit state machine.

void Pbc_CommitConfigureData (const unsigned long source, const unsigned long dest, const size_t bytes)
 Configure commit request for memory block.

unsigned int Pbc_CommitConfigureFile (const unsigned long source, const size_t bytes, const unsigned int fileId)
 Configure commit request for a file upload.

void Pbc_CommitDone (const unsigned long newBootMode)
 Copy next chunk of data.

void Pbc_CommitService ()
 Service commit state machine.

void Pbc_ErrorLogInit ()
 Initialize PBC error log.

void Pbc_ErrorLogPop ()
 Pop oldest entry from the error ring.

void Pbc_ErrorLogStats (unsigned int *totalCount, unsigned int *ringCount, unsigned int *queuedCode, unsigned int *lastCode)
 Get state of PBC error log.

void Pbc_ErrCheck (void)
 Check for errors reported in PPCI registers.


Variables

GLOBAL Pbc_GlobalStateData Pbc_globalState
volatile BOOT_Diagnostics * Pbc_diagsPtr = (volatile BOOT_Diagnostics *)MEMMAP_BOOT_DIAGS_ADDR
unsigned long Pbc_RamExcStart
unsigned long Pbc_RamExcEnd

Detailed Description

PBC private definitions and prototypes.

Top-level header for boot shell. Contains boot functions defs and prototypes.

Date
2005/04/26 16:22:28
Source
/nfs/slac/g/glast/flight/archive/PBC/src/bootshell.h,v
Author
dmay
Revision
1.29
Log
bootshell.h,v
Revision 1.29 2005/04/26 16:22:28 dmay return tlm packet size in Pbc_TlmCreateHkp

Revision 1.28 2005/03/03 22:31:12 dmay move build info to excVector.S

Revision 1.27 2005/01/26 17:31:37 dmay support EE driver changes

Revision 1.26 2005/01/10 22:39:48 dmay add PBC_icache_disable prototype

Revision 1.25 2004/12/30 20:05:30 dmay add Pbc_buildInfo and Pbc_buildSrc; add info about PBC_reboot and PBC_init_ram

Revision 1.24 2004/12/08 18:19:46 dmay remove apid from Pbc_ProcessMemDump()

Revision 1.23 2004/12/07 14:26:34 dmay add Pbc_ProcessMemLoad, Pbc_ProcessPciLoad, and Pbc_ProcessRegLoad

Revision 1.22 2004/10/29 19:58:13 dmay fix doxygen tag error

Revision 1.21 2004/10/29 19:38:04 dmay add Pbc_MODULE_PAD_14

Revision 1.20 2004/10/15 16:18:05 dmay add PBC_init_ram()

Revision 1.19 2004/09/23 21:11:20 dmay add PBC_reboot; remove comm functions

Revision 1.18 2004/09/09 19:33:07 dmay use pbc_memmap.h

Revision 1.17 2004/07/26 14:06:11 dmay merge MEM load and MEM dump APIDs and function codes; add software memory scrubber; add memmap table entries for SIB registers and RAM

Revision 1.16 2004/07/20 14:10:51 dmay Add more function prototypes; add eeLoadBank

Revision 1.15 2004/06/29 13:20:40 dmay accomodate MEM dump interface changes

Revision 1.14 2004/06/17 19:31:57 dmay add Memory Load context handle to global state

Revision 1.13 2004/04/19 20:14:14 dmay Removed a redundant doxygen description of struct _Pbc_CommHandle

Revision 1.12 2004/04/06 12:22:50 ray add last command telemetry

Revision 1.11 2004/03/19 15:33:43 ray added file load reset after commit

Revision 1.10 2004/03/18 15:24:29 ray completed implementation of EEPROM commit

Revision 1.9 2004/03/11 13:33:06 ray added dumpActive to global state, added commit and file upload

Revision 1.8 2004/03/09 13:33:43 ray added PBC watchdog configuration

Revision 1.7 2004/02/23 19:41:57 ray fix doxygen constructs

Revision 1.6 2004/02/23 15:52:05 ray added background memory dump

Revision 1.5 2004/01/29 20:24:26 ray moved error logging features, first full implementation of PBC command/telemetry, change in Pbc_ExecuteSecondary() interface

Revision 1.4 2003/12/11 16:31:00 ray header re-org, document bootshell.h

Revision 1.3 2003/12/10 15:18:15 ray Further development: added command and telemetry interface, exception vectors, boot timing initial timeout state, module pad

Revision 1.2 2003/11/14 13:37:24 ray addition of interfaces from secondary.c and sysLib.c

Revision 1.1.1.1 2003/08/04 19:19:40 ray Create package PBC


Define Documentation

#define GLOBAL   extern
 

Global allocation symbol.

Allows for single point of allocation and definition of global variables. If ALLOC_GLOBALS is defined, GLOBAL will be noop-ed, causing allocation to occur. Otherwise, GLOBAL evaluates to "extern", causing a reference to be defined. One and only one module must define ALLOC_GLOBALS before including this header file. For PBC, that file is bootshell.c.

#define INITIAL initializer   ) 
 

Global symbol initializer.

Allows for single point of initialization of global variables. See GLOBAL for more information.

#define PBC_AUTOBOOT_MIN   (10)
 

Initial delay before autoboot, in minutes.

Define how long the PBC waits in the timeout state before autoboot. In minutes.

#define PBC_AUTOBOOT_MSEC   (1000 * PBC_AUTOBOOT_SEC)
 

Initial delay before autoboot, in milliseconds.

See PBC_AUTOBOOT_MIN.

#define PBC_AUTOBOOT_NSEC   ((unsigned long long)1000000 * (unsigned long long)PBC_AUTOBOOT_MSEC)
 

Initial delay before autoboot, in nanoseconds.

See PBC_AUTOBOOT_MIN.

#define PBC_AUTOBOOT_SEC   (60 * PBC_AUTOBOOT_MIN)
 

Initial delay before autoboot, in seconds.

See PBC_AUTOBOOT_MIN.

#define PBC_CMD_DELAY_MSEC   (10)
 

Inter-command delay in milliseconds.

How long to delay between commands. The minimum inter-command delay is 20 msec, we will over sample by 2 to check commands.

#define PBC_CMD_DELAY_NSEC   (1000 * PBC_CMD_DELAY_USEC)
 

Inter-command delay in nanoseconds.

See PBC_CMD_DELAY_MSEC.

#define PBC_CMD_DELAY_USEC   (1000 * PBC_CMD_DELAY_MSEC)
 

Inter-command delay in microseconds.

See PBC_CMD_DELAY_MSEC.

#define Pbc_MODULE_PAD
 

Module trailing padding.

Pad out the end of the file. This is a convenient for debug because it results in quicker loads.

The theory is that is a developer can change a little code in a module, and not force a reload of all of the SUROM, since the new code only eats up the pad.

The pad byte of 0x4b will generate an instruction that is likely to cause an exception (bla 0xff4b4b48) for safety reasons.

Only used in DEBUG mode. Noop-ed out otherwise.

#define PBC_WATCHDOG_LOOP_SECONDS   (600)
 

Command loop watchdog timer value.

This defines the watchdog timer value that is set each time through the PBC command and telemetry loop.

#define PBC_WATCHDOG_SBC_SECONDS   (600)
 

Secondary boot watchdog timer value.

This defines the watchdog timer value that is set before executing the secondary boot.


Typedef Documentation

Pbc_GlobalStateData
 

Typedef for struct _Pbc_GlobalStateData

Pbc_UplinkCountSet
 

Typedef for struct _Pbc_UplinkCountSet

Pbc_UplinkStatus
 

Typedef for struct _Pbc_UplinkStatus


Function Documentation

void Pbc_CommitConfigureData const unsigned long  source,
const unsigned long  dest,
const size_t  bytes
 

Configure commit request for memory block.

Configure commit state machine to copy a specified data to RAM or EEPROM. Takes source address, destination address and size arguments. Puts the commit state machine in the active state.

Parameters:
source Address of data to be commited.
dest Address where data is to be commited.
bytes Number of bytes to commit.
Return values:
none 

unsigned int Pbc_CommitConfigureFile const unsigned long  source,
const size_t  bytes,
const unsigned int  fileId
 

Configure commit request for a file upload.

Configure commit state machine to copy a specified file to RAM or EEPROM. Takes source address, file id and size arguments. Puts the commit state machine in the active state. A destination address is calculated from the fileId.

Parameters:
source Address of data to be commited.
fileId File id that maps to an address where data is to be commited.
bytes Number of bytes to commit.
Return values:
none 

Here is the call graph for this function:

void Pbc_CommitDone const unsigned long  newBootMode  ) 
 

Copy next chunk of data.

Cleanup state machine and PBC state when commit is done. Commit state machine is reset and we go back into boot command mode. It is assumed that we're in the PBC_SW_MODE_COMMIT mode when this function is called.

Parameters:
newBootMode boot mode to enter
Return values:
none 

Here is the call graph for this function:

void Pbc_CommitInit  ) 
 

Initialize commit state machine.

Set internal commit data to idle state and reset members of commit context.

Return values:
none 

void Pbc_CommitService  ) 
 

Service commit state machine.

Perform periodic processing of commit state machine. Should be called at all times, even when commit is not active.

Sorry, no parameters - all data is in global pbc_commitData structure.

Return values:
none 

Here is the call graph for this function:

void Pbc_ErrCheck void   ) 
 

Check for errors reported in PPCI registers.

Checks error registers within the PPCI bridge chip and reports any pending errors.

Returns:
Nothing.

void Pbc_ErrorLogInit  ) 
 

Initialize PBC error log.

Initialize error long structure. All counters cleared. Ring buffer is reset. Last error is erased.

Here is the call graph for this function:

void Pbc_ErrorLogPop void   ) 
 

Pop oldest entry from the error ring.

Pop oldest entry from the error ring. The "first" pointer is moved forward by one error entry. This routine has no effect if the error log is empty.

void Pbc_ErrorLogStats unsigned int *  totalCount,
unsigned int *  ringCount,
unsigned int *  queuedCode,
unsigned int *  lastCode
 

Get state of PBC error log.

Return information about the error log. Returns both error counts (total errors & number of errors in the ring). Also returns the oldest and lastest error codes.

The return contents of lastCode will only be valid if totalCount is non-zero. The return contents of firstCode will only be valid if ringCount is non-zero.

Parameters:
totalCount Total number of errors reported.
ringCount Total number of errors in the error ring.
queuedCode The next error code at the "front" of the ring.
lastCode Newst error code.

int Pbc_ExecuteSecondary const int  rtosArg,
const unsigned long  sbcFlags
 

Load, possibly inflate and execute secondary boot code.

This function is a bit long.

It sets up secondary boot flags in boot diagnostics, copies the file out of EEPROM if needed, parses the file header, runs a checksum on the file, uncompresses if required, and if all of that succeeds, it jumps to the secondary.

Parameters:
rtosArg Argument to pass to to secondary boot
sbcFlags Secondary boot flags
Returns:
Will not return if successful.
Return values:
PBC_INFLERR on inflation error.
PBC_BHDRCHK on bad EEPROM bank header.
PBC_FILECHK on bad file checksum.
FILE_EHDRCKSM on bad file header checksum.

Here is the call graph for this function:

void Pbc_GetFileLoadTlm unsigned short *  fileUploadState,
unsigned short *  fileUploadPktCnt,
unsigned long *  fileUploadError
 

Get file load telemetry.

Get file load telemetry.

void PBC_icache_disable void   ) 
 

Disable the instruction cache.

Returns:
Nothing.

int PBC_init_ram unsigned int  start_addr,
unsigned int  num_bytes
 

Use the PPCI hardware to initialize a region of RAM to 0.

Parameters:
start_addr Starting address to initialize.
num_bytes Number of bytes to initialize.
Return values:
0 Success.
nonzero Failure.

unsigned int Pbc_InitFileLoad  ) 
 

Initialize file upload command handling.

Initialize file upload command handling.

unsigned int Pbc_MemLoadService void   ) 
 

Service the Memory Load operation.

This function services the Memory Load operation by writing the next chunk of data. When all data has been loaded, and the target of the load was SIB EEPROM, the EEPROM is locked.

Returns:
A PBC or MEM MSG value.

unsigned int Pbc_ProcessFileLoad const unsigned short  apid,
const unsigned short  funcCode,
const void *  fileLoad,
const unsigned int  pktSize
 

Process LAT file load telecommands.

This function will process file load telecommands received by the LAT. Processing depends on function code.

Parameters:
apid Application ID, shall be PBC_APID_LAT_FILE_LOAD.
funcCode Function code of packet.
fileLoad Contents of packet, including header.
pktSize Size of packet, including header.
Return values:
PBC_SUCCESS Successful command processing.
PBC_CMDIGN Command ignored (consider this successful processing).
PBC_BADPID apid was not PBC_APID_LAT_FILE_LOAD.
PBC_NULLPTR pkt was NULL pointer.
PBC_PKTSIZE pktSize was not correct.
PBC_CMDBDFC Bad function code encountered.

Here is the call graph for this function:

unsigned int Pbc_ProcessLatBoot const unsigned short  apid,
const unsigned short  funcCode,
const void *  latBoot,
const unsigned int  pktSize
 

Process LAT boot telecommands.

This function will process boot telecommands received by the LAT. Processing depends on function code.

Parameters:
apid Application ID, shall be PBC_APID_LAT_BOOT.
funcCode Function code of packet.
latBoot Contents of packet, including header.
pktSize size of packet, including header.
Return values:
PBC_SUCCESS Successful command processing.
PBC_CMDIGN Command ignored (consider this successful processing).
PBC_BADPID apid was not PBC_APID_LAT_BOOT.
PBC_NULLPTR pkt was NULL pointer.
PBC_PKTSIZE pktSize was not correct.
PBC_CMDBDFC Bad function code encountered.

Here is the call graph for this function:

unsigned int Pbc_ProcessMemDump const unsigned short  funcCode,
const void *  memDump,
const unsigned int  pktSize
 

Process LAT MEMORY DUMP telecommands.

This function will process memory dump telecommands received by the LAT. Processing depends on function code.

Parameters:
funcCode Function code of packet.
memDump Contents of packet, including header.
pktSize Size of packet, including header. Unused.
Return values:
PBC_SUCCESS Successful command processing.
PBC_CMDMODE PBC in wrong mode to accept command.
PBC_NULLPTR pkt was NULL pointer.
PBC_CMDBDFC Bad function code encountered.

Here is the call graph for this function:

unsigned int Pbc_ProcessMemLoad const void *  memLoad,
const unsigned int  pktSize
 

Process Memory Write commands.

Parameters:
memLoad Contents of packet, including header.
pktSize Size of packet, including header.
Returns:
MSG value.

Here is the call graph for this function:

unsigned int Pbc_ProcessPciLoad const void *  pciLoad,
const unsigned int  pktSize
 

Process Memory PCI Device Header Write commands.

Parameters:
pciLoad Contents of packet, including header.
pktSize Size of packet, including header.
Returns:
MSG value.

Here is the call graph for this function:

unsigned int Pbc_ProcessRegLoad const void *  regLoad,
const unsigned int  pktSize
 

Process Memory Processor Register Write commands.

Parameters:
regLoad Contents of packet, including header.
pktSize Size of packet, including header.
Returns:
MSG value.

Here is the call graph for this function:

unsigned int Pbc_ProcessScBroadcast const unsigned short  apid,
const unsigned short  funcCode,
const void *  scBroadcast,
const unsigned int  pktSize
 

Process spacecraft broadcast telecommand.

This function will process spacecraft broadcast telecommands received by the LAT. The only function code of the spacecraft broadcast telecommand that is processed is the SITIMETONE. When a SITIMETONE packet is received, the seconds parameter in that packet is recorded as the current time in the PBC.

No processing is done for SIANCILLARY and SIATTITUDE function codes.

Parameters:
apid Application ID, shall be PBC_APID_SC_BROADCAST.
funcCode Function code.
scBroadcast contents of packet, including header.
pktSize size of packet, including header.
Return values:
PBC_SUCCESS Successful command processing.
PBC_CMDIGN Command ignored (consider this successful processing).
PBC_BADPID apid was not PBC_APID_SC_BROADCAST.
PBC_NULLPTR pkt was NULL pointer.
PBC_PKTSIZE pktSize was not correct.
PBC_CMDBDFC Bad function code encountered.

Here is the call graph for this function:

void PBC_reboot unsigned int  cause,
unsigned int  pri_boot_flags
 

Warm reboot the RAD750.

Parameters:
cause Cause of the reboot.
pri_boot_flags Primary boot flags to use for the reboot.
Returns:
Nothing.

void Pbc_ResetFileLoad  ) 
 

Reset FILE upload state machine.

A simple front end to FILE_uplReset()

void Pbc_ResetWatchdog unsigned long  seconds  ) 
 

Set watchdog timer.

Set watchdog timer counter to specified number of seconds.

Parameters:
seconds Watchdog timer value in seconds.
Return values:
none 

void Pbc_TimeGet unsigned long *  seconds,
unsigned long *  subSeconds
 

Get boot time.

Get time.

Parameters:
seconds Pointer to location to store seconds count
subSeconds Pointer to location to store sub seconds count
Return values:
none 

void Pbc_TimeInit  ) 
 

Init boot time.

Init time. Time set to zero.

Return values:
none 

void Pbc_TimeSetSeconds unsigned long  seconds  ) 
 

Set boot time seconds.

Set current boot time.

Parameters:
seconds New value of seconds.
Return values:
none 

unsigned int Pbc_TlmCreateHkp unsigned short  seqCount,
void *  pkt_p,
unsigned int *  size_p,
size_t  pktSize
 

Create boot housekeeping telemetry packet.

Creates an up-to-date boot housekeeping telemetry packet. All contents of the telemetry packet are gathered in this function EXCEPT the sequence count. The calling routine must manage the sequence count and pass in the desired sequence count as an argument.

The caller must also pass in a non-null pointer for pkt and must have allocated enough space to fit a housekeeping telemetry packet.

Parameters:
seqCount Sequence count to use in packet generation.
pkt_p Pointer to packet storage. Must be non-null.
size_p Location to return actual packet size, in bytes.
pktSize Size that the caller has allocated for telemetry packet. Must be large enough to contain the boot housekeeping telemetry.
Return values:
PBC_SUCCESS Packet successfully generated.
PBC_PKTSIZE pktSize too small.
PBC_NULLPTR pkt_p or tlm_bytes_p was NULL pointer.
. Also see CCSDS_pktHdrCreate() for more errors.

Here is the call graph for this function:


Variable Documentation

Pbc_diagsPtr = (volatile BOOT_Diagnostics *)MEMMAP_BOOT_DIAGS_ADDR
 

Global pointer to diagnostics

Pbc_globalState
 

Global boot state information.

Pbc_RamExcEnd
 

Symbol defined at the end of ram exceptions. The address of this variable is the last address of RAM exceptions vectors stored in ROM.

Pbc_RamExcStart
 

Symbol defined at the start of ram exceptions. The address of this variable is the address where RAM exceptions vectors are stored in ROM.


Generated on Fri Jul 22 20:16:59 2005 by doxygen 1.3.3