Lines Matching refs:asd_ha

46 u8  asd_read_reg_byte(struct asd_ha_struct *asd_ha, u32 reg);
47 u16 asd_read_reg_word(struct asd_ha_struct *asd_ha, u32 reg);
48 u32 asd_read_reg_dword(struct asd_ha_struct *asd_ha, u32 reg);
50 void asd_write_reg_byte(struct asd_ha_struct *asd_ha, u32 reg, u8 val);
51 void asd_write_reg_word(struct asd_ha_struct *asd_ha, u32 reg, u16 val);
52 void asd_write_reg_dword(struct asd_ha_struct *asd_ha, u32 reg, u32 val);
54 void asd_read_reg_string(struct asd_ha_struct *asd_ha, void *dst,
56 void asd_write_reg_string(struct asd_ha_struct *asd_ha, void *src,
60 static inline type asd_read_ocm_##ord (struct asd_ha_struct *asd_ha, \
63 struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[1]; \
74 static inline void asd_write_ocm_##ord (struct asd_ha_struct *asd_ha, \
77 struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[1]; \
87 static inline type asd_ddbsite_read_##ord (struct asd_ha_struct *asd_ha, \
91 asd_write_reg_word(asd_ha, ALTCIOADR, MnDDB_SITE + offs); \
92 asd_write_reg_word(asd_ha, ADDBPTR, ddb_site_no); \
93 return asd_read_reg_##ord (asd_ha, CTXACCESS); \
99 static inline u8 asd_ddbsite_read_byte(struct asd_ha_struct *asd_ha, in asd_ddbsite_read_byte() argument
104 return asd_ddbsite_read_word(asd_ha, ddb_site_no, in asd_ddbsite_read_byte()
107 return asd_ddbsite_read_word(asd_ha, ddb_site_no, in asd_ddbsite_read_byte()
113 static inline void asd_ddbsite_write_##ord (struct asd_ha_struct *asd_ha, \
117 asd_write_reg_word(asd_ha, ALTCIOADR, MnDDB_SITE + offs); \
118 asd_write_reg_word(asd_ha, ADDBPTR, ddb_site_no); \
119 asd_write_reg_##ord (asd_ha, CTXACCESS, val); \
125 static inline void asd_ddbsite_write_byte(struct asd_ha_struct *asd_ha, in asd_ddbsite_write_byte() argument
130 u16 rval = asd_ddbsite_read_word(asd_ha, ddb_site_no, base); in asd_ddbsite_write_byte()
135 asd_ddbsite_write_word(asd_ha, ddb_site_no, base, rval); in asd_ddbsite_write_byte()
140 static inline type asd_scbsite_read_##ord (struct asd_ha_struct *asd_ha, \
144 asd_write_reg_word(asd_ha, ALTCIOADR, MnSCB_SITE + offs); \
145 asd_write_reg_word(asd_ha, ASCBPTR, scb_site_no); \
146 return asd_read_reg_##ord (asd_ha, CTXACCESS); \
152 static inline u8 asd_scbsite_read_byte(struct asd_ha_struct *asd_ha, in asd_scbsite_read_byte() argument
157 return asd_scbsite_read_word(asd_ha, scb_site_no, in asd_scbsite_read_byte()
160 return asd_scbsite_read_word(asd_ha, scb_site_no, in asd_scbsite_read_byte()
166 static inline void asd_scbsite_write_##ord (struct asd_ha_struct *asd_ha, \
170 asd_write_reg_word(asd_ha, ALTCIOADR, MnSCB_SITE + offs); \
171 asd_write_reg_word(asd_ha, ASCBPTR, scb_site_no); \
172 asd_write_reg_##ord (asd_ha, CTXACCESS, val); \
178 static inline void asd_scbsite_write_byte(struct asd_ha_struct *asd_ha, in asd_scbsite_write_byte() argument
183 u16 rval = asd_scbsite_read_word(asd_ha, scb_site_no, base); in asd_scbsite_write_byte()
188 asd_scbsite_write_word(asd_ha, scb_site_no, base, rval); in asd_scbsite_write_byte()
206 static inline int asd_ddbsite_update_word(struct asd_ha_struct *asd_ha, in asd_ddbsite_update_word() argument
211 u16 oval = asd_ddbsite_read_word(asd_ha, ddb_site_no, offs); in asd_ddbsite_update_word()
214 asd_write_reg_word(asd_ha, AOLDDATA, oldval); in asd_ddbsite_update_word()
215 asd_write_reg_word(asd_ha, ANEWDATA, newval); in asd_ddbsite_update_word()
217 done = asd_read_reg_byte(asd_ha, ATOMICSTATCTL); in asd_ddbsite_update_word()
227 static inline int asd_ddbsite_update_byte(struct asd_ha_struct *asd_ha, in asd_ddbsite_update_byte() argument
233 u16 nval = asd_ddbsite_read_word(asd_ha, ddb_site_no, base); in asd_ddbsite_update_byte()
245 return asd_ddbsite_update_word(asd_ha, ddb_site_no, base, oval, nval); in asd_ddbsite_update_byte()
248 static inline void asd_write_reg_addr(struct asd_ha_struct *asd_ha, u32 reg, in asd_write_reg_addr() argument
251 asd_write_reg_dword(asd_ha, reg, ASD_BUSADDR_LO(dma_handle)); in asd_write_reg_addr()
252 asd_write_reg_dword(asd_ha, reg+4, ASD_BUSADDR_HI(dma_handle)); in asd_write_reg_addr()
255 static inline u32 asd_get_cmdctx_size(struct asd_ha_struct *asd_ha) in asd_get_cmdctx_size() argument
258 u32 ctxmemsize = asd_read_reg_dword(asd_ha, LmMnINT(0,0)) & CTXMEMSIZE; in asd_get_cmdctx_size()
262 static inline u32 asd_get_devctx_size(struct asd_ha_struct *asd_ha) in asd_get_devctx_size() argument
264 u32 ctxmemsize = asd_read_reg_dword(asd_ha, LmMnINT(0,0)) & CTXMEMSIZE; in asd_get_devctx_size()
268 static inline void asd_disable_ints(struct asd_ha_struct *asd_ha) in asd_disable_ints() argument
270 asd_write_reg_dword(asd_ha, CHIMINTEN, RST_CHIMINTEN); in asd_disable_ints()
273 static inline void asd_enable_ints(struct asd_ha_struct *asd_ha) in asd_enable_ints() argument
276 asd_write_reg_dword(asd_ha, COMSTATEN, in asd_enable_ints()
279 asd_write_reg_dword(asd_ha, DCHSTATUS, EN_CFIFTOERR); in asd_enable_ints()
281 asd_write_reg_dword(asd_ha, CHIMINTEN, SET_CHIMINTEN); in asd_enable_ints()