28 #include <epicsVersion.h> 30 #if EPICS_VERSION==3 && EPICS_REVISION==14 && EPICS_MODIFICATION<10 36 #include <epicsTypes.h> 46 # define INLINE inline 50 #define DEVLIBVME_MAJOR 1 51 #define DEVLIBVME_MINOR 0 63 #define VMECSR_END {0,0,0} 66 #define VMECSRANY 0xFfffFfff 69 #define VMECSRSLOTMAX ((1<<5)-1) 130 #define CSRSlotBase(slot) ( (slot)<<19 ) 137 #define CSRADER(addr,mod) ( ((addr)&0xFfffFf00) | ( ((mod)&0x3f)<<2 ) ) 142 #define CSRRead8(addr) ioread8(addr) 144 #define CSRRead16(addr) ( CSRRead8(addr)<<8 | CSRRead8(addr+4) ) 146 #define CSRRead24(addr) ( CSRRead16(addr)<<8 | CSRRead8(addr+8) ) 148 #define CSRRead32(addr) ( CSRRead24(addr)<<8 | CSRRead8(addr+12) ) 150 #define CSRWrite8(addr,val) iowrite8(addr, val) 152 #define CSRWrite16(addr,val) \ 153 do{ CSRWrite8(addr,(val&0xff00)>>8); CSRWrite8(addr+4,val&0xff); }while(0) 155 #define CSRWrite24(addr,val) \ 156 do{ CSRWrite16(addr,(val&0xffff00)>>8); CSRWrite8(addr+8,val&0xff); }while(0) 158 #define CSRWrite32(addr,val) \ 159 do{ CSRWrite24(addr,(val&0xffffff00)>>8); CSRWrite8(addr+12,val&0xff); }while(0) 216 #define CR_ROM_CHECKSUM 0x0003 217 #define CR_ROM_LENGTH 0x0007 218 #define CR_DATA_ACCESS_WIDTH 0x0013 219 #define CSR_DATA_ACCESS_WIDTH 0x0017 220 #define CR_SPACE_ID 0x001B 222 #define CR_ASCII_C 0x001F 223 #define CR_ASCII_R 0x0023 225 #define CR_IEEE_OUI 0x0027 226 #define CR_IEEE_OUI_BYTES 3 227 #define CR_BOARD_ID 0x0033 228 #define CR_BOARD_ID_BYTES 4 229 #define CR_REVISION_ID 0x0043 230 #define CR_REVISION_ID_BYTES 4 231 #define CR_ASCII_STRING 0x0053 232 #define CR_PROGRAM_ID 0x007F 236 #define CR_BEG_UCR 0x0083 237 #define CR_END_UCR 0x008F 238 #define CR_BEG_UCSR_BYTES 3 240 #define CR_BEG_CRAM 0x009B 241 #define CR_END_CRAM 0x00A7 243 #define CR_BEG_UCSR 0x00B3 244 #define CR_END_UCSR 0x00BF 246 #define CR_BEG_SN 0x00CB 247 #define CR_END_SN 0x00DF 249 #define CR_SLAVE_CHAR 0x00E3 250 #define CR_UD_SLAVE_CHAR 0x00E7 252 #define CR_MASTER_CHAR 0x00EB 253 #define CR_UD_MASTER_CHAR 0x00EF 255 #define CR_IRQ_HANDLER_CAP 0x00F3 256 #define CR_IRQ_CAP 0x00F7 258 #define CR_CRAM_WIDTH 0x00FF 260 #define CR_FN_DAWPR(N) ( 0x0103 + (N)*0x04 ) 262 #define CR_DAWPR_BYTES 1 264 #define CR_FN_AMCAP(N) ( 0x0123 + (N)*0x20 ) 266 #define CR_AMCAP_BYTES 8 268 #define CR_FN_XAMCAP(N) ( 0x0223 + (N)*0x80 ) 270 #define CR_XAMCAP_BYTES 32 272 #define CR_FN_ADEM(N) ( 0x0623 + (N)*0x10 ) 274 #define CR_ADEM_BYTES 4 276 #define CR_MASTER_DAWPR 0x06AF 277 #define CR_MASTER_AMCAP 0x06B3 278 #define CR_MASTER_XAMCAP 0x06D3 283 #define CR_SIZE 0x0750 284 #define CR_BYTES (CR_SIZE>>2) 292 #define CSR_BAR 0x7ffff 293 #define CSR_BIT_SET 0x7fffb 294 #define CSR_BIT_CLEAR 0x7fff7 298 #define CSR_CRAM_OWNER 0x7fff3 299 #define CSR_UD_BIT_SET 0x7ffef 300 #define CSR_UD_BIT_CLEAR 0x7ffeb 301 #define CSR_FN_ADER(N) (0x7ff63 + (N)*0x10) 303 #define CSR_ADER_BYTES 4 308 #define CSR_BITSET_RESET_MODE 0x80 309 #define CSR_BITSET_SYSFAIL_ENA 0x40 310 #define CSR_BITSET_MODULE_FAIL 0x20 311 #define CSR_BITSET_MODULE_ENA 0x10 312 #define CSR_BITSET_BERR 0x08 313 #define CSR_BITSET_CRAM_OWNED 0x04 330 CSRSetBase(
volatile void* base, epicsUInt8 N, epicsUInt32 addr, epicsUInt8 amod)
332 volatile char* ptr=(
volatile char*)base;
INLINE void CSRSetBase(volatile void *base, epicsUInt8 N, epicsUInt32 addr, epicsUInt8 amod)
Set base address for VME64x function N.
epicsShareExtern void vmecsrprint(int N, int verb)
Decode contents of CSR/CR and print to screen.
epicsShareFunc volatile unsigned char * devCSRTestSlot(const struct VMECSRID *devs, int slot, struct VMECSRID *info)
Probe a VME slot then check its ID.
ID info for a VME64(x) device This structure is used to hold identifying information for a VME64 comp...
epicsShareFunc volatile unsigned char * devCSRProbeSlot(int slot)
Get the CSR base address for a slot.
#define CSRWrite32(addr, val)
#define CSR_FN_ADER(N)
Function N Address Decoder Compare Register (1st byte)
epicsShareExtern void vmecsrdump(int verb)
Decode contents of CSR/CR for all cards and print to screen.
#define CSRADER(addr, mod)
Computes values for the VME64x address decode registers (ADER).