Browse Source

MIPS: fastdata bulk write fallback

If fastdata access fails, then fallback to default mips_m4k_write_memory
Remove unnecessary fastdata loader verify check

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
tags/v0.4.0-rc2
Spencer Oliver 12 years ago
parent
commit
2d450b9033
2 changed files with 7 additions and 9 deletions
  1. +1
    -9
      src/target/mips32_pracc.c
  2. +6
    -0
      src/target/mips_m4k.c

+ 1
- 9
src/target/mips32_pracc.c View File

@@ -968,15 +968,7 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are
/* write program into RAM */
mips32_pracc_write_mem32(ejtag_info, source->address, ARRAY_SIZE(handler_code), handler_code);

/* quick verify RAM is working */
mips32_pracc_read_u32(ejtag_info, source->address, &val);
if (val != handler_code[0])
{
LOG_ERROR("fastdata handler verify failed\n");
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
}

LOG_INFO("%s using 0x%.8x for write handler\n", __func__, source->address);
LOG_DEBUG("%s using 0x%.8x for write handler\n", __func__, source->address);

jmp_code[1] |= UPPER16(source->address);
jmp_code[2] |= LOWER16(source->address);


+ 6
- 0
src/target/mips_m4k.c View File

@@ -1001,6 +1001,12 @@ int mips_m4k_bulk_write_memory(struct target *target, uint32_t address, uint32_t
}

retval = mips32_pracc_fastdata_xfer(ejtag_info, source, write, address, count, (uint32_t*) buffer);
if (retval != ERROR_OK)
{
/* FASTDATA access failed, try normal memory write */
LOG_WARNING("Fastdata access Failed, falling back to non-bulk write");
retval = mips_m4k_write_memory(target, address, 4, count, buffer);
}

if (source)
target_free_working_area(target, source);


Loading…
Cancel
Save