aboutsummaryrefslogtreecommitdiffstats
path: root/src/rp2040/bootrom.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-07-04 11:40:45 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-07-04 12:45:27 -0400
commitf2b4d353d859e0fc75a13b53050812516b06302c (patch)
tree5e7648b175c8f637dfdb3fcee42d4086f730e535 /src/rp2040/bootrom.c
parentba958468b7a98e3a61bc0e5cbe30686abe6e16aa (diff)
downloadkutter-f2b4d353d859e0fc75a13b53050812516b06302c.tar.gz
kutter-f2b4d353d859e0fc75a13b53050812516b06302c.tar.xz
kutter-f2b4d353d859e0fc75a13b53050812516b06302c.zip
rp2040: Add _ramfunc macro to internal.h and use in bootrom.c and chipid.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/rp2040/bootrom.c')
-rw-r--r--src/rp2040/bootrom.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rp2040/bootrom.c b/src/rp2040/bootrom.c
index b0cfeefb..99e60f2d 100644
--- a/src/rp2040/bootrom.c
+++ b/src/rp2040/bootrom.c
@@ -7,15 +7,15 @@
#include <stdint.h> // uint16_t, uint32_t, uintptr_t
#include <string.h> // memcpy
#include "compiler.h" // noinline, __section
+#include "internal.h" // _ramfunc
#define ROM_TABLE_CODE(c1, c2) ((c1) | ((c2) << 8))
// All functions in here need to be RAM-resident, as we may need
// to (especially for the flash functions) call while the XIP layer
// is unavailable.
-#define noinline_ram noinline __section(".ramfunc.read_chip_id")
-static void * noinline_ram
+static void * _ramfunc
rom_func_lookup(uint32_t code)
{
// Table and lookup function are provided by the BOOTROM
@@ -25,7 +25,7 @@ rom_func_lookup(uint32_t code)
return fn(table, code);
}
-void noinline_ram
+void _ramfunc
reset_to_usb_boot(uint32_t gpio_activity_pin_mask
, uint32_t disable_interface_mask)
{
@@ -33,21 +33,21 @@ reset_to_usb_boot(uint32_t gpio_activity_pin_mask
fn(gpio_activity_pin_mask, disable_interface_mask);
}
-void noinline_ram
+void _ramfunc
connect_internal_flash(void)
{
void (*fn)(void) = rom_func_lookup(ROM_TABLE_CODE('I', 'F'));
fn();
}
-void noinline_ram
+void _ramfunc
flash_exit_xip(void)
{
void (*fn)(void) = rom_func_lookup(ROM_TABLE_CODE('E', 'X'));
fn();
}
-void noinline_ram
+void _ramfunc
flash_flush_cache(void)
{
void (*fn)(void) = rom_func_lookup(ROM_TABLE_CODE('F', 'C'));