Commit graph

32260 commits

Author SHA1 Message Date
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
b8bad8412f regtools/qeditor: clean-up
Free the backend when closing a tab to release some memory. Implement about
dialogs.

Change-Id: Ic8c500a23d38e6c3dd4de6a4ba862012925968be
2014-02-10 23:14:26 +01:00
Amaury Pouly
a66a5af4db regtools/qeditor: prepare support for register writing
Change-Id: Ifef36a3ddb1604db63ec974da2d6a77a5540ff42
2014-02-10 23:14:26 +01:00
Amaury Pouly
3d07706c05 regtools/qeditor: rewrite soc handling
The code was a mess with respect to soc handling: some code just plain copied
the SoC descriptor which are big objects, some was using indexes. The new soc
factor out everything in a few classes which hide these ugly details so that
descriptors are never copied.

Change-Id: I17af8b47f997a528b58221621389d42d24fded93
2014-02-10 23:14:26 +01:00
Amaury Pouly
8358707d82 hwstub/regtools/qeditor: put soc descriptors in a list instead of a vector
A SoC descriptor is not a small object: it can be as large as ~100KiB so
it's better to avoid copying things over.

Change-Id: I1ef862e1260299cdaa0c4d2822ac45968713498a
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
f982ea6398 utils/regtools: slight rework of tab management in qeditor
Change-Id: Iaf41defb79bb76010f3ff5269c28e4bad991ebc3
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
61dbeb60b7 mkimxboot: don't forget to select LRADC source before reading
Change-Id: I3435857f48580d7b3bf9363a2eed96738fbda69a
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
Amaury Pouly
0e0c610df0 utils/regtools: make qeditor able to poke directly at a hwstub device
This commit add the very handy feature of being able to read registers
directly from a device using hwstub. This is mostly trivial using the hwstub
library and the biggest change here is actually:
- being able to read registers by name and/or addresses
- being able to enumerate devives
The UI code currently doesn't handle hotplug but the backend does so it should
be trivial to add in the future. It also opens up the possibility the write
registers from hwstub or save the register values to a file.
Since it relies on both hwstub and libusb, a switch has been introduced in
qmake to disable it (use -config nohwstub).

Change-Id: I5d7d7a2a7c97ecd7407227357c8553c2773ea6cc
2014-02-10 23:14:25 +01:00
Amaury Pouly
81dfed27cf utils/hwstub: make stmp stub able to load in a MMU'ed environement
In might be useful to load hwstub in an environment with the MMU active,
in which case care must be taken on the order in which things are done.
Mostly, one should not disable the MMU before moving stuff around. The code
assumes the linking address (0 currently) is identity mapped.

Change-Id: I8d54ce9e8cadcde2e08990353ca7a46803731ca7
2014-02-10 23:14:25 +01:00
Amaury Pouly
c17d30f204 utils/hwstub: completely rework the protocol, drop unused features
The protocol has evolved a lot during the 2.x.y lifetime, bringing more
features which later got unused. This commit removes all the unused stuff
and simplifies everything:
- drop the feature mask: everything is mandatory or stalled on error
- remove the info request and put all static information in standard USB
  descriptors which are part of the configuration descriptor (and can be
  retrieved using the standard GetDescriptor request).
- remove the USB interface, we had only one anyway
- remove all endpoint descriptors
- remove the exit/atexit stuff, it never worked as intended anyway
- update the hwstub library and make it able to handle any device
- update the tools (mostly renaming and removing of code)

Change-Id: I1872bba7f4177fc3891180e8f944aab88f5bde31
2014-02-10 23:14:24 +01:00
Amaury Pouly
6d64111b3c imx233: add hardware and software watchdog
The hardware watchdog automatically shutdown the device after 10s of
inactivity, being defined as 10s without the tick IRQ fired (aka braindead
device).
The software IRQ mechanism is more interesting: it uses a very high priority
timer setup as one-shot to trigger after 5s of inactivity (but IRQ still
enabled). When detected, it patches the running code to insert a SWI
instruction so that on interrupt return it will trigger a SWI and produce
a meaningfull backtrace to debug the deadlock. This should allow to debug
freezes in IRQ context.

Change-Id: Ic55dad01201676bfb6dd79e78e535c6707cb88e6
2014-02-10 23:14:24 +01:00
Amaury Pouly
1a06292e41 imx233: increase audio DAC IRQ priority
This should hopefully fix some audio glitches

Change-Id: Ic9701d281e7559c9d93fcb8dad9373caaad9bfb6
2014-02-10 23:14:24 +01:00
Amaury Pouly
91a8cd1ae9 imx233: add code to debug menu to check nested IRQ actually work
Change-Id: I6b51e89222efa868c03944fc37bcc9f382853be1
2014-02-10 23:14:24 +01:00
Amaury Pouly
f7efa925fd imx233: add support for nested IRQ
Rewrite IRQ handling to allow nested IRQs: on each IRQ entry, we save the
parameters on the (IRQ) stack and then switch to SVC mode (with its own
stack) and renable interrupts. Make sure interrupt is properly acknowledged
by using the read side-effect (RSE) mode and handle priority levels as well.

Change-Id: I3fd68289b430c56bdd256868939238ff268e42b4
2014-02-10 23:14:24 +01:00
Amaury Pouly
cefaabfe9d imx233: cleanup icoll and add software irq sources
Change-Id: I4cf2b0b74cf391021afaec08329ec7cf5dbd578d
2014-02-10 23:14:24 +01:00
Amaury Pouly
55877f442a imx233: always disable watchdog on boot
Change-Id: I2e81b038b783968aa18ef3398d6e2aa66a2fee7c
2014-02-10 23:14:24 +01:00
Amaury Pouly
0ba4c3b078 imx233: enhance icoll with priority and soft IRQ
Change-Id: If9568ab6e11bf933b2cc607e5a86866a975886bc
2014-02-10 23:14:24 +01:00
Amaury Pouly
ab5dfd55aa imx233: add timrot to debug menu
Change-Id: Id60fcd64d509445d4ab62c4a2a8f2a074727c31d
2014-02-10 23:14:24 +01:00
Amaury Pouly
4495913c28 imx233: clean timrot a bit
Change-Id: Ic803a6b5c93978cd3246e553579ac8a1ba35e191
2014-02-10 23:14:23 +01:00
Marcin Bukat
c1609b0889 Coding style fix for bde5394
Change-Id: I6e9ba6a2570915191cf5b66f58ed9ddb1959b6cc
2014-02-10 07:46:13 +01:00
Marcin Bukat
7552542288 atj213x: Simple test exploring irq handling
This test software setups timer T0 periodic interrupt.
In ISR it changes backlight level. The interrupt handler
does not support nesting and the whole ISR is run in interrupt
context. Exceptions are not handled yet.

Change-Id: Idc5d622991c7257b4577448d8be08ddd1c24c745
2014-02-09 22:29:30 +01:00
Frank Gevaerts
bde5394f5a Return a valid USB string descriptor for index 0xEE.
Windows will try to retrieve such a descriptor on first connect.
If the device returns STALL or a regular string descriptor (i.e.
not one that follows the Microsoft OS Descriptor spec), things
will continue normally.

Unfortunately some of our low-level USB drivers have issues with
STALL so any other valid descriptor is the next best solution.

Change-Id: I59eb09eea157e4e14bec0197a898be378a5559f2
Reviewed-on: http://gerrit.rockbox.org/680
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
Tested: Frank Gevaerts <frank@gevaerts.be>
2014-02-09 20:39:18 +01:00
Avi Eisenberg
f723ca5805 Fixed bug where exiting textviewer after using up all the bookmarks caused that file unable to be read the next time.
Change-Id: I1924fe68c8528c03c4197f74a4f014edb0ac9f2a
2014-02-07 17:57:17 +01:00
Thomas Martitz
457bdfb6fc ypr0: Remove SDL copy&paste left-overs
Change-Id: Ie3e90070328798c398099c55f23665bfefdcf397
2014-02-05 22:58:45 +01:00
Lorenzo Miori
f005d841f2 Samsung YP-R0/YP-R1 refactoring
This patch includes some refactoring:
- renaming according to Rockbox guidelines
- GPIO code merging, still with target defines
- some simplification in firmware/SOURCES

Change-Id: I7fd95aece53f40efdf8caac22348376615795431
2014-02-05 21:57:31 +01:00
Frank Gevaerts
e32ace831a Disable rombox on the Player.
No more Archos rombox left...

Change-Id: I7de15b1ce1fabdb19ba7b0b69e0b7799664d8413
2014-02-05 19:50:47 +01:00
Lorenzo Miori
e876f4df6d Samsung YP-R1 target port
This is the basic port to the new target Samsung
YP-R1, which runs on a similar platform as YP-R0.
Port is usable, although there are still
some optimizations that have to be done.

Change-Id: If83a8e386369e413581753780c159026d9e41f04
2014-02-05 09:56:21 +01:00
Thomas Martitz
b828b9d99b samsung ypr0: Include getty service in the patched firmware for usb serial shell access.
The getty service mointors /dev/ttyGS0 (also created by the patched firmware).
When the g_serial.ko module is loaded this automatically enables shell access
via usb. It exposes a cdc-acm device to the host which is compatible to linux
(usb_serial.ko) and windows.

The g_serial.ko is not included module can be build from the YP-R0 open source
package provided by samsung. It can be loaded via rc.user on the internal memory.

Change-Id: I4903a635fd2e2f0ce6f5e91589a31d72bba2776b
2014-02-04 22:26:06 +01:00
Alex Parker
761975ef50 Slight change to line positioning in 128x128x16 Cabbie
Change-Id: Iaa7ce5bc2702854da661a77069c74637a64e4be7
2014-02-03 17:43:30 +00:00
Thomas Martitz
0b7a90722a talk: On hwcodec disabling DMA interrupt is required during buflib move
Even though the DMA buffer itself does not move the ISR copies from a movable
buffer into the static commit buffer. To ensure this copying yields consistent
data it must not be interrupted by this ISR..

Also bump the commit buffer size to 2k, this should reduce the overhead
considerably because many clips are smaller than that (especially on
swcodec/speex).

Change-Id: I4e1ab83074f31fc91b51a58baa1df55ce659ac73
2014-02-03 12:43:05 +01:00
Thomas Martitz
10b3bc78f6 Fix warnings.
Change-Id: If3cbcd7557797684f1b7fea8e1bb134777680dee
2014-02-03 12:33:33 +01:00
Thomas Martitz
e5eb74592e talk/voice: Reduce the size of the commit buffer.
The voice engine can now request more voice data during decoding, it does
not require the entire clip to be available before start of decoding anymore.
Therefore the commit buffer does not need to hold an entire voice clip anymore,
and can be made greatly smaller.

Change-Id: I3eca9026448e725b9b8d0dae1efca0ad185371da
2014-02-02 19:40:39 +01:00
Thomas Martitz
af02a674c5 talk.c: The new cache management is good enough to use it for .talk clips as well.
This unifies the talk.c for all possible voice payload. .talk clips are placed
onto the same unified clip cache, along with normal clips. This allows for more
effecient memory usage.

The cache handling makes a slight difference between normal clips and .talk
ones: .talk clips can be cached multiple and are always freed first.The extra
logic to avoid loading multiple copies of .talks is not necessary because the
will be freed first anyway.

Change-Id: I88d056a0a613b129f5875f50fdb757b58bac0a42
2014-02-02 19:40:39 +01:00
Thomas Martitz
03f373c9cd talk.c: The new cache management is good enough to use it on all targets.
This unifies the talk.c for all targets. The only separation is left is
TALK_PROGRESSIVE_LOAD: When this is defined the talk buffer will not be
initially prefilled. This is useful for super slow storage or when the buffer
is not large enough to prefill it with useful clips (the prefill code could
be made smarter too).

The buffer size can be adjusted. By default lowmem uses 100k while
other targets load the entire file. The bigger the more clips can be cached
but with diminishing returns.

Change-Id: Ife38fb101c53093117e6638c40c65f7d177a31d4
2014-02-02 19:40:39 +01:00
Thomas Martitz
c46f9be10a talk: Smarter cache management for TALK_PARTIAL_LOAD.
Previously the clip cache of TALK_PARTIAL_LOAD reserved space N clips, each slot
was as big as the maximum sized clip which was necessary to replace clips
in-memory in MRU-style.

The cache management now uses buflib to allocate and free each clip, using the
clip's real size. This allows the clip cache to be much more compact, because
no space is wasted for the max. sized clip. This makes use of buflib's ability
to easily manage differently-sized memory chunks by moving them to make free
space.

As an example: for english.voice TALK_PARTIAL_LOAD allocated 288k in advance.
for just 64 clips. With this patch ~70 clips can be stored in a 100k buffer.
This, the memory usage is cut by 2/3 and almost optimal (there's still the
buflib per-alloc cookie overhead).

As a result the TALK_PARTIAL_LOAD buffer is restricted to 100k which still
allows for more clips than previously, on average.

Change-Id: I257654071e9a95770cd6db2c2765f020befce412
2014-02-02 19:40:39 +01:00
Thomas Martitz
dac40fdd60 talk: Add debug menu entry to view statistics about talk engine.
This engine includes voicefile, memory usage and cache
hits/misses for TALK_PARTIAL_LOAD.

Change-Id: I331981ddda39ea30c57b4b74504accb3c556c3b9
2014-02-02 19:40:39 +01:00
Thomas Martitz
57000b513b talk: Make talk_voice_required() local to talk.c
Change-Id: I3a04760d550efab7f011a917597ef29c039b05bd
2014-02-02 19:40:39 +01:00
Thomas Martitz
60dea95cad talk/hwcodec: Do always free the clip buffer in shrink_callback().
This is necessary because when voice is active audio is disabled. But only
audio was able to shrink it's buffer to let other memory allocs succeed.
talk needs to be able to do this too when it owns the audio buffer exclusively.

Change-Id: Idea8ab90da7169f977c0c766cccb42c4fe6d6e81
2014-02-02 19:40:39 +01:00
Thomas Martitz
428f069a1f talk: Remove superflous call to talk_init().
talk_init() is called by settings_apply() already which is called on boot.
Doing it again means loading the voicefile a second time which isn't necessary.

Change-Id: I4decd16401e63bf87338d3163c99d06d69fe3a3c
2014-02-02 19:40:38 +01:00
Thomas Martitz
4ce39f7e73 buflib: Add a define telling the per-alloc overhead.
This allows buflib clients to more accurately estimate the total memory usage.
It's still not 100% accurate because the handle table grows in blocks, thus
buflib might use more memory that caused by allocations directly.

Change-Id: I68338bb94f510ad188fcb588aebf895b5f9197c5
2014-02-02 19:40:38 +01:00
Thomas Martitz
4ce1deacfd buflib: Properly support allocations without any name, to avoid wasting space
in micro-allocation scenarios.

Change-Id: I97a065bcfba8e0fda9b1670445e839e267c769c8
2014-02-02 19:40:38 +01:00