From 4e18dffaa0a2ebb315187f9b0fe95f74f44c4929 Mon Sep 17 00:00:00 2001 From: Polprzewodnikowy Date: Sun, 11 Sep 2022 21:22:36 +0200 Subject: [PATCH] inst cache invalidate --- sw/bootloader/src/io.c | 8 ++++++-- sw/bootloader/src/io.h | 1 + sw/bootloader/src/menu.c | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sw/bootloader/src/io.c b/sw/bootloader/src/io.c index 0be6b9d..aff1879 100644 --- a/sw/bootloader/src/io.c +++ b/sw/bootloader/src/io.c @@ -65,9 +65,13 @@ static void cache_operation (uint8_t operation, uint8_t line_size, void *address } void cache_data_hit_invalidate (void *address, size_t length) { - cache_operation (0x11, 16, address, length); + cache_operation(0x11, 16, address, length); } void cache_data_hit_writeback (void *address, size_t length) { - cache_operation (0x19, 16, address, length); + cache_operation(0x19, 16, address, length); +} + +void cache_inst_hit_invalidate (void *address, size_t length) { + cache_operation(0x10, 32, address, length); } diff --git a/sw/bootloader/src/io.h b/sw/bootloader/src/io.h index b6ea2db..c3e11e5 100644 --- a/sw/bootloader/src/io.h +++ b/sw/bootloader/src/io.h @@ -288,6 +288,7 @@ uint32_t si_io_read (io32_t *address); void si_io_write (io32_t *address, uint32_t value); void cache_data_hit_invalidate (void *address, size_t length); void cache_data_hit_writeback (void *address, size_t length); +void cache_inst_hit_invalidate (void *address, size_t length); #endif diff --git a/sw/bootloader/src/menu.c b/sw/bootloader/src/menu.c index 8f9b71d..a9c43d5 100644 --- a/sw/bootloader/src/menu.c +++ b/sw/bootloader/src/menu.c @@ -1,6 +1,7 @@ #include "error.h" #include "fatfs/ff.h" #include "init.h" +#include "io.h" #include "menu.h" @@ -66,6 +67,8 @@ void menu_load_and_run (void) { FF_CHECK(f_close(&fil), "Couldn't close menu file"); FF_CHECK(f_unmount(""), "Couldn't unmount drive"); + cache_inst_hit_invalidate(menu, size); + deinit(); menu();