This is intended for debugging OF kernel boot problems and has
to be enabled manually at compile time to make it usable.
Change-Id: Ie5ce9f0a7639be0acf5e3879cfc3a7b8b89caa5c
Two helpers (_init_clocktree and _init_uart2) already existed in
the SPL and are copied verbatim from there. The SPL versions are
still present and will be removed when dual boot works from the
main bootloader.
The other two helpers (_cleanup and _load_pdma_fw) are new.
Change-Id: I4661667966e26f52e6c5142f1947d2a34b7008ef
On the bootloader there's no point reserving memory for these,
the only users of codecbuf/pluginbuf are in the apps/ tree.
Change-Id: Ib57b4d59aff8f4dcc753d7993956ed15e61cdc52
Using the audio buffer directly is a bad idea because this will
render core_alloc non-functional if load_firmware() writes into
the buffer but then fails, for example on a checksum mismatch.
Change-Id: Ib2d17bcea53bdea1c4c5496cec0c4eee5dd66069
Document what the symbols are supposed to mean, fixup SPL's
usage of DRAM_END which should really be SDRAM_END instead.
No functional changes.
Change-Id: Ie85b0ee35fea8b7858891e5b9d6634eaae42c9f8
The implementation of write_bootdata() and get_redirect_dir() was
copied verbatim in two different places, obviously a bad thing for
maintainability. This moves them to a new file multiboot.c as they
are only used for multiboot.
Change-Id: Id0279216e4dd019f8bf612a81d3835eff010e506
This looks like it was copy-pasted blindly from elsewhere and it
wouldn't even compile, since hosted RoLo is completely different
from native RoLo.
Change-Id: I4074f5323dcbdae85db8a04f222c858e9a228432
The header format is basic, a variable length list of values
tagged by 4-byte strings. The main application to to allow a
loader to determine the load address of the binary at runtime
instead of using a hardcoded address. But the header contents
aren't fixed and it could be extended for other purposes too.
Change-Id: If51d85b4c2eb53c919a91b54985b157e8e5c20ef
filename buffer was too small to retrieve redirect path
if redirected to sd root remove <SD1> as it is redundant
Change-Id: I1326601f1ba4a18d6bc173798759eb762b55528c
Adds a loader for the legacy uImage format that is commonly used on
embedded Linux systems. It verifies checksums and supports uncompressed
and gzipped images. Supports arbitrary reader functions to allow the
images to be streamed off any storage device, for optimal RAM use.
Change-Id: I93c35f9a6f323999a22a07300e05627fabfcbd2c
This didn't account for partial page reads properly which resulted
in corrupted data. Fortunately, current released bootloaders do not
perform such reads so they don't trigger this bug.
Change-Id: I426a95ef8d0f20f4567498530e216d80e1aceef2
Helper for another semi-typical operation: find out how big of a
buffer should be allocated before decompressing. This can be useful
when the stream container doesn't specify the decompressed size.
Change-Id: I5f1536f809bb6f9bc6023120c024c3de7cea4269
Using an in-memory buffer for the input or output data for 'inflate'
is likely to be extremely common and there's really only one way to
do it, so predefined helpers should be provided.
Change-Id: Ifd22e7b140a08e0e7dc05aec6b340dff5e2d9d0a
Loads external drive into root namespace
Root Redirects can now be put into different folders
For instance placing '/_test' into SD1/rockbox_main.<playername>
will redirect to /<1>/_test/.rockbox
Debug menu>Bootdata now has root directory listed in addition to RAW Bootdata
Redirect root work from Michael Sevakis g#1556, RESTORED -> g#4256
Change-Id: Ia97cf50ff5f5b440877f9c005da6f12c53af931e
Provide definitions for the macros:
* RB_ROOT_VOL_HIDDEN(v) to exclude certain items from the root.
* RB_ROOT_CONTENTS to return a string with the name of the
directory to mount in the root.
Defaults are in export/rbpaths.h
It's a bit much for those that don't need the full functionality.
Some conditional define can cut it back a lot to cut out things only
needed if alternate root mounts are required. I'm just not bothering
yet. The basic concept would be applied to all targets to keep file
code from forking too much.
Change-Id: I3b5a14c530ff4b10d97f67636237d96875eb8969
Author: Michael Sevakis
There are various allocations that can't be moved or shrunk.
Provide a global callback struct for this use case instead of
making each caller declare its own dummy struct.
Also fixed ROLO and x1000 installer code which incorrectly
used movable allocations.
Change-Id: I00088396b9826e02e69a4a33477fe1a7816374f1
Tested with my SansaClip+. I don't think this will need extra battery
but let me know if I am wrong.
Change-Id: I287dae134113e0f8a138af68f5087b8ea45b0f4c
This kind of reverts 7b596416bf ("Gigabeat S: Update RDS processing to
use asynchronous I2C rather than thread."). However, requiring RDS to
run in thread context will a) allow more upcoming features and b) remove
quite some complexity from the codebase (see the diffstat here) because
Gigabeat is the only user. iMX31 should be able to handle one more
thread, as it can even run Linux.
Change-Id: I46130034595ba66392c5417c275d036f4bd26943
The OST prescaler bugfix (7a5130a277) broke runtime switching
between 1.0V and 2.0V modes. The 1ms delay after shutting down
the DAC isn't long enough to reset it, so it gets stuck in the
power mode assigned at boot. Change the delay back to 4ms, the
effective value prior to the OST bugfix.
Change-Id: Ic4583d1a6fa82540062aa185386f14bbf785a3f4
use si4700_read() instead of si4700_read_reg() to make it clear we are
not interested in the register itself but in the cache update. Also, a
tiny bit more efficient as we save a function call and don't request a
return value we don't use anyhow.
Change-Id: Ibbb66fd9e5ea748ba11ac3c2a0570f5219b72637
This controls the playback volume, which is not useful for
the M3K because it's impossible to play back and record at
the same time.
Change-Id: I5b0931c22b484f3ff6441d6c88079f18ec70f7f8
Recording works now, although I'm sure there will be a few
things that need fine-tuning. A major issue is that writing
to the SD card creates noticable interference, which happens
on the original firmware too but seems worse under Rockbox.
(Since Rockbox waits until RAM fills up before writing data,
the interference will only be heard on >50 MiB recordings.)
Change-Id: I5561dd9668c3bdd34e92f34ef50848aef8c0b7eb
As detailed in the <Low Power Mode> section of the AK4376A
datasheet, the amp should be powered down before switching
power modes (or to a sample rate <= 12 KHz).
Change-Id: I3ab0a21c78a3ad2bb418b64c916f7dbe2a843efa
Define proper symbolic constants for power mode. Also allow
targets to define the default power mode setting.
Change-Id: Ia07cf854dce47d0a6aa88e067471f1ff9fbc45fb
Remove the battery power ADC since it's not used right now,
and seems to fluctuate too rapidly to be of much use.
Change-Id: If115e4e3ce14d4c18ce899f5a889f7f99ab66489
This caused LCD problems on the ErosQ, where the screen would
go white until being put through a sleep/wake cycle. The exact
reason for this isn't obvious, but the problem didn't exist
prior to the AXP driver rewrite.
The two dependent changes,
42999913ba - x1000: Increase USB current limit to 500 mA at all times
90dd2f84a9 - x1000: Correctly limit USB charging current
ended up bringing the USB charging situation back to where it
was prior to the rewrite, so the cleanest option is to revert
the whole lot.
This reverts commit 42999913ba.
This reverts commit 90dd2f84a9.
This reverts commit 2d89143962.
Change-Id: I1cff2bfdd1b189df14bcf8cce42db725caa470d7
The 100 mA USB current limit added in commit 90dd2f84a9
is a problem when booting with a completely dead battery.
Often 100 mA isn't enough to power the player, never mind
charge the battery, so revert to the old behavior of only
limiting charge current.
Given that the original firmware on these devices isn't
following the USB spec to the letter, it's probably not
worth trying to make Rockbox do so unless and until it
causes a real problem - which hasn't happened yet.
Change-Id: I179a08310c226fe01460680c62fd25fd69079256
This problem actually had nothing to do with USB boot; it's
because the cable is plugged in when the USB mode menu item
is selected. The USB thread detected the select button press
and went into charge-only mode (as it usually does when you
hold down a key in Rockbox). This is fixed by having the USB
thread ignore most keys in the bootloader.
USB connect events are delivered via the button queue, and
there were also cases where the connection could be missed
if the event happened within another UI screen. This should
also be fixed.
Change-Id: I077d705a6ac845c8713219eee45d26aa6addfa61
Guard against division by zero and prevent the time_now
value from going negative if the counter drops below zero.
Change-Id: Ia8cadfe76086d6d0200964c1f27bab0be708b135
This method, while far from perfect, is able to make use of
real-time battery usage information and updates frequently
in fine-grained increments. This should make time estimates
a lot more useful than they previously were.
Change-Id: I66c6daba88210f60a27e239fbbcc56869be3b878
The way this was done before was wrong - limiting the charge
current is not enough since the device will draw additional
power to run. Use the AXP192's vbus current limit control to
stay compliant with the USB specification.
Change-Id: I91b84e3480a432e49bec53cf2a17e4e3444404a4
I noticed a few mistakes in the old driver code and it was in
need of an overhaul anyway... I decided to scale things back,
simplify the code and remove most of the debug menus, netting
a nice code size savings.
One new feature is an advanced debug menu which is accessible
by recompiling the code with AXP_EXTRA_DEBUG. It adds quite a
bit of code size and isn't useful other than for development
so it must be manually enabled by editing the source.
Change-Id: I30e17c1194c14823decd726a574ed14451d4cb2d
This reverts commit 6ff1a935b9.
Reason: it created a mismatch between the displayed voltage
and percent since the voltage was unfiltered but percentage
was based off the filtered voltage.
Change-Id: I4cba099f2e1edf0ef7c4e17a32f566aa66f5b933
This allows battery run time to be calculated from the
actual battery usage on the FiiO M3K and Shanling Q1.
This isn't very good for the time being and the estimate
tends to go all over the place due to small variations
in current or voltage.
The Eros Q can support this feature as well, but since
it already has fixed estimates defined and the quality
of the "real time" estimate is low I am not enabling it
there.
Change-Id: Id34a93ee4b7d66f9f7e56ef0f5149f67e8e72039
I've tried to clean up cruft and clarify what's being
done, prior to adding new features. The behavior should
be unchanged.
Change-Id: If8a68b7b48173d283df981a21cdd854b714e7695