Change return value on error.
[openocd.git] / src / flash / nor / lpc2900.c
index 99d6d1dc1b6bff614355aaf5a56351e3c0fedc59..4960e9c6be7ab8992c1133d7eb6f0a90098a777f 100644 (file)
@@ -184,7 +184,7 @@ static uint32_t lpc2900_run_bist128(struct flash_bank *bank,
                                     uint32_t addr_from, uint32_t addr_to,
                                     uint32_t (*signature)[4] );
 static uint32_t lpc2900_address2sector(struct flash_bank *bank, uint32_t offset);
-static uint32_t lpc2900_calc_tr( uint32_t clock, uint32_t time );
+static uint32_t lpc2900_calc_tr(uint32_t clock_var, uint32_t time_var);
 
 
 /***********************  Helper functions  **************************/
@@ -542,8 +542,7 @@ COMMAND_HANDLER(lpc2900_handle_signature_command)
 
        if( CMD_ARGC < 1 )
        {
-               LOG_WARNING( "Too few arguments. Call: lpc2900 signature <bank#>" );
-               return ERROR_FLASH_BANK_INVALID;
+               return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        struct flash_bank *bank;
@@ -954,9 +953,9 @@ COMMAND_HANDLER(lpc2900_handle_secure_jtag_command)
 static const struct command_registration lpc2900_exec_command_handlers[] = {
        {
                .name = "signature",
+               .usage = "<bank>",
                .handler = lpc2900_handle_signature_command,
                .mode = COMMAND_EXEC,
-               .usage = "bank_id",
                .help = "Calculate and display signature of flash bank.",
        },
        {
@@ -1017,8 +1016,7 @@ FLASH_BANK_COMMAND_HANDLER(lpc2900_flash_bank_command)
 
        if (CMD_ARGC < 6)
        {
-               LOG_WARNING("incomplete flash_bank LPC2900 configuration");
-               return ERROR_FLASH_BANK_INVALID;
+               return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        lpc2900_info = malloc(sizeof(struct lpc2900_flash_bank));
@@ -1638,7 +1636,11 @@ static int lpc2900_probe(struct flash_bank *bank)
                else if ( package_code == 4 )
                {
                        /* 144-pin package */
-                       if ( (bank->size == 512*KiB) && (feat3 == 0xFFFFFCF0) )
+                       if ( (bank->size == 256*KiB) && (feat3 == 0xFFFFFFE9) )
+                       {
+                               lpc2900_info->target_name = "LPC2926";
+                       }
+                       else if ( (bank->size == 512*KiB) && (feat3 == 0xFFFFFCF0) )
                        {
                                lpc2900_info->target_name = "LPC2917/01";
                        }
@@ -1672,7 +1674,11 @@ static int lpc2900_probe(struct flash_bank *bank)
 
        if ( !found )
        {
-               LOG_WARNING("Unknown LPC29xx derivative");
+               LOG_WARNING("Unknown LPC29xx derivative"
+                           " (FEATx="
+                           "%08" PRIx32 ":%08" PRIx32 ":%08" PRIx32 ":%08" PRIx32 ")",
+                                       feat0, feat1, feat2, feat3
+                                       );
                return ERROR_FLASH_OPERATION_FAILED;
        }
 

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)