Should make debugging crashes on native MIPS targets far easier.
This is by no means a 100% complete or robust implementation but
it seems to handle the vast majority of functions.
Change-Id: Id5f430270e02b5092b79026b6876675c784aa649
These don't seem usable and it looks like the files were added by
accident by d66346789c "buflib: Check the validity of of handles
passed to buflib_get_data() in DEBUG builds."
Change-Id: I4d4601f1fef7901c08ae86448853d008f48d5f43
Left shifts are not defined in C if they would cause signed overflow,
so these expressions get instrumented, which makes them unusable as
switch values and triggers compile errors when compiling with UBSan.
Change-Id: I0588d4be1e00ba1cfde0eac119ead368b20d10c9
flags were getting un-initialized memory
it really didn't matter with the flags getting initialized
anyway
But once I added a new flag that didn't explicitly
set or clear the flag at init well here we are
set flags to VP_DEFAULT_FLAGS in viewport_set_defaults()
add the flags variable to the default vp's set to 0
(it was already initialized to 0 by bss, make it explicit)
Change-Id: I3a9a062455b4cf66d2b8c70fdf05402a5c0c091c
Allow a clean shutdown to end in either power off or reboot. Add a
new event SYS_REBOOT to signal it and sys_reboot() to trigger the
event. SYS_REBOOT signals a reboot request and should be listened
for alongside SYS_POWEROFF events.
Change-Id: I99ba7fb5feed2bb5a0a40a274e8466ad74fe3a43
when drwing multiple areas of the screen with other gui elements
you might want to combine updates into a single screen redraw
Change-Id: Ie4130366fa13e25d3d14e937257d11547dd61134
MEM_ALIGN_ATTR should take advantage of cache line alignment on
all native CPUs which define it, not just ARM CPUs. (This could
arguably be done for hosted targets too, but we don't necessarily
know the size of a cache line there.)
Change-Id: Ife9302105ea57388afd55ce31da848b00b5b1b25
Hold "Play" to boot the OF, or boot it from the recovery menu
by holding "Vol. Up". If you had the hosted port installed on your
player before installing the native port, you'll still have to go
through the hosted bootloader.
A couple notes:
- When booting from the menu, the recovery menu disappears, then
reappears before going into the OF.
- You need to hold the play button for like a half second after the
blue light comes on in order to get into the OF.
The recovery appears to be there, but it doesn't seem to be intended
for end users - it just says "Updater V1.1 - Insert TF Pls". I haven't
tested it beyond seeing that it boots, so I'm going to comment it out
for now.
Change-Id: Ie271ee479bb628cc74141b7fe07273b3f193f358
This gets the volume that the path eventually refers to by parsing
the last volume specifier and returning the part of the path after
it (which does not contain any volume specifiers). The initial part
of the path therefore contains everything up to and including the
last volume specifier.
Change-Id: I9a935543256f8f22e0b8b1e3c88d4e47bd9dae8a
Enables multiboot for the FiiO M3K, Shanling Q1, and Eros Q native port.
Note this requires an up-to-date Rockbox _and_ bootloader.
Usage instructions will (eventually) be found on the wiki:
https://www.rockbox.org/wiki/MultibootBootloader
Change-Id: Ia2da1ad6ef611e499d2fbafa93838387bc1023ba
Searching in volume 0 is necessary for multiboot targets with only
one drive, like the M3K/Q1/ErosQ. Without this the search code will
never look at the redirect file on these targets.
The search bound is configured with a setting MULTIBOOT_MIN_VOLUME,
which defaults to 0, but is defined to 1 for Sansa players so they
keep their old behavior.
Change-Id: I6dc5cf98db4258731de2c68c3ab1182b4a4a655b
There should be no need for any compatibility hacks since this
value was mostly used internally between the SPL and bootloader.
clk_init() was the only user in the main Rockbox binary which
accessed it, but when loaded by the Rockbox bootloader that code
will not be reached since BOOT_FLAG_CLK_INIT is already set.
Change-Id: Idd68b9834172e652b47432bfb1e00c923ea35407
Removes the SPL's dual boot support code, and removes the dual
boot selection code on the M3K and Q1 since they can now do it
from the main bootloader.
Change-Id: Ie1b27e98c6ed4b3e37db86cfb485d6f3a6c5b25e
Screenshots of the recovery menu will be useful for documentation.
This can be disabled by turning off HAVE_BOOTLOADER_SCREENDUMP in
the target config file if the bootloader should ever run up against
max size limits.
Change-Id: I62ec1e465df2ca7a8a0e78625d88b31f6c4ef078
Basically, there's longstanding bug in Linux with self-extracting
kernels on MIPS which just happened to manifest now on the M3K as
a hang on boot. The fix is applied to the M3K and Q1 since they
both use this type of kernel image.
Change-Id: I17d2bad6eebd677cd6d2e0bf146450c71fcf1229
- Remove unused redefinitions of screen_dump() from bootloaders
- Use empty do-while when screendump is compiled out
Change-Id: I3ccdb0390ddaa28d8f561ff744d0db6aaef17f5d
Calling multiple levels of indirection in a loop slows things down
Really these need to be rewritten to take a start and end address
like most of the rest of the codebase
But this is safer without having test hardware in hand
Change-Id: Idae7b92ee779d020ed7fcc9334e2d5a9c710e64d
Replace inline section copy/fill loops with subroutines, which
reduces code size a bit and and handle zero size copies properly.
Remove the cache initialization loop as well. There's no actual
reason for this because the SPL initializes the caches and just
dropping the cache can even be harmful (in this case it wasn't,
because the SPL flushes the whole cache right before calling in).
Change-Id: I7cddc9ed6d060b1f1bdd75544297883d014cad2d
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
Also keeps display from lighting up before shutdown,
which reduces distractions, especially at night and
when the sleep timer is used by allowing the
screen to remain dark.
Change-Id: I1c2d1966f6fb9766532adf01e8828876a871857f
Create a new battery_current() function to report the
the battery's charging/discharging current. Move the
old runcurrent() implementation into it and clean up
some of the related defines.
Change-Id: I7dbe5b6532d291fa72add1cb23b30e3cbac8c3ca
Remove battery_read_info() which is a simple wrapper
function only used by debug screens. Use the polling
functions directly to save a bit of code size.
Change-Id: I2919f78105bab186f6933dc1823f9fa67fe74f3e
- Don't include the 'battery capacity' setting unless the
target allows changing it.
- Clean up the preprocessor conditionals used to check for
variable battery capacity support.
- Don't use a variable for battery capacity unless it is
actually needed.
Change-Id: I3d8a338f107014f2c5098bc0a44ef0cfb4df9356
Give iBasso DX50/DX90 empty adc-target.h headers like all
the other hosted targets to avoid special cases.
Change-Id: Iaae15642fdec4ff18bc9ac01245753135128f676
Rewrite the loop to update the framebuffer by rows rather
than by columns. This should (a) be more efficient on the
majority of targets using horizontal stride framebuffers,
(b) skimp a bit on code size and (c) avoid AddressSanitizer
errors caused by reading past the end of the source buffer.
Change-Id: I238d191d63bfdecd25336fd8879a63d9d6ab7087
Future-proofing against newer versions of GCC/binutils which
are stricter about the use of 'inline' functions in headers.
Change-Id: Id620812ed340f0d790ba6c5b8b5cb1d700acfbbf
This handles the case where the host sends a new setup packet
in the middle of an ongoing control transfer.
Change-Id: I1d2e02467e9b813c9827cc0699cb87a500515e31
The FT6x06 driver used for the Shanling Q1's touchscreen
has been extended to report more than one touch point. It
can also return the gesture detected by the controller,
but this doesn't seem to report anything useful on the Q1.
Multi-touch is only useful in 3x3 grid mode since the Rockbox
button API cannot report more than one touch point.
The FiiO M3K uses the same driver so it's been updated to the
multi-touch API, but functionality is unchanged.
Change-Id: I4de42f44808d6eb902e3da212d8f936b7a5042c7
Touch devices have physical buttons too, and these should be
subject to repeat acceleration. That feature was disabled for
the sake of better touch event responsiveness (apparently).
So, re-enable the acceleration feature & add a special case
to exempt BUTTON_TOUCHSCREEN from acceleration.
Change-Id: I9e097e27457fbd6b824f098e8b325ff35c59dde4
Based on a patch by Amaury Pouly which was based on a patch from Ryan
Hitchman.
I mainly moved the code for polling into the tuner driver so it can be
reused by other targets. I added the CONFIG parameter for the polling
frequency (in ticks) to save energy. Also, I did some minor cleanups.
Change-Id: I95a62e7e1e42c62dbf47ecb27a3b312a42be62aa
All three X1000 native targets turned out to have a very
similar boot configuration and used a nearly identical
makefile. Eliminate this duplication by moving the logic
into the main makefile.
Change-Id: I13044b9675c0abd605b8accdb2fee4f54549b020
Due to how the old control request API worked, the request
pointer (and the pointed-to contents) passed by the driver
must remain valid for the lifetime of the request.
The buffered copy wasn't used consistently anyway, so it
should be safe to just get rid of it.
(This only affects the old API compatibility layer.)
Change-Id: I00294c718a7515a91b84f7c7cae5220c73aa5960
In the old API, usb_core_transfer_complete() would ignore
any completions on EP0. The legacy control API will also
ignore most completions on EP0, but it only did so after
filling in the completion event.
If the driver submits a spurious completion on EP0, then
this could clobber a previously queued completion event.
Fix this by deciding whether to ignore the completion
*before* modifying the event data.
Change-Id: I68526898a96efa594ada4e94bb6851aaaf12e92a
Appears to return 0 until the axp has (presumably) completed
its first real measurement.
Note about erosq: keep the power_inint() delay large to ensure
nothing breaks in the bootloader for the time being.
Change-Id: I444e858207cc401c42f1e6ceacf067ad543d4ff8
The address from the packet needs to be saved before sending
the response -- after the response the request being pointed
to could get overwritten. This used to be done correctly but
I unintentionally broke it when updating the handler to the
new control request API.
Change-Id: I9b11548baf20dce44a82301731405dc8e8f1cef3
Ive seen no ill effects having this disabled on target so
limit it to the sim to stop Address Sanitizer from dumping
on the extra byte read. the bad data is never used AFAICT
since the loop ends
Change-Id: I8cb54e9d1f8fe28747867d861a015edb3dbfa5ff
Because usb_core_legacy_control_request() is called by an
interrupt handler the global variables used to track the
current control request at the very least need to be volatile.
It might also be necessary to disable IRQs but I'm not sure
of that.
Change-Id: I0f0bb86d0ad63734e8d3c73cb1c52fedf5a98120
We have this nice event library laying around probably a few more places
we could use event callbacks
Change-Id: I9180fa9d78788d161f2587110644ca3e08df6f50
OST timer fix (7a5130a277) causes a boot failure on some units,
the battery voltage reading needs more time to stabilize.
Change-Id: Ic4a9ba90a16fab8ac6d27dbbe7af381f7c810f8f
The battery stabilization delay call seems to need to be
about 170 at minimum now, let's do 190 for safety (+20ms).
Change-Id: Ifd0248891abe827dfcc3e6baf48cc5bef0d0cc1c
It turns out the prescaler fields in OST_CTRL are 2 bits wide,
not 3. The programming manual (as usual) is ambiguous and its
diagram shows 2-bit wide fields, but the bit positions in the
text give a 3-bit wide field. Ingenic's Linux code and my own
testing shows that they are, in fact, 2 bits wide.
This caused the OST2 divisor to be 16 instead of 4; the OST1
divisor was correct. This means that all udelay/mdelay calls
took 4x longer than they should've. After this change the OST2
prescaler will be 4, as intended, and udelay/mdelay calls will
wait for the intended duration.
Change-Id: I2ac0a9190f49b59a840c649bf586131f5f9fde82
This boosts USB transfer performance a bit, ~10% for reads and
~25% for writes, for large-ish file transfers. Rockbox is still
around 33-50% slower than the OF.
Change-Id: I236a1e5c69a290c47ed27b70cb2631111fc157ed
When performing an OUT transfer which is not a multiple of the
max packet size, the last packet of the OUT transfer should be
a short packet. However, there's no guarantee the host sends
the expected amount of data in the final packet.
The DWC2 USB controller handles this case by accepting any size
packet and copying it out to memory. So if the packet is bigger
than expected, it'll overrun the caller's buffer and Bad Things
will happen.
The USB 2.0 spec seems to endorse this behavior. Section 8.5.1
says "an ACK handshake indicates the endpoint has space for a
wMaxPacketSize data payload." So it is possible that other USB
controllers share the DWC2's behavior.
The simplest solution is to force all USB RX buffers to be big
enough to hold the transfer size, rounded up to a multiple of
the max packet size. For example, a transfer of 700 bytes would
require a 1024-byte buffer if the MPS = 512 bytes.
Change-Id: Ibb84d2b2d53aec8800a3a7c2449f7a17480acbcf
All existing USB drivers now define USB_LEGACY_CONTROL_API to
enable the emulation layer.
Control request handlers will be ported in follow-up commits.
Change-Id: I4be1ce7c372f2f6fee5978a4858c841b72e77405
This makes it possible for macros of conditionally included string
descriptors to get a correct index no matter what other usb drivers
are enabled or disabled due to the nature behavior of enums.
Change-Id: I8ccebbd316605bed0f5d90b6b73fab4a333c02fa
Write -1 to AIC_DR to initialize the "last sample"
to -1 in order to prevent power-on clicks.
It appears necessary to completely fill the FIFO,
otherwise I was able to get a click out of it, however
uncommon it was.
Not only does this prevent a click when first
playing a song after power-on, but it also seems to prevent
any click at all when powering on - previously, a small
click may have been heard when first booting.
Change-Id: I2b81c2fa6af9809ef1c354d7a08ca8f9893a7690
Previously it used the last sample, which turns out to be broken.
The AIC appears to send out a random non-zero sample continously
after boot -- probably because the last sample is uninitialized by
the hardware. Disabling playback is supposed to make it send zero
samples irregardless of the LSMP bit according to the docs, but it
doesn't seem to work this way.
- Change eliminates the white noise heard on the M3K after boot.
- Change has no adverse effects on the Q1.
- Leave Eros Q on the old setting since sending zeros exacerbates
clicking due to DAC's automute feature.
Change-Id: I9996793fc34f4475b19700d076b11505353b3836
According to a forum user, there's an audible click when changing
the volume between -32 and -32.5 dB with some headphones. Fix this
by not (ab)using the DAC digital mixer for volume control.
The mixer only provides an extra -6 dB of hardware volume range,
so the only side effect is that software volume will now kick in
at -32 dB instead of -38 dB.
Change-Id: If24d9bc0058eff3c1a29aefb155a2e378522623c
there is a 1MB free region that is used to load the firmware but we
shouldn't need that till after a USB connection
so here is my 2nd try
Change-Id: I2552db3a7fba019d7e7188984432f758ddafe548
Upon getting a USB reset, the USB core will update charging
current by calling usb_charging_maxcurrent_change(). On all
current X1000 targets this may cause a hang, since changing
the charge current involves a blocking I2C transaction.
Eg. if the host issues a reset when we're already configured
as part of error recovery, the change from 500 mA -> 100 mA
will cause a hang.
Change-Id: I5b45272c01fa16b179ae3d16bbc50c7fab9a416b
0.) B 0 /rockbox/apps/main.c:405
1.) B 1 /rockbox/firmware/kernel/thread.c thread[dircache]:1508
2.) B 2 /rockbox/apps/tagcache.c:4772
3.) U 3 /rockbox/apps/tagcache.c:4793
add logic to show count after log rolls over
clean-up
Change-Id: Ibda0a56e5d8d89aa8b7649f4f9fa64eb1ff0e08f
Adjust the battery scale to be a little better. I've set
the 100% (discharge) point to be where the battery sags to
when it is done charging but still plugged in.
Not quite sure how best to set the charge scale, it's just
equal to the discharge scale for now.
Change-Id: I9a2730c0b2051300af9eeddb4f67164f38a29002
IMHO the current name is somewhat misleading:
- usb_drv_send() is blocking and we have usb_drv_send_nonblocking()
for the non-blocking case. This inconsistent naming can only
promote confusion. (And what would we call a blocking receive?)
- Other hardware abstraction APIs in Rockbox are usually blocking:
storage, LCD, backlight, audio... in other words, blocking is the
default expected behavior, with non-blocking calls being a rarity.
Change-Id: I05b41088d09eab582697674f4f06fdca0c8950af
A reasonable default assumption for a user
would be that they can plug their device into
a USB AC adapter and it will charge with as much
current as it reasonably can. With the previous
default, an AC adapter will only do 100mA, basically
a trickle charge.
Make this configurable default per-device, so as not
to break old devices without testing.
Define TARGET_USB_CHARGING_DEFAULT to USB_CHARGING_FORCE
to use the new default.
Tested on both erosQ Native and M3K.
Change-Id: I77265d356a41d67357ebc6e9f7e0c25a37b74931
Fixes backlight not turning on after booting (tested on an iPod Mini 2G).
backlight_hw_init() copied from iPod 4G.
Change-Id: I9c32ca5ecd3dc74ea997e6cb843da79d303b0615
Set the maximum volume on both hosted and native ports
to -2 dB.
Verified behavior here on native and by borkitall on irc
for hosted.
Change-Id: I3aebc2bb4b9294a4137a33694c83139c0d76099a
'Bugfix' mono_bitmap_part reads ahead in the buffer,
if the height is <= char bit pixels other memory gets read
found with [Address Sanitizer]
also g#3332 since this is clearly a problem across the code
instead place the check for height < 8 in the lcd_mono_bitmap_part function
second try places the check above the negative y offset
this was causing glitches on the Q1 and likely other TS targets
since a negative y was added to height it made it < CHAR_BIT setting
stride = 0 even though the bitmap was >= CHAR_BIT high
Change-Id: I13bb8ab472c2ae61302a6de5d9e2c78243354460
It's not yet working and because all storage is removable (and the OF
works fine) it's of limited utility aynway.
Change-Id: I8a6a59ac16503d0f4574c3934f473cac54e86858
It has only a couple GB of onboard flash storage with no storage
driver in Rockbox. It hasn't seen any meaningful development since
its initial commit, it's not on the build farm, and the bootloader
build is broken by other refactoring.
Change-Id: Idd9e3c46fac9b96f416ce444182f97a50770e747
I feel this is probably unlikely to be called with a NULL pointer
for cachep but being that we are already doing the check why not
guard file_cache_reset as well
Change-Id: I1a13767ef28a4129ae3513f7aa999fb6c1d6fad8
Similar to the native port, the hosted port benefits from
adding a -1 dc bias to the PCM data. This prevents almost
all clicking artifacts.
Change-Id: Ic6378716774b6d88df23c476e2ef54d49f33dc72
An oversight on my part meant that setting channel balance to
100% L or 100% R would mute both channels - this logic will
prevent that.
Change-Id: I912c2745784fbbbd7a773e1234179801f2ca4680
A small negative offset seems to silence all
play/pause clicking on the PCM5102A.
Also adding PCM soft muting, and muting the headphone amp
when the headphones are detected as removed. This has been
tested to not cause any unintended side effects on the
line out.
Also confirmed the numerical dB values are (approx.) correct.
Change-Id: I689d68887c86add9cc5e0ccb0c7de01aaa69b4d9
This will eventually be used by the ZIP module and other things
that support DEFLATE based streams.
Change-Id: I4acc9561eb56c9c368d1defab9c14e0454d105e1
According to backtrace(3) man page, the string returned from
backtrace_symbols() contains the return address so we shouldn't
need to print it ourselves.
Change-Id: Ia779207285c9ea0052b9aee3d84ee8380bf46d82
Overflow is due to a hidden assumption in create_datetime_filename()
and create_numbered_filename() where buffer must be >= MAX_PATH bytes.
Change-Id: I9d36517d861b6925352380d551afc5439edbb340
* It had a (read) buffer overflow when dumping the stuff on the back half of the buffer
* a highly questionable code construct was nuked
Change-Id: I7f6f119524fc2095f788fc9b3d356459955d3ace
This adds an adapted version of the adler32 algorithm from tinf/zlib
which will be necessary to support ZLIB deflate streams in the future.
Change-Id: Ie60e15acb288acf56a2d44e3d3e912e1b3eb2216
The funny thing is that the memset() for the field in question was
redundant, as the overall inquiry structure was memset(0) already.
Change-Id: I8bec0c93c9317823ff39cf7133535e3bf58fb987
What works:
- LCD: 16-bit RGB565
- all buttons, including scrollwheel
- SD Card
- Battery level and charging/not charging status
- USB
- audio
- sample rate switching
- HP / LO detect, with "safe" fixed LO volume -
LO volume will only be put to user-defined max volume
if headphones are not present.
- rtc
- Plugins build, tried a couple and they seem OK
- Bootloader, installable to nand via usbboot
What doesn't work:
- Dual Boot
- power on/off has intermittent, low volume audio click
(sometimes it's completely silent, sometimes there's
a click)
- Audio uses 16-bit volume scaling, so clicking/popping
is pretty bad at lower volumes - need 32 bit volume
scaling, 24 bit I2S data
- USB HID keys not yet defined
- no jztool support
Unknowns:
- Stereo Switch pins: Direction select, AC_DC
(probably not even hooked up)
- What is the actual purpose of the Stereo Swtich?
- How does the bluetooth module connect?
"Someday" stuff:
- get LCD working at higher bit depth
- Bluetooth
Change-Id: I70dda8fc092c6e3f4352f2245e4164193f803c33
This relies on a macro, CRC32R_FAST, to select which version to
compile with. In tests the fast version is 2x faster at the expense
of requiring 960 more bytes for the lookup table. For now the default
is the space optimized version but in the future I would like to enable
this for ports where we can afford the extra storage and/or memory
requirements.
Change-Id: I25397dadedc3187bb02b2444f8b8ded77c2509b6