Skip to content

Commit

Permalink
Explicitly invalidate cache lines on RP2350
Browse files Browse the repository at this point in the history
Clean alone can lead to crashes.

Fixes #9746
  • Loading branch information
tannewt committed Oct 23, 2024
1 parent c606994 commit 9bda80b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ports/raspberrypi/supervisor/internal_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ static void save_psram_settings(void) {
// We're about to invalidate the XIP cache, clean it first to commit any dirty writes to PSRAM
uint8_t *maintenance_ptr = (uint8_t *)XIP_MAINTENANCE_BASE;
for (int i = 1; i < 16 * 1024; i += 8) {
maintenance_ptr[i] = 0;
// Background info: https://forums.raspberrypi.com/viewtopic.php?t=378249
maintenance_ptr[i] = 0; // Clean
maintenance_ptr[i - 1] = 0; // Explicitly invalidate
}

m1_timing = qmi_hw->m[1].timing;
Expand Down

0 comments on commit 9bda80b

Please sign in to comment.