rk27xx: boot Rockbox on USB wake when it can write the NAND

The bootloader starts the OF when the player is woken by plugging in
USB, because the OF was the only firmware that could give the host
write access to the internal flash. A build with FTL_ALLOW_WRITE
can do that itself, so boot Rockbox there and leave the OF to a held
key. Builds without it keep the old behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: I74af2f8c56436a3f7c9ad97d1b1638469807f0dc
This commit is contained in:
Marcin Bukat 2026-10-07 22:20:18 +02:00
parent 1669e49cd7
commit 776fe2ad9c

View file

@ -135,9 +135,13 @@ void main(void)
if ((btn & ~POWEROFF_BUTTON)) if ((btn & ~POWEROFF_BUTTON))
boot = of; boot = of;
/* if we are woken up by USB insert boot into OF */ #ifndef FTL_ALLOW_WRITE
/* if we are woken up by USB insert boot into OF: only it can give
* the host write access to the NAND
*/
if (DEV_INFO & (1<<20)) if (DEV_INFO & (1<<20))
boot = of; boot = of;
#endif
/* The OF asks for a mode before it resets itself, e.g. at the end of /* The OF asks for a mode before it resets itself, e.g. at the end of
* a firmware update, and the cell survives the reset. Rockbox never * a firmware update, and the cell survives the reset. Rockbox never