Defines | Functions | Variables

llprotocol.h File Reference

API for bus level protocol. More...

#include <setjmp.h>

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

sigjmp_buf G_env
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.

Referenced by do_run(), runSYNC_2V(), runSYNC_2VAO32(), and runSYNC_ECM().

#define DAC_SAMPLE_SIZE   (DAC_COUNT*sizeof(short))
#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_2V(), and appEnterLLC_SYNC_2VAO32().

#define LLCV2_AO_HSBS   0x400

Definition at line 331 of file llprotocol.h.

Referenced by runSYNC_2V(), runSYNC_2VAO32(), and runSYNC_ECM().

#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(), runSYNC_ECM(), 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 221 of file llprotocol.c.

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

Referenced by appEnterLLC_SYNC_2V(), appEnterLLC_SYNC_2VAO32(), and appEnterLLC_SYNC_ECM().

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

Definition at line 198 of file llprotocol.c.

References BP_SET_A1, and enterLLC().

Referenced by enterLLC_SYNC_ECM(), and runTest().

int enterLLCSoftClock ( struct MU m,
int  clkpos,
int  trpos,
int  internal_loopback,
u32  command_mods 
)

Definition at line 178 of file llprotocol.c.

References BP_SET_A1, and enterLLC().

Referenced by runTest().

int leaveLLC ( struct MU m  ) 

Definition at line 235 of file llprotocol.c.

References LLC_CSR_M_ESC, and llSetCmd().

Referenced by quit_handler(), and runTest().

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().

Referenced by do_run(), runSCM216(), runSYNC_2V(), runSYNC_2VAO32(), and runSYNC_ECM().

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().

Referenced by do_run(), and mbox_updateTstats().

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().

Referenced by mbox_updateTstats().

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

Definition at line 159 of file llprotocol.h.

References BP_MB_LLC_CSR, G_env, 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]
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.

Referenced by do_run().

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 do_run(), runSCM216(), runSYNC_2V(), runSYNC_2VAO32(), and runSYNC_ECM().

u32 llv2_extend32 ( u32  old32,
u32  new12 
)

return 32 bit count as function of old32, new12.

Definition at line 281 of file llprotocol.c.

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 363 of file llprotocol.c.

Referenced by runSYNC_2V(), runSYNC_2VAO32(), and runSYNC_ECM().

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

Todo:
old, new looks wrong!

Definition at line 293 of file llprotocol.c.

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 331 of file llprotocol.c.

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 243 of file llprotocol.c.

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

Referenced by card_v1_WaitDmaDone().


Variable Documentation

sigjmp_buf G_env

Definition at line 129 of file llprotocol.c.

Referenced by llPollSack(), and runTest().

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 1113 of file llcontrol.c.

Referenced by appEnterLLC_SYNC_2V(), appEnterLLC_SYNC_2VAO32(), and appEnterLLC_SYNC_ECM().