rockbox/firmware/target/arm/rk27xx
Marcin Bukat c3a62cee96 rk27xx: pass the NAND bootloader's handoff words to the OF
Before it jumps to an image, the rk27xx NAND bootloader writes three
words at the address in RKW header field 0x14: a magic, its version
and which copy of the image it loaded. The original firmware never
initialises them: it reports the version over USB and counts its own
reboots in the third word, and once the count reaches 5 it reboots
into a mode the NAND bootloader will not boot. When our bootloader
started the OF, nothing wrote them, so the OF ran with whatever was
left in DRAM.

Field 0x14 of our own images held a constant taken from some other
image. Point it at the last 12 bytes of DRAM, which nothing uses
before our bootloader runs. load_rkw() in the bootloader now reads
the words there before loading an image, and writes them at the
address in the loaded image's header when that lies between the
image and the bootloader. Started over USB, it passes version 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: Ife1d63e361a780c28a9f0626d110552b98bb6b7f
2026-10-07 18:09:15 +02:00
..
hm60x chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
hm801 chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
ihifi chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
ihifi2 chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
ma chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
rk27generic rk27xx: fix busy-wait asm that modifies an input-only operand 2026-09-28 16:22:13 +02:00
ypcp3 YP-CP3: Si4703 FM radio 2026-09-29 09:47:51 +02:00
adc-rk27xx.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
adc-target.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
app.lds rk27xx: rename 'start' to '__start' 2020-07-15 14:18:09 -04:00
ata-nand-rk27xx.c rk27xx: add the Scheme A FTL 2026-10-01 12:15:25 +02:00
audio-rk27xx.c rk27xx: recording over I2S and HDMA channel 1 2026-09-29 09:50:20 +02:00
backlight-rk27xx.c New target: Samsung YP-CP3 (rk27xx) 2026-09-29 08:53:27 +02:00
backlight-target.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
boot.lds rk27xx: rename 'start' to '__start' 2020-07-15 14:18:09 -04:00
crt0.S misc: respect standard __ASSEMBLER__ define in CPU headers 2026-03-05 21:13:50 +00:00
debug-rk27xx.c New target: Samsung YP-CP3 (rk27xx) 2026-09-29 08:53:27 +02:00
flash-rk27xx.c rk27xx: leave the NAND program running until the next access 2026-10-01 23:47:51 +02:00
flash-rk27xx.h rk27xx: leave the NAND program running until the next access 2026-10-01 23:47:51 +02:00
ftl-probe-rk27xx.c rk27xx: add a finder for the NAND's FTL scheme 2026-10-01 12:15:25 +02:00
ftl-probe-rk27xx.h rk27xx: add a finder for the NAND's FTL scheme 2026-10-01 12:15:25 +02:00
ftl-rk27xx.c rk27xx: leave the NAND program running until the next access 2026-10-01 23:47:51 +02:00
ftl-scheme-a.c rk27xx: add the Scheme A FTL 2026-10-01 12:15:25 +02:00
ftl-scheme-a.h rk27xx: add the Scheme A FTL 2026-10-01 12:15:25 +02:00
ftl-scheme-b.c rk27xx: add the Scheme B flash translation layer 2026-10-01 12:15:25 +02:00
ftl-scheme-b.h rk27xx: add the Scheme B flash translation layer 2026-10-01 12:15:25 +02:00
ftl-target.h rk27xx: add the Scheme A FTL 2026-10-01 12:15:25 +02:00
i2c-rk27xx.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
kernel-rk27xx.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-hifiman.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcdif-rk27xx.c rk27xx: keep the LCD bus timing at the boosted clock 2026-10-02 10:30:58 +02:00
lcdif-rk27xx.h rk27xx: keep the LCD bus timing at the boosted clock 2026-10-02 10:30:58 +02:00
nand-rk27xx.c rk27xx: set the NAND bus timing from the access time 2026-10-01 23:47:41 +02:00
nand-target.h rk27xx: program both planes of a NAND page at once 2026-10-01 21:36:03 +02:00
pcm-rk27xx.c YP-CP3: make the WM8750 the I2S master 2026-10-05 22:35:12 +02:00
rkw-loader.c rk27xx: pass the NAND bootloader's handoff words to the OF 2026-10-07 18:09:15 +02:00
rolo_restart.S
sd-rk27xx.c rk27xx: don't switch SD cards to high-speed mode 2026-10-01 20:18:10 +02:00
spfd5420a.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
system-rk27xx.c rk27xx: no whole-cache invalidate at run time 2026-10-07 08:20:44 +02:00
system-target.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
timer-rk27xx.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb-drv-rk27xx.c rk27xx: re-enable the UDC interrupt at every connect 2026-10-01 21:54:02 +02:00
usb-rk27xx.c rk27xx: re-enable the UDC interrupt at every connect 2026-10-01 21:54:02 +02:00