From 5c2f920cc792d40f449cf596b5729671d0414fa1 Mon Sep 17 00:00:00 2001 From: Andreas Fritiofson Date: Mon, 11 Mar 2013 22:21:13 +0100 Subject: [RFC] target: Move bulk_write_memory to arm7_9 The only remaining user is arm7_9 so remove it from the target API and add it to struct arm7_9_common to support all its variants with minimal changes. Many of the variants are likely not correct in the cache/mmu handling when the bulk write is triggered. This patch does nothing to change that, except for arm946e, where it was easier to do what might be the right thing. Change-Id: Ie73ac07507ff0936fefdb90760046cc8810ed182 Signed-off-by: Andreas Fritiofson Reviewed-on: http://openocd.zylin.com/1220 Tested-by: jenkins Reviewed-by: Spencer Oliver --- src/target/target.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'src/target/target.c') diff --git a/src/target/target.c b/src/target/target.c index 29a011ce..6aee0983 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -986,12 +986,6 @@ int target_write_phys_memory(struct target *target, return target->type->write_phys_memory(target, address, size, count, buffer); } -static int target_bulk_write_memory_default(struct target *target, - uint32_t address, uint32_t count, const uint8_t *buffer) -{ - return target_write_memory(target, address, 4, count, buffer); -} - int target_add_breakpoint(struct target *target, struct breakpoint *breakpoint) { @@ -1173,9 +1167,6 @@ static int target_init_one(struct command_context *cmd_ctx, if (target->type->write_buffer == NULL) target->type->write_buffer = target_write_buffer_default; - if (target->type->bulk_write_memory == NULL) - target->type->bulk_write_memory = target_bulk_write_memory_default; - if (target->type->get_gdb_fileio_info == NULL) target->type->get_gdb_fileio_info = target_get_gdb_fileio_info_default; @@ -1802,16 +1793,9 @@ static int target_write_buffer_default(struct target *target, uint32_t address, if (size >= 4) { int aligned = size - (size % 4); - /* use bulk writes above a certain limit. This may have to be changed */ - if (aligned > 128) { - retval = target->type->bulk_write_memory(target, address, aligned / 4, buffer); - if (retval != ERROR_OK) - return retval; - } else { - retval = target_write_memory(target, address, 4, aligned / 4, buffer); - if (retval != ERROR_OK) - return retval; - } + retval = target_write_memory(target, address, 4, aligned / 4, buffer); + if (retval != ERROR_OK) + return retval; buffer += aligned; address += aligned; -- cgit v1.2.3-18-g5258