Commit graph

4085 commits

Author SHA1 Message Date
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