LLC2_API
Defines | Functions | Variables
llprotocol.h File Reference

API for bus level protocol. More...

Go to the source code of this file.

Defines

#define BP_MB_LLC_UPDATEDAC   1
#define LLC_CSR_M_UPDATEDACS   'f'
#define DAC_COUNT   16
#define DAC_SAMPLE_SIZE   (DAC_COUNT*sizeof(short))
#define DAC_BASE(bigbuf_base, mfa)   ((void*)bigbuf_base + (mfa))
#define LLCV2_HB_OFFSET   0x00100000
 V2 host buffer segmentation - for full V2, 4K is enough.
#define LLCV2_AI_HSBT   0x000
#define LLCV2_AO_HSBS   0x400
#define LLCV2_DO_HSBS   0x800
#define LLCV2_STATUS_HSBT   0xc000
#define LLCV2_OFFSET_AI_HSBT   (llcv2_hb_offset+LLCV2_AI_HSBT)
#define LLCV2_OFFSET_AO_HSBS   (llcv2_hb_offset+LLCV2_AO_HSBS)
#define LLCV2_OFFSET_DO_HSBS   (llcv2_hb_offset+LLCV2_DO_HSBS)
#define LLCV2_OFFSET_STATUS_HSBT   (llcv2_hb_offset+LLCV2_STATUS_HSBT)

Functions

int enterLLCSoftClock (struct MU *m, int clkpos, int trpos, int internal_loopback, u32 command_mods)
int enterLLCExtClock (struct MU *m, int clkpos, int trpos, unsigned short divisor, int internal_loopback, u32 command_mods)
int enterLLC_SYNC_ECM (struct MU *m, int clkpos, int trpos, unsigned short divisor, int internal_loopback, u32 command_mods, u32 init_buf_baddr)
 Enter LowLatency Mode for EXTERNAL CLOCK capture.
int leaveLLC (struct MU *m)
static u32 llPollSack (struct MU *m)
static u32 llGetCsr (struct MU *m)
static u32 llSetCmd (struct MU *m, u32 cmd)
static void llSetAddr (struct MU *m, u32 addr, u32 cmd)
static u32 llGetTlatch (struct MU *m)
static int llSetTlatch (struct MU *m, u32 value)
static u32 llGetTinst (struct MU *m)
static u32 llGetTprocess (struct MU *m)
u32 llWaitDmaDone (struct MU *m)
 polls until DMA has completed.
u32 llv2WaitDmaDone (struct MU *m, volatile u32 *hstats)
 polls until DMA has completed.
u32 llv2WaitDmaDone_2v (struct MU *m, volatile u32 *hstats, unsigned tlatch)
 polls until DMA has completed.
void llv2InitDmaDone (volatile u32 *hstats)
 polls until DMA has completed.
static int llCounterRunning (struct MU *m, u32 csr)
 prepare (poison) target buf for incoming DMA.
static void llSetDacs (struct MU *mu, void *dacvals, char *bigbuf_base)
 uses i2o buffer Q.
void llPrimePollHB (struct DmaBuffer *buf, int offset, int sample_len)
void llPollHB (struct DmaBuffer *buf, int offset, int sample_len)
u32 llv2_extend32 (u32 old32, u32 new12)
 return 32 bit count as function of old32, new12.

Variables

unsigned llcv2_hb_offset
 but for future, simpler host side drivers, we'd like a single 4K buf, no offset.

Detailed Description

API for bus level protocol.

Definition in file llprotocol.h.


Define Documentation

#define BP_MB_LLC_UPDATEDAC   1

Definition at line 111 of file llprotocol.h.

#define DAC_BASE (   bigbuf_base,
  mfa 
)    ((void*)bigbuf_base + (mfa))

Definition at line 313 of file llprotocol.h.

#define DAC_COUNT   16

Definition at line 280 of file llprotocol.h.

#define DAC_SAMPLE_SIZE   (DAC_COUNT*sizeof(short))

Definition at line 281 of file llprotocol.h.

Referenced by llSetDacs(), and td_get_next_dac_data().

#define LLC_CSR_M_UPDATEDACS   'f'

Definition at line 112 of file llprotocol.h.

#define LLCV2_AI_HSBT   0x000

Definition at line 330 of file llprotocol.h.

Referenced by appEnterLLC_SYNC_2VAO32(), and ACQ196::getAI().

#define LLCV2_AO_HSBS   0x400
#define LLCV2_DO_HSBS   0x800

Definition at line 332 of file llprotocol.h.

#define LLCV2_HB_OFFSET   0x00100000

V2 host buffer segmentation - for full V2, 4K is enough.

Definition at line 322 of file llprotocol.h.

#define LLCV2_OFFSET_AI_HSBT   (llcv2_hb_offset+LLCV2_AI_HSBT)

Definition at line 335 of file llprotocol.h.

#define LLCV2_OFFSET_AO_HSBS   (llcv2_hb_offset+LLCV2_AO_HSBS)

Definition at line 336 of file llprotocol.h.

#define LLCV2_OFFSET_DO_HSBS   (llcv2_hb_offset+LLCV2_DO_HSBS)

Definition at line 337 of file llprotocol.h.

#define LLCV2_OFFSET_STATUS_HSBT   (llcv2_hb_offset+LLCV2_STATUS_HSBT)

Definition at line 338 of file llprotocol.h.

Referenced by card_v2_WaitDmaDone(), and v2_updateTstats().

#define LLCV2_STATUS_HSBT   0xc000

Definition at line 333 of file llprotocol.h.


Function Documentation

int enterLLC_SYNC_ECM ( struct MU m,
int  clkpos,
int  trpos,
unsigned short  divisor,
int  internal_loopback,
u32  command_mods,
u32  init_buf_baddr 
)

Enter LowLatency Mode for EXTERNAL CLOCK capture.

Definition at line 222 of file llprotocol.cpp.

References BP_FC_SET_LLCV2_INIT, BP_MB_A4, enterLLCExtClock(), and setMbox().

Referenced by appEnterLLC_SYNC_2VAO32().

int enterLLCExtClock ( struct MU m,
int  clkpos,
int  trpos,
unsigned short  divisor,
int  internal_loopback,
u32  command_mods 
)
int enterLLCSoftClock ( struct MU m,
int  clkpos,
int  trpos,
int  internal_loopback,
u32  command_mods 
)
int leaveLLC ( struct MU m)

Definition at line 236 of file llprotocol.cpp.

References LLC_CSR_M_ESC, llSetCmd(), and setPathCleanup().

Referenced by quit_handler(), and LL_ControlSystemI::Stop().

static int llCounterRunning ( struct MU m,
u32  csr 
) [inline, static]

prepare (poison) target buf for incoming DMA.

returns TRUE when counters are running the process has started on GATE.

Definition at line 273 of file llprotocol.h.

References LLC_CSR_M_READCTR, LLC_CSR_S_CTR_RUN, and llSetCmd().

static u32 llGetCsr ( struct MU m) [inline, static]

Definition at line 171 of file llprotocol.h.

References BP_MB_LLC_CSR, and getMbox().

Referenced by llGetTprocess().

static u32 llGetTinst ( struct MU m) [inline, static]

Definition at line 237 of file llprotocol.h.

References BP_MB_LLC_TINST, and getMbox().

static u32 llGetTlatch ( struct MU m) [inline, static]

Definition at line 225 of file llprotocol.h.

References BP_MB_LLC_TADC, and getMbox().

Referenced by llWaitDmaDone().

static u32 llGetTprocess ( struct MU m) [inline, static]

Definition at line 243 of file llprotocol.h.

References LLC_GET_TCYCLE, and llGetCsr().

void llPollHB ( struct DmaBuffer buf,
int  offset,
int  sample_len 
)
static u32 llPollSack ( struct MU m) [inline, static]

Definition at line 155 of file llprotocol.h.

References BP_MB_LLC_CSR, LLC_CSR_SACK, LLC_CSR_SNACK, and pollMboxBits().

Referenced by llSetCmd().

void llPrimePollHB ( struct DmaBuffer buf,
int  offset,
int  sample_len 
)
static void llSetAddr ( struct MU m,
u32  addr,
u32  cmd 
) [inline, static]

Definition at line 215 of file llprotocol.h.

References BP_MB_LLC_DATA_ADDR, LLC_CSR_M_SETADDR, llSetCmd(), and setMbox().

Referenced by updateTargetAddr().

static u32 llSetCmd ( struct MU m,
u32  cmd 
) [inline, static]

Definition at line 204 of file llprotocol.h.

References BP_MB_LLC_CSR, LLC_CSR_SACK, LLC_CSR_SNACK, llPollSack(), PRINTF, and setMbox().

Referenced by leaveLLC(), llCounterRunning(), and llSetAddr().

static void llSetDacs ( struct MU mu,
void *  dacvals,
char *  bigbuf_base 
) [inline, static]

uses i2o buffer Q.

  • obtain a descriptor (MFA) from the target Q (1)
  • copy from client buffer to slave memory ref by MFA (2)
  • post descriptor to target Q (3)

target is notified about the post, and uses the MFA to setup a DMA direct from host memory to DACs.

For MINIMUM latency

  • a/ split the function to mu_reserveOutbound(mu) ahead of time (don't pre-reserve more than one .. 100 this is a limited resource
  • b/ eliminate the memcpy (but this is quick, regardless).

Definition at line 285 of file llprotocol.h.

References DAC_SAMPLE_SIZE, mu_putOutbound(), mu_reserveOutbound(), and PRINTF.

static int llSetTlatch ( struct MU m,
u32  value 
) [inline, static]

Definition at line 231 of file llprotocol.h.

References BP_MB_LLC_TADC, and setMbox().

Referenced by LL_ControlSystemI::Arm().

u32 llv2_extend32 ( u32  old32,
u32  new12 
)

return 32 bit count as function of old32, new12.

Definition at line 283 of file llprotocol.cpp.

References ACQ196_TCR_MASK, and SERVICE_ROLLOVER.

Referenced by llv2WaitDmaDone(), llv2WaitDmaDone_2v(), sync_2v_updateTstats(), and v2_updateTstats().

void llv2InitDmaDone ( volatile u32 hstats)

polls until DMA has completed.

Returns tlatch guaranteed DMA done when tlatch updated V2 method does NOT poll PCI

Definition at line 364 of file llprotocol.cpp.

References LLC_SYNC2V_IN_LAST, LLCV2_POISON, and LLCV2_STATUS_BDR.

Referenced by LL_ControlSystemI::Arm().

u32 llv2WaitDmaDone ( struct MU m,
volatile u32 hstats 
)

polls until DMA has completed.

Returns tlatch guaranteed DMA done when tlatch updated

Returns tlatch guaranteed DMA done when tlatch updated V2 method does NOT poll PCI

Definition at line 295 of file llprotocol.cpp.

References BP_MB_LLC_TADC, LLCV2_POISON, LLCV2_STATUS_BDR, LLCV2_STATUS_TLATCH, llv2_extend32(), mask, and setMboxPollcount().

Referenced by card_v2_WaitDmaDone().

u32 llv2WaitDmaDone_2v ( struct MU m,
volatile u32 hstats,
unsigned  tlatch 
)

polls until DMA has completed.

Returns tlatch guaranteed DMA done when tlatch updated V2 method does NOT poll PCI

Definition at line 332 of file llprotocol.cpp.

References LLC_SYNC2V_IN_LAST, LLCV2_POISON, LLCV2_STATUS_TLATCH, llv2_extend32(), mask, and setMboxPollcount().

Referenced by card_sync_2v_WaitDmaDone().

u32 llWaitDmaDone ( struct MU m)

polls until DMA has completed.

Returns tlatch guaranteed DMA done when tlatch updated

Definition at line 245 of file llprotocol.cpp.

References BP_MB_LLC_TADC, getMboxShadow(), llGetTlatch(), and setMboxPollcount().


Variable Documentation

unsigned llcv2_hb_offset

but for future, simpler host side drivers, we'd like a single 4K buf, no offset.

=> use a variable and set as appropriate

Definition at line 108 of file llcontrol-core.cpp.

Referenced by appEnterLLC_SYNC_2VAO32().