kinetis flash: use longword write when writing into pflash
[openocd.git] / src / flash / nor / ecos.c
index 7a0b26f323d44f0e220542824f2c8c3798c75603..c850f4f9c26d484c46bb1813af099d5d8644432f 100644 (file)
 #include "config.h"
 #endif
 
-#include "flash.h"
-#include "embeddedice.h"
-#include "image.h"
-#include "algorithm.h"
+#include "imp.h"
+#include <target/embeddedice.h>
+#include <target/algorithm.h>
+#include <target/image.h>
 
 
 #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(&reg_params[0], "r0", 32, PARAM_IN_OUT);
        init_reg_param(&reg_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
+};

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)