imx233: clean timrot a bit

Change-Id: Ic803a6b5c93978cd3246e553579ac8a1ba35e191
imx233: add timrot to debug menu

Change-Id: Id60fcd64d509445d4ab62c4a2a8f2a074727c31d
imx233: enhance icoll with priority and soft IRQ

Change-Id: If9568ab6e11bf933b2cc607e5a86866a975886bc
imx233: always disable watchdog on boot

Change-Id: I2e81b038b783968aa18ef3398d6e2aa66a2fee7c
imx233: cleanup icoll and add software irq sources

Change-Id: I4cf2b0b74cf391021afaec08329ec7cf5dbd578d
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
imx233: add code to debug menu to check nested IRQ actually work

Change-Id: I6b51e89222efa868c03944fc37bcc9f382853be1
imx233: increase audio DAC IRQ priority

This should hopefully fix some audio glitches

Change-Id: Ic9701d281e7559c9d93fcb8dad9373caaad9bfb6
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
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
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
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
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
imx233: handle jack detect inversion on some devices

Change-Id: I6e8644d8dc410f275c7c7580fa9bcbd2fa26a041
imx233: fix typos

Change-Id: If5bc0f09dc0b3b1e833e41bbbdd216002e37d147
imx233: add button debug screen

Change-Id: Iab85f1215a06507c06bffb746f2eac596e8c7992
Fix typo

Change-Id: Ib9d569886abf66a23f6569b6b44acf155a65009d
mkimxboot: don't forget to select LRADC source before reading

Change-Id: I3435857f48580d7b3bf9363a2eed96738fbda69a
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
utils/regtools: slight rework of tab management in qeditor

Change-Id: Iaf41defb79bb76010f3ff5269c28e4bad991ebc3