-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add support for using XIP cache as SRAM #2932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 42 commits
b8f699f
6dc06e6
727cabd
3a83dc7
4b1a3ec
ae97a22
3811e67
a20f86a
6bd9e5b
2bf8555
fe2d56b
1bd7089
72adb67
e47fe09
9c0ed0c
e44bdea
dc3a2e8
8b9d9ec
91c3a9a
614f7f0
da23cf4
780c05e
2e7ca67
4180427
c122bf7
ea8320b
ad35ad8
8e3aca5
737e8ba
ae5122a
220086e
d801abf
c88dd9b
31fc968
b8631a7
d13ddb4
4428d39
d7b4f6d
394d9ad
b74fd32
6a92324
67325b9
3af1971
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -237,6 +237,7 @@ string_flag( | |
| "no_flash", | ||
| "copy_to_ram", | ||
| "blocked_ram", | ||
| "xip_ram", | ||
| ], | ||
| ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| INCLUDE "memmap_xip_ram.incl" | ||
|
|
||
| /* BEGIN_MEMMAP_INCLUDE_TREE | ||
| * This is the default include tree for this file (generated by tools/memmap_annotate.py | ||
| * and tools/memmap_include_tree.py). To override any files in this tree, see the | ||
| * pico_add_linker_script_override_path CMake function under pico_standard_link. | ||
| * | ||
| * memmap_xip_ram.ld rp2350/pico_platform | ||
| * └── memmap_xip_ram.incl rp2_common/pico_standard_link | ||
| * ├── set_memory_locations.incl rp2_common/pico_standard_link | ||
| * ├── memory_ram.incl rp2_common/pico_standard_link | ||
| * ├── memory_scratch.incl rp2_common/pico_standard_link | ||
| * ├── memory_generated.incl rp2_common/pico_standard_link | ||
| * ├── memory_extra.incl rp2_common/pico_standard_link | ||
| * ├── memory_aliases_xip_ram_only.incl rp2_common/pico_standard_link | ||
| * └── sections_no_flash.incl rp2_common/pico_standard_link | ||
| * ├── sections_no_flash_text.incl rp2_common/pico_standard_link | ||
| * │ ├── section_no_flash_text.incl rp2_common/pico_standard_link | ||
| * │ ├── section_no_flash_rodata.incl rp2_common/pico_standard_link | ||
| * │ ├── sections_arm_ex.incl rp2_common/pico_standard_link | ||
| * │ └── section_binary_info.incl rp2_common/pico_standard_link | ||
| * ├── section_generated_post_text.incl rp2_common/pico_standard_link | ||
| * ├── section_extra_post_text.incl rp2_common/pico_standard_link | ||
| * ├── sections_no_flash_data.incl rp2_common/pico_standard_link | ||
| * │ ├── section_no_flash_data.incl rp2_common/pico_standard_link | ||
| * │ ├── section_uninitialized_data.incl rp2_common/pico_standard_link | ||
| * │ ├── section_tls.incl rp2_common/pico_standard_link | ||
| * │ └── section_persistent_data.incl rp2_common/pico_standard_link | ||
| * ├── section_generated_post_data.incl rp2_common/pico_standard_link | ||
| * ├── section_extra_post_data.incl rp2_common/pico_standard_link | ||
| * ├── section_heap.incl rp2_common/pico_standard_link | ||
| * ├── sections_scratch.incl rp2_common/pico_standard_link | ||
| * ├── section_generated_post_scratch.incl rp2_common/pico_standard_link | ||
| * ├── section_extra_post_scratch.incl rp2_common/pico_standard_link | ||
| * ├── sections_stack.incl rp2_common/pico_standard_link | ||
| * ├── section_end.incl rp2_common/pico_standard_link | ||
| * ├── section_generated_post_end.incl rp2_common/pico_standard_link | ||
| * ├── section_extra_post_end.incl rp2_common/pico_standard_link | ||
| * ├── section_platform_end.incl rp2350/pico_platform | ||
| * ├── section_generated_post_platform_end.incl rp2_common/pico_standard_link | ||
| * └── section_extra_post_platform_end.incl rp2_common/pico_standard_link | ||
| * END_MEMMAP_INCLUDE_TREE */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,62 +10,102 @@ | |
| #include "pico.h" | ||
| #include "hardware/sync.h" | ||
|
|
||
| // PICO_CONFIG: PICO_USE_SW_SPIN_LOCKS, Use software implementation for spin locks, type=bool, default=1 on RP2350 due to errata, group=hardware_sync | ||
| // PICO_CONFIG: PICO_USE_SW_SPIN_LOCKS, Use software implementation for spin locks, type=bool, default=1 on RP2350 due to errata E2, group=hardware_sync | ||
| #ifndef PICO_USE_SW_SPIN_LOCKS | ||
| #if PICO_RP2350 | ||
| #define PICO_USE_SW_SPIN_LOCKS 1 | ||
| #define PICO_USE_SW_SPIN_LOCKS !PICO_XIP_RAM | ||
| #endif | ||
| #endif | ||
|
|
||
| // PICO_CONFIG: PICO_SPINLOCK_ID_IRQ, Spinlock ID for IRQ protection, min=0, max=31, default=9, group=hardware_sync | ||
| #ifndef PICO_SPINLOCK_ID_IRQ | ||
| #if PICO_RP2350 && !PICO_USE_SW_SPIN_LOCKS | ||
| #define PICO_SPINLOCK_ID_IRQ 5 | ||
| #else | ||
| #define PICO_SPINLOCK_ID_IRQ 9 | ||
| #endif | ||
| #endif | ||
|
|
||
| // PICO_CONFIG: PICO_SPINLOCK_ID_TIMER, Spinlock ID for Timer protection, min=0, max=31, default=10, group=hardware_sync | ||
| #ifndef PICO_SPINLOCK_ID_TIMER | ||
| #if PICO_RP2350 && !PICO_USE_SW_SPIN_LOCKS | ||
| #define PICO_SPINLOCK_ID_TIMER 6 | ||
| #else | ||
| #define PICO_SPINLOCK_ID_TIMER 10 | ||
| #endif | ||
| #endif | ||
|
|
||
| // PICO_CONFIG: PICO_SPINLOCK_ID_HARDWARE_CLAIM, Spinlock ID for Hardware claim protection, min=0, max=31, default=11, group=hardware_sync | ||
| #ifndef PICO_SPINLOCK_ID_HARDWARE_CLAIM | ||
| #if PICO_RP2350 && !PICO_USE_SW_SPIN_LOCKS | ||
| #define PICO_SPINLOCK_ID_HARDWARE_CLAIM 7 | ||
| #else | ||
| #define PICO_SPINLOCK_ID_HARDWARE_CLAIM 11 | ||
| #endif | ||
| #endif | ||
|
|
||
| // PICO_CONFIG: PICO_SPINLOCK_ID_RAND, Spinlock ID for Random Number Generator, min=0, max=31, default=12, group=hardware_sync | ||
| #ifndef PICO_SPINLOCK_ID_RAND | ||
| #if PICO_RP2350 && !PICO_USE_SW_SPIN_LOCKS | ||
| #define PICO_SPINLOCK_ID_RAND 10 | ||
| #else | ||
| #define PICO_SPINLOCK_ID_RAND 12 | ||
| #endif | ||
| #endif | ||
|
|
||
| // PICO_CONFIG: PICO_SPINLOCK_ID_ATOMIC, Spinlock ID for atomics, min=0, max=31, default=13, group=hardware_sync | ||
| #ifndef PICO_SPINLOCK_ID_ATOMIC | ||
| #if PICO_RP2350 && !PICO_USE_SW_SPIN_LOCKS | ||
| #define PICO_SPINLOCK_ID_ATOMIC 11 | ||
| #else | ||
| #define PICO_SPINLOCK_ID_ATOMIC 13 | ||
| #endif | ||
| #endif | ||
|
lurch marked this conversation as resolved.
|
||
|
|
||
| // PICO_CONFIG: PICO_SPINLOCK_ID_OS1, First Spinlock ID reserved for use by low level OS style software, min=0, max=31, default=14, group=hardware_sync | ||
| #ifndef PICO_SPINLOCK_ID_OS1 | ||
| #if PICO_RP2350 && !PICO_USE_SW_SPIN_LOCKS | ||
| #define PICO_SPINLOCK_ID_OS1 18 | ||
| #else | ||
| #define PICO_SPINLOCK_ID_OS1 14 | ||
| #endif | ||
| #endif | ||
|
Comment on lines
+67
to
+72
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the PICO_SPINLOCK_IDs defined before this one, the newly-added
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #2645
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aha, thanks! 😆 |
||
|
|
||
| // PICO_CONFIG: PICO_SPINLOCK_ID_OS2, Second Spinlock ID reserved for use by low level OS style software, min=0, max=31, default=15, group=hardware_sync | ||
| #ifndef PICO_SPINLOCK_ID_OS2 | ||
| #if PICO_RP2350 && !PICO_USE_SW_SPIN_LOCKS | ||
| #define PICO_SPINLOCK_ID_OS2 19 | ||
| #else | ||
| #define PICO_SPINLOCK_ID_OS2 15 | ||
| #endif | ||
| #endif | ||
|
|
||
| // PICO_CONFIG: PICO_SPINLOCK_ID_STRIPED_FIRST, Lowest Spinlock ID in the 'striped' range, min=0, max=31, default=16, group=hardware_sync | ||
| #ifndef PICO_SPINLOCK_ID_STRIPED_FIRST | ||
| #if PICO_RP2350 && !PICO_USE_SW_SPIN_LOCKS | ||
| #define PICO_SPINLOCK_ID_STRIPED_FIRST 20 | ||
| #else | ||
| #define PICO_SPINLOCK_ID_STRIPED_FIRST 16 | ||
| #endif | ||
| #endif | ||
|
|
||
| // PICO_CONFIG: PICO_SPINLOCK_ID_STRIPED_LAST, Highest Spinlock ID in the 'striped' range, min=0, max=31, default=23, group=hardware_sync | ||
| #ifndef PICO_SPINLOCK_ID_STRIPED_LAST | ||
| #if PICO_RP2350 && !PICO_USE_SW_SPIN_LOCKS | ||
| #define PICO_SPINLOCK_ID_STRIPED_LAST 25 | ||
| #else | ||
| #define PICO_SPINLOCK_ID_STRIPED_LAST 23 | ||
| #endif | ||
| #endif | ||
|
|
||
| // PICO_CONFIG: PICO_SPINLOCK_ID_CLAIM_FREE_FIRST, Lowest Spinlock ID in the 'claim free' range, min=0, max=31, default=24, group=hardware_sync | ||
| #ifndef PICO_SPINLOCK_ID_CLAIM_FREE_FIRST | ||
| #if PICO_RP2350 && !PICO_USE_SW_SPIN_LOCKS | ||
| #define PICO_SPINLOCK_ID_CLAIM_FREE_FIRST 26 | ||
| #else | ||
| #define PICO_SPINLOCK_ID_CLAIM_FREE_FIRST 24 | ||
| #endif | ||
| #endif | ||
|
|
||
| #ifdef PICO_SPINLOCK_ID_CLAIM_FREE_END | ||
| #warning PICO_SPINLOCK_ID_CLAIM_FREE_END has been renamed to PICO_SPINLOCK_ID_CLAIM_FREE_LAST | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.