stellaris: update bulk flash writes
[openocd.git] / src / flash / nor / tcl.c
index d417ca0f6f92e4ba0f69536032b89a866d2b7a5f..1e933b2733a36bd7a2e1671771c60acf8ddc029f 100644 (file)
@@ -697,21 +697,21 @@ static const struct command_registration flash_exec_command_handlers[] = {
                .name = "fillw",
                .handler = &handle_flash_fill_command,
                .mode = COMMAND_EXEC,
-               .usage = "<bank> <address> <word_pattern> <count>",
+               .usage = "<address> <word_pattern> <count>",
                .help = "fill with pattern (no autoerase)",
        },
        {
                .name = "fillh",
                .handler = &handle_flash_fill_command,
                .mode = COMMAND_EXEC,
-               .usage = "<bank> <address> <halfword_pattern> <count>",
+               .usage = "<address> <halfword_pattern> <count>",
                .help = "fill with pattern",
        },
        {
                .name = "fillb",
                .handler = &handle_flash_fill_command,
                .mode = COMMAND_EXEC,
-               .usage = "<bank> <address> <byte_pattern> <count>",
+               .usage = "<address> <byte_pattern> <count>",
                .help = "fill with pattern",
 
        },
@@ -726,7 +726,7 @@ static const struct command_registration flash_exec_command_handlers[] = {
                .name = "write_image",
                .handler = &handle_flash_write_image_command,
                .mode = COMMAND_EXEC,
-               .usage = "<bank> [erase] [unlock] <file> [offset] [type]",
+               .usage = "[erase] [unlock] <file> [offset] [type]",
                .help = "write an image to flash"
        },
        {
@@ -816,14 +816,30 @@ COMMAND_HANDLER(handle_flash_bank_command)
        flash_bank_add(c);
 
        return ERROR_OK;
-
 }
 
+COMMAND_HANDLER(handle_flash_banks_command)
+{
+       if (CMD_ARGC != 0)
+               return ERROR_INVALID_ARGUMENTS;
 
-static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
+       unsigned n = 0;
+       for (struct flash_bank *p = flash_bank_list(); p; p = p->next, n++)
+       {
+               LOG_USER("#%u: %s at 0x%8.8" PRIx32 ", size 0x%8.8" PRIx32 ", "
+                       "buswidth %u, chipwidth %u", n,
+                       p->driver->name, p->base, p->size,
+                       p->bus_width, p->chip_width);
+       }
+       return ERROR_OK;
+}
+
+static int jim_flash_list(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
-       if (argc != 1) {
-               Jim_WrongNumArgs(interp, 1, argv, "no arguments to flash_banks command");
+       if (argc != 1)
+       {
+               Jim_WrongNumArgs(interp, 1, argv,
+                               "no arguments to 'flash list' command");
                return JIM_ERR;
        }
 
@@ -890,8 +906,14 @@ static const struct command_registration flash_config_command_handlers[] = {
        {
                .name = "banks",
                .mode = COMMAND_ANY,
-               .jim_handler = &jim_flash_banks,
-               .help = "return information about the flash banks",
+               .handler = &handle_flash_banks_command,
+               .help = "return readable information about the flash banks",
+       },
+       {
+               .name = "list",
+               .mode = COMMAND_ANY,
+               .jim_handler = &jim_flash_list,
+               .help = "returns a list of details about the flash banks",
        },
        COMMAND_REGISTRATION_DONE
 };

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)