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.c File Reference

Boot shell main loop. More...

#include "rom_defs.h"
#include "PBC/PBC.h"
#include "asmFns.h"
#include "bootshell.h"
#include "pbc_sio.h"
#include "pbc_memmap.h"
#include "BootDiagnostics.h"
#include "CCSDS/CCSDS_pkt.h"
#include "PBC/PBC_msgs.h"
#include "PBC/PBC_types.h"
#include "PBC/PBC_string.h"
#include "ZLIB/zlib.h"
#include "CCSDS/CCSDS_msg.h"
#include "CTDB/SUMT_rt_poll.h"
#include "cmdtlm.h"
#include "CTDB/CO1553_util.h"
#include "PBS/SPIN.h"
#include "MEM/MEM_apid.h"
#include "MEM/MEM_cmddefs.h"
#include "MEM/MEM_dump.h"
#include "MEM/MEM_load.h"
#include "MEM/MEM_map.h"
#include <drv/ppci/ppciInt.h>
#include <drv/ppci/ppciMem.h>
#include <drv/ppci/ppciRegs.h>
#include "EE_boot.h"
#include "SIB/SIB.h"
#include "bootcomm.h"

Include dependency graph for bootshell.c:

Include dependency graph

Functions

void pbc_RejectPacket (void *cmdBuffer)
 Mark CCSDS as rejected command.

void pbc_RejectCommand (const unsigned short apid, void *cmdBuffer)
 Mark telecommand as rejected.

void pbc_AcceptCommand (const unsigned short apid, void *cmdBuffer)
 Mark telecommand as accepted.

unsigned int pbc_ProcessTelecommand (void *telecommand, unsigned short apid, unsigned short funcCode, unsigned short pktSize)
 Process telecommand at the LAT telecommand layer.

unsigned int pbc_ProcessCcsdsPacket (void *cmdBuffer, unsigned int cmdBufferSize)
 Process telecommand at the CCSDS protocol layer.

void pbc_CommandLoop (void)
 Boot command/telemetry processing.

void pbc_InitPpci (void)
 Initialize the Power PCI bridge chip.

void pbc_EnableMemoryInterrupts ()
 Enable memory controller interrupts.

void pbc_EnablePciInterrupts ()
 Enable PCI error interrupts.

void pbc_InstallRamExc ()
 Install exception handers into RAM.

void pbc_EnableRamExc ()
 Enable exception handers in RAM.

void pbc_InitMemSystem ()
 Initialize the MEM interface.

void * pbc_eeReadFunc (void *dest_p, const void *source_p, const size_t nbytes, void *context_p, size_t *bytes_read_p)
 EEPROM read callback function.

void * pbc_eeWriteFunc (void *dest_p, const void *source_p, const size_t nbytes, void *context_p, size_t *bytes_written_p)
 EEPROM write callback function.

void pbc_InitSIB (void)
 Initialize the SIB interface.

void pbc_InitScrubber (void)
 Initialize the software memory scrubber.

void pbc_CheckSelectionResults ()
 Check the image selection results.

void pbc_InitGlobalState (const unsigned int bootType)
 Initialize global state structure.

void PBC_BootShell (const unsigned int bootType)
 Primary boot code shell.


Detailed Description

Boot shell main loop.

Boot shell main loop.

  CVS $Id: bootshell.c,v 1.36 2005/05/17 20:41:03 dmay Exp $
  

Function Documentation

void pbc_AcceptCommand const unsigned short  apid,
void *  cmdBuffer
[static]
 

Mark telecommand as accepted.

Accept telecommand.

Parameters:
apid Application ID of packet
cmdBuffer Buffer containting telecommand to be accepted.
Return values:
none 

void PBC_BootShell const unsigned int  bootType  ) 
 

Primary boot code shell.

This is the "main" function for the primary boot code. It is the first C function that is called after the romInit code has run.

This function is resposible for finishing all of the RAD750 hardware setup (mainly setup of the PCI bus) and devices on the PCI bus (the SIB and LCB).

After the RAD750 and periphirals are configured, the PBC_BootShell will examine the boot flags to determine if the primary boot code will run the command and telemetry loop or proceed directly to running the secondary boot code.

This function should not return. If it does, it will result in a warm start in the romInit code.

Return values:
none 

Here is the call graph for this function:

void pbc_CheckSelectionResults void   ) 
 

Check the image selection results.

Check the results of the image selection process and report any failures.

Returns:
Nothing.

Here is the call graph for this function:

void pbc_CommandLoop void   )  [static]
 

Boot command/telemetry processing.

Process the command and telemetry loop during the boot command operations.

This function is your basic endless loop. Each time through the loop, the communications interface is polled with Pbc_CommPoll(). If Pbc_CommPoll() indicates a command was received, the command is processed with pbc_ProcessCcsdsPacket(). Pbc_CommPoll() also generates and sends telemetry to the spacecraft.

If pbc_ProcessCcsdsPacket() is given a Boot Start telemcommand, it will not return if a secondary boot is successfully loaded and executed. This is the only way to (properly) exit this loop.

Return values:
none 

Here is the call graph for this function:

void * pbc_eeReadFunc void *  dest_p,
const void *  source_p,
const size_t  nbytes,
void *  context_p,
size_t *  bytes_read_p
 

EEPROM read callback function.

EEPROM read function that is suitable for use as a memory map table entry callback function.

Parameters:
dest_p Pointer to destination of the memory read.
source_p Pointer to source of the memory read.
nbytes Number of bytes to read.
context_p Pointer to generic context (unused).
bytes_read_p Pointer to location to return number of bytes read.
Returns:
dest_p if no error occurred, NULL if an error occurred.

void * pbc_eeWriteFunc void *  dest_p,
const void *  source_p,
const size_t  nbytes,
void *  context_p,
size_t *  bytes_written_p
 

EEPROM write callback function.

EEPROM write function that is suitable for use as a memory map table entry callback function.

Parameters:
dest_p Pointer to destination of the memory write.
source_p Pointer to source of the memory write.
nbytes Number of bytes to write.
context_p Pointer to generic context (unused).
bytes_written_p Pointer to location to return num bytes written.
Returns:
dest_p if no error occurred, NULL if an error occurred.

void pbc_EnableMemoryInterrupts  )  [static]
 

Enable memory controller interrupts.

Enable errors in the memory controller to interrupt the processor. This will cause the interrupt exception handler to record the memory controller error and reset the processor.

Return values:
none 

void pbc_EnablePciInterrupts  )  [static]
 

Enable PCI error interrupts.

Enable errors on the PCI to interrupt the processor. This will cause the interrupt exception handler to record the PCI error and reset the processor.

Return values:
none 

void pbc_EnableRamExc  )  [static]
 

Enable exception handers in RAM.

Enable exception vectors located in RAM. The MSR is be programmed to use these vectors instead of the vectors in ROM.

Return values:
none 

void pbc_InitGlobalState const unsigned int  bootType  ) 
 

Initialize global state structure.

This routine will initialize the PBC global state structure. It should be called once at the start of PBC. The argument bootType will be used to initialize the bootType member of the global data.

The boot mode it set to "INIT". All command counts are zeroed.

Parameters:
bootType Boot type argument.
Return values:
none 

Here is the call graph for this function:

void pbc_InitMemSystem void   ) 
 

Initialize the MEM interface.

Initialize the memory map, dump, and load functions.

Returns:
Nothing.

void pbc_InitPpci void   ) 
 

Initialize the Power PCI bridge chip.

Initialize the registers within the Power PCI bridge chip. This function is modeled after the ppciInit function from VxWorks.

Returns:
Nothing.

void pbc_InitScrubber void   ) 
 

Initialize the software memory scrubber.

Initialize the software memory scrubber. In boot mode, the hardware scrubber is not used since we don't want to scrub all of SDRAM. Instead, the command loop marches through the SDRAM and scrubs it 'manually'. In this way we restrict the scrub operation to the portion of SDRAM that is used by the boot code. Just before the boot code jumps to the secondary boot code, it should enable the hardware scrubber.

Returns:
Nothing.

void pbc_InitSIB void   ) 
 

Initialize the SIB interface.

Initialize the interface to the SIB functions.

Returns:
Nothing.

Here is the call graph for this function:

void pbc_InstallRamExc  )  [static]
 

Install exception handers into RAM.

Install exception vectors into RAM. The vectors are stored in the .rodata section in ROM. Two symbols, Pbc_RamExcStart and Pbc_RamExcEnd are defined to indicate the start and end address of the vectors. This routine copies the code from the ROM into RAM.

After these exception vectors are installed, the MSR must be programmed to use these vectors instead of the vectors in ROM. Use the function Pbc_EnableRamExc() to do this.

Return values:
none 

Here is the call graph for this function:

unsigned int pbc_ProcessCcsdsPacket void *  cmdBuffer,
unsigned int  cmdBufferSize
[static]
 

Process telecommand at the CCSDS protocol layer.

This is the function that processes all commands sent to the PBC. Commands are verified through the CCDSD protocol layer. Commands that do not pass verification are rejected. Commands that pass verification are passed to pbc_ProcessTelecommand() for processing.

Parameters:
cmdBuffer Buffer containting telecommand to be processed.
cmdBufferSize Length of telecommand buffer.
Return values:
PBC_UNKNOWN Coding error.
PBC_CMDREJ Command rejected.
PBC_CMDACPT Command accepted.
PBC_CMDIGN Command verified, but ingored.
PBC_CMDUNSP Command verified, but not supported.

Here is the call graph for this function:

unsigned int pbc_ProcessTelecommand void *  telecommand,
unsigned short  apid,
unsigned short  funcCode,
unsigned short  pktSize
[static]
 

Process telecommand at the LAT telecommand layer.

This is the function that processes all verified LAT commands sent to the PBC. It is assumed that commands processed here have passed verification. Commands are processed based on APID.

Parameters:
telecommand Buffer containting telecommand to be processed.
apid Application ID of packet.
funcCode Function code of packet.
pktSize Size of packet, including header.
Return values:
PBC_UNKNOWN Coding error.
PBC_CMDREJ Command rejected.
PBC_CMDACPT Command accepted.
PBC_CMDIGN Command verified, but ingored.
PBC_CMDUNSP Command verified, but not supported.

Here is the call graph for this function:

void pbc_RejectCommand const unsigned short  apid,
void *  cmdBuffer
[static]
 

Mark telecommand as rejected.

Reject telecommand.

Parameters:
apid Application ID of packet
cmdBuffer Buffer containting telecommand to be rejected.
Return values:
none 

void pbc_RejectPacket void *  cmdBuffer  )  [static]
 

Mark CCSDS as rejected command.

Reject a CCSDS packet. This is used if a CCSDS count failed protocol checks so badly that I could not be interpreted as a telecommand.

Parameters:
cmdBuffer Buffer containting telecommand to be rejected.
Return values:
none 


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