|
11 | 11 |
|
12 | 12 | #include "hardware/regs/addressmap.h"
|
13 | 13 | #include "hardware/regs/sio.h"
|
| 14 | +#include "hardware/regs/xip.h" |
14 | 15 | #include "pico/binary_info/defs.h"
|
15 | 16 | #include "boot/picobin.h"
|
16 | 17 | #include "pico/bootrom.h"
|
@@ -457,6 +458,22 @@ hold_non_core0_in_bootrom:
|
457 | 458 | b _enter_vtable_in_r0
|
458 | 459 | 1:
|
459 | 460 |
|
| 461 | +#if PICO_RP2040 && PICO_NO_FLASH |
| 462 | + #if PICO_USE_XIP_CACHE_AS_RAM |
| 463 | + // Disable the XIP cache making its 16k of XIP RAM available for storage |
| 464 | +_disable_xip_cache: |
| 465 | + ldr r0, =(REG_ALIAS_CLR_BITS + XIP_CTRL_BASE + XIP_CTRL_OFFSET) |
| 466 | + movs r1, #XIP_CTRL_EN_BITS |
| 467 | + str r1, [r0] |
| 468 | + #else |
| 469 | + // Enable the XIP cache (hardware default) |
| 470 | +_enable_xip_cache: |
| 471 | + ldr r0, =(REG_ALIAS_SET_BITS + XIP_CTRL_BASE + XIP_CTRL_OFFSET) |
| 472 | + movs r1, #XIP_CTRL_EN_BITS |
| 473 | + str r1, [r0] |
| 474 | + #endif |
| 475 | +#endif |
| 476 | + |
460 | 477 | #if !PICO_RP2040 && PICO_EMBED_XIP_SETUP && !PICO_NO_FLASH
|
461 | 478 | // Execute boot2 on the core 0 stack (it also gets copied into BOOTRAM due
|
462 | 479 | // to inclusion in the data copy table below). Note the reference
|
@@ -552,6 +569,12 @@ data_cpy_table:
|
552 | 569 | .word __data_start__
|
553 | 570 | .word __data_end__
|
554 | 571 |
|
| 572 | +#if PICO_RP2040 && PICO_USE_XIP_CACHE_AS_RAM |
| 573 | +.word __xip_ram_text_source__ |
| 574 | +.word __xip_ram_text_start__ |
| 575 | +.word __xip_ram_text_end__ |
| 576 | +#endif |
| 577 | + |
555 | 578 | .word __scratch_x_source__
|
556 | 579 | .word __scratch_x_start__
|
557 | 580 | .word __scratch_x_end__
|
|
0 commit comments