From 776fe2ad9cb41a6fa541c92aacb1389c99319370 Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Wed, 7 Oct 2026 22:20:18 +0200 Subject: [PATCH] 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 Change-Id: I74af2f8c56436a3f7c9ad97d1b1638469807f0dc --- bootloader/rk27xx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bootloader/rk27xx.c b/bootloader/rk27xx.c index db4fd675ac..096555bfbf 100644 --- a/bootloader/rk27xx.c +++ b/bootloader/rk27xx.c @@ -135,9 +135,13 @@ void main(void) if ((btn & ~POWEROFF_BUTTON)) 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)) boot = of; +#endif /* 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