rockbox/firmware
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
..
asm Fix YUV generic C performance function on 24-bit framebuffer 2014-11-10 20:30:16 +01:00
common Fix warning in firmware/common/structec.c 2015-02-24 16:27:16 -05:00
decompressor Add KEEP() around vectors in linker scripts. 2011-12-18 06:43:08 +00:00
drivers Samsung YHxxx: reduce pop noise on power down 2015-09-24 23:06:18 +02:00
export iPod Classic: introduce PL080 DMA controller driver 2015-10-07 06:15:03 +02:00
include Improve core_alloc() / buflib_alloc() documentation 2015-01-02 18:51:15 +01:00
kernel Remove I/O priority. It is harmful when used with the new file code. 2014-08-30 14:01:21 -04:00
libc mktime(): Remove redundant assignment of 'result' 2015-01-04 17:37:35 +01:00
target iPod Classic: introduce PL080 DMA controller driver 2015-10-07 06:15:03 +02:00
test Limit more variables to file scope 2015-01-11 21:40:51 +01:00
usbstack Revert "usb_storage: make it a bit more correct" 2015-02-16 14:06:28 +01:00
arabjoin.c
arabjoin.h
ata_idle_notify.c Fix reds. 2014-03-14 23:43:45 +01:00
backlight-sw-fading.c Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
backlight.c iBasso DX50/DX90: Major code cleanup and reorganization. 2015-02-02 21:57:55 +01:00
bidi.c bidi.c: Check buffer sizes. 2014-01-09 23:30:32 +01:00
buflib.c buflib: Switch from term "cookie" to "metadata" 2015-01-02 19:26:03 +01:00
COPYING
core_alloc.c Make a few local variables static 2015-01-11 18:02:43 +01:00
debug.c Redirect (L)DEBUGFs to adb logcat in DEBUG enabled builds. 2010-09-20 17:38:47 +00:00
eeprom_settings.c
enc_base.c FS#12378 : Remove various unused code, and comment out some unused code and data for reference or future use. 2011-12-14 21:45:25 +00:00
events.c Make thirty functions static to reduce binary size 2015-01-05 18:44:36 +01:00
firmware.make Prevent spurious recompiles on account of changed version. 2014-08-28 15:48:56 +02:00
font_cache.c fonts: Do not unload completely on USB. 2014-01-15 23:37:39 +01:00
font.c fonts: Fix regression(s) caused by c23ce62. 2014-01-26 14:01:48 +01:00
general.c kernel: Break out kernel primitives into separate files and move to separate dir. 2014-03-03 18:11:57 +01:00
hangul.c
ifp_usb_serial.c Make thirty functions static to reduce binary size 2015-01-05 18:44:36 +01:00
load_code.c Fix various reds. Some includes needed fixup. 2014-03-03 19:10:48 +01:00
logf.c Make a few local variables static 2015-01-11 18:02:43 +01:00
lru.c Revert r30818 2011-10-22 08:02:38 +00:00
panic.c panicf doesn't return so why not tell GCC and $AVE : 2014-08-25 13:55:16 -04:00
pcm_mixer.c Enable setting of global output samplerate on certain targets. 2013-07-06 04:22:04 +02:00
pcm_sampr.c
pcm_sw_volume.c Greatly reduce volume-change zipper artifacts with SW volume. 2014-03-08 08:04:41 +01:00
pcm.c Greatly reduce volume-change zipper artifacts with SW volume. 2014-03-08 08:04:41 +01:00
powermgmt.c iBasso DX50/DX90: Major code cleanup and reorganization. 2015-02-02 21:57:55 +01:00
profile.c Remove last traces of sprintf.h 2010-05-07 02:13:47 +00:00
README
rolo.c Fix reds. Also apply the new scrolling to lcd charcell (this even uncovered an 2013-12-15 00:38:48 +01:00
rom.lds rombox: Do not copy .init section to ram on startup. 2014-01-20 10:42:02 +01:00
screendump.c Fix warnings in firmware/screendump.c 2015-02-24 16:55:26 -05:00
scroll_engine.c scroll_engine: Fix FS#12894: Text scrolling stops working after a few seconds/minutes 2014-01-12 21:29:55 +01:00
sdmmc.c Various minor cleanups 2010-08-01 10:07:05 +00:00
sound.c Add DAC's oversampling filter roll-off selection to sound settings. 2013-05-24 11:18:16 +04:00
SOURCES iPod Classic: introduce PL080 DMA controller driver 2015-10-07 06:15:03 +02:00
storage.c Remove I/O priority. It is harmful when used with the new file code. 2014-08-30 14:01:21 -04:00
system.c Fix reds. 2011-12-24 12:21:16 +00:00
timer.c Remove the TIMER_* macros and declare target-specific functions in timer.h 2009-06-29 14:29:57 +00:00
tuner.c Add stub STFM1000 tuner driver 2012-05-19 16:10:52 +02:00
usb.c usb: finally get rid of USE_ROCKBOX_USB in Sansa bootloader, use bootloader usb 2015-01-08 22:30:22 +01:00

See docs/README