]> www.infradead.org Git - users/borneoa/openocd-next.git/commitdiff
flash/nor/rp2040: RP2350 A1 changes
authorgraham sanderson <graham.sanderson@raspberrypi.com>
Sun, 24 Mar 2024 23:33:24 +0000 (18:33 -0500)
committerTomas Vanek <vanekt@fbl.cz>
Fri, 25 Apr 2025 09:26:27 +0000 (09:26 +0000)
TV: cortex_m.c changes removed.

Change-Id: I85830f2d64f8afb86690737f9ae70dde5e6143e1
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: graham sanderson <graham.sanderson@raspberrypi.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8442
Tested-by: jenkins
src/flash/nor/rp2040.c

index 1e582b433a6214a2b8f51933d209e4e0e70756ec..764a034c6aff0b7b403f98b4953c65e9d1e81e49 100644 (file)
@@ -256,13 +256,10 @@ static int rp2350_a0_lookup_symbol(struct target *target, uint16_t tag, uint16_t
        return ERROR_FAIL;
 }
 
-static int rp2350_lookup_rom_symbol(struct target *target, uint16_t tag, uint16_t flags, uint16_t *symbol_out)
+static int rp2350_lookup_rom_symbol(struct target *target, uint32_t ptr_to_entry,
+                                                                       uint16_t tag, uint16_t flags, uint16_t *symbol_out)
 {
        LOG_ROM_SYMBOL_DEBUG("Looking up ROM symbol '%c%c' in RP2350 A1 table", tag & 0xff, (tag >> 8) & 0xff);
-       uint32_t ptr_to_entry;
-       int err = target_read_u32(target, BOOTROM_MAGIC_ADDR + 4, &ptr_to_entry);
-       if (err != ERROR_OK)
-               return err;
 
        /* On RP2350 A1, Each entry has a flag bitmap identifying the type of its
           contents. The entry contains one halfword of data for each set flag
@@ -272,7 +269,7 @@ static int rp2350_lookup_rom_symbol(struct target *target, uint16_t tag, uint16_
        while (true) {
                uint16_t entry_tag, entry_flags;
 
-               err = target_read_u16(target, ptr_to_entry, &entry_tag);
+               uint32_t err = target_read_u16(target, ptr_to_entry, &entry_tag);
                if (err != ERROR_OK)
                        return err;
                if (entry_tag == 0) {
@@ -341,7 +338,7 @@ static int rp2xxx_lookup_rom_symbol(struct target *target, uint16_t tag, uint16_
                if (table_ptr < 0x7c00)
                        return rp2350_a0_lookup_symbol(target, tag, flags, symbol_out);
                else
-                       return rp2350_lookup_rom_symbol(target, tag, flags, symbol_out);
+                       return rp2350_lookup_rom_symbol(target, table_ptr, tag, flags, symbol_out);
 
        } else if (magic == BOOTROM_RP2040_MAGIC) {
                return rp2040_lookup_rom_symbol(target, tag, flags, symbol_out);