Lines Matching full:cppi
5 * This file implements a DMA interface using TI's CPPI DMA.
6 * For now it's DaVinci-only, but CPPI isn't specific to DaVinci or USB.
7 * The TUSB6020, using VLYNQ, has CPPI that looks much like DaVinci.
21 /* CPPI DMA status 7-mar-2006:
37 * REVISIT: the "transfer DMA" glue between CPPI and USB fifos will
110 static void cppi_pool_init(struct cppi *cppi, struct cppi_channel *c) in cppi_pool_init() argument
119 c->controller = cppi; in cppi_pool_init()
128 bd = dma_pool_alloc(cppi->pool, GFP_KERNEL, &dma); in cppi_pool_init()
138 struct cppi *cppi = c->controller; in cppi_pool_free() local
149 dma_pool_free(cppi->pool, bd, bd->dma); in cppi_pool_free()
155 static void cppi_controller_start(struct cppi *controller) in cppi_controller_start()
201 /* enable individual cppi channels */ in cppi_controller_start()
207 /* enable tx/rx CPPI control */ in cppi_controller_start()
222 static void cppi_controller_stop(struct cppi *controller) in cppi_controller_stop()
247 * Tx/Rx CPPI after cleanup of Tx channels. Before TX teardown is in cppi_controller_stop()
248 * complete TX CPPI cannot be disabled. in cppi_controller_stop()
250 /*disable tx/rx cppi */ in cppi_controller_stop()
261 * REVISIT same issue applies to pure PIO usage too, and non-cppi dma...
275 * Allocate a CPPI Channel for DMA. With CPPI, channels are bound to
284 struct cppi *controller; in cppi_channel_allocate()
290 controller = container_of(c, struct cppi, controller); in cppi_channel_allocate()
294 /* ep0 doesn't use DMA; remember cppi indices are 0..N-1 */ in cppi_channel_allocate()
297 /* return the corresponding CPPI Channel Handle, and in cppi_channel_allocate()
298 * probably disable the non-CPPI irq until we need it. in cppi_channel_allocate()
302 musb_dbg(musb, "no %cX%d CPPI channel", 'T', index); in cppi_channel_allocate()
308 musb_dbg(musb, "no %cX%d CPPI channel", 'R', index); in cppi_channel_allocate()
325 musb_dbg(musb, "Allocate CPPI%d %cX", index, transmit ? 'T' : 'R'); in cppi_channel_allocate()
329 /* Release a CPPI Channel. */
345 /* for now, leave its cppi IRQ enabled (we won't trigger it) */ in cppi_channel_release()
413 /* we may need to change the rndis flag for this cppi channel */ in cppi_rndis_update()
451 * so we won't ever use it (see "CPPI RX Woes" below).
528 * That's true even in the CPPI- friendly iso case, where most urbs have
534 * CPPI TX:
545 * written?) boiling down to not being able to rely on CPPI writing any
556 * REVISIT try to handle terminating zero length packets using CPPI
572 /* TX can use the CPPI "rndis" mode, where we can probably fit this in cppi_next_tx_segment()
670 * CPPI RX Woes:
678 * the buffer with 1024 bytes. How to do that with CPPI?
689 * converse problems: (b) is handled right, but (a) loses badly. CPPI RX
706 * But there seems to be no way to identify the cases where CPPI RNDIS mode
714 * since CPPI penalizes our need for a "true RNDIS" default mode.
727 * - less than 64KB (max per cppi descriptor)
952 struct cppi *controller; in cppi_channel_program()
1001 static bool cppi_rx_scan(struct cppi *cppi, unsigned ch) in cppi_rx_scan() argument
1003 struct cppi_channel *rx = &cppi->rx[ch]; in cppi_rx_scan()
1012 struct musb *musb = cppi->controller.musb; in cppi_rx_scan()
1026 /* catch latest BD writes from CPPI */ in cppi_rx_scan()
1050 * CPPI ignores those BDs even though OWN is still set. in cppi_rx_scan()
1059 * CPPI may completing other BDs while we scan this list... in cppi_rx_scan()
1061 * RACE: we can notice OWN cleared before CPPI raises the in cppi_rx_scan()
1100 musb_ep_select(cppi->mregs, rx->index + 1); in cppi_rx_scan()
1124 if (is_host_active(cppi->controller.musb) in cppi_rx_scan()
1144 struct cppi *cppi; in cppi_interrupt() local
1151 cppi = container_of(musb->dma_controller, struct cppi, controller); in cppi_interrupt()
1152 if (cppi->irq) in cppi_interrupt()
1161 if (cppi->irq) in cppi_interrupt()
1166 musb_dbg(musb, "CPPI IRQ Tx%x Rx%x", tx, rx); in cppi_interrupt()
1178 tx_ch = cppi->tx + index; in cppi_interrupt()
1204 /* catch latest BD writes from CPPI */ in cppi_interrupt()
1264 rx_ch = cppi->rx + index; in cppi_interrupt()
1267 if (!cppi_rx_scan(cppi, index)) in cppi_interrupt()
1288 /* write to CPPI EOI register to re-enable interrupts */ in cppi_interrupt()
1291 if (cppi->irq) in cppi_interrupt()
1302 struct cppi *controller; in cppi_dma_controller_create()
1325 controller->pool = dma_pool_create("cppi", in cppi_dma_controller_create()
1335 if (request_irq(irq, cppi_interrupt, 0, "cppi-dma", musb)) { in cppi_dma_controller_create()
1353 struct cppi *cppi; in cppi_dma_controller_destroy() local
1355 cppi = container_of(c, struct cppi, controller); in cppi_dma_controller_destroy()
1357 cppi_controller_stop(cppi); in cppi_dma_controller_destroy()
1359 if (cppi->irq) in cppi_dma_controller_destroy()
1360 free_irq(cppi->irq, cppi->controller.musb); in cppi_dma_controller_destroy()
1363 dma_pool_destroy(cppi->pool); in cppi_dma_controller_destroy()
1365 kfree(cppi); in cppi_dma_controller_destroy()
1375 struct cppi *controller; in cppi_channel_abort()
1464 * expect that if the usb core stops telling the cppi core in cppi_channel_abort()
1518 /* next DMA request _should_ load cppi head ptr */ in cppi_channel_abort()
1545 * Power Management ... probably turn off cppi during suspend, restart;