Commit graph

3564 commits

Author SHA1 Message Date
Amaury Pouly
2a71c08533 zenxfi: enable speaker
Change-Id: I603112d2a348abf92d5c8975ea76d3a57fda7cfc
2014-03-09 01:25:51 +01:00
Amaury Pouly
9637f4486b imx233: rewrite frequency scaling to use the new function
Change-Id: I0f9968de76ce17710d31f7bc609440654e68b6f1
2014-03-08 18:51:54 +01:00
Amaury Pouly
1f3979821c imx233: add function to change cpu/hbus frequency safely
Change-Id: I88e9ad54ba65846ae4d94ae03009b3656f2489f2
2014-03-08 18:51:54 +01:00
Amaury Pouly
3e2f3efd89 imx233: prepare frequency scaling for stmp3700
Add entry for stmp3700 maximum frequency which is 320MHz.

Change-Id: I6db4aad4efa0a7c1347a1ceb262a0295f63057ae
2014-03-08 18:51:54 +01:00
Amaury Pouly
9fe3687923 imx233: fix regulator code on stmp3700
For some reason the power subsystem needs to know the relationship between
the VDD{D,A,IO} and uses a weird register to do so.

Change-Id: I7fcc75f6cc0460b4997914986deda7ca544a4940
2014-03-08 18:51:54 +01:00
Amaury Pouly
4b2f59b3db zen: handle lcd underflow by hand
Contrary to the imx233, the stmp37xx lcdif doesn't know how to properly
recover from underflow and things are worse because of the errata which
makes the lcdif not clear the fifo. Workaround this by detecting underflow
and taking action: stop dotclk mode (will clear fifo) and schedule next frame.
The dma transfers now write the ctrl register as part of the PIO writes,
making the code simpler.

Change-Id: I15abc24567f322cd03bf2ef7903094f7f0178427
2014-03-08 18:51:54 +01:00
Amaury Pouly
b0940b1dd3 imx233: add lcdif underflow irq support
Change-Id: Ie3fe223ff40abff38bb9b09f398eb5411fa0be4c
2014-03-08 18:51:53 +01:00
Michael Sevakis
669fa9a130 Gigabeat S: Improve headphone thread implementation.
Implement scanning as binary tree in array.

Make the ADC calls fewer without compromising read quality.

Declare the thread function as 'noreturn' to save some stack. Reduce
stack size (regardless, % use is now a bit lower).

Change-Id: I239792fd2a0a2c019d1ec4af1d6d4b466cdf0ef5
2014-03-06 17:28:26 -05:00
Thomas Martitz
c35e1db832 Fix last warnings.
Change-Id: If0a7e11c3e107cb7756c0d70ed5b17fda92b166e
2014-03-03 20:34:46 +01:00
Thomas Martitz
68768260e8 Fix more reds.
Change-Id: I4b58dda0953b7f9799238c32b78037b0a5403c04
2014-03-03 20:26:08 +01:00
Thomas Martitz
c245de029d Fix various reds. Some includes needed fixup.
Change-Id: I4327740bae17054131feb917abdd58846c451988
2014-03-03 19:10:48 +01:00
Amaury Pouly
e5ce28ca09 zen/zenxfi: correctly implement lcdif errata
Change-Id: Ib2a6000035d70d687025a78bbea416d77af562fe
2014-03-03 18:33:04 +01:00
Thomas Martitz
382d1861af kernel: Break out kernel primitives into separate files and move to separate dir.
No code changed, just shuffling stuff around. This should make it easier to
build only select parts kernel and use different implementations.

Change-Id: Ie1f00f93008833ce38419d760afd70062c5e22b5
2014-03-03 18:11:57 +01:00
Amaury Pouly
3f116769fd zenxfi3: fix yellow
Change-Id: Id7eca51aa1c19cbb1798a0c8eeb5105ee4dc4769
2014-02-22 21:22:45 +01:00
Amaury Pouly
666f8fe7e3 zenmozaic: enable speaker support
Change-Id: I5f90a9816e9b7ca817fcb3195b63891fda5236f5
2014-02-22 20:40:45 +01:00
Amaury Pouly
1450f2658a stmp3700: implement speaker support by mean of lineout
Change-Id: Ic4c8b536fde7a840d3f3f295531cc1253de6320d
2014-02-22 20:38:40 +01:00
Amaury Pouly
b9db3d3743 imx233: remove nested irq check from debug menu
Change-Id: Ic16c6bf988d21c849488489d1b4a3477f2762afb
2014-02-22 20:38:10 +01:00
Amaury Pouly
f8e81594e2 imx233: switch debug screen to new button driver
Change-Id: I402a2ee1ff11e71702a7a1d6c878eab1e5405313
2014-02-22 20:37:46 +01:00
Amaury Pouly
c6caf58407 fuzeplus: switch to new button driver
Change-Id: Ida1e5b4913131ec671b2d713743e26a28fca6a25
2014-02-22 20:36:52 +01:00
Amaury Pouly
4e3e3badcf zenxfi3: switch to new button driver
Change-Id: I14b8f35a556ef07cc5fd43c39c6ad17a1229b4f8
2014-02-22 20:36:27 +01:00
Amaury Pouly
a750b73352 zenxfi2: switch to new button driver
Change-Id: I5c5bc33d0cc08316e4d853e81a5ba4fb9c5b08d9
2014-02-22 20:36:02 +01:00
Amaury Pouly
8660393c9f nwz{e360,e370}: switch to new button driver
Change-Id: Iad08653f6cdbcfd75d3130186f91ed0b49a04ac9
2014-02-22 20:34:39 +01:00
Amaury Pouly
a2bfbe9ebc zen{,xfi,mozaic,xfistyle,v}: switch to the new button driver
Change-Id: I206b16f6374f536ab6d84e84fefc8370a96ef759
2014-02-22 20:33:20 +01:00
Amaury Pouly
82b86d4316 imx233: introduce new generic button driver
This driver will subsume the old button-lradc driver and support far more
options. It can sense LRADC channels, PSWITCH, GPIOs and it handles special
"buttons" like headphone insertion and hold detection. It also provides a
more natural description of the buttons using a target-defined table with some
macros to make it easy to read and write. It uniformely handles debouncing on
LRADC channels and PSWITCH.

Change-Id: Ie61d1f593fdcf3bd456ba1d53a1fd784286834ce
2014-02-22 20:28:51 +01:00
Amaury Pouly
c02bc1afd2 imxtools/scsitools: increase SCSI delay to 10 seconds
On some OSes like Windows or if running in a virtual machine, the one second
timeout might be too short.

Change-Id: I717f7a2aaed1cb3d40e8fbe6f9b1081b43ceea95
2014-02-22 20:27:32 +01:00
Amaury Pouly
fd0a86a572 imx233: split lradc channel setup into source and sampling parameters
Change-Id: I1be43fec9622cb78fc5737e5ed8d7fda17baf576
2014-02-20 13:53:39 +01:00
Amaury Pouly
961498d58a imx233: stop watchdog on exception
Change-Id: If11d90343d32d5889857e7ba30a99f60a87639f1
2014-02-18 18:20:57 +01:00
Amaury Pouly
f890bd504f imx233: regenerate headers
Change-Id: I9dae85eb27337154ddb82015666773a5254cc388
2014-02-18 18:19:44 +01:00
Amaury Pouly
8927df4205 imx233: fix app.lds to properly support INIT_ATTR
Original fix by Marcin: it had a problem because crt0 on imx233 is more
complicated than many targets: since we use virtual memory, we first disable
the MMU, then move the entire image (including init and itext stuff), then
setup a temporary stack to setup the MMU. Only when the MMU is enabled, can
we move the init and itext stuff to its right location and finally boot.
This requires some trickery because:
- the initial move copies everything, including init and itext
- the stack overlaps with init and itext to reclaim space
- the temporary stack cannot be the same as the main stack to avoid trashing
  the init and itext code, also it needs to be a physical address

Change-Id: Ibaf331c7d90b61f99225d93c9e621eb0f3f8f2dc
2014-02-17 19:02:21 +01:00
Amaury Pouly
dd6f5cfb1e Revert "imx233: fix app.lds to properly support INIT_ATTR"
This reverts commit 2b02cbe1cc.
For some reason it breaks the build, more investigation is needed.
2014-02-17 14:30:41 +01:00
Amaury Pouly
db392245e2 imx233: rework interrupt nesting, disabled for now
Rework the irq code, to put more code in the C part. When interrupt
nesting is enable, Rockbox gets pretty unstable so disable it for now.

Change-Id: Iee18b539c80ea408273f6082975faaa87d3ee1b6
2014-02-16 20:53:08 +01:00
Amaury Pouly
556fa2c4cd zenxfistyle: implement speaker support
Change-Id: If59aaacdea9f57932464a1615f2b80e410ec50dc
2014-02-16 20:53:08 +01:00
Amaury Pouly
f0f1758067 zenxfi2: implement headphones detection
Change-Id: Ifbc8b10cebb3b7b126f1d6a212f6731f91e234e4
2014-02-16 20:53:08 +01:00
Amaury Pouly
6b3c29da69 zenxfi2: add speaker support
Change-Id: I37b85e23e6af92939700d640dbea74c646f49b7b
2014-02-16 20:53:08 +01:00
Amaury Pouly
812c3e7c48 imx233: add support for speaker on stmp3780
Change-Id: I990ca2bd43e12047e257f85ff06f046dfa3f94b3
2014-02-16 20:53:08 +01:00
Amaury Pouly
3d852bc1bf imx233: avoid overlapping text in debug
Change-Id: I9cb456ab60c0d05f202791ed8114a80d2819c399
2014-02-16 20:53:08 +01:00
Amaury Pouly
5172d66399 imx233: cleanup in sdmmc
Change-Id: I82eac65b1bf9f2e963c4ebfb7c22da678ae63642
2014-02-11 19:09:51 +01:00
Marcin Bukat
2b02cbe1cc imx233: fix app.lds to properly support INIT_ATTR
Change-Id: I1a917511e7e1540856815c77c4d996d1b8a03606
Reviewed-on: http://gerrit.rockbox.org/725
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-02-10 23:48:21 +01:00
Amaury Pouly
68163e8f49 imx233: don"t be smart when waiting for voltage stabilisation
Unfortunately the hardware is not very helpful when changing voltage: in DCDC
mode we have the DC_OK_IRQ but in linear regulator mode, the only available
bit doesn't work when lowering the voltages. At the moment, simply sleep for a
little while before a better solution is found.

Change-Id: I89335873e9e42e5c6e9131f40db7839b008c021c
2014-02-10 23:14:27 +01:00
Amaury Pouly
935c0ad14a imx233: stop the watchdog before loading main firmware
Change-Id: I0a13444d6788a09b0fc04ed1a5115cb2e5fe6f57
2014-02-10 23:14:26 +01:00
Amaury Pouly
34fb6906dd imx233: preventive fix of timrot
The old could trigger an immediate IRQ if for example the count was 0
when setting up the timer: since the count was updared *after* clearing the
IRQ, it could fire in between.

Change-Id: I0357b201655bc0e56425ffb249ca807525f30217
2014-02-10 23:14:26 +01:00
Amaury Pouly
619f7fba93 zen: enable dma channel after lcdif init
Change-Id: I8886698ed618f9724df2f46d71f36b7443bc821b
2014-02-10 23:14:26 +01:00
Amaury Pouly
0d5b061ecc zen: workaround errata on imx233 lcdif
Change-Id: I9d723aa13628e4ab38ee7f648c1923b9e7101d22
2014-02-10 23:14:26 +01:00
Amaury Pouly
1f4f7369ee imx233: add support for sd/mmc probing
zenxfi2: add support for internal storage on the SD version

The code can now skip devices marked as PROBE if they fail to init, thus
making it possible to handle various kinds of internal storages. The current
code probably doesn't interplay nicely since it acquires pins and never
release them so it will probably break NAND code when it's ready but NAND code
is not ready yet anyway.

Change-Id: I4cb962de4215661e521743a3f511445dbbf28673
2014-02-10 23:14:26 +01:00
Amaury Pouly
c043ecf9e1 imx233: rework early time power init
The current code does hazardous tweaks to the power subsystem: indeed if one
boots with USB plugged and some stub powers on the DCDC switch, it will fail.
Indeed, a hardware bug prevents from going back to linear regulators (see
errata) so we cannot expect to reach a known state (linreg on, dcdc off)
on each configuration and in particular, powering down the 4p2 rail in
such a configuration will result in a power brownout.
This commit works around this issue by not touching the initial power
configuration until USB is (un)plugged, which are the best spots to get
known states.

Change-Id: I8741a3995df8ae61ca1c887a3ecb7903d0ac5136
2014-02-10 23:14:25 +01:00
Amaury Pouly
cf99d48ab7 Fix typo
Change-Id: Ib9d569886abf66a23f6569b6b44acf155a65009d
2014-02-10 23:14:25 +01:00
Amaury Pouly
db5d74503e imx233: add button debug screen
Change-Id: Iab85f1215a06507c06bffb746f2eac596e8c7992
2014-02-10 23:14:25 +01:00
Amaury Pouly
65d5c426a7 imx233: fix typos
Change-Id: If5bc0f09dc0b3b1e833e41bbbdd216002e37d147
2014-02-10 23:14:25 +01:00
Amaury Pouly
965c268e5f imx233: handle jack detect inversion on some devices
Change-Id: I6e8644d8dc410f275c7c7580fa9bcbd2fa26a041
2014-02-10 23:14:25 +01:00
Amaury Pouly
0324bf59a8 imx233: make button-lradc drive able to handle VDDIO derived values
In most devices, the button ladder is not actually derived from VDDIO but
from a constant voltage source, making it very easy to read it. However on
some devices like ther ZEN X-Fi Style, the ladder is wired to VDDIO we
can be changed so it's crucial that the button driver correctly scales the
values wrt VDDIO.

Change-Id: Ifc11abe2838fa7d16d0d60ecd96964a8dc5ea6d7
2014-02-10 23:14:25 +01:00