Lines Matching +full:max +full:- +full:retries
24 * (c) Copyright 2007-2008 Xilinx Inc.
79 #define XHI_WFO_MAX_VACANCY 1024 /* Max Write FIFO Vacancy, in words */
80 #define XHI_RFO_MAX_OCCUPANCY 256 /* Max Read FIFO Occupancy, in words */
87 * fifo_icap_fifo_write - Write data to the write FIFO.
89 * @data: the 32-bit value to be written to the FIFO.
96 dev_dbg(drvdata->dev, "fifo_write: %x\n", data); in fifo_icap_fifo_write()
97 out_be32(drvdata->base_address + XHI_WF_OFFSET, data); in fifo_icap_fifo_write()
101 * fifo_icap_fifo_read - Read data from the Read FIFO.
108 u32 data = in_be32(drvdata->base_address + XHI_RF_OFFSET); in fifo_icap_fifo_read()
109 dev_dbg(drvdata->dev, "fifo_read: %x\n", data); in fifo_icap_fifo_read()
114 * fifo_icap_set_read_size - Set the size register.
121 out_be32(drvdata->base_address + XHI_SZ_OFFSET, data); in fifo_icap_set_read_size()
125 * fifo_icap_start_config - Initiate a configuration (write) to the device.
130 out_be32(drvdata->base_address + XHI_CR_OFFSET, XHI_CR_WRITE_MASK); in fifo_icap_start_config()
131 dev_dbg(drvdata->dev, "configuration started\n"); in fifo_icap_start_config()
135 * fifo_icap_start_readback - Initiate a readback from the device.
140 out_be32(drvdata->base_address + XHI_CR_OFFSET, XHI_CR_READ_MASK); in fifo_icap_start_readback()
141 dev_dbg(drvdata->dev, "readback started\n"); in fifo_icap_start_readback()
145 * fifo_icap_get_status - Get the contents of the status register.
150 * D8 - cfgerr
151 * D7 - dalign
152 * D6 - rip
153 * D5 - in_abort_l
154 * D4 - Always 1
155 * D3 - Always 1
156 * D2 - Always 1
157 * D1 - Always 1
158 * D0 - Done bit
162 u32 status = in_be32(drvdata->base_address + XHI_SR_OFFSET); in fifo_icap_get_status()
163 dev_dbg(drvdata->dev, "Getting status = %x\n", status); in fifo_icap_get_status()
168 * fifo_icap_busy - Return true if the ICAP is still processing a transaction.
173 u32 status = in_be32(drvdata->base_address + XHI_SR_OFFSET); in fifo_icap_busy()
178 * fifo_icap_write_fifo_vacancy - Query the write fifo available space.
186 return in_be32(drvdata->base_address + XHI_WFV_OFFSET); in fifo_icap_write_fifo_vacancy()
190 * fifo_icap_read_fifo_occupancy - Query the read fifo available data.
198 return in_be32(drvdata->base_address + XHI_RFO_OFFSET); in fifo_icap_read_fifo_occupancy()
202 * fifo_icap_set_configuration - Send configuration data to the ICAP.
218 u32 retries = 0; in fifo_icap_set_configuration() local
221 dev_dbg(drvdata->dev, "fifo_set_configuration\n"); in fifo_icap_set_configuration()
227 return -EBUSY; in fifo_icap_set_configuration()
241 retries++; in fifo_icap_set_configuration()
242 if (retries > XHI_MAX_RETRIES) in fifo_icap_set_configuration()
243 return -EIO; in fifo_icap_set_configuration()
253 remaining_words--; in fifo_icap_set_configuration()
254 write_fifo_vacancy--; in fifo_icap_set_configuration()
263 retries++; in fifo_icap_set_configuration()
264 if (retries > XHI_MAX_RETRIES) in fifo_icap_set_configuration()
268 dev_dbg(drvdata->dev, "done fifo_set_configuration\n"); in fifo_icap_set_configuration()
275 return -EIO; in fifo_icap_set_configuration()
281 * fifo_icap_get_configuration - Read configuration data from the device.
294 u32 retries = 0; in fifo_icap_get_configuration() local
299 dev_dbg(drvdata->dev, "fifo_get_configuration\n"); in fifo_icap_get_configuration()
305 return -EBUSY; in fifo_icap_get_configuration()
316 remaining_words -= words_to_read; in fifo_icap_get_configuration()
326 retries++; in fifo_icap_get_configuration()
327 if (retries > XHI_MAX_RETRIES) in fifo_icap_get_configuration()
328 return -EIO; in fifo_icap_get_configuration()
334 words_to_read -= read_fifo_occupancy; in fifo_icap_get_configuration()
339 read_fifo_occupancy--; in fifo_icap_get_configuration()
344 dev_dbg(drvdata->dev, "done fifo_get_configuration\n"); in fifo_icap_get_configuration()
350 * buffer_icap_reset - Reset the logic of the icap device.
364 reg_data = in_be32(drvdata->base_address + XHI_CR_OFFSET); in fifo_icap_reset()
366 out_be32(drvdata->base_address + XHI_CR_OFFSET, in fifo_icap_reset()
369 out_be32(drvdata->base_address + XHI_CR_OFFSET, in fifo_icap_reset()
375 * fifo_icap_flush_fifo - This function flushes the FIFOs in the device.
385 reg_data = in_be32(drvdata->base_address + XHI_CR_OFFSET); in fifo_icap_flush_fifo()
387 out_be32(drvdata->base_address + XHI_CR_OFFSET, in fifo_icap_flush_fifo()
390 out_be32(drvdata->base_address + XHI_CR_OFFSET, in fifo_icap_flush_fifo()