rockbox/firmware/target/arm
Cástor Muñoz d6ee2c9eaf iPod Classic: introduce PL080 DMA controller driver
Motivation:

 This driver began as a set of functions to help to test and
 experiment with different DMA configurations. It is cumbersome,
 time consuming, and leads to mistakes to handle LLIs and DMA
 registers dispersed along the code.

 Later, i decided to adapt an old DMA queue driver written in the
 past for a similar (scatter-gather) controller, all task/queue
 code is based on the old driver.

 Finally, some cleaning and dmac_ch_get_info() function was added
 to complete RB needs.

Description:

 - Generic, can be used by other targets including the same
   controller. Not difficult to adapt for other similar
   controllers if necesary.

 - Easy to experiment and compare results using different
   setups and/or queue algorithms:

   Multi-controller and fully configurable from an unique place.

   All task and LLI management is done by the driver, user only
   has to (statically) allocate them.

 - Two queue modes:

   QUEUE_NORMAL: each task in the queue is launched using a new
   DMA transfer once previous task is finished.

   QUEUE_LINK: when a task is queued, it is linked with the last
   queued task, creating a single continuous DMA transfer. New
   tasks must be queued while the channel is running, otherwise
   the continuous DMA transfer will be broken.

   On Classic, QUEUE_LINK mode is needed for I2S continuous
   transfers, QUEUE_NORMAL is used for LCD and could be useful
   in the future for I2C or UART (non-blocking serial debug) if
   necessary.

 - Robust DMA transfer progress info (peak meter), needs final
   testing, see below.

Technical details about DMA progress:

 There are comments in the code related to the method actually
 used (sequence method), it reads progress without halting the
 DMA transfer. Althought the datasheet does not recommend to do
 that, the sequence method seems to be robust, I ran tests calling
 dmac_ch_get_info() millions of times and the results were always
 as expected (tests done at 2:1 CPU/AHB clock ratio, no other
 ratios were tried but probably sequence method will work for any
 typical ratio).

 This controller allows to halt the transfer and drain the DMAC
 FIFO, DMA requests are ignored when the DMA channel is halted.
 This method is not suitable for playback because FIFO is never
 drained to I2S peripheral (who raises the DMA requests). This
 method probably works for capture, the FIFO is drained to memory
 before halting.

 Another way is to disable (stop) the playback channel. When the
 channel is disabled, all FIFO data is lost. It is unknown how much
 the FIFO was filled when it was cleared, SRCADDR counter includes
 the lost data, therefore the only useful information is LINK and
 COUNT, that is the same information disponible when using the
 sequence method. At this point we must procced in the same way as
 in sequence method, in addition the playback channel should be
 relaunched (configure + start) after calculating real SRCADDR.

 The stop+relaunch method should work, it is a bit complicated,
 and not valid for all peripheral FIFO configurations (depending
 on stream rate). Moreover, due to the way the COUNT register is
 implemented in HW, I suspect that this method will fail when
 source and destination bus widths doesn't match. And more
 important, it is not easy to garantize that no sample is lost
 here or there, using the sequence method we can always be sure
 that playback is ok.

Change-Id: Ib12a1e2992e2b6da4fc68431128c793a21b4b540
2015-10-07 06:15:03 +02:00
..
archos/av300 button-target.h : move prototypes to button.h 2012-01-08 00:07:19 +00:00
as3525 AMS: Change DMA transfer size for audio. 2015-06-01 18:23:57 +02:00
at91sam Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
imx31 Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
imx233 Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
ipod Fix red/yellow 2015-01-12 12:02:24 +01:00
iriver Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
olympus Fix red/yellow 2015-01-12 12:02:24 +01:00
pbell Fix red/yellow round #2 2015-01-12 13:25:14 +01:00
philips Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
pnx0101 Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
pp Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
rk27xx Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
s3c2440 Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
s5l8700 Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
s5l8702 iPod Classic: introduce PL080 DMA controller driver 2015-10-07 06:15:03 +02:00
samsung Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
sandisk Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
tatung Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
tcc77x Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
tcc780x Fix red/yellow 2015-01-12 12:02:24 +01:00
tms320dm320 Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
ata-as-arm.S FS#11335 by me: make ARM assembly functions thumb-friendly 2010-06-11 04:41:36 +00:00
ata-nand-telechips.c Add missing kernel.h includes (hopefully all of them). 2014-01-05 20:32:09 +01:00
bits-armv4.S Do some things to make -ffunction-sections work better. 2011-12-17 01:43:32 +00:00
bits-armv6.S Do some things to make -ffunction-sections work better. 2011-12-17 01:43:32 +00:00
crt0.S arm: factor all exception handlers out of the crt0.S files 2012-04-06 13:46:32 +02:00
i2c-telechips.c Fix various reds. Some includes needed fixup. 2014-03-03 19:10:48 +01:00
lcd-c200_c200v2.c lcd drivers: Convert lcd_[remote_]framebuffer to a pointer 2012-02-28 11:44:59 +11:00
lcd-ssd1815.c lcd drivers: Convert lcd_[remote_]framebuffer to a pointer 2012-02-28 11:44:59 +11:00
mmu-arm.h Commit to certain names for cache coherency APIs and discard the aliases. 2011-12-17 07:27:24 +00:00
mmu-arm.S imx233: define HAVE_TEST_AND_CLEAN_CACHE 2012-06-07 14:48:43 +02:00
mmu-armv6.S Commit to certain names for cache coherency APIs and discard the aliases. 2011-12-17 07:27:24 +00:00
pcm-telechips.c Fix errors in unintentionally merged gerrit commit. 2012-03-03 01:45:09 -05:00
powermgmt-ascodec.c AMSv2: add proper definitions for charge current 2012-03-04 12:23:05 +01:00
system-arm.c Restore backtrace which was accidentely commented out 2012-05-19 16:55:07 +02:00
system-arm.h Create fimrware/asm directory for assembly optimized stuff. 2012-01-22 18:46:44 +01:00
usb-drv-arc.c Get rid of usb_drv_attach() from USB code. 2013-05-14 22:13:38 -04:00
usb-s3c6400x.c Make sure the USB PHY is disabled after use. Patch by Mihail Zenkov who has 2014-09-28 21:07:45 +02:00
usb-tcc.c usb-target.h: remove 2011-12-31 18:44:55 +00:00
wmcodec-telechips.c D2 also needs audiohw_preinit() 2008-11-28 23:44:06 +00:00