Commit graph

38886 commits

Author SHA1 Message Date
Solomon Peachy
8baeeda23f x1000: Bootloader now probes for the ONFI flash header at multiple addesses
The location (and number of pages) is apparently manufacturer-dependent.
here are some known so far:

Winbond:    page 1
gigadevice: page 4

This info is only queried/dumped when explicitly requested for debug
purposes.

Change-Id: Icc4f9c0d4f2cc9097b2295c8f42a22aab392d0d5
2026-02-03 07:01:10 -05:00
Aidan MacDonald
78542df466 Nuke GDB stub
It looks like the GDB stub only ever worked for the Archos
Recorder and iRiver IFP-7xx, neither of which are in-tree
any more.

Change-Id: If1910675b88b4707d26df9bc095818902af2d25b
2026-02-03 10:55:53 +00:00
Aidan MacDonald
2429e117d0 Replace all uses of PLUGIN_USE_IRAM with USE_IRAM
PLUGIN_USE_IRAM is almost equivalent to USE_IRAM except
that USE_IRAM might be defined in core, but not plugins.
All remaining uses of PLUGIN_USE_IRAM are inside plugins,
however, so there is no point keeping both defines around.

Change-Id: I6902c85651f3d82b7d19ea32eaa60fc5c19eded7
2026-02-02 17:11:04 -05:00
Aidan MacDonald
34525a18dc plugins: drop audio_hard_stop() from plugin API
Commit 01f96e40a7 ("mpegplayer: remove IRAM save/restore hack")
removed the only user.

Change-Id: Ia6281159387ab984906443f047b849614d92ef9e
2026-02-02 16:27:25 -05:00
Aidan MacDonald
828fd7941f x1000: ensure sections are 4-byte aligned
The section copy loops in crt0.S rely on sections starting
and ending on 4-byte aligned addresses. If the last variable
alloacted in the BSS section isn't a multiple of 4 bytes,
then _bssend can get misaligned and break the copy loop.

This problem was masked by -fcommon since COMMON variables
go at the end of the BSS section, and they were for the most
part a multiple of 4 bytes. The switch to -fno-common broke
the bootloader because with COMMON gone, the last thing in
BSS was a 1-byte variable in led.o. The main binary appears
to have had the correct alignments by sheer luck.

Change-Id: I21ee3653d89d1607a2f458c457f1a51e33c22f05
2026-02-02 20:50:05 +00:00
Solomon Peachy
3a68848099 erosqnative: Rename bootloader entries for stock firmware / recovery
"Aigo Player" => "Hiby Player"
"Aigo Recovery" => "HibyOS Recovery"

All four (so far) brandings of the "erosq/k" family utilize the same
HibyOS+HibyPlayer platform.  This platform is additionally shared by
nearly all X1000-based devices.

...So let's call it what it is.

Change-Id: I986ed202ad0ca13b0650be87cf5b612c9648e571
2026-02-02 08:27:43 -05:00
Solomon Peachy
84e5d193fb x1000: Turn on QSPI mode for W25N01GV and XT26G01C flashes
With the QSPI TMODE fix, they are confirmed working

Change-Id: Ic47b13312299bab8a632ebf517015362a0cb6a49
2026-02-02 08:22:46 -05:00
Solomon Peachy
9f216921b8 x1000: Correct SFC TMODE bit definitions
We were using a definition of 0b100 for "Quad Input / Quad Output" mode
which is marked as "reserved" in the X1000 TRM.  The correct value is
0b101.

Somehow this "worked" for some devices but failed for others?

Credit for this discovery+fix goes to forum user ZappBranigan2972

Change-Id: Iedbd2d1b6da55113e266ad8aa51fc9c3130bf2b8
2026-02-02 08:22:46 -05:00
Solomon Peachy
78778d6e6f misc: Correct inifinite loop when volume has a fractional component
Introduced in 3f2ca2024

Purely a theretical problem but we should fix it regardless

Change-Id: Ifeb4e1aeb3291c723b2addf2f2d391775db57b03
2026-02-02 08:22:46 -05:00
Aidan MacDonald
3f2ca20245 misc: fix issues with perceptual volume calculations
The constant NVOL_FACTOR used in the calculations needs
to be scaled if the target doesn't represent volumes in
1/10th dB units (ie. most targets). Using a wrong factor
caused the results to be slightly "off", with wide steps
between points on the upper end of the volume curve.

Drop use_linear_dB_scale() because the magic constant
involved has a similar problem (and we don't use this
function anyway).

Also, make sure to account for the guaranteed min/max
points when generating the normalized volume table to
avoid sometimes generating one or two extra volume steps
very close to the min/max volumes.

Change-Id: I5c15809a7306f14bb1befe6d29a5e2b5b0974eaa
2026-02-01 17:33:08 +00:00
Aidan MacDonald
ad9471be3b echoplayer: add shadow framebuffer to avoid tearing
Using a simple memcpy to a separate framebuffer prevents
objectionable levels of flickering caused by scanning out
the main framebuffer while it's modified between updates.

With optimized memcpy, copying the whole framebuffer takes
about 260us at maximum CPU+bus frequency. Using DMA would
likely be a bit faster and more power-efficient, but that
can be left as a future optimization.

Change-Id: Ia6dc36d797cdb7a5f6663078c0ecce661267bedf
2026-02-01 10:18:20 -05:00
Aidan MacDonald
7adb9cd1b4 arm: add optimized ARMv7-M memcpy implementation
This assembly implementation is marginally faster than
the non-size-optimized C version for large copies, but
is around half the code size.

Unaligned loads/stores will be used on platforms that
support it: though slower than aligned accesses, this
is still faster than copying byte-by-byte and has the
advantage of simplicity and small code size.

Change-Id: Ieee73d7557318d510601583f190ef3aa018c9121
2026-02-01 10:02:55 -05:00
Aidan MacDonald
01f96e40a7 mpegplayer: remove IRAM save/restore hack
On targets where plugins can use IRAM, mpegplayer copies
its own IRAM region to main memory before enabling voiced
menus and then copies it back when exiting the menu.

I'm reasonably certain this is unnecessary because the
core IRAM area is completely separate from plugin IRAM
(which is the same memory as codec IRAM). If they _did_
conflict, then we'd expect to see massive problems with
voiced menus during normal playback since most codecs
make fairly heavy use of IRAM.

There are two other reasons to get rid of this hack:
(1) it's ugly, and (2) it will not work on targets with
"split" IRAM like on the STM32H743 where the fastest
code/data memories are separate.

Change-Id: Id8656539c7cafb724691494c54a07448fbcf8129
2026-02-01 09:55:04 -05:00
Solomon Peachy
3083277ee4 rbutil: Don't forget to bump the version for MacOS builds
(And a minor correction to the changelog)

Change-Id: Ic00e32444ee815b214755c8a17a511ce4310caca
2026-02-01 09:35:08 -05:00
Solomon Peachy
c458f4663c x1000: Do not use QSPI mode on the XT26G01C flash
Either QSPI is not wired up, or there is some other issue preventing
them from working correctly.

If this doesn't show any more issues then we should be able to produce a
new set of bootloader builds enabling support for the HifiWalker H2 v2.3
variant. We will eventually find out if other OEMs have chosen dfferent
flash parts for their specific ErosQ/K variations.

(Credit for these experiments goes to the forum users
 ZappBranigan2972 and gonzyfrigus)

Change-Id: I349f4bbac509010753ac2ad24ad42a234cccdea5
2026-02-01 07:45:29 -05:00
Roman Artiukhin
98b25f146b rockboxdev: glib: drop tests and docs from autreconf
Removes dependency on distuitls (ModuleNotFoundError: No module named 'distutils');
gtk-doc-tools still required;

Change-Id: I50f69411d146b5b9b9c496b3507bcef5bb1638bc
2026-01-31 15:48:23 +02:00
Roman Artiukhin
3bfce366ac hiby: r1_patcher: stop script execution on any error
Change-Id: Ic683b8ed155a5e9d2779d40a3b7673579056d9b1
2026-01-31 13:26:35 +02:00
Solomon Peachy
ee3e630efa rbutil: Upgrade bundled quazip from 0.9.1 to 1.1
Just reducing the delta a little bit.  Later versions are
more complicated.

Change-Id: If0452a529b840383333062ec2604ff257646627a
2026-01-30 20:42:21 -05:00
Solomon Peachy
e11a449031 rbutil: Pull the internal/external QUAZIP library stuff into the toplevel
Prevents a build failure when we have to build quazip as part of the build

Change-Id: I274cd4c358c50152bcfea2e33ad580fac0277e4a
2026-01-30 15:08:23 -05:00
Christian Soffke
11263d73af imageviewer: add back semicolon
accidentally removed in 3c6b9bb

file isn't normally used, so there was no error

Change-Id: I65cc59bfcb3c59678a990b9804070d518318b016
2026-01-30 14:12:57 +01:00
Christian Soffke
2556cfc7b3 usb: fix hang when disconnecting from USB
regression introduced in 33d0a3efa3

Change-Id: I0ded61d70a09b27820e65979381d2c38410d2923
2026-01-30 13:55:30 +01:00
Solomon Peachy
c23e1ba09a x1000: Drop XT26G01C flash clock speed to 104MHz as per datasheet
Change-Id: I17da992c608a6ad1340c500c34d42009eccf6fbb
2026-01-30 06:07:00 -05:00
Solomon Peachy
5563643b38 x1000: Bump NAND_DRV_MAXPAGESIZE to (2048+128)
X6G01C flash has 128B of ECC data per page, overruning our
buffer.

Change-Id: I8caa8bec6291f1b3391af9c7da1ee22805ff01e2
2026-01-30 06:07:00 -05:00
Solomon Peachy
c826554067 manual: Minor correction to the list of ErosQ/K hardare revisions
Change-Id: I4691d11b5c26a1b0e09e62ccb62e0661a09851b9
2026-01-30 06:06:59 -05:00
Aidan MacDonald
b8b55128b1 firmware: make config.h IRAM usage defines more readable
Split up the single massive '#if' condition into several
smaller blocks to make it easier to understand what is
happening. Compiled binaries should remain unchanged.

Change-Id: I65359cb55c60d71d5a424cafda83c83bddb20974
2026-01-29 18:38:16 -05:00
Solomon Peachy
1f30d9efe3 FS#13769 - Updated Italian translation (Alessio Lenzi)
Change-Id: Ieeefb31f70f1924c8de25ea640ad75e17cac40f5
2026-01-29 17:16:51 -05:00
Solomon Peachy
2a4cb29b27 synopsis-dwmac: Make ep0_buffer (and friends) static.
Looks like an oversight

Change-Id: Ia730fd1f9e19ca31add581400372dfacead7b452
2026-01-28 15:55:45 -05:00
Solomon Peachy
62200ff4d7 FS#13768: Updated Serbian Translation (Ivan Pesic)
Change-Id: Iae502c6757823ae00ec22a65d83c3e151d0c4c55
2026-01-27 19:48:37 -05:00
Solomon Peachy
83420e0a95 voice: Switch default en_GB TTS voice to Piper's 'alba' #2
The previous commit just switched the voice used for the nightlies; this
changes the default used when using the cmdline voice.pl tool without
the user overriding it with something else.

Change-Id: I5144fe66e355f3c41677ca37226a743667d291bf
2026-01-27 17:45:19 -05:00
Solomon Peachy
30ff611529 voice: Switch default en_GB TTS voice to Piper's 'alba'.
Does better for short phrases/words than 'semaine'. "No/Yes" and
numbers in were pretty bad in particular.

Change-Id: I795ad57b7ca8c5b8a3fe0c2b721ef167d0dd9f6d
2026-01-27 17:27:20 -05:00
Solomon Peachy
b349eea2c9 usb: fix yellow in eb69211791
Bootloaders with HAVE_USBSTACK but without HAVE_BOOTLOADER_USB_MODE end
up with USB_NUM_DRIVERS of 0 which leads to a warning due to a signed
number being checked to see if it's >= 0.

Work around this temporarily; the proper fix is to not build usb_core
and its class drivers when BOOTLOADER & !HAVE_BOOTLOADER_USB_MODE

Change-Id: I1b41140d31ba9df6b4c760478c4265d4e5584963
2026-01-27 15:23:47 -05:00
mojyack
eb69211791 usb: introduce USB_NOTIFY_CLASS_DRIVER
this invokes specified class driver's notify_event method.
initial purpose is to trigger a callback from isr, like a timer event.

Change-Id: Id600e9f0d8840a12da779d5a15783edf14bd76b5
2026-01-27 13:39:58 -05:00
Solomon Peachy
fce8248267 usb: Hopefully resolve the red in 41f9285def
First, leave USB_FULL_INIT on for all non-bootloader builds; this is
needed for devices that don't have a USBSTACK (such as most hosted
targets and ones that provide USB<>ATA in hardware)

Then unwind another hack that is no longer needed now that USB_FULL_INIT
is not set in most bootloaders.

Change-Id: I00881ac76b2469e5cd7700bad2203c58ef1e09e7
2026-01-27 13:05:57 -05:00
Solomon Peachy
a5b589cf5b vx747: Target needs HAVE_BOOTLOADER_USB_MODE
Change-Id: I735cbf5575b0368741f2b8147eb80a71e0a67c98
2026-01-27 12:21:42 -05:00
Solomon Peachy
41f9285def usb: Clean up the pile of USB_FULL_INIT exceptions
The intent here is that when HAVE_USBSTACK is not defined, or we are
in a bootloader wthout HAVE_BOOTLOADER_USB_MODE, a device may still
some of USB subsystem initialized.  For example, this may be needed
to enable USB-based charging functionality.

So, get rid of the blanket enables of USB_FULL_INIT based on target SoC,
enabling HAVE_BOOTLOADER_USB_MODE on targets that need it, and clean up
the initial mess. Most of this mess is because usb_core.c has no sense
of USB_FULL_INIT or not, and is always included when HAVE_USBSTACK is
set (even in bootloaders without BOOTLOADER_USB_MODE), but dealing with
that latter case will come later.

Change-Id: I7f805b89dded39aeea2db9038209780069e3b600
2026-01-27 10:27:09 -05:00
Aidan MacDonald
7b77752aff echoplayer: reduce USB storage buffer size for bootloader
This saves 64k of BSS, freeing up space in AXI SRAM.

Change-Id: I37079c5fa5ed2b969d70622491dbf0f4dca2c759
2026-01-27 10:05:20 -05:00
Aidan MacDonald
d15bb5f848 stm32h7: move LCD framebuffer to AXI SRAM
Framebuffer access consumes a lot of SDRAM bandwidth.
Moving it to AXI SRAM should be a big improvement as
it's around 8x faster (2x clock speed, 4x bus width).

Also take advantage of explicitly assigning sections
to the special :NONE segment, which means they will
not appear in any ELF program header and thus aren't
visible to the bootloader. They can then overlap
areas used by the bootloader -- by the time they're
written, the bootloader will be long gone -- making
it easier to make efficient use of SRAM.

Change-Id: I2392fd23b17472cc08dc5fe4556f6def3cc186ed
2026-01-27 10:04:59 -05:00
Aidan MacDonald
77f30202d0 tools: detect Git revision correctly in non-default worktrees
In a non-default Git worktree, the .git directory is replaced
by a file containing the path to the real .git directory. This
breaks the version detection logic because it expects .git to
be a directory.

Passing the root of the source tree via "git -C", letting Git
figure out if we're in a repo or not, solves this problem.

Change-Id: I595f1a694258cad490b1a4964f8ae9d51ae76de1
2026-01-27 09:22:31 -05:00
Aidan MacDonald
2b09078b92 stm32h7: set 8-byte alignment on main and irq stack
Explicitly set 8-byte alignment as per the AAPCS, which
says the stack should be 8-byte aligned at a public ABI
boundary.

Change-Id: Ie60b664718119ea576e7c6b5efaac011eb907531
2026-01-27 13:31:12 +00:00
Solomon Peachy
e1d10c938a config: Targets must opt-in to bootloader USB storage support
ie by only using HAVE_BOOTLOADER_USB_MODE, instead of blanket-enabling
USB_ENABLE_STORAGE for numerous SoC families

Change-Id: Ief433a1d693876072779e714883438c0012ba2e0
2026-01-27 07:36:40 -05:00
Solomon Peachy
33678c6c3c s3c2440: Fix some compilation failures in the mini2440 bootloader
This whole platform has bitrotten, may be prudent to just nuke it.

Change-Id: Ia12e7ebc160484e57a74dd689d6095d22f3dbfd9
2026-01-27 07:11:32 -05:00
Solomon Peachy
b562c9d58f Fix red introduced in 33d0a3ef
Many bootloaders broke because they have only partial USB
implementations -- HAVE_USBSTACK but without HAVE_BOOTLOADER_USB_MODE...
and a pile of exceptions.

Those exceptions need to be cleaned up properly, but for now, get the
build going again by wrapping the new ack-tracking bits with the
USB_FULL_INIT define created by the above conditions.

Change-Id: I936d4989b8c8195ee30d53808f61104a4986942a
2026-01-26 22:56:47 -05:00
Solomon Peachy
89cf5b57e6 Fix yellow from 1951c17e0b on targets with USB_NONE
gui_usb_screen_run() is a do{} while(0) macro, resulting in an unused
variable warning in the "caller"

Change-Id: I4b4b00ef38decfb5cc9db0da3d81ad0c9a4207d1
2026-01-26 20:36:58 -05:00
mojyack
33d0a3efa3 usb: enter to exclusive disk mode only when required by usb config
currently, exclusive disk mode was enabled at the same time as the
usb insertion. when multiple usb configurations exist, this is not
appropriate.

manage it in the core and enable it only when necessary.

Change-Id: Iadbec05fad1d1319471233227ae0e72c12079295
2026-01-26 19:52:22 -05:00
mojyack
1951c17e0b pass event data to usb_acknowledge
add second argument to usb_acknowledge.
it can be used for more appropriate connection tracking that does not
rely on timeout in the future.

Change-Id: I8a44366b7c7a1f944524c4ba8ecd6d9673746a65
2026-01-26 19:47:09 -05:00
Aidan MacDonald
d5506dfa22 echoplayer: implement boot from debugger
Add a 'make start' target which starts Rockbox using a
debugger. This only works to load the main binary, but
makes it much faster to test changes that don't affect
plugins/codecs.

Because SDRAM isn't accessible at reset and the main
binary is usually too big to fit in SRAM, the bootloader
must be flashed first before Rockbox can be loaded in
this way.

The boot protocol involves GDB writing a check pattern
to SRAM while the CPU is held in reset. The bootloader
detects the pattern and takes a breakpoint, by which
time SDRAM is accessible; GDB can then upload a binary
ELF image (copied as a raw file, since the ELF will be
loaded using RB's ELF loader) and leave the breakpoint
to continue booting.

From there the bootloader can load the ELF binary from
memory, exactly like a normal SD card boot.

Change-Id: I4eb971b4162ea422e38660455cfa0958cefaa18d
2026-01-26 08:55:01 -05:00
Aidan MacDonald
603c5bb2be echoplayer: load Rockbox from SD card in bootloader
To avoid problems with SDMMC DMA not being able to
access all SRAMs equally, the ELF binary is loaded
at the top of SDRAM and then copied into place.

Change-Id: Icf16d02bc15605539cbe781dd27709225abca8f9
2026-01-25 19:51:56 -05:00
Aidan MacDonald
7868e45edb elf_loader: add elf_loadmem() to load file from memory
Change-Id: Ib68b0e8b610d45713a2d5480da015cc4295f2676
2026-01-25 19:51:07 -05:00
Aidan MacDonald
843322f898 elf_loader: add generic callback-based loader
Change-Id: I1dd972a585bc7c805e32c9665d13e248663ccc73
2026-01-25 19:50:12 -05:00
Aidan MacDonald
a610998ea4 firmware: add simple ELF loader for static binaries
This is a small & simple ELF loader which just copies
program segments from disk to memory. It only supports
static binaries right now.

Change-Id: I8944feb5b9dafcc5c56e12383aed25e2718ad7ea
2026-01-25 18:19:51 -05:00