Commit graph

3597 commits

Author SHA1 Message Date
Thomas Martitz
22a28f9caa Add missing kernel.h includes (hopefully all of them).
Change-Id: I9c1825296a788587b8d494d8514b3314847b0ff0
2014-01-05 20:32:09 +01:00
Thomas Martitz
281d1fadb3 Do not include kernel.h in system.h.
system.h doesn't need it on its own and this change makes it less
dependant on Rockbox internals.

Change-Id: I4e1e4108a52a7b599627a829204eb82b392fc6d6
2014-01-05 19:35:23 +01:00
Amaury Pouly
40fae1d718 zenxfi2: remove unused function
Change-Id: I98acfc9394ac83a45985364fdfad85af2f7d1773
2013-12-24 12:39:58 +01:00
Thomas Martitz
22e802e800 playback,talk: Share audiobuffer via core_alloc_maximum().
This fixes the radioart crash that was the result of buffering.c working
on a freed buffer at the same time as buflib (radioart uses buffering.c for the
images). With this change the buffer is owned by buflib exclusively so this
cannot happen.

As a result, audio_get_buffer() doesn't exist anymore. Callers should call
core_alloc_maximum() directly. This buffer needs to be protected as usual
against movement if necessary (previously it was not protected at all which
cased the radioart crash), To get most of it they can adjust the willingness of
the talk engine to give its buffer away (at the expense of disabling voice
interface) with the new talk_buffer_set_policy() function.

Change-Id: I52123012208d04967876a304451d634e2bef3a33
2013-12-23 12:17:38 +01:00
Andrew Ryabinin
5b5f0755d6 Introduce IHIFI760/960 targets.
Change-Id: Ie36e48742c0ed9aa3fd6f49aa034a11d2492327c
2013-12-16 00:45:18 +04:00
Andrew Ryabinin
04c59b8a15 rk27xx: Fix ifdef for DEBUG_CANCEL button.
Change-Id: Iebbe518dcaf5c9e1573309b3fee17b52998d941c
2013-12-16 00:18:58 +04:00
Amaury Pouly
01d8cc6f39 Fix yellow
Change-Id: I60cd312c501f2f0fe0c12489c86c856eeb8e1aa8
2013-12-08 11:30:13 +01:00
Amaury Pouly
b163fb9eac rmi/fuze+: add product info in the debug screen
Change-Id: Id06dbe0909e37587a45a2ebf5b0beab93cd44f61
2013-12-08 11:12:39 +01:00
Amaury Pouly
2bf192ee6e imx233: regenerate registers headers
Change-Id: I546177a247646d7a9864d1ec2796ef0708e50667
2013-12-06 02:04:37 +01:00
Amaury Pouly
c945fb6e94 imx233: fix storage code to work for non-MD builds
Change-Id: Ic326e59385aff3be1ada52b482e94051c512323d
2013-12-06 01:55:37 +01:00
Lorenzo Miori
1deab73980 Initial commit for the YP-Z5 port
The port uses the imx233 soc, it's a STMP3650 based Samsung player

Change-Id: I50b6d7e77fd292fab5ed26de87853cd5aaf9eaa4
Reviewed-on: http://gerrit.rockbox.org/490
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-12-02 20:48:21 +01:00
Amaury Pouly
23c6421f38 imx233: don't compile fm tuner code in bootloader
Change-Id: Icd36e6b03965272eb169a19630b720f38bac6d9e
2013-12-02 20:09:56 +01:00
Amaury Pouly
9dab30adf0 imx233: fix red on stmp3600
Change-Id: I56527f2d643cb3c453e08cd1f759b80ce10ceb66
2013-12-02 19:59:16 +01:00
Amaury Pouly
3f55f01e92 imx233: rework power management for work on stmp3700
Change-Id: Ia1f7e8b633dfe6ef8dc840b3eb22eaf79c53ce6b
2013-12-01 22:37:36 +00:00
Amaury Pouly
2ce484c658 Revert "imx233: always keep cards in TRAN mode"
This reverts commit 462adf2a0f.
Leaving the card in TRAN results in a huge power consumption because some cards
and internal bridges do not automatically enter power saving mode in TRAN state.

Change-Id: If79efe8cf99b24174889b3a5ebbcb51b07085f58
2013-11-30 16:15:35 +00:00
Amaury Pouly
cbed7ecafe zen: rework lcd enable
The ZEN/ZEN-XFi seem to be very picky about the lcd. And they do not like
standby mode so I'm going to drop it, the OF doesn't use it anyway. I still
don't know what this "power" pin is about, obviously it's not real power but
the OF toggle it. Let's hope the lcd will finally become more stable with
fix: the driver now does full power on/off on enable/disable.

Change-Id: I1c465ee4f2462bc3d9507e5f575f0a181af60214
2013-11-26 15:57:13 +00:00
Lorenzo Miori
75c791dabf imx233: add the possibility to choose audio output coupling mode
via target-defined option

Change-Id: I1bffbc7f17a11cf690a771057c2e4a7ba6a5faaa
Reviewed-on: http://gerrit.rockbox.org/678
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-11-25 20:17:12 +01:00
Marcin Bukat
71f0b884bc rk27xx: small cleanup of crt0.S
Change-Id: I5f40efd03b133acab86315d36580fcad68834f78
2013-11-23 22:42:33 +01:00
andypotter
c71e0567d6 Add IAP support to iPod Mini 1G.
Tested on iPod Mini 1G.

Change-Id: I67ac9b7ed84c34533107136d0aa72e5ce3bcc5bc
Reviewed-on: http://gerrit.rockbox.org/668
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
2013-11-20 21:20:54 +01:00
Amaury Pouly
75dc601738 imx233/sdmmc: {sd,mmc}_{present,removable} don't depend on multivolume
Change-Id: Id35fbdbc62b804e9a67c6d1f18b19a1d2051bb78
2013-11-20 16:38:54 +00:00
Amaury Pouly
1ef7b6529e Finally fix yellow
Change-Id: Ia7c30821a9417a23478c053b3edcf26e1179a9d9
2013-11-19 22:58:41 +00:00
Amaury Pouly
0fb05249c6 Fix yellow
Change-Id: I9d283592c6411c97948ae4962e2c22d7ab45bec3
2013-11-19 22:29:31 +00:00
Amaury Pouly
da7be39614 Fix sim red
Change-Id: Icbdf47c5c508516892b1ce75558b878dc512e780
2013-11-19 22:12:42 +00:00
Amaury Pouly
0c394770aa Forgot lcd driver of the ZEN V !
Change-Id: I0e0e04d4de3b28058e3822043d46d64291265c75
2013-11-19 21:05:47 +00:00
Amaury Pouly
446f352abd imx233: factor fmradio i2c and tuner power code
Choices are limited for those: i2c is either generic software or imx233
hardware and power is either none or with a gpio. So factor ever possible
combination in a single common file and use fmradio-target.h to supply the
required parameters. This will remove a bunch of duplicate code.

Change-Id: If12faeb2e371631cd39cc18a4c1d859812007934
2013-11-19 20:39:10 +00:00
Amaury Pouly
c2c2274e0a imx233: factor adc accross targets
The old code allowed each target to specify its adc targets but this proved
useless since the target rely directly on imx233/lradc for input method and
generic adc is mostly used for battery and debug. Remove all target specific
files and provide a generic implemenation. The targets can still specify a
battery temperature channel in powermgmt-target.h

Change-Id: I68cf2e3e46379d174ac6d774ffb237bb15a19ae3
2013-11-19 19:04:03 +00:00
Amaury Pouly
977a6c3ce7 Initial commit for the Creative ZEN V
Change-Id: I3408cfdf742ea5995d5c87bf76653f436e1ec2b0
2013-11-18 21:44:06 +00:00
Amaury Pouly
a8b816ae9c creativezenmozaic: factor out code with the zen/zenxfi
Most of the code is similar, only the lcd driver is significantly different.

Change-Id: I9eab1faf08d2356f2d820d6930ef3b0653349aa1
2013-11-18 21:44:05 +00:00
Amaury Pouly
bb8dd05343 imx233/creative: workaround stupid Creative partition table
This should fix wrong partition size on the ZEN, X-Fi and Mozaic

Change-Id: Ib8999d414773c12e1b97d515e9bf058a82141d35
2013-11-11 02:02:11 +00:00
Amaury Pouly
39bfd0d2ab imx233: fix yellow
Change-Id: I6fc2559a0c6f91301bb1039d7125f7a6fb55cac5
2013-11-11 02:01:48 +00:00
Amaury Pouly
a54c4ab7d4 zen/zenxfi: correctly implement partial redraw
Although there is no difference in the cost of a full or partial update,
it is preferable that the semantic of lcd_update_rect() be correct.

Change-Id: I8a168388b98e0dbd7237729b7fd8a62fa1885be1
2013-11-11 02:01:05 +00:00
Amaury Pouly
7bbdcc1c3b zen/zenxfi: implement lcd standby
Change-Id: I5960221d45490c469ffd2a481d447185aba70e56
2013-11-11 02:00:41 +00:00
Ralf Ertzinger
b170c73f92 Updated IAP commands.
Originally written and uploaded by Lalufu (Ralf Ertzinger) in Feb 2012.
They have been condensed into a single patch and some further additions
by Andy Potter.

Currently includes Authentication V2 support from iPod to Accessory,
RF/BlueTooth transmitter support, selecting a playlist and selecting a
track from the current playlist. Does not support uploading Album Art
or podcasts. Has been tested on the following iPods,
4th Gen Grayscale, 4th Gen Color/Photo, Mini 2nd Gen, Nano 1st Gen and
Video 5.5Gen.

Change-Id: Ie8fc098361844132f0228ecbe3c48da948726f5e
Co-Authored by: Andy Potter <liveboxandy@gmail.com>
Reviewed-on: http://gerrit.rockbox.org/533
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
2013-11-10 18:41:24 +01:00
Amaury Pouly
b1ee21d45e zenxfi/zenmozaic: put HAVE_HEADPHONE_DETECTION in config file
Otherwise it breaks the simulator build

Change-Id: I816a34920283fc16e9c08ed6abe5fa41c0671f0a
2013-11-08 13:05:02 +00:00
Andrew Ryabinin
357dd680b4 ma8/ma9: Cleanup - fix tabs, remove unused defines. 2013-11-05 13:34:52 +04:00
Andrew Ryabinin
3a97e12fc5 Introduce HiFi E.T. MA8/MA8C ports.
HiFi E.T. MA8 is almost the same as MA9 except
another DAC(pcm1792 in ma8, df1704 in ma9).

MA8 has ILI9342 lcd, MA8C has ILI9342C lcd.

Change-Id: If2ac04f5a3382590b2a392c46286559f54b2ed6a
2013-11-05 09:59:45 +04:00
Andrew Ryabinin
a170c99170 ma9: Slightly change df1704 driver API.
This change should be done for easier integration of ma8 port.
2013-11-05 09:59:45 +04:00
Andrew Ryabinin
d602717735 Introduce HiFi E.T. MA9C port.
The only difference between this target and HiFi E.T. MA9
is display driver (ILI9342 in MA9 and ILI9342c in MA9C)

Change-Id: Icc3d2490f850902a653175360f12283f3708bbb7
2013-11-05 09:59:45 +04:00
Andrew Ryabinin
b48e6d0e1c ma9: Fix 'always load OF' bug in bootloader.
button_read_device() could be called before pca9555_read_thread
intializes pca9555_in_ports variable, and return incorrect value.

Change-Id: I960bff72fe230c9d0256b20e92d0a75e67266038
2013-11-05 09:59:45 +04:00
Amaury Pouly
78c060b09c imx233: rework vdd5v shared irq handling
The previous code disabled the irq when there were fired. This seems
unreliable for some mysterious reason. Instead simply disable them
before enabling the irq.

Change-Id: I7ee1aa25dbc41c7dd53aa7c7744aa5e4d70ff2d8
Reviewed-on: http://gerrit.rockbox.org/640
Reviewed-by: benjamin brown <foolshperson@gmail.com>
Tested-by: benjamin brown <foolshperson@gmail.com>
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-10-23 13:33:02 +02:00
Amaury Pouly
4aa32fb8f4 imx233: fix partition window computation
The code was broken in two ways:
- it called storage_read_sectors with a wrong drive number
- calling storage_read_sectors too early at boot time will fail because
  we are in the init function, so the drive is not yet registered.
To fix this, use a user provided read callback instead of storage read
functions.

Change-Id: I5ab79d48391fae619d5f8ae09c3d499fc43854c8
2013-10-22 15:55:28 +02:00
Amaury Pouly
a0728672bf Initial commit for the Creative ZEN and ZEN X-Fi
Change-Id: Ibd7b1b0b957ef11c200cb63eff7da53f11774748
2013-10-22 00:34:45 +02:00
Amaury Pouly
d3bc64833c Initial commit for the Creative ZEN Mozaic
Change-Id: Ib65aad9f5de37e514047955cad7ca40dc0af4f74
2013-10-22 00:34:44 +02:00
Amaury Pouly
3d1666042e imx233/system: don't do frequency management on < stmp3780, it's not working
Change-Id: Ie9ff5122f1cb4fe3809bb4c6b88ef0cfc353e0e1
2013-10-22 00:16:22 +02:00
Amaury Pouly
151fa30257 imx233/sdmmc: add write protect pin config
The setting is currently unused but it provides some documentation and basic
support for a more comprehensive implementation of read-only support.

Change-Id: I353c33ef765ef6e6c09d59e943da6654a311ad84
2013-10-22 00:14:24 +02:00
Amaury Pouly
17851f742e imx233/audio: workaround unused variable
The exact combination on which recording is needed is too complicated, so
just always cancel the unused warning, the compiler will optimise it away.

Change-Id: I0946586e4b01769c98babc4616f893c38f44c05f
2013-10-22 00:07:50 +02:00
Amaury Pouly
7d62a78af4 imx233: extend partition window support to be more generic
The new code can select among several types of window (user, system, ...).
Furthermore, the type of partitions to use is selectable in config file.
Currently, two types are support: Freescale style MBR and Creative MBLK

Change-Id: I969d60a3d08f2c9448fb4b9c440051b7801b94cd
2013-10-22 00:07:07 +02:00
Amaury Pouly
5c7167c79c imx233/i2c: relax timeout
Change-Id: Ie9cf8c8bb0a89d9cbcc795e04559864b9fbaf639
2013-10-22 00:02:05 +02:00
Amaury Pouly
71c5a52add imx233: fix power irq storm
When bootloader is too intelligent, like on Creative devices, it might leave
some unexpected IRQs sources on, this is problematic when those sources share
the same IRQ line.

Change-Id: Ie9333918eb1048b1f2de4ea738cddf556aa75ee2
2013-10-21 01:23:14 +02:00
Amaury Pouly
898b760e59 imx233: fix audioout on stmp3700
Strangely enough, only stmp3780 and stmp3600 have speaker control

Change-Id: Icec1ed4b7e80e8b3787a3d08b32695551b58aeb9
2013-10-21 01:23:14 +02:00
Amaury Pouly
28669ca0fd fuze+: fix typo
Change-Id: I0b86d5cadeb5b792dbdd71ea1e25230a6643afdf
2013-10-21 01:23:14 +02:00
Amaury Pouly
46416c619d imx233: fix usb_detect() to be consistent with vbus detection
The STMP3700 has unreliable vbusvalid irq so we need to use
vdd5gtvddio. Therefore, using the vbusvalid bit produces
inconsistent results between events and detect. Fix that
by making power handle all the usb detect stuff.

Change-Id: Ic521b2f6677602e184fe46352c5359f4b4ba8d56
2013-10-21 01:23:14 +02:00
Amaury Pouly
187017bad1 imx233: simplify sd/mmc code
Change-Id: I7e36b4c1c91540a2ae383109e440818bc610dde6
2013-10-21 01:23:13 +02:00
Amaury Pouly
5b3eaf6f5b imx233/i2c: use 1sec timeout by default instead of blocking
These functions are mostly used by the radio drivers and any blocking
call could potentially block the entire UI, which is pretty bad.
Since any request is expected to finish within a few us, having a 10ms
timeout doesn't seem unreasonable.

Change-Id: I03b19729511547e5bbdeb3476d020e5d87d0d7e1
2013-10-21 01:23:13 +02:00
Amaury Pouly
6006eb59b1 imx233/i2c: always reset the i2c block on timeout
On targets like stmp3700, resetting the dma channel on "soft" timeout
drives the whole block crazy unless it goes through complete reset.

Change-Id: I830b252279989bf9f9cd9c138240a6ea9b003527
2013-10-21 01:23:13 +02:00
Amaury Pouly
4c6c8cd1aa fuze+/zenxfi2: make sure pixclk is running before initialising lcdif
Change-Id: I50b2376d5f6dcf4dde994b533e0b946589a737e8
2013-09-26 22:54:29 +02:00
Amaury Pouly
120701646f imx233: always start SSPCLK before ungating the spp blocks
This should fix some boot hang issues which appeared at random.

Change-Id: I5430690a61c042b45ed26b58f485a1cc5d82987f
2013-09-26 20:12:42 +02:00
Amaury Pouly
94f2bc7473 sonynwze360: fix color swap
I found the BGR bits in the lcd registers by trival and error.

Change-Id: Ib263611e827e8671a0128242b947d76911bd9f47
2013-09-26 16:41:57 +02:00
Amaury Pouly
e41d2ba02b imx233: only clear got_a_nak on imx233, it doesn't exists on other stmps
Change-Id: I88e369dd7fa289f054837b442983bb7c97a58c53
2013-09-25 16:36:41 +02:00
Amaury Pouly
9392d036c4 Initial commit for the sony NWZ-E360 and NWZ-E370
Change-Id: I52d21e136a98eaf481615d641795cf7ecf325465
2013-09-25 14:31:39 +02:00
Amaury Pouly
b181c4963e fix whitespace
Change-Id: I569dba9c172ec3927cf8a26ee4e58e189addc728
2013-09-25 14:31:39 +02:00
Amaury Pouly
5909438193 imx233: improve button lradc driver
The driver can now handle HOLD in several ways, including using a GPIO.
Also add a debug routine to read the raw value of the adc.

Change-Id: Ide2cb1ac58e759b4bc464e606b432f2c150ee36f
2013-09-25 14:31:39 +02:00
Amaury Pouly
2f5f2ba91d imx233: always boost in bootloader
Many imx233 targets boot in a very low performance mode, typically cpu and
dram at 24MHz. This results in very slow boots and very unstable USB
bootloader mode. Since cpu frequency scaling is disabled in bootloader in
rockbox, always make the frequency scaling code available and boost at boot
time.

Change-Id: Ie96623c00f7c4cd9a377b84dcb14b772558cfa4d
2013-09-25 14:31:39 +02:00
Amaury Pouly
b4c1bb0214 imx233: fix block reset code
Change-Id: I5fbc76315a651c91b278e1c7dc6cb49b7e00d9ad
2013-09-18 13:17:19 +02:00
Amaury Pouly
90007da3e9 imx233: implement mmc card info
This one is a bit strange: our codebase just don't use it if there is both
SD and MMC, so this missing function got unnoticed so far.

Change-Id: Ifea4bb5140477b7637d033737594259cc44fb10e
2013-09-07 00:53:21 +02:00
Amaury Pouly
070e27933c imx233: fix red when target cannot record
Change-Id: Ia5f6b290da2f645021ef8becdfbac7436407ec0b
2013-09-07 00:52:36 +02:00
Amaury Pouly
a1e557bbdd imx233: fix horrible sd/mmc bug
The wrong variable was used to enumerate mmc drives. Also fix incorrect
function prototype.

Change-Id: Idd8dca7685bbc2bc4744b7b29e948f0ca2f56cc9
2013-09-06 18:22:34 +02:00
Amaury Pouly
4be366f4b0 cosmetics
Change-Id: Ia2b334ad9dd3f465ad5024e6fc226cb3e60a6e45
2013-09-06 18:22:02 +02:00
Amaury Pouly
74ed592b39 imx233: fix lcdif (don't send anything on empty buffer)
Change-Id: Ic39b2117b24d84452bb6f7b9c410b1cf55066b6d
2013-09-06 18:21:35 +02:00
Amaury Pouly
164876eaf1 imx233: fix i2c issues
The i2c core has some bugs: it locks up when the slave doesn't NAK and
prevent the dma channel from being resetted. Specifically handle this
situation by setting CLR_GOT_A_NAK (workaround) and then reset dma and i2c
block.

Change-Id: I0e09d38d4301a0ad42dfad785cc934b43f2c4485
2013-09-06 18:19:09 +02:00
Amaury Pouly
f13cad4c8e imx233: cleanup lradc button driver
Change-Id: I85fbe6807a1f91ae5be97b6847c07b24a4f18c24
2013-09-05 23:16:19 +02:00
Jean-Louis Biasini
df6eb82f51 touch devices: Disable touch on softlock.
Target that have a touchpad/touchscreen should disable it while
being locked (In order to avoid LCD to drain battery power due to
"key locked" constant reporting messages. If they a have a keylock
button this was already handled at driver level. If not (e.g. fuze+),
they will have to implement a switch at driver level that action.c
can operate on softlock.
This patch does the following for any target having a touchpad
or a touchscreen and no HAS_BUTTON_HOLD (ie any softlock target)
1) it implements the code to call button_enable_touch(bool en) in
action.c.
2) button_enable_touch is implemented in button.c and call
either touchpad_enable or touchscreen_enable
3) those two function are implemented respectively in touchscreen.c
and a new touchpad.c file. They provide a generic way to silents touch's
device and call a function at driver level where target specific code
can be implemented if possible/needed (for power saving for instance).
Those function name are touchpad_enable_device and touchscreen_enable_device
4) we implement an empty function at driver level of targets that need it
to have them still being able to compiled.

Change-Id: I9ead78a25bd33466a8533f5b9f259b395cb5ce49
Reviewed-on: http://gerrit.rockbox.org/569
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-09-05 20:02:07 +02:00
Amaury Pouly
b63b330775 imx233: revert sd card high speed (unstable)
Change-Id: I3d6a20de4ea1ca0d0150e6b4fc6af849eda0f4ab
2013-08-22 23:46:29 +02:00
Amaury Pouly
92725394eb imx233: always set VDDIO to 3.3V
On some device like Creative Zen X-Fi2 it is set to 3.1V on boot.

Change-Id: I1f9e407eb321c31b3109b7fed07862400073b54f
2013-08-22 23:44:15 +02:00
Amaury Pouly
96125e84f1 imx233: disable half fets on boot
This might cause freeze if the power supply is not able to cope
with the demand

Change-Id: I231142327fcad2096c18d3c8872ac8b6ee24f69c
2013-08-22 23:43:25 +02:00
Amaury Pouly
fb35f06bf5 imx233: rework emi frequency scaling
Drop most of the cases: only keep 64 MHz and 133 MHz. Pick values
from the manual which seem to match real life values.

Change-Id: I912752fbe372f9f44207db6853d0ff92fd619bed
2013-08-22 23:42:26 +02:00
Amaury Pouly
902306378e imx233: add support for 50MHz clock with SD cards
Now that the drive strength problem has been fixed, we can safely
drive sd cards at 48MHz in HS mode to get the best possible
transfer speed at 3.3V.

Change-Id: I0291589c399fb4880deba97895ff578451a32f99
2013-08-21 20:18:36 +02:00
Amaury Pouly
96d355abba imx233: fix drive strength for sd/mmc
At high speed, we need a drive strength of 8mA on the clock line
to get stable transfers.

Change-Id: Ida668db10cd3e10ad5740e35fd973f2fa394edb2
2013-08-21 20:18:36 +02:00
Amaury Pouly
462adf2a0f imx233: always keep cards in TRAN mode
Instead of going back and forth between TRAN and STBY modes,
stay in TRAN mode all the time, this avoid two commands on each
read/write and a potential delay to wait for the card.

Change-Id: Iafd456ab9a581d870331b622eeb48dcc254eda7f
2013-08-21 20:18:36 +02:00
Amaury Pouly
e90a5efe54 imx233: add support for CMD23 in sd/mmc
This allows tells the card the number of blocks that will be
transfered. This is usually faster than continuous read/write.
It is mandatory for MMC and on SD cards, support is probed.

Change-Id: Ide3f97c26c2b714390884c69e05b00c2caa552f8
2013-08-21 20:18:36 +02:00
Amaury Pouly
9a58721974 imx233: rework yield management for wait state, didn't make sense
Change-Id: I5ecb1afb5461018c2c9675d5f4ee1c6e4ded636d
2013-08-21 20:18:36 +02:00
Amaury Pouly
6d7734649d imx233: increase max dma transfer size
The old max dma transfer size was set to 2^15 because allowing
values up to 2^16 would result in overflow of the transfer count
in many places. This was a problem with the old register headers
because the macros didn't make sure the result is contained in
the bitmask of the field. The new macro do so 2^16 will actually
end up being 0 which means 2^16 for the hardware. This is kind of
hacky but it works and I prefer that this stays a power of two
because setting it to 2^16-1 would be extremely weird.

Change-Id: I9ce5661c477a79ab52efd5c573948e2353117804
2013-08-21 20:18:36 +02:00
Jean-Louis Biasini
8d2e4f9b7d [Fuze+][Touchpad] Improve touchpad power managment
- take advantage of the new rmi power function implemented to:
1) lower usual power_mode to low_power as it seems to be enough and might save
some battery
2) implement a system that lower that state to very_low_power
after 1 minute of inactivity.
3) implement touchdev_enable(bool) that can be use later to disable the
touchpad when needed
4) improve the debug screen report of the current power state and
changing the power state using volume keys

Change-Id: I0b372696d4b2bef5360c778d0500870fd9badee1
Reviewed-on: http://gerrit.rockbox.org/525
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-08-19 13:37:57 +02:00
Michael Sevakis
a56f1ca1ed Cleanup MV/MD macros a little.
When using variadic macros there's no need for IF_MD2/IF_MV2 to deal
with function parameters. IF_MD/IF_MV are enough.

Throw in IF_MD_DRV/ID_MV_VOL that return the parameter if MD/MV, or 0
if not.

Change-Id: I7605e6039f3be19cb47110c84dcb3c5516f2c3eb
2013-08-17 12:18:22 -04:00
Amaury Pouly
630a166a94 fuze+: fix radio power up
Change-Id: I7c9e056879c56f7f385ef6a8855d5726cf994b51
2013-08-16 17:23:41 +02:00
Amaury Pouly
737dafe7df Revert "rk27xx: implement usb driver"
This reverts commit 310f9e068d.
2013-08-11 19:21:24 +02:00
Marcin Bukat
310f9e068d rk27xx: implement usb driver
Change-Id: Iee3036944652fd6431d3177ab619e5df1f9bd44c
2013-08-06 21:27:46 +02:00
Michael Sevakis
9faabb98d4 Fix d2249dc errors
I wonder why it didn't cause more mayhem.

Change-Id: I4a585367d650417b4be3af2a0fe6235d8066c895
2013-07-19 08:37:40 -04:00
Michael Sevakis
d2249dce6f Combine PortalPlayer .lds files into one for app and boot.
These nearly identical files are multiplying like rabbits as PP targets
are added and make SoC-related changes a PITA. Just include the master
.lds file from the target one as was done for bootloader USB.

Change-Id: I65e9e653030f0688b1728e32ada16abf2932e029
2013-07-19 08:18:16 -04:00
Amaury Pouly
47785ca7f9 fuzeplus: add touchpad sensitivity
Change-Id: I0252c0967716a4f1a628191dcde7ffc80279370b
Reviewed-on: http://gerrit.rockbox.org/515
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-07-15 18:41:32 +02:00
Amaury Pouly
d85f796890 imx233: fix debug screen keys for the zen x-fi3
Change-Id: I81cfb25d3bd6ff8ec43c64a9f55e1b7bd0ee1473
2013-07-13 03:02:41 +02:00
Amaury Pouly
1a7bf7b91c imx233: fix debug keys for zenxfi2
Change-Id: I535fb611f951244686c60f336a49e068edfaf96a
2013-07-13 02:52:47 +02:00
Amaury Pouly
bbe94e2b24 imx233: fix audio debug screen
Change-Id: Iaadd43a28907ebd425a0b7199f067a4fab8e9653
2013-07-13 02:42:17 +02:00
Amaury Pouly
8c91d05543 imx233: add audioin debug info
Change-Id: Iba6e2b720489c1d2178a44a0a4fe5df2a7540579
2013-07-13 02:42:17 +02:00
Amaury Pouly
15c8ec8987 imx233: don't disable monitor when recording from radio
Change-Id: Ibefb0b12b7ff787f5b8a837cab1f764148a8b0c6
2013-07-13 02:42:17 +02:00
Amaury Pouly
a3af301677 imx233: rewrite debug screens
The old code used get_action which is bad because it belongs to
apps/. Instead rewrite a simple version of get_action, also
rewrite the top level handler. Since the number of screens is
becoming quite high, it now shows a list and the user can start
from any screen. Once in a screen and as long as the user presses
select, it will advance to next screen until it finally returns
to the list on cancellation.

Change-Id: Icbc7676a17e4a6e859b7781a4a471d8303910591
2013-07-13 02:42:17 +02:00
Amaury Pouly
a22855ce61 imx233: add audioout debug info
Change-Id: Iac092de861847e31aba48d2fdc51ae72cd9bd202
2013-07-13 02:42:17 +02:00
Amaury Pouly
3afcb53fb9 imx233: rework power management
The current code was spreaded over power and powermgmt which made
it behave strangely, especially since there are relationships
between power management and frequency scaling. The new code makes
sure power management is initialised before frequency scaling
starts. It also makes sure to start from a known state, thus
fixing potential issue when the bootloader stops in a trickle
state where DCDC is improperly configured.

Change-Id: Ibded2e590e108f6c98daa52d2cf1bd28763c8923
2013-07-07 17:36:21 +02:00
Amaury Pouly
659febc749 imx233: add emi debug info
Change-Id: I33317ae26b70c825d4c5e3aaac364da5e0dc06c2
2013-07-07 17:36:20 +02:00
Amaury Pouly
20ee453edc imx233: fix sd init sequence
Implement the switch function as specified by the specification,
that is wait for the response AND transfer 64 bytes of data. This
fixes some issue when the SD card take a long time to switch. In
particular waiting 100ms (max per spec) will not work if no data
is transfered in some cases.

Change-Id: Ia22350468018b842e57ce6f6c1a8d676eba97fb8
2013-07-02 00:45:00 +02:00
Amaury Pouly
d8024df105 imx233: implement alarm wake up
This adds the application part of alarm wake up. On some targets
like the Fuze+, it will also require a bootloader change to make
sure that the device doesn't power down on alarm wake up (for
example on the Fuze+ the bootloader requires the power button to
be hold sufficiently long, thus preventing alarm wake up to work)

Change-Id: I5d01957852355fddbd48110d3d75a5533f07879e
2013-07-02 00:45:00 +02:00
Amaury Pouly
2773673733 imx233: fix emi frequency scaling
On the ZEN X-Fi2, the fractiona dividers are gated by the
bootloader and must be ungated before switching emi to pll.

Change-Id: I5df57ed5581054883da4cbb3b4f3ce3539391ab5
2013-07-02 00:45:00 +02:00
Marcin Bukat
0b29691324 Move load_firmware() to separate file
The idea is to share loading code between bootloaders and rolo().

Change-Id: I1656ed91946d7a05cb7c9fa7a16793c3c862a5cd
Reviewed-on: http://gerrit.rockbox.org/190
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-06-27 13:50:11 +02:00
Amaury Pouly
d938ae692c imx233: fix ocotop/debug and usb-core for stmp3600
Currently we don't know where the serial number is stored on the
stmp3600. It is probably using the laser fuses but this needs to
be investigated

Change-Id: I1ac25e38b8f65635abb68788ceb65df0a740dabd
2013-06-24 13:17:17 +02:00
Amaury Pouly
c57b37ab99 imx233: fix debug for stmp3600
The STMP3600 cannot lock some usb bits so there is only a single
status in POWER_STS. Also stmp3600 has no clock bypass and frac
div.

Change-Id: I101f4263bdddeff58e142d10f9b76dd643bf928d
2013-06-20 14:11:58 +02:00
Amaury Pouly
a235200430 zenxfi2: remove lcd yuv blitting code (duplicate from generic)
Change-Id: I2be7d5f9cbc2086673c731e7b76b7d7d6f728f26
2013-06-20 13:49:59 +02:00
Amaury Pouly
277d358eda imx233: add generic lradc based button driver
This driver does debouncing and best lradc usage and only requires
a sorted table of values to work, this factoring code as much as
possible.

Change-Id: I84b46f4b08094634e1c5deb5ca9ba20763389e66
2013-06-18 16:43:27 +02:00
Amaury Pouly
0b6198f8a8 imx233: add basic ATA driver
The current driver only works in PIO mode.

Change-Id: I1cf2eaedcce0172a254c3bab0e1257886226d3a0
2013-06-18 16:41:13 +02:00
Amaury Pouly
bbb789120c imx233: add uartdbg driver
The driver is current unused and very minimal. It can used on
targets which have an accessible UART port and it will be used on
some creative targets as backlight control.

Change-Id: Id710d63574aadb0a2d7327b03187506b469470b1
2013-06-18 16:24:28 +02:00
Amaury Pouly
4962854005 imx233: add stmp3600 and stmp3700 pin descriptions
Change-Id: I1f64b669eac688583f27dde5216e40f7333de0b6
2013-06-18 16:21:38 +02:00
Amaury Pouly
ea8b22a9b6 zenxfi3: drop audio routing driver in favor of the generic one
Change-Id: Ia104c148f9139434d2c70190d2834b06de20de23
2013-06-18 16:19:28 +02:00
Amaury Pouly
11c907a83c zenxfi2: drop audio routing driver in favor of the generic one
Change-Id: I8186f4b8e7cdc5abc549dffb033178921f447998
2013-06-18 16:18:08 +02:00
Amaury Pouly
d997dafb6c fuzeplus: drop audio routing driver in favor of the generic one
Change-Id: I89828ef858606bf09e115ff9c27ff9ecc8bf8b8e
2013-06-18 16:15:07 +02:00
Amaury Pouly
e735ce4693 imx233: introduce generic audio routing driver
Change-Id: Icd439e02dd9835778d2733fc01a9306552b36966
2013-06-18 16:11:51 +02:00
Amaury Pouly
7fb0b893f9 imx233: implement recording side of pcm
Although everything is implemented, recording still doesn't work,
dma is stuck. Add code for reference until this get a proper fix.

Change-Id: Ifc016b00876230c6d337a5cd4f8bb90b856efac8
2013-06-18 15:45:58 +02:00
Amaury Pouly
ac4e76d072 imx233: implement audioin
Change-Id: I0cf896f59fd2176217d0dd1f6032c3463b936669
2013-06-18 15:43:43 +02:00
Amaury Pouly
57bb7b2d27 imx233: rework touchscreen driver
The old driver didn't behave nicely because it waiting for
stability which could never arrive on some gestures. The new one
uses a fixed delay and averaging.

Change-Id: I8ff80f373b6792e6d5fc3cfe41b709642e61c38b
2013-06-18 15:34:54 +02:00
Amaury Pouly
9c965c88b4 fuze+: fix lcd code which got broken in 52426d0
The lcd data line were not setup as input anymore, making register
reading plain broken and probably lead to bad lcd detection.

Change-Id: I281460f845537c58045f3893261ded5c9c6e53b5
2013-06-18 13:08:38 +02:00
Amaury Pouly
dafc359fad imx233: fix system for stmp3600 and stmp3700
Change-Id: I2b425b56358ed21269beae27a4afb490939b7f9d
2013-06-17 00:29:26 +02:00
Amaury Pouly
8d7cc320b7 imx233: only do power management on imx233
Power management is somewhat different on stmp3700 which doesn't
have the 4.2V rail and completely different on stmp3600 which has
several DCDC. Currently only handle imx233.

Change-Id: Ic7815141286117b74022ffc53cfa48664fd7faac
2013-06-17 00:29:25 +02:00
Amaury Pouly
2ed36fc4a2 imx233: clarity comment about errata
Change-Id: I3309ce112762f09fcf6bce9d416dbf4b0aa2f197
2013-06-17 00:29:25 +02:00
Amaury Pouly
63ffdc1c89 imx233: fix audioout for stmp3600 and stmp3700, add 3d effect
Although the 3D effets sound terrible, add support for it.

Change-Id: Ib24be01986a974387b592c6e291d34b196ceb884
2013-06-17 00:29:25 +02:00
Amaury Pouly
f0f6aee58c imx233: fix octop for stmp3600 and stmp3700
Change-Id: Iacfa8bb96c8b78d56e5010f313bc47b73df80720
2013-06-17 00:29:25 +02:00
Amaury Pouly
6e88d98dcf imx233: always use the timer for kernel tick
Change-Id: Ifb7f77569b351e66edb5b8f1ac2e805c2f8b394a
2013-06-17 00:29:25 +02:00
Amaury Pouly
b74a459189 imx233: fix ssp for stmp3600 and stmp3700
Using the ssp macros, we can easily handle the stmp3600 which
has a single ssp block. Take care of all the nasty differences
between targets like bus width

Change-Id: If98a091cc262e9e6834f6fb9826f7c5515bfe621
2013-06-17 00:29:25 +02:00
Amaury Pouly
86ff093267 imx233: fix emi for stmp3600 and stmp3700
Currently don't do anything on stmp3600 because emi is completely
different. On stmp3700 it is unsure how the pll lock is handled
and this will need more testing.

Change-Id: I3d11282531f54f2ecc4187c0d913e2c61f4de14d
2013-06-17 00:29:25 +02:00
Amaury Pouly
e671472c3f imx233: fix dma for stmp3600 and stmp3700, improve support
Add finer granularity to start command: now commands can be
prepared, schedule and semaphore increased independently.

Change-Id: Ib1ed1f20f4b46dc61b6dbab6ddec8b54e3d832b9
2013-06-17 00:29:25 +02:00
Amaury Pouly
bdc572b8a1 imx233: improve debug and fix for stmp3600 and stmp3700
Add pwm and usb screen, fix charging, icoll and dcp on other
stmps.

Change-Id: I3cddf987e178bc01046132adaed15cff750835c9
2013-06-17 00:29:25 +02:00
Amaury Pouly
069a0269a9 imx233: fix/improve lcdif for stmp3600 and stmp4700, fix drivers
Factorise pin setup, rewrite PIO code, add support for lcdif irq,
handle all the various differences between the stmps, drop yuv
blitting code since it already exists in the common lcd drivers.

Change-Id: Ifc40aed9b3b12f16611ce960602e46a5bc87ae53
2013-06-17 00:29:25 +02:00
Amaury Pouly
52426d0891 imx233: fix pinctrl for stmp3600 and stmp3700
Change-Id: I87281b89315890fa285cb9a63fda5c90bdc8cdbf
2013-06-17 00:29:25 +02:00
Amaury Pouly
f4fdf1ffe2 imx233: fix lradc/adc for stmp3600 and stmp3700
The lradc architecture of the stmp3600 is rather different:
only channels 6 and 7 have configurable source and we need to
take care when allocating channels so that we can actually
measure the right channel! Delegate die temperature sensing to
the power block on stmp3600.

Change-Id: I0860eb4ea98240facc3d4a19d61684eca5f630cc
2013-06-17 00:29:25 +02:00
Amaury Pouly
239219ee70 imx233: fix power for stmp3600 and stmp3700
There are many small differences between them. In particular
some regulators are not available on stmp3600. Also the vbusvalid
detect method is not available as an irq on stmp3600 and seems
broken on stmp3700. Finally die temperature is handled by the
power block on stmp3600.

Change-Id: I2c68b418738f15564e445d3a1496018cef97fff7
2013-06-17 00:29:25 +02:00
Amaury Pouly
2d0d752bf8 imx233: fix clkctrl for stmp3600 and stmp3700
Change-Id: I7596e41c0d0b7fdcc18f7d328a0927c2c78dc4cb
2013-06-17 00:29:24 +02:00
Amaury Pouly
023621d401 imx233: fix icoll for stmp3600 and stmp3700
Change-Id: I97b86d67b53615eca0d870058ff5c095c3063151
2013-06-17 00:29:24 +02:00
Amaury Pouly
8ed8a79f5c imx233: various sdmmc fixes
Change-Id: I261d0bdea1e7c5bc9139b10bf42e7ce7ce6b6dd8
2013-06-17 00:29:24 +02:00
Amaury Pouly
fbee03e0f0 imx233: simplify timer code
Change-Id: I845c3f20c17ce6091ed02bc4fbfca176358d31b7
2013-06-17 00:29:24 +02:00
Amaury Pouly
f1c6c71218 imx233: improve ssp
Under some circumstance (timeout), the dma interrupt is not fired
and only the error one is. This can happen with some picky SD
cards and with the current code it causes a 1 second timeout.
This code properly catches the error interrupt to stop as soon
as possible.

Change-Id: I9c53ea272d01793f0f229571502e99eb62f1b723
2013-06-17 00:29:24 +02:00
Amaury Pouly
49ea1b3cef imx233: make linker file more regular
Change-Id: Ic3fe21be9124af71eae88a00793f914fe03ee5a2
2013-06-17 00:29:24 +02:00
Amaury Pouly
f8d2984875 imx233: enhance pwm
The current pwm interface is too low-level. Introduce a higher
level setup function which directly computes the parameters from
the required frequency.

Change-Id: Ie95c7522e9f42492fe872203f4cab46770a9649a
2013-06-17 00:29:24 +02:00
Amaury Pouly
f5ac658d16 imx233: normalise clkctrl
The clkctrl functions were becoming a mess. Normalise the names,
get rid of the xtal derived as special case and use the same
interface.

Change-Id: Ib954a8d30a6bd691914b5e0d97774ec9fc560c50
2013-06-17 00:29:24 +02:00
Amaury Pouly
84fc327aeb imx233: introduce virtual pins to simplify pin setup
A number of pins on the imx233 are standard and manually calling
functions to acquire, set function/drive/output is painful. This
will become unmanageable when we will add support for the other
stmp chips.
Introduce the concept of virtual pin which is a way to completely
describe a virtual pin (virtual because pins are muxed).

Change-Id: I01b6e040945648e58e1d1abab06529c9571c5f10
2013-06-17 00:29:24 +02:00
Amaury Pouly
8f351d6e21 imx233: enhance pinctrl irq with user pointer
Change-Id: I191704299487598a853af4df5aebbbf8a7134a34
2013-06-17 00:29:24 +02:00
Amaury Pouly
918a06a12a imx233: normalise pinctrl names
The current pinctrl functions were a mess. Normalise the functions
names to make them shorter and clearer.

Change-Id: Iac6ff84625ef2b7610268e3a5802dc0088de3167
2013-06-17 00:29:24 +02:00
Amaury Pouly
8390eb931e imx233: rewrite dma using new register headers
Change-Id: If73b84d9c9f4a152a54fb9d2dbec895e72d2e753
2013-06-16 18:21:49 +02:00
Amaury Pouly
852a82b90a imx233: rewrite timrot using new register headers
Change-Id: Ia6dc7ac7e1fdf471a518111f5593bd96bc3acfac
2013-06-16 18:21:49 +02:00
Amaury Pouly
96b1d02b05 imx233: rewrite digctl using new register headers
Change-Id: I910a09e07b9f5a82bb6cb150739fcebc942cb7c1
2013-06-16 18:21:48 +02:00
Amaury Pouly
a759242b55 imx233: rewrite ssp using new register headers
Change-Id: Ibf186b610beb07bd615c976630cdca9de2c7448e
2013-06-16 18:21:48 +02:00
Amaury Pouly
94cb72301d imx233: fix sdmmc code
The SD SWITCH command has a result and can take a long time to
finish. Ignoring the answer and waiting an arbitrary time is
unreliable at best.

Change-Id: I1bfbb193952b96598f8bb056bac88220d4edf1fc
2013-06-16 18:21:48 +02:00
Amaury Pouly
2d12ef6c73 imx233: rewrite rtc using new registers
Change-Id: I30794dac2175d5717ea8e05e911abec65a214c44
2013-06-16 18:21:48 +02:00
Amaury Pouly
3e8c2dc46d imx233: rewrite pwm using new registers
Change-Id: Ie222f0b25f4b8af9ccf21aecd82a7f4eba40aa3c
2013-06-16 18:21:48 +02:00