X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fecos.c;h=945852ddabb6504664fa93350901917b19cd9d81;hb=42082f7c23ded282489e8ac6ec52fe94fa097cde;hp=2524ae7f24c2eb4ee05386e538993541a979778d;hpb=0073e7a69e55eb435fc2e274ba245a27779963e4;p=openocd.git diff --git a/src/flash/nor/ecos.c b/src/flash/nor/ecos.c index 2524ae7f24..945852ddab 100644 --- a/src/flash/nor/ecos.c +++ b/src/flash/nor/ecos.c @@ -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,8 +208,8 @@ 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; + 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; @@ -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; @@ -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 +};