]> git.gag.com Git - fw/openocd/blobdiff - src/flash/nor/lpc2900.c
cmd: add missing usage var
[fw/openocd] / src / flash / nor / lpc2900.c
index 99d6d1dc1b6bff614355aaf5a56351e3c0fedc59..5a80b323d97f25f622361d742717e20f021d16a0 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.",
        },
        {
@@ -1005,6 +1004,7 @@ static const struct command_registration lpc2900_command_handlers[] = {
                .name = "lpc2900",
                .mode = COMMAND_ANY,
                .help = "LPC2900 flash command group",
+               .usage = "",
                .chain = lpc2900_exec_command_handlers,
        },
        COMMAND_REGISTRATION_DONE
@@ -1017,8 +1017,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 +1637,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 +1675,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;
        }