[RFC] target: Move bulk_write_memory to arm7_9
[fw/openocd] / src / target / target.c
index e4235ed26ab5d2e4c52f55e488826be24a52b519..6aee09832e3983362d278c3caef9394c66cf7fed 100644 (file)
@@ -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;
 
@@ -1734,14 +1725,16 @@ int target_arch_state(struct target *target)
 static int target_get_gdb_fileio_info_default(struct target *target,
                struct gdb_fileio_info *fileio_info)
 {
-       LOG_ERROR("Not implemented: %s", __func__);
+       /* If target does not support semi-hosting function, target
+          has no need to provide .get_gdb_fileio_info callback.
+          It just return ERROR_FAIL and gdb_server will return "Txx"
+          as target halted every time.  */
        return ERROR_FAIL;
 }
 
 static int target_gdb_fileio_end_default(struct target *target,
                int retcode, int fileio_errno, bool ctrl_c)
 {
-       LOG_ERROR("Not implemented: %s", __func__);
        return ERROR_OK;
 }
 
@@ -1800,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;