Doxygen Documentation

Main Index

Package Index

Package:

DUTIL

Version:

V0-2-5

Marked:

(not marked)

Constituent:

start

Tag:

rad750


Interface   Compound List   File List   Compound Members   File Members  

start.c File Reference

Provides functions to power on and configure the LAT. More...

#include "DUTIL/start.h"
#include "LCB_cfg_p.h"
#include "PBS/MBA.h"
#include "PBS/FORK.h"
#include "PBS/TASK.h"
#include "PBS/FPA.h"
#include "LCB/LCB.h"
#include "LCB/LCB_log.h"
#include "LCB/LCB_init.h"
#include "LCB/LCB_io.h"
#include "LCB/LCB_dispatch.h"
#include "LCB/LCB_err.h"
#include "LCB/LCB_bulk.h"
#include "LCB/LCB_reg.h"
#include "LCB/LIOX.h"
#include "LCB/LIOX_init.h"
#include "LCB/LIOX_sys.h"
#include "LCB/LIOX_sync.h"
#include "LCB/LIOX_cmd.h"
#include "LCB/LIOX_addr.h"
#include "DAB/reg.h"
#include "DAB/scru.h"
#include "DAB/spdu.h"
#include "DAB/sgem.h"
#include "DAB/sebm.h"
#include "DEM/TEM_reg.h"
#include "DEM/TEM_CC_sync.h"
#include "DEM/TEM_GCCC_sync.h"
#include "DEM/TEM_GTIC_sync.h"
#include "DEM/AEM_reg.h"
#include "DEM/AEM_CC_sync.h"
#include <stdio.h>
#include <string.h>

Include dependency graph for start.c:

Include dependency graph

Defines

#define DEFAULT_DELAY   60
 Time (in 60ths of a second) to wait after powering on a cpt before trying to configure it (used in addTEM).

#define N_CRU_REGS   3
 Number of CRU registers to save and restore in useOtherDAB.

#define N_EBM_REGS   8
 Number of EBM registers to save and restore in useOtherDAB.

#define _printf(format, args...)
 Provide printf-like functionality.


Functions

void powerOn (LIOXs slh, unsigned priMask, unsigned redMask, unsigned delay)
 Configures the PDUs to power the required components of the LAT.

int configCRU (LIOXs slh, unsigned cptMask)
 Configures the CRU to allow LATp C/R with the specified components and sets the LATp addresses of those cpts.

int configEBM (LIOXs slh, unsigned cptMask)
 Configures the source and destination enables of the EBM.

void useOtherLATp (LCB lcb, LIOXs slh)
 Invert the command and event path bits in the configuration registers of the LCB (change to the other LATp fabric).

unsigned useOtherDAB (LCB lcb, LIOXs slh)
 Stop using the current (prim/red) LATp fabric and switch to the other, transferring over the CRU and EBM configurations in the process.

unsigned getEPUaddr (LIOXs slh)
 Returns address to use in the event contributions.

int addTEM (LIOXs slh, unsigned temID, unsigned redPDU)
 Power on a TEM and configure it along with the CRU and EBM.

int removeTEM (LIOXs slh, unsigned temID)
 Power off a TEM and remove it from the CRU and EBM configurations.

int addEPU (LIOXs slh, unsigned epuID, unsigned redPDU)
 Power on an EPU and configure it along with the CRU and EBM.

int removeEPU (LIOXs slh, unsigned epuID)
 Power off an EPU and remove it from the CRU and EBM configurations.

int powerOn_load (LIOXs slh, unsigned temMask, unsigned delay)
 Power on the CAL and TRK.

unsigned int createSLH (LCB lcb, LIOXs *slh)
 Allocate memory for and initializes Synchronous LIOX handle.

unsigned int t_LCB_drainQ (LCB lcb)
 Drains the result and event hardware FIFOs.

unsigned LCB_startup (LCB *pLCB, LCB_cfg *cfg)
 Laundry list of LCB initializations.

unsigned LCB_promote (LIOXs slh)
 Assert the LCB commander wire - field promotion from SLAVE to COMMANDER.

unsigned LCB_demote (LIOXs slh)
 De-assert the LCB commander wire.


Detailed Description

Provides functions to power on and configure the LAT.

Author:
James Swain -- jswain@slac.stanford.edu

Define Documentation

#define _printf format,
args...   ) 
 

Value:

printf ( __FUNCTION__"():%05d "format".\n" , __LINE__ , ## args); \
          fflush ( stdout);
Provide printf-like functionality.


Function Documentation

int addEPU LIOXs  slh,
unsigned  epuID,
unsigned  redPDU
 

Power on an EPU and configure it along with the CRU and EBM.

Parameters:
slh Synchronous LIOX handle
epuID 0 ... 2
redPDU 0 -> use Primary PDU, 1 -> use Redundant PDU
Returns:
0 if successful, -1 if failed

int addTEM LIOXs  slh,
unsigned  temID,
unsigned  redPDU
 

Power on a TEM and configure it along with the CRU and EBM.

Parameters:
slh Synchronous LIOX handle
temID 0 ... 15
redPDU 0 -> use Primary PDU, 1 -> use Redundant PDU
Returns:
0 if successful, -1 if failed

int configCRU LIOXs  slh,
unsigned  cptMask
 

Configures the CRU to allow LATp C/R with the specified components and sets the LATp addresses of those cpts.

int configCRU(LIOXs slh, unsigned cptMask)

Parameters:
slh Synchronous LIOX handle
cptMask Bit mask indicating which components should be configured
Returns:
0 on success, -1 on failure
1) Any component that is not specified in cptMask will be inaccessible following the execution of this function

2) Only the TEMs, DAB and PDUs are configured by this function.

3) cptMask is laid out in the manner of the CRU command and response enable bit masks (LAT-TD-01547, figs 12 & 13).

TEM0 = 0x00000001 TEM1 = 0x00000002 TEM2 = 0x00000004 : TEMe = 0x00004000 TEMf = 0x00008000 GEM = 0x00010000 AEM = 0x00020000 EBM = 0x00040000 PDU0 = 0x00080000 PDU1 = 0x00100000 SIUx = 0x01000000 SIU0 = 0x02000000 SIU1 = 0x04000000 EPU0 = 0x08000000 EPU1 = 0x10000000 EPU2 = 0x20000000

int configEBM LIOXs  slh,
unsigned  cptMask
 

Configures the source and destination enables of the EBM.

int configEBM(LIOXs slh, unsigned cptMask)

Parameters:
slh Synchronous LIOX handle
cptMask Bit mask indicating which components should be configured
Returns:
0 on success, -1 on failure
1) cptMask is the concatenation of registers 4-6 of the EBM controller block (LAT-TD-01546, the source enable registers) with an additional bit in the most- significant-byte representing the SSR

GEM = 0x00000001 TEM0 = 0x00000002 TEM1 = 0x00000004 TEM2 = 0x00000008 : TEMe = 0x00008000 TEMf = 0x00010000 AEM = 0x00020000 SIUX = 0x00040000 SIU0 = 0x00080000 SIU1 = 0x00100000 EPU0 = 0x00200000 EPU1 = 0x00400000 EPU2 = 0x00800000

unsigned int createSLH LCB  lcb,
LIOXs *  slh
 

Allocate memory for and initializes Synchronous LIOX handle.

Parameters:
lcb Initialized LCB handle
slh Pointer to uninitialed Synchronous LIOX handle
Returns:
LCB_OK

unsigned getEPUaddr LIOXs  slh  ) 
 

Returns address to use in the event contributions.

Parameters:
slh Synchronous LIOX handle
Returns:
Destination address to use when configuring the GEM
Once the round-robin functionality is available in the EBM, this will return 0. Until then it returns the address of the commander node.

unsigned LCB_demote LIOXs  slh  ) 
 

De-assert the LCB commander wire.

Parameters:
slh Synchronous LIOX handle
Returns:
Status of the CSR write

unsigned LCB_promote LIOXs  slh  ) 
 

Assert the LCB commander wire - field promotion from SLAVE to COMMANDER.

Parameters:
slh Synchronous LIOX handle
Returns:
Status of the CSR write

unsigned LCB_startup LCB *  pLCB,
LCB_cfg cfg
 

Laundry list of LCB initializations.

Parameters:
pLCB pointer to hold Initialized LCB handle
cfg Pointer to a LCB_cfg structure containing configuration information
Returns:
LCB_OK

Here is the call graph for this function:

void powerOn LIOXs  slh,
unsigned  priMask,
unsigned  redMask,
unsigned  delay
 

Configures the PDUs to power the required components of the LAT.

void powerOn (LIOXs slh, unsigned priMask, unsigned redMask, unsigned delay)

Parameters:
slh Synchronous LIOX handle
priMask Bit mask indicating which components should be powered on by the PRIMARY PDU
redMask Bit mask indicating which components should be powered on by the REDUNDANT PDU
delay Time (in 60ths of a second) to wait after powering a cpt before powering the next
1) Function assumes that the CRU is unconfigured so begins by configuring the CRU to access the requested PDUs and sets the LATp addresses of the aforementioned PDUs.

2) Currently only the Primary EPU DC-DC converters are available.

3) Currently only the Primary ACD supply and converters are available.

4) priMask and redMask are laid out in the manner of the CRU command and response enable bit masks (LAT-TD-01547, figs 12 & 13).

TEM0 = 0x00000001 TEM1 = 0x00000002 TEM2 = 0x00000004 : TEMe = 0x00004000 TEMf = 0x00008000 GEM = 0x00010000 AEM = 0x00020000 EBM = 0x00040000 PDU0 = 0x00080000 PDU1 = 0x00100000 SIUx = 0x01000000 SIU0 = 0x02000000 SIU1 = 0x04000000 EPU0 = 0x08000000 EPU1 = 0x10000000 EPU2 = 0x20000000

int powerOn_load LIOXs  slh,
unsigned  temMask,
unsigned  delay
 

Power on the CAL and TRK.

Parameters:
slh Synchronous LIOX handle
temMask Bitmask indicating the load boards to power
delay Time (in 60ths of a second) between each power-on command
Returns:
0 on success, -1 on failure

int removeEPU LIOXs  slh,
unsigned  epuID
 

Power off an EPU and remove it from the CRU and EBM configurations.

Parameters:
slh Synchronous LIOX handle
epuID 0 ... 3
Returns:
0 if successful, -1 if failed

int removeTEM LIOXs  slh,
unsigned  temID
 

Power off a TEM and remove it from the CRU and EBM configurations.

Parameters:
slh Synchronous LIOX handle
temID 0 ... 15
Returns:
0 if successful, -1 if failed

unsigned int t_LCB_drainQ LCB  lcb  )  [static]
 

Drains the result and event hardware FIFOs.

Parameters:
lcb Initialized LCB handle
Returns:
LCB_OK

unsigned useOtherDAB LCB  lcb,
LIOXs  slh
 

Stop using the current (prim/red) LATp fabric and switch to the other, transferring over the CRU and EBM configurations in the process.

Parameters:
lcb Pointer to the LCB
slh Synchronous LIOX handle
Returns:
DAB status code (DAB_SUCCESS if all goes well)

Here is the call graph for this function:

void useOtherLATp LCB  lcb,
LIOXs  slh
 

Invert the command and event path bits in the configuration registers of the LCB (change to the other LATp fabric).

Parameters:
lcb Pointer to the LCB
slh Synchronous LIOX handle


Generated on Wed Apr 14 18:56:33 2004 by doxygen 1.3.3