36 #define XHI_GIER_OFFSET 0x1C
37 #define XHI_IPISR_OFFSET 0x20
38 #define XHI_IPIER_OFFSET 0x28
39 #define XHI_WF_OFFSET 0x100
40 #define XHI_RF_OFFSET 0x104
41 #define XHI_SZ_OFFSET 0x108
42 #define XHI_CR_OFFSET 0x10C
43 #define XHI_SR_OFFSET 0x110
44 #define XHI_WFV_OFFSET 0x114
45 #define XHI_RFO_OFFSET 0x118
49 #define XHI_GIER_GIE_MASK 0x80000000
66 #define XHI_IPIXR_RFULL_MASK 0x00000008
67 #define XHI_IPIXR_WEMPTY_MASK 0x00000004
68 #define XHI_IPIXR_RDP_MASK 0x00000002
69 #define XHI_IPIXR_WRP_MASK 0x00000001
70 #define XHI_IPIXR_ALL_MASK 0x0000000F
73 #define XHI_CR_SW_RESET_MASK 0x00000008
74 #define XHI_CR_FIFO_CLR_MASK 0x00000004
75 #define XHI_CR_READ_MASK 0x00000002
76 #define XHI_CR_WRITE_MASK 0x00000001
79 #define XHI_WFO_MAX_VACANCY 1024
80 #define XHI_RFO_MAX_OCCUPANCY 256
83 #define XHI_MAX_READ_TRANSACTION_WORDS 0xFFF
96 dev_dbg(drvdata->
dev,
"fifo_write: %x\n", data);
109 dev_dbg(drvdata->
dev,
"fifo_read: %x\n", data);
131 dev_dbg(drvdata->
dev,
"configuration started\n");
163 dev_dbg(drvdata->
dev,
"Getting status = %x\n", status);
183 static inline u32 fifo_icap_write_fifo_vacancy(
195 static inline u32 fifo_icap_read_fifo_occupancy(
217 u32 write_fifo_vacancy = 0;
221 dev_dbg(drvdata->
dev,
"fifo_set_configuration\n");
226 if (fifo_icap_busy(drvdata))
232 remaining_words = num_words;
234 while (remaining_words > 0) {
238 while (write_fifo_vacancy == 0) {
240 fifo_icap_write_fifo_vacancy(drvdata);
249 while ((write_fifo_vacancy != 0) &&
250 (remaining_words > 0)) {
251 fifo_icap_fifo_write(drvdata, *frame_buffer);
254 write_fifo_vacancy--;
258 fifo_icap_start_config(drvdata);
262 while (fifo_icap_busy(drvdata)) {
268 dev_dbg(drvdata->
dev,
"done fifo_set_configuration\n");
274 if (remaining_words != 0)
293 u32 read_fifo_occupancy = 0;
299 dev_dbg(drvdata->
dev,
"fifo_get_configuration\n");
304 if (fifo_icap_busy(drvdata))
307 remaining_words = num_words;
309 while (remaining_words > 0) {
310 words_to_read = remaining_words;
316 remaining_words -= words_to_read;
318 fifo_icap_set_read_size(drvdata, words_to_read);
319 fifo_icap_start_readback(drvdata);
321 while (words_to_read > 0) {
323 while (read_fifo_occupancy == 0) {
324 read_fifo_occupancy =
325 fifo_icap_read_fifo_occupancy(drvdata);
331 if (read_fifo_occupancy > words_to_read)
332 read_fifo_occupancy = words_to_read;
334 words_to_read -= read_fifo_occupancy;
337 while (read_fifo_occupancy != 0) {
338 *data++ = fifo_icap_fifo_read(drvdata);
339 read_fifo_occupancy--;
344 dev_dbg(drvdata->
dev,
"done fifo_get_configuration\n");