Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
aic94xx_reg.h File Reference
#include <asm/io.h>
#include "aic94xx_hwi.h"
#include "aic94xx_reg_def.h"

Go to the source code of this file.

Macros

#define AIC9410_DEV_REV_B0   0x8
 
#define REG_BASE_ADDR   0xB8000000
 
#define REG_BASE_ADDR_CSEQCIO   0xB8002000
 
#define REG_BASE_ADDR_EXSI   0xB8042800
 
#define MBAR0_SWA_SIZE   0x58
 
#define MBAR0_SWC_SIZE   0x8
 
#define OCM_BASE_ADDR   0xA0000000
 
#define OCM_MAX_SIZE   0x20000
 
#define ALL_BASE_ADDR   OCM_BASE_ADDR
 
#define PCI_IOBAR_OFFSET   4
 
#define PCI_CONF_MBAR1   0x6C
 
#define PCI_CONF_MBAR0_SWA   0x70
 
#define PCI_CONF_MBAR0_SWB   0x74
 
#define PCI_CONF_MBAR0_SWC   0x78
 
#define PCI_CONF_MBAR_KEY   0x7C
 
#define PCI_CONF_FLSH_BAR   0xB8
 
#define ASD_READ_OCM(type, ord, S)
 
#define ASD_WRITE_OCM(type, ord, S)
 
#define ASD_DDBSITE_READ(type, ord)
 
#define ASD_DDBSITE_WRITE(type, ord)
 
#define ASD_SCBSITE_READ(type, ord)
 
#define ASD_SCBSITE_WRITE(type, ord)
 

Functions

u8 asd_read_reg_byte (struct asd_ha_struct *asd_ha, u32 reg)
 
u16 asd_read_reg_word (struct asd_ha_struct *asd_ha, u32 reg)
 
u32 asd_read_reg_dword (struct asd_ha_struct *asd_ha, u32 reg)
 
void asd_write_reg_byte (struct asd_ha_struct *asd_ha, u32 reg, u8 val)
 
void asd_write_reg_word (struct asd_ha_struct *asd_ha, u32 reg, u16 val)
 
void asd_write_reg_dword (struct asd_ha_struct *asd_ha, u32 reg, u32 val)
 
void asd_read_reg_string (struct asd_ha_struct *asd_ha, void *dst, u32 offs, int count)
 
void asd_write_reg_string (struct asd_ha_struct *asd_ha, void *src, u32 offs, int count)
 
 ASD_READ_OCM (u8, byte, b)
 
 ASD_READ_OCM (u16, word, w)
 
 ASD_READ_OCM (u32, dword, l)
 
 ASD_WRITE_OCM (u8, byte, b)
 
 ASD_WRITE_OCM (u16, word, w)
 
 ASD_WRITE_OCM (u32, dword, l)
 
 ASD_DDBSITE_READ (u32, dword)
 
 ASD_DDBSITE_READ (u16, word)
 
 ASD_DDBSITE_WRITE (u32, dword)
 
 ASD_DDBSITE_WRITE (u16, word)
 
 ASD_SCBSITE_READ (u32, dword)
 
 ASD_SCBSITE_READ (u16, word)
 
 ASD_SCBSITE_WRITE (u32, dword)
 
 ASD_SCBSITE_WRITE (u16, word)
 

Variables

u32 MBAR0_SWB_SIZE
 

Macro Definition Documentation

#define AIC9410_DEV_REV_B0   0x8

Definition at line 34 of file aic94xx_reg.h.

#define ALL_BASE_ADDR   OCM_BASE_ADDR

Definition at line 50 of file aic94xx_reg.h.

#define ASD_DDBSITE_READ (   type,
  ord 
)
Value:
static inline type asd_ddbsite_read_##ord (struct asd_ha_struct *asd_ha, \
u16 ddb_site_no, \
u16 offs) \
{ \
asd_write_reg_word(asd_ha, ALTCIOADR, MnDDB_SITE + offs); \
asd_write_reg_word(asd_ha, ADDBPTR, ddb_site_no); \
return asd_read_reg_##ord (asd_ha, CTXACCESS); \
}

Definition at line 104 of file aic94xx_reg.h.

#define ASD_DDBSITE_WRITE (   type,
  ord 
)
Value:
static inline void asd_ddbsite_write_##ord (struct asd_ha_struct *asd_ha, \
u16 ddb_site_no, \
{ \
asd_write_reg_word(asd_ha, ALTCIOADR, MnDDB_SITE + offs); \
asd_write_reg_word(asd_ha, ADDBPTR, ddb_site_no); \
asd_write_reg_##ord (asd_ha, CTXACCESS, val); \
}

Definition at line 130 of file aic94xx_reg.h.

#define ASD_READ_OCM (   type,
  ord,
  S 
)
Value:
static inline type asd_read_ocm_##ord (struct asd_ha_struct *asd_ha, \
u32 offs) \
{ \
struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[1]; \
type val = read##S (io_handle->addr + (unsigned long) offs); \
rmb(); \
return val; \
}

Definition at line 77 of file aic94xx_reg.h.

#define ASD_SCBSITE_READ (   type,
  ord 
)
Value:
static inline type asd_scbsite_read_##ord (struct asd_ha_struct *asd_ha, \
u16 scb_site_no, \
u16 offs) \
{ \
asd_write_reg_word(asd_ha, ALTCIOADR, MnSCB_SITE + offs); \
asd_write_reg_word(asd_ha, ASCBPTR, scb_site_no); \
return asd_read_reg_##ord (asd_ha, CTXACCESS); \
}

Definition at line 157 of file aic94xx_reg.h.

#define ASD_SCBSITE_WRITE (   type,
  ord 
)
Value:
static inline void asd_scbsite_write_##ord (struct asd_ha_struct *asd_ha, \
u16 scb_site_no, \
{ \
asd_write_reg_word(asd_ha, ALTCIOADR, MnSCB_SITE + offs); \
asd_write_reg_word(asd_ha, ASCBPTR, scb_site_no); \
asd_write_reg_##ord (asd_ha, CTXACCESS, val); \
}

Definition at line 183 of file aic94xx_reg.h.

#define ASD_WRITE_OCM (   type,
  ord,
  S 
)
Value:
static inline void asd_write_ocm_##ord (struct asd_ha_struct *asd_ha, \
{ \
struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[1]; \
write##S (val, io_handle->addr + (unsigned long) offs); \
return; \
}

Definition at line 91 of file aic94xx_reg.h.

#define MBAR0_SWA_SIZE   0x58

Definition at line 41 of file aic94xx_reg.h.

#define MBAR0_SWC_SIZE   0x8

Definition at line 43 of file aic94xx_reg.h.

#define OCM_BASE_ADDR   0xA0000000

Definition at line 46 of file aic94xx_reg.h.

#define OCM_MAX_SIZE   0x20000

Definition at line 47 of file aic94xx_reg.h.

#define PCI_CONF_FLSH_BAR   0xB8

Definition at line 60 of file aic94xx_reg.h.

#define PCI_CONF_MBAR0_SWA   0x70

Definition at line 56 of file aic94xx_reg.h.

#define PCI_CONF_MBAR0_SWB   0x74

Definition at line 57 of file aic94xx_reg.h.

#define PCI_CONF_MBAR0_SWC   0x78

Definition at line 58 of file aic94xx_reg.h.

#define PCI_CONF_MBAR1   0x6C

Definition at line 55 of file aic94xx_reg.h.

#define PCI_CONF_MBAR_KEY   0x7C

Definition at line 59 of file aic94xx_reg.h.

#define PCI_IOBAR_OFFSET   4

Definition at line 53 of file aic94xx_reg.h.

#define REG_BASE_ADDR   0xB8000000

Definition at line 37 of file aic94xx_reg.h.

#define REG_BASE_ADDR_CSEQCIO   0xB8002000

Definition at line 38 of file aic94xx_reg.h.

#define REG_BASE_ADDR_EXSI   0xB8042800

Definition at line 39 of file aic94xx_reg.h.

Function Documentation

ASD_DDBSITE_READ ( u32  ,
dword   
)
ASD_DDBSITE_READ ( u16  ,
word   
)
ASD_DDBSITE_WRITE ( u32  ,
dword   
)
ASD_DDBSITE_WRITE ( u16  ,
word   
)
ASD_READ_OCM ( u8  ,
byte  ,
b   
)
ASD_READ_OCM ( u16  ,
word  ,
w   
)
ASD_READ_OCM ( u32  ,
dword  ,
l   
)
u8 asd_read_reg_byte ( struct asd_ha_struct asd_ha,
u32  reg 
)
u32 asd_read_reg_dword ( struct asd_ha_struct asd_ha,
u32  reg 
)
void asd_read_reg_string ( struct asd_ha_struct asd_ha,
void dst,
u32  offs,
int  count 
)

asd_read_reg_string – read a string of bytes from io space memory : pointer to host adapter structure : pointer to a destination buffer where data will be written to : start offset (register) to read from : number of bytes to read

Definition at line 302 of file aic94xx_reg.c.

u16 asd_read_reg_word ( struct asd_ha_struct asd_ha,
u32  reg 
)
ASD_SCBSITE_READ ( u32  ,
dword   
)
ASD_SCBSITE_READ ( u16  ,
word   
)
ASD_SCBSITE_WRITE ( u32  ,
dword   
)
ASD_SCBSITE_WRITE ( u16  ,
word   
)
ASD_WRITE_OCM ( u8  ,
byte  ,
b   
)
ASD_WRITE_OCM ( u16  ,
word  ,
w   
)
ASD_WRITE_OCM ( u32  ,
dword  ,
l   
)
void asd_write_reg_byte ( struct asd_ha_struct asd_ha,
u32  reg,
u8  val 
)
void asd_write_reg_dword ( struct asd_ha_struct asd_ha,
u32  reg,
u32  val 
)
void asd_write_reg_string ( struct asd_ha_struct asd_ha,
void src,
u32  offs,
int  count 
)

asd_write_reg_string – write a string of bytes to io space memory : pointer to host adapter structure : pointer to source buffer where data will be read from : start offset (register) to write to : number of bytes to write

Definition at line 321 of file aic94xx_reg.c.

void asd_write_reg_word ( struct asd_ha_struct asd_ha,
u32  reg,
u16  val 
)

Variable Documentation

u32 MBAR0_SWB_SIZE

Definition at line 39 of file aic94xx_hwi.c.