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
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
Plugins/Applications/main_menu_config allows you to edit the
main menu order without having to manually edit config.cfg.
Press the standard OK button to access the internal menu
which allows you to move items up/down in the order and toggle
their visibility. Exit via this menu to have the order saved.
(Suggestions welcome to improve this UI)
Change-Id: I59715ef1ca265aeb6f9666ef27026bc1093f2579
The UI now has a "read-only" check box to prevent accidently changes: once
unchecked, the UI can do write to register (only full register writes are
supported for now). If the register supports it, the UI provides SCT writes
as well. The display register panel was moved to its own class to cleanup
things a bit.
Change-Id: I0fc6aab3b351f9080076102ee6fad0037ab5353b
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
On the ZEN, the LCD is fed continuously by the DMA and this refresh needs to
be stop when the bootloader gives control to the firmware, otherwise the DMA
will source data from invalid region and it might even lock-up if the new
code touches the memory setup. Work around this by properly stopping the LCD
driver: the bootloader assumes that if the target defines HAVE_LCD_ENABLE
in bootloader build (which is unusual) then it needs to stop the LCD. Since
stopping the LCD could produce funny screens, power down backlight
which is expected to power down the LCD too, giving a nice black screen
instead of some random pixels.
Change-Id: I7ce5ba9bfd08e596907c4ff8f80feb189f0576ce
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
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
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
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
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
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
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
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
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
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
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