From a7e3418258f79d6e0081b8e6d01d8f4268629ded Mon Sep 17 00:00:00 2001 From: Andreas Fritiofson Date: Fri, 8 Mar 2013 21:13:42 +0100 Subject: [PATCH] target: Retire target_bulk_write_memory() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only caller was arm_nandwrite(). Replace that call with target_write_buffer() instead, which in turn may end up calling the same bulk_write_memory target API function. Change-Id: If34c7474df5cf14af3b732fb4774816818f28e79 Signed-off-by: Andreas Fritiofson Reviewed-on: http://openocd.zylin.com/1214 Tested-by: jenkins Reviewed-by: Øyvind Harboe Reviewed-by: Spencer Oliver --- src/flash/nand/arm_io.c | 6 +----- src/target/target.c | 6 ------ src/target/target.h | 10 ---------- 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/flash/nand/arm_io.c b/src/flash/nand/arm_io.c index cf494766d..aab1d050f 100644 --- a/src/flash/nand/arm_io.c +++ b/src/flash/nand/arm_io.c @@ -128,11 +128,7 @@ int arm_nandwrite(struct arm_nand_data *nand, uint8_t *data, int size) /* copy data to work area */ target_buf = nand->copy_area->address + sizeof(code); - retval = target_bulk_write_memory(target, target_buf, size / 4, data); - if (retval == ERROR_OK && (size & 3) != 0) - retval = target_write_memory(target, - target_buf + (size & ~3), - 1, size & 3, data + (size & ~3)); + retval = target_write_buffer(target, target_buf, size, data); if (retval != ERROR_OK) return retval; diff --git a/src/target/target.c b/src/target/target.c index 04e375b84..ed1a2cc4c 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -970,12 +970,6 @@ int target_write_phys_memory(struct target *target, return target->type->write_phys_memory(target, address, size, count, buffer); } -int target_bulk_write_memory(struct target *target, - uint32_t address, uint32_t count, const uint8_t *buffer) -{ - return target->type->bulk_write_memory(target, address, count, buffer); -} - static int target_bulk_write_memory_default(struct target *target, uint32_t address, uint32_t count, const uint8_t *buffer) { diff --git a/src/target/target.h b/src/target/target.h index 3baafbe70..e6b931ddf 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -485,16 +485,6 @@ int target_write_memory(struct target *target, int target_write_phys_memory(struct target *target, uint32_t address, uint32_t size, uint32_t count, const uint8_t *buffer); -/** - * Write @a count items of 4 bytes to the memory of @a target at - * the @a address given. Because it operates only on whole words, - * this should be faster than target_write_memory(). - * - * This routine is wrapper for target->type->bulk_write_memory. - */ -int target_bulk_write_memory(struct target *target, - uint32_t address, uint32_t count, const uint8_t *buffer); - /* * Write to target memory using the virtual address. *