summaryrefslogtreecommitdiff
path: root/firmware/export/s5l8702.h (follow)
Commit message (Collapse)AuthorAge
* iPod Classic: rework on I2C driverCástor Muñoz2016-08-12
| | | | | | | | | | - Some rewrite with the intent to get ride of these random errors appearing on some builds/devices (not much noticeable on RB but can ruin bootloader builds). - Error handling (ACK). - IIC clock increased to be the same as in OF. Change-Id: Idf8cfa3c230a0a61ec9c879bf6f0ea8b061a4607
* iPod Classic: use the new USB DesignWare driverCástor Muñoz2016-08-02
| | | | Change-Id: I36aabb5cb9cfe2d8c4f8fbcea944efec58ef9671
* iPod Classic: i2c updatesCástor Muñoz2016-05-26
| | | | Change-Id: Ib516f3f52cf619fb44dc1bb6982b635c49f53a8f
* iPod Classic: updates for uc8702 driverCástor Muñoz2016-05-13
| | | | | | | | | | - Small rework on the UC8702 UART controller to make it compatible with other s5l870x SOCs. Files moved and renamed, many conditional code added to deal with capabilities and 'features' of the different CPUs. - A couple of optimizacions that should not affect the functionality. Change-Id: I705169f7e8b18d5d1da642f81ffc31c4089780a6
* iPod Classic: add non-cached memory regionCástor Muñoz2015-12-17
| | | | | | | | Configures uncached memory region and adds some defines for misc HW, for compability with the bootloader and other future use, current functionality should not be affected. Change-Id: I390e79bea1aef5b10dfbc72ad327d7fe438ec6f5
* iPod Classic: prepare LCD driver for the bootloaderCástor Muñoz2015-12-17
| | | | | | Optimizes encoding of LCD command sequences. Change-Id: I9d1eb735e5a972c1a176177ed570a3fe991d7b9f
* iPod Classic: s5l8702 clocking rewrite+documentationCástor Muñoz2015-12-17
| | | | | | | | | | | | | | | | | This is a rewrite of the clocking section, the resulting system frequencies are the same as the current git version. This pàtch uses fixed FClk and just one register is written to switch all system frequencies, it needs less steps than the current git version to reach the desired frequency, so it is faster and safer. Includes functions to step-up/down over a table of predefined set of frequencies. The major difference is that Vcore is decreased from 1050 to 1000 mV. See clocking-s5l8702.h for more information. Change-Id: I58ac6634e1996adbe1c0c0918a7ce94ad1917d8e
* iPod Classic: implement HAVE_SERIALCástor Muñoz2015-10-07
| | | | Change-Id: I24a861cd45095d858d1a7db39969f6eda17cc563
* iPod Classic: use new PL080 DMA driverCástor Muñoz2015-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch uses the new pl080 DMA driver for I2S playback and LCD update. I have tried to be as fiel as possible to the current behaviour, algorithms and configurations are the same, but using the new driver. Other modifications: Playback: - CHUNK_SIZE is decreased from 42988 to 8188 bytes, it does not affect normal playback (block size 1024), was tested using metronome (block size 46080). This change is needed because the new code commits d-cache range instead of commiting the whole d-cache, maximum time spent commiting the range should be limited, CHUNK_SIZE can be decreased even more if necessary. - pcm_play_dma_start() calls pcm_play_dma_stop() to stop the channel when it is running (metronome replays the tick sound without stopping the channel). - pcm_play_dma_get_peak_buffer(): same as actual SVN function but returns samples count instead of bytes count. TODO: AFAIK, actually this function is not used in RB. Not tested, but probably this function will fail because it returns pointers to the internal double buffer. LCD update: - suppresses lcd_wakeup semaphore and uses yield() Change-Id: I79b8aa47a941e0dd91847150618f3f7f676c26ef
* iPod Classic: introduce PL080 DMA controller driverCástor Muñoz2015-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* iPod Classic: s5l8702 GPIO interrupt controller.Cástor Muñoz2015-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements a simple API to use the external interrupt hardware present on s5l8702 (GPIO interrupt controller). This GPIOIC has been fully tested using emcore apps. Code is based on openiBoot project, there are a few modifications to optimize space considering we will only use two or three external interrupts. The API compiles and works, but has been never used, therefore probably will need some changes to the final version. External interrupts are necessary for jack remote+mic controller (see iAP Interface Specifiction: Headphone Remote and Mic System), this controller is located at I2C bus address 0x72, there is a IRQ line for remote button press/release events routed to GPIO E6. At this moment, the functionallity of this controller has been extensively tested using emcore, getting a lot of information about how it works. Microphone is already working on RB, jack accessory detection and button events are work in progress. PMU IRQ line is also routed to GPIO F3, it signals many events: holdswitch, usb plug, wall adapter, low battery... The use of PMU interrupts is the orthodox way of doing things, at this moment there is no work done in this direction, there are a lot of PMU events and i think it is a matter of discursion what to do and how. Change-Id: Icc2e48965e664ca56c9518d84a81c9d9fdd31736
* iPod Classic: update timer API using 32-bit timers.Cástor Muñoz2014-11-16
| | | | | | Change-Id: I49dab8ae955a339ad0a27402fa21caa411c4ecf6 Reviewed-on: http://gerrit.rockbox.org/1032 Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
* iPod Classic: fix s5l8702 cache line length.Cástor Muñoz2014-11-13
| | | | | | | | | | Use 32 bytes for cache line length (arm926ej-s), this prevents misalignments of ATA storage buffer which in some builds could cause weird faults. Change-Id: I88dc595d251315620ec49b0251ddc039ff47181e Reviewed-on: http://gerrit.rockbox.org/1031 Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
* iPod Classic/6G: PCM support for all CS42L55 ratesCástor Muñoz2013-01-09
| | | | | | | pcm_dma_apply_settings(): sets the configured PCM frequency, all native CS42L55 sample rates are available. Change-Id: I2fcd5581457a669c3044516804cb64fb972218d0
* s5l870x: use usb-s3c6400 definesRafaël Carré2011-12-13
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31223 a1c6a512-1295-4272-9138-f99709370657
* Bulk convert all DOS line endings to UNIX.Torne Wuff2011-11-06
| | | | | | | | | | | | | | For the git migration we want a nice clean repository with UNIX line endings. git does not use svn:eol-style, we just need the file contents to be sane. Sorry everybody. I know this messes up blame. Scumbag *NIX developer says migrating to git will make line ending issues go away; commits giant change to svn which changes line endings anyway. :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30924 a1c6a512-1295-4272-9138-f99709370657
* iPod Classic: Set LCD controller configuration register during ↵Michael Sparmann2011-11-06
| | | | | | initialization and don't rely on the bootloader doing that (closes FS#12233) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30908 a1c6a512-1295-4272-9138-f99709370657
* iPod Classic: Fix YUV blitting. Mpegplayer works now.Michael Sparmann2011-02-28
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29460 a1c6a512-1295-4272-9138-f99709370657
* iPod Classic CE-ATA Support (Part 4 of 4: S5L8702 ATA driver)Michael Sparmann2011-02-27
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29448 a1c6a512-1295-4272-9138-f99709370657
* iPod Classic: Enable boosting by switching the CPU between 1x and 2x AHB clockMichael Sparmann2011-02-09
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29265 a1c6a512-1295-4272-9138-f99709370657
* Adjust iPod Classic CPU clock speed constants to at least roughly correct valuesMichael Sparmann2011-01-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29005 a1c6a512-1295-4272-9138-f99709370657
* Fix iPod Classic USEC_TIMERMichael Sparmann2011-01-07
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28987 a1c6a512-1295-4272-9138-f99709370657
* New port: iPod Classic (also known as iPod 6G/6.5G/7G)Michael Sparmann2011-01-02
Major known issues: - No bootloader yet - No support for the first-generation 160GB CE-ATA hard disk drive yet - Audio playback is slow, only FLAC seems to reach realtime git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28953 a1c6a512-1295-4272-9138-f99709370657