X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fecos.c;h=c850f4f9c26d484c46bb1813af099d5d8644432f;hp=ca8f3f519b74941c5ee857269528b006db24161c;hb=a665ef716a9a90c30fb15e1f979845b3438a7251;hpb=1650ab3a22d62c834126138f253643031c8418ba diff --git a/src/flash/nor/ecos.c b/src/flash/nor/ecos.c index ca8f3f519b..c850f4f9c2 100644 --- a/src/flash/nor/ecos.c +++ b/src/flash/nor/ecos.c @@ -21,10 +21,10 @@ #include "config.h" #endif -#include "flash.h" +#include "imp.h" #include -#include "image.h" #include +#include #if 0 @@ -173,7 +173,6 @@ static int loadDriver(struct ecosflash_flash_bank *info) for (i = 0; i < image.num_sections; i++) { void *buffer = malloc(image.sections[i].size); - int retval; if ((retval = image_read_section(&image, i, 0x0, image.sections[i].size, buffer, &buf_cnt)) != ERROR_OK) { free(buffer); @@ -209,10 +208,10 @@ static int runCode(struct ecosflash_flash_bank *info, struct target *target = info->target; struct reg_param reg_params[3]; - struct armv4_5_algorithm armv4_5_info; - armv4_5_info.common_magic = ARMV4_5_COMMON_MAGIC; - armv4_5_info.core_mode = ARMV4_5_MODE_SVC; - armv4_5_info.core_state = ARMV4_5_STATE_ARM; + struct arm_algorithm armv4_5_info; + armv4_5_info.common_magic = ARM_COMMON_MAGIC; + armv4_5_info.core_mode = ARM_MODE_SVC; + armv4_5_info.core_state = ARM_STATE_ARM; init_reg_param(®_params[0], "r0", 32, PARAM_IN_OUT); init_reg_param(®_params[1], "r1", 32, PARAM_OUT); @@ -265,7 +264,7 @@ static int eCosBoard_erase(struct ecosflash_flash_bank *info, uint32_t address, if (flashErr != 0x0) { - LOG_ERROR("Flash erase failed with %d (%s)\n", (int)flashErr, flash_errmsg(flashErr)); + LOG_ERROR("Flash erase failed with %d (%s)", (int)flashErr, flash_errmsg(flashErr)); return ERROR_FAIL; } @@ -305,7 +304,6 @@ static int eCosBoard_flash(struct ecosflash_flash_bank *info, void *data, uint32 t = chunk; } - int retval; retval = target_write_buffer(target, buffer, t, ((uint8_t *)data) + i); if (retval != ERROR_OK) return retval; @@ -324,7 +322,7 @@ static int eCosBoard_flash(struct ecosflash_flash_bank *info, void *data, uint32 if (flashErr != 0x0) { - LOG_ERROR("Flash prog failed with %d (%s)\n", (int)flashErr, flash_errmsg(flashErr)); + LOG_ERROR("Flash prog failed with %d (%s)", (int)flashErr, flash_errmsg(flashErr)); return ERROR_FAIL; } } @@ -431,14 +429,15 @@ static int ecosflash_handle_gpnvm_command(struct command_context *cmd_ctx, char #endif struct flash_driver ecosflash_flash = { - .name = "ecosflash", - .flash_bank_command = &ecosflash_flash_bank_command, - .erase = &ecosflash_erase, - .protect = &ecosflash_protect, - .write = &ecosflash_write, - .probe = &ecosflash_probe, - .auto_probe = &ecosflash_probe, - .erase_check = &default_flash_blank_check, - .protect_check = &ecosflash_protect_check, - .info = &ecosflash_info - }; + .name = "ecosflash", + .flash_bank_command = ecosflash_flash_bank_command, + .erase = ecosflash_erase, + .protect = ecosflash_protect, + .write = ecosflash_write, + .read = default_flash_read, + .probe = ecosflash_probe, + .auto_probe = ecosflash_probe, + .erase_check = default_flash_blank_check, + .protect_check = ecosflash_protect_check, + .info = ecosflash_info +};