Commit graph

12004 commits

Author SHA1 Message Date
Vencislav Atanasov
e3372f495e Add a dummy nand_get_info for ipodnano3g and ipodnano4g
All non-simulator and non-hostfs targets are required to implement storage_get_info() since 04dc052a

Change-Id: I87febd12e101797d9cbbffc0e2e46efc2dace9da
2026-01-08 10:12:51 -05:00
Aidan MacDonald
e6e56ceb51 firmware: make lc_open_from_mem() optional
Define HAVE_LC_OPEN_FROM_MEM if the target implements
lc_open_from_mem(). Make HAVE_CODEC_BUFFERING depend
on this feature.

Change-Id: If5f70db58963dcdc33848b860c028841ac380ab2
2026-01-05 13:42:52 -05:00
Aidan MacDonald
3d281c2ea3 apps: cleanly disable codec buffering when not supported
Move HAVE_CODEC_BUFFERING to config.h, and disable all
related code on targets that don't support the feature,
ie. hosted targets that can't implement lc_open_from_mem().

Change-Id: I0d2a43900cd05b1a80c3cee519f8ad7b26e39fe7
2026-01-05 13:15:49 -05:00
Aidan MacDonald
3d0888875e firmware: introduce CONFIG_BINFMT
Add CONFIG_BINFMT to select the binary format used for
plugins/codecs and define two options for the existing
implementations (native ".rock" format or dlopen-based).

Split the load_code.h header into two separate headers
to make it look less messy.

Change-Id: Ibd66773160df35a8c6f29a617d12c961bdabf317
2026-01-05 13:14:30 -05:00
Aidan MacDonald
6a8989f347 echoplayer: enable SD card using sdmmc_host
Enable pullups on SDMMC CMD/DATx lines and set output
speed to medium. Using HIGH and VERYHIGH speeds seems
to cause data corruption, with frequent CRC failures.

Change-Id: I732d19e03a2a857453755b68b6749497eafaef70
2026-01-04 10:27:15 -05:00
Aidan MacDonald
141b4a223f stm32h7: implement sdmmc_host-based SDMMC controller driver
Change-Id: I26c47c630ea364de043a224b549d7867fb1e5794
2026-01-04 09:31:05 -05:00
Aidan MacDonald
38db211a48 stm32h743: add SDMMC registers and RCC_AHB3RSTR register
Change-Id: I134a10e4b9116b85ec4327cc76c539c8340973cf
2026-01-04 09:31:05 -05:00
Aidan MacDonald
ed1f34af75 system: add membarrier() function for compiler memory barrier
Change-Id: I27be9b635bdabee523e56dd0c2245812cb7647eb
2026-01-04 09:08:22 -05:00
Aidan MacDonald
87bf6b4ebb firmware: add sdmmc_host storage driver
sdmmc_host is a portable driver for targets with SD/MMC
storage. It handles all the logic needed to initialize
and access SD/MMC devices which is common to all targets.

Targets only need to implement functions to issue SD/MMC
commands, manage clocks & power, and managing the insert
state of the card (if it is hotswappable). This vastly
reduces the work needed to get a new SD/MMC based target
up & running.

At present it's only written for and tested with SD cards,
as I don't have access to an MMC-based target to test on.

Change-Id: I6a0d7747113c11a3697ae20cbb551bef8bfd1292
2026-01-04 09:07:06 -05:00
mojyack
e3bb80384d usb: do not call usb_core_do_set_config(0) inside bus reset isr
Change-Id: Ic06719ef92cd1fae42c7155ab72029466826a59b
2026-01-03 19:58:38 -05:00
mojyack
6db1e937e9 usb: set config to 0 on bus reset and exit
Change-Id: I4ee0e33f031388d17b30bbe591fe9b7d6386e940
2026-01-03 19:58:07 -05:00
mojyack
03fbd2784d usb: preparation to support multiple usb configs
- existing class drivers are placed to config 1
- drivers_connected==true is replaced with usb_config!=0
- supports config transition between nonzero configs
- STALL if request set_config was invalid

Change-Id: Ia775ae2dcb7d0cc08d2f3ee5ca41683837b04259
2026-01-03 19:57:33 -05:00
Solomon Peachy
ef47ffe250 Fix the last of the issues introduced in 350a2250b
Change-Id: I4b58f5d9d1c4649080826a9cf1b438e13ed7ce81
2026-01-03 14:42:54 -05:00
Solomon Peachy
5bbd4d63f0 Fix build errors+warnings introduced in 350a2250b1
Change-Id: Ia5f2079ccc99da30e0058b0d9ce5bb8369201804
2026-01-03 13:59:53 -05:00
mojyack
350a2250b1 usb: implement endpoint allocation
this commit has following changes:
- introduce `usb_drv_ep_spec` table to udc drivers, which represents
  endpoint characteristics.
- introduce 'ep_allocs' table to class drivers, which represents what
  endpoint type does the class driver want.
- implement endpoint matching logic to usb core.

this is a required step to implement usb config switching, because we
need to create config descriptors without actually initializing endpoints.

Change-Id: I11c324cd35189ab636744488f6259d0cdb2179f0
2026-01-03 13:23:53 -05:00
Aidan MacDonald
20d31c114a arm: use optimized find_first_set_bit() on Cortex-M
Use the optimized version based on __buitlin_ctz() which GCC
will compile to two instructions (rbit, ctz) on Cortex-M4/M7;
faster and smaller than the handcoded assembly version.

Change-Id: I33f69ff829b048f1e53fc7ead1bd6ac3c5bd7a4c
2026-01-01 11:25:43 -05:00
Aidan MacDonald
4ceb9e22d6 echoplayer: drive LCD parallel bus using STM32 LTDC
This is much, much faster than using SPI and is able to
offload the CPU completely.

Change-Id: Ia4c0289775296fe41d594ba849bd057e8482306e
2026-01-01 11:16:23 -05:00
Aidan MacDonald
e98dc7936c stm32h743: add LCD-TFT controller registers
Change-Id: Icefbe3c7f10a38c424105586b0bccf6941972cb1
2026-01-01 11:16:23 -05:00
Aidan MacDonald
801f386d9d stm32h743: add AXI GPV registers
Change-Id: Ie048e60701405e9aeafa6aa066cd88b3354e11c2
2026-01-01 11:16:23 -05:00
Aidan MacDonald
ddb2dfa267 stm32h7: simplify bootloader linker scripts
Remove ifdefs for load to RAM, it won't be usable once
the bootloader is able to load Rockbox.

Change-Id: Ia0c9261d2073261f4089ce1804d7a3483c959d6e
2026-01-01 11:15:14 -05:00
Aidan MacDonald
5137ef49e3 stm32h7: support setting bus frequency in SPI driver
Change-Id: I71edf28fdc24d8a00d27aa727815f99e788b675a
2026-01-01 09:17:17 -05:00
Aidan MacDonald
a4b0af2a44 stm32h7: add function to get frequency of a clock
Change-Id: Ice60bc0e443a134ebb8ec03015fef98991ef9b05
2026-01-01 09:17:17 -05:00
Aidan MacDonald
a9b75fc4c4 stm32h7: support clock enable/disable in SPI driver
Change-Id: Id4baa340e1b67fb265628add9191acb08e3a0615
2026-01-01 09:17:17 -05:00
Aidan MacDonald
ddb3bb354c stm32h7: add clock enable/disable callbacks
Change-Id: I4c135ba9cbed2c8e607c5f191bb9d82638f9b6b3
2026-01-01 09:15:56 -05:00
Aidan MacDonald
23448a13d1 stm32h7: refactor clock init to target-specific callback
Given the myriad of clocking options the STM32H7 family
provides, it is easiest to let targets simply implement
what they need.

Change-Id: I9cceed40a2d638998e8b583651f73557d2ffbd46
2026-01-01 09:15:56 -05:00
Aidan MacDonald
37b90baa5f stm32h7: handle SPI transfers via interrupts
Change-Id: I6e60f4222f4d99019e72377de7c3b689a77ac548
2025-12-31 22:03:51 -05:00
Aidan MacDonald
7eed19dbaa stm32h743: add NVIC IRQ numbers
Change-Id: If50655268180f38ed4114c35779d32f25a3631b5
2025-12-31 22:03:51 -05:00
Aidan MacDonald
b0b4c6bf2f stm32h743: split SPI IRQ handlers
No sense in pessimizing this; each SPI instance has a dedicated
interrupt line.

Change-Id: I2243626c960873738e5d9cf4e60d2f9e635514e7
2025-12-31 22:03:51 -05:00
Aidan MacDonald
8d279aa48d stm32h7: simplify generic SPI driver
Supporting large transfers (>64k) isn't really needed;
the main use case right now is interfacing with an LCD
controller.

Change-Id: I901e5ddb1b4efa9aa650b3e5074537ba785c6d41
2025-12-31 21:15:43 -05:00
Aidan MacDonald
025f3def04 stm32h743: make debugger attach more reliable
Add an optional sequence in the startup code to disable clock
gating when the CPU goes to sleep. Normally the D1 and D3 domain
clocks can be automatically gated when the CPU is asleep, and
because the debug infrastructure is clocked from these domains,
the debugger cannot attach when those clocks are stopped.

Setting some bits in DBGMCU_CR prevents this problem, but will
increase power consumption, hence it isn't enabled by default.

Change-Id: Iba87750371a493adf72655aab86a908ef2702cef
2025-12-31 08:10:20 -05:00
Aidan MacDonald
4b9b2c510e stm32h743: add DBGMCU registers
Change-Id: I47aecaad9a6c0fc0f8c4d2807585909b4bb5d7d6
2025-12-31 07:30:00 -05:00
Aidan MacDonald
8514c1c9a8 echoplayer: convert STM32H7 register access to RegGen
Change-Id: Ie16d7340a9f047e44cf510bc776030570edb3966
2025-12-31 07:30:00 -05:00
Aidan MacDonald
d8b0bc5797 firmware: convert ARM Cortex-M register access to RegGen
Change-Id: I225fb53da84946876d6c4af08af5f80197e71e95
2025-12-31 07:30:00 -05:00
Mauricio Garrido
0b3e0d1432 3ds: Small changes to port sources.
This commit does the following changes:

- Replace buffered io implementation with a simpler, lighter, slightly faster version.
- Turn off both screens when backlight goes off.
- Small change to enable plugins in the folling commit (s).

Change-Id: I45df30be037c3a1686bd85c16c87bcd248db456f
2025-12-30 16:30:34 -05:00
Aidan MacDonald
44afcc8cbe firmware: add build rules for RegGen-generated headers
Change-Id: I86ff1a39aec1ee428abd6464483ae3732fdf9196
2025-12-30 13:53:48 -05:00
Aidan MacDonald
a8d792c248 firmware: add RegGen API header
Change-Id: Ifb79416f91a40d0a6538ba0b4a3c7b0496543a5f
2025-12-30 13:53:48 -05:00
Aidan MacDonald
1064aa8dab firmware: add RegGen description for Cortex-M
Change-Id: Iec8c8f1f962653cfa27c50b2bac8b2092eb7afce
2025-12-30 13:53:48 -05:00
Aidan MacDonald
e7b139b06a firmware: add RegGen description for STM32H743
Change-Id: I084c54bd1c2c2974e5fd0b1bfea68697b2b394ba
2025-12-30 13:53:48 -05:00
Sebastian Leonhardt
6552554939 Creative ZEN: split ZEN V keymaps off from other ZEN targets
The ZEN V target is the only one which has volume buttons,
but lacks the menu and shortcut buttons.
IMO an independant keymap will make maintenance easier.

Change-Id: Ide79fab629b13eae94946561d99052e570c0e4f2
2025-12-29 23:20:06 +01:00
Aidan MacDonald
cb9094dabb arm: fix start_thread() on Cortex-M targets
The layout of 'struct regs' is a bit different on Cortex-M
and start_thread() wasn't updated to match; it was loading
'sp' from the wrong offset.

Change-Id: I57dbef26809821d411dc86e2066a2f53e78a3f2d
2025-12-29 13:04:54 -05:00
Petr Mikhalicin
6f7d70797e plugin api: Add audio_pre_ff_rewind to plugin's API
According to wps code audio_pre_ff_rewind function should be called
before any rewinding. It stops playback and automatically resumes it
after audio_ff_rewind call

So, let's add audio_pre_ff_rewind to plugin's API

Lua scipts were tested:
```lua
-- has issue with rewinding
rb.audio("ff_rewind", 0)
```

```lua
-- no issue with rewinding
rb.audio("pre_ff_rewind")
rb.audio("ff_rewind", 0)
```

Change-Id: I2ad6b9c396760b2086bc0a28633a1c80c3512739
2025-12-29 19:58:26 +05:00
Marc Aarts
1183b1ab1b Rockbox for the HiBy R3 Pro II/R1
Original author Melissa Autumn (https://codeberg.org/oopsallnaps/rockbox-hibyos) with contributions from Marc Aarts.

Adaptation to Rockbox standards by Marc Aarts

Change-Id: I09e5af7ba0a75c648e4b9fd424badc2d3665c943
2025-12-27 15:44:54 -05:00
William Wilgus
44a5163061 firmware: fix misdefinition of QUEUE_GET_THREAD macro #2?
Broke the sim, just above it has..

struct queue_sender_list
{
    /* If non-NULL, there is a thread waiting for the corresponding event */
    /* Must be statically allocated to put in non-cached ram. */
    struct thread_entry *senders[QUEUE_LENGTH]; /* message->thread map */
    struct __wait_queue list;                   /* list of senders in map */
    /* Send info for last message dequeued or NULL if replied or not sent */
    struct thread_entry * volatile curr_sender;
    struct blocker blocker;
};

Change-Id: Ifc7a5fe92ebe5f06c0dc5655ce9725752e606381
2025-12-26 09:24:11 -05:00
Aidan MacDonald
28fa9ca760 firmware: fat: fix sector_t passed to 64-bit format strings
sector_t is still 32-bit on most targets, resulting in compile
warnings on debug builds when used with an %llu/%llx format.
Fix by always casting the sector to uint64_t.

Change-Id: I5afc4a0ae170981c304274806e00ac07be232cd8
2025-12-24 09:30:47 -05:00
Aidan MacDonald
d21d8f49fc firmware: fix misdefinition of QUEUE_GET_THREAD macro
This tries to access 'struct event_queue->send', but that
is only available if HAVE_EXTENDED_MESSAGING_AND_NAME is set.
This is not defined for bootloaders; this is a problem when
trying to build a bootloader with debugging enabled, because
the misdefined macro is used in some KERNEL_ASSERTs that get
compiled out on non-debug builds.

Change-Id: I334eedcda1ee7047c8dddcb7fa0c9717156f2a0a
2025-12-24 09:30:18 -05:00
Christian Soffke
eb49b82d33 backlight-sw-fading: FS#13717 fix brightness overshoot
Change-Id: If4cb0a1993c93e6ba524cbed8690bb6c1664908e
2025-12-19 08:20:07 +01:00
Dana Conrad
75df18f2c1 FS#13712: ErosQ: move all of sound hw init to audiohw_init()
Fixes voice not working after booting but before starting music playback
while line-out is plugged in. Doesn't seem to break anything on hw1 or
hw4.

Change-Id: I7b830adeeceae621177c94353e4814aa6ad0e1ec
2025-12-12 22:44:22 -05:00
Aidan MacDonald
fe11a04579 mips: show version info on exception panic screen
Change-Id: Iff315869e9190ce7d68c672c6cc78cb1fc301264
2025-12-11 15:48:50 +00:00
William Wilgus
8a773fb29f lua -- remove strtol and strtoul replace with rb->strtol and rb->strtoul
Change-Id: Ib7ba358b6488b946404c0c4cd8773e948810a7f7
2025-12-06 18:11:13 -05:00
Solomon Peachy
dada036b10 configure: Partial revert of 6c6bdbf60e
Turns out I compile-tested stale trees instead of the broken change

Net result is just the simpler MIPS revision (32/64/"classic") lookup rather than
the sub-revision (eg mips32r2 etc).

Change-Id: Ideebe522d29132f00f3769222f3846000b3a89fd
2025-12-06 15:54:43 -05:00