summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-20 11:26:35 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-24 21:37:29 -0800
commit833e7f5248778bcb31b4db1a1b91160995415203 (patch)
tree7d5d5fa143b74f4989cc3226a0958e983cb1d2b5 /src/flash
parentf7e1f2df74b599903a6fb2d2ace94c3f1ef06097 (diff)
downloadopenocd+libswd-833e7f5248778bcb31b4db1a1b91160995415203.tar.gz
openocd+libswd-833e7f5248778bcb31b4db1a1b91160995415203.tar.bz2
openocd+libswd-833e7f5248778bcb31b4db1a1b91160995415203.tar.xz
openocd+libswd-833e7f5248778bcb31b4db1a1b91160995415203.zip
use COMMAND_REGISTER macro
Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/at91sam3.c8
-rw-r--r--src/flash/at91sam7.c4
-rw-r--r--src/flash/avrf.c4
-rw-r--r--src/flash/cfi.c4
-rw-r--r--src/flash/ecos.c2
-rw-r--r--src/flash/flash.c28
-rw-r--r--src/flash/lpc2000.c4
-rw-r--r--src/flash/lpc2900.c54
-rw-r--r--src/flash/lpc3180_nand_controller.c4
-rw-r--r--src/flash/mflash.c12
-rw-r--r--src/flash/nand.c24
-rw-r--r--src/flash/pic32mx.c10
-rw-r--r--src/flash/stellaris.c4
-rw-r--r--src/flash/stm32x.c12
-rw-r--r--src/flash/str7x.c4
-rw-r--r--src/flash/str9x.c4
-rw-r--r--src/flash/str9xpec.c24
-rw-r--r--src/flash/tms470.c8
18 files changed, 95 insertions, 119 deletions
diff --git a/src/flash/at91sam3.c b/src/flash/at91sam3.c
index 195da91a..d8460b09 100644
--- a/src/flash/at91sam3.c
+++ b/src/flash/at91sam3.c
@@ -2478,18 +2478,18 @@ sam3_register_commands(struct command_context *cmd_ctx)
if (!sam3_registered) {
sam3_registered++;
- pCmd = register_command(cmd_ctx, NULL, "at91sam3", NULL, COMMAND_ANY, NULL);
- register_command(cmd_ctx, pCmd,
+ pCmd = COMMAND_REGISTER(cmd_ctx, NULL, "at91sam3", NULL, COMMAND_ANY, NULL);
+ COMMAND_REGISTER(cmd_ctx, pCmd,
"gpnvm",
sam3_handle_gpnvm_command,
COMMAND_EXEC,
"at91sam3 gpnvm [action [<BIT>], by default 'show', otherwise set | clear BIT");
- register_command(cmd_ctx, pCmd,
+ COMMAND_REGISTER(cmd_ctx, pCmd,
"info",
sam3_handle_info_command,
COMMAND_EXEC,
"at91sam3 info - print information about the current sam3 chip");
- register_command(cmd_ctx, pCmd,
+ COMMAND_REGISTER(cmd_ctx, pCmd,
"slowclk",
sam3_handle_slowclk_command,
COMMAND_EXEC,
diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c
index 3e5dbdd8..1665b915 100644
--- a/src/flash/at91sam7.c
+++ b/src/flash/at91sam7.c
@@ -1180,10 +1180,10 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command)
static int at91sam7_register_commands(struct command_context *cmd_ctx)
{
- struct command *at91sam7_cmd = register_command(cmd_ctx, NULL, "at91sam7",
+ struct command *at91sam7_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "at91sam7",
NULL, COMMAND_ANY, NULL);
- register_command(cmd_ctx, at91sam7_cmd, "gpnvm",
+ COMMAND_REGISTER(cmd_ctx, at91sam7_cmd, "gpnvm",
at91sam7_handle_gpnvm_command, COMMAND_EXEC,
"at91sam7 gpnvm <bit> set | clear, "
"set or clear one gpnvm bit");
diff --git a/src/flash/avrf.c b/src/flash/avrf.c
index 356c4049..692992f4 100644
--- a/src/flash/avrf.c
+++ b/src/flash/avrf.c
@@ -451,10 +451,10 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command)
static int avrf_register_commands(struct command_context *cmd_ctx)
{
- struct command *avr_cmd = register_command(cmd_ctx, NULL, "avr",
+ struct command *avr_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "avr",
NULL, COMMAND_ANY, "avr flash specific commands");
- register_command(cmd_ctx, avr_cmd, "mass_erase",
+ COMMAND_REGISTER(cmd_ctx, avr_cmd, "mass_erase",
avrf_handle_mass_erase_command, COMMAND_EXEC,
"mass erase device");
diff --git a/src/flash/cfi.c b/src/flash/cfi.c
index 59c9c6c9..e743fe9e 100644
--- a/src/flash/cfi.c
+++ b/src/flash/cfi.c
@@ -592,9 +592,9 @@ static int cfi_intel_info(struct flash_bank *bank, char *buf, int buf_size)
static int cfi_register_commands(struct command_context *cmd_ctx)
{
/*struct command *cfi_cmd = */
- register_command(cmd_ctx, NULL, "cfi", NULL, COMMAND_ANY, "flash bank cfi <base> <size> <chip_width> <bus_width> <targetNum> [jedec_probe/x16_as_x8]");
+ COMMAND_REGISTER(cmd_ctx, NULL, "cfi", NULL, COMMAND_ANY, "flash bank cfi <base> <size> <chip_width> <bus_width> <targetNum> [jedec_probe/x16_as_x8]");
/*
- register_command(cmd_ctx, cfi_cmd, "part_id", cfi_handle_part_id_command, COMMAND_EXEC,
+ COMMAND_REGISTER(cmd_ctx, cfi_cmd, "part_id", cfi_handle_part_id_command, COMMAND_EXEC,
"print part id of cfi flash bank <num>");
*/
return ERROR_OK;
diff --git a/src/flash/ecos.c b/src/flash/ecos.c
index 863c12b2..381f858c 100644
--- a/src/flash/ecos.c
+++ b/src/flash/ecos.c
@@ -338,7 +338,7 @@ static int ecosflash_probe(struct flash_bank *bank)
static int ecosflash_register_commands(struct command_context *cmd_ctx)
{
- register_command(cmd_ctx, NULL, "ecosflash", NULL, COMMAND_ANY, NULL);
+ COMMAND_REGISTER(cmd_ctx, NULL, "ecosflash", NULL, COMMAND_ANY, NULL);
return ERROR_OK;
}
diff --git a/src/flash/flash.c b/src/flash/flash.c
index e2136b70..7bc74ab7 100644
--- a/src/flash/flash.c
+++ b/src/flash/flash.c
@@ -1280,42 +1280,42 @@ int flash_init_drivers(struct command_context *cmd_ctx)
if (!flash_banks)
return ERROR_OK;
- register_command(cmd_ctx, flash_cmd, "info",
+ COMMAND_REGISTER(cmd_ctx, flash_cmd, "info",
handle_flash_info_command, COMMAND_EXEC,
"print info about flash bank <num>");
- register_command(cmd_ctx, flash_cmd, "probe",
+ COMMAND_REGISTER(cmd_ctx, flash_cmd, "probe",
handle_flash_probe_command, COMMAND_EXEC,
"identify flash bank <num>");
- register_command(cmd_ctx, flash_cmd, "erase_check",
+ COMMAND_REGISTER(cmd_ctx, flash_cmd, "erase_check",
handle_flash_erase_check_command, COMMAND_EXEC,
"check erase state of sectors in flash bank <num>");
- register_command(cmd_ctx, flash_cmd, "protect_check",
+ COMMAND_REGISTER(cmd_ctx, flash_cmd, "protect_check",
handle_flash_protect_check_command, COMMAND_EXEC,
"check protection state of sectors in flash bank <num>");
- register_command(cmd_ctx, flash_cmd, "erase_sector",
+ COMMAND_REGISTER(cmd_ctx, flash_cmd, "erase_sector",
handle_flash_erase_command, COMMAND_EXEC,
"erase sectors at <bank> <first> <last>");
- register_command(cmd_ctx, flash_cmd, "erase_address",
+ COMMAND_REGISTER(cmd_ctx, flash_cmd, "erase_address",
handle_flash_erase_address_command, COMMAND_EXEC,
"erase address range <address> <length>");
- register_command(cmd_ctx, flash_cmd, "fillw",
+ COMMAND_REGISTER(cmd_ctx, flash_cmd, "fillw",
handle_flash_fill_command, COMMAND_EXEC,
"fill with pattern (no autoerase) <address> <word_pattern> <count>");
- register_command(cmd_ctx, flash_cmd, "fillh",
+ COMMAND_REGISTER(cmd_ctx, flash_cmd, "fillh",
handle_flash_fill_command, COMMAND_EXEC,
"fill with pattern <address> <halfword_pattern> <count>");
- register_command(cmd_ctx, flash_cmd, "fillb",
+ COMMAND_REGISTER(cmd_ctx, flash_cmd, "fillb",
handle_flash_fill_command, COMMAND_EXEC,
"fill with pattern <address> <byte_pattern> <count>");
- register_command(cmd_ctx, flash_cmd, "write_bank",
+ COMMAND_REGISTER(cmd_ctx, flash_cmd, "write_bank",
handle_flash_write_bank_command, COMMAND_EXEC,
"write binary data to <bank> <file> <offset>");
- register_command(cmd_ctx, flash_cmd, "write_image",
+ COMMAND_REGISTER(cmd_ctx, flash_cmd, "write_image",
handle_flash_write_image_command, COMMAND_EXEC,
"write_image [erase] [unlock] <file> [offset] [type]");
- register_command(cmd_ctx, flash_cmd, "protect",
+ COMMAND_REGISTER(cmd_ctx, flash_cmd, "protect",
handle_flash_protect_command, COMMAND_EXEC,
"set protection of sectors at <bank> <first> <last> <on | off>");
@@ -1324,10 +1324,10 @@ int flash_init_drivers(struct command_context *cmd_ctx)
int flash_register_commands(struct command_context *cmd_ctx)
{
- flash_cmd = register_command(cmd_ctx, NULL, "flash",
+ flash_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "flash",
NULL, COMMAND_ANY, NULL);
- register_command(cmd_ctx, flash_cmd, "bank",
+ COMMAND_REGISTER(cmd_ctx, flash_cmd, "bank",
handle_flash_bank_command, COMMAND_CONFIG,
"flash bank <driver> <base> <size> "
"<chip_width> <bus_width> <target> [driver_options ...]");
diff --git a/src/flash/lpc2000.c b/src/flash/lpc2000.c
index b60c6cfd..4a934c02 100644
--- a/src/flash/lpc2000.c
+++ b/src/flash/lpc2000.c
@@ -778,10 +778,10 @@ COMMAND_HANDLER(lpc2000_handle_part_id_command)
static int lpc2000_register_commands(struct command_context *cmd_ctx)
{
- struct command *lpc2000_cmd = register_command(cmd_ctx, NULL, "lpc2000",
+ struct command *lpc2000_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "lpc2000",
NULL, COMMAND_ANY, NULL);
- register_command(cmd_ctx, lpc2000_cmd, "part_id",
+ COMMAND_REGISTER(cmd_ctx, lpc2000_cmd, "part_id",
lpc2000_handle_part_id_command, COMMAND_EXEC,
"print part id of lpc2000 flash bank <num>");
diff --git a/src/flash/lpc2900.c b/src/flash/lpc2900.c
index 465d7768..c7f1b3a2 100644
--- a/src/flash/lpc2900.c
+++ b/src/flash/lpc2900.c
@@ -954,60 +954,36 @@ COMMAND_HANDLER(lpc2900_handle_secure_jtag_command)
*/
static int lpc2900_register_commands(struct command_context *cmd_ctx)
{
- struct command *lpc2900_cmd = register_command(cmd_ctx, NULL, "lpc2900",
+ struct command *lpc2900_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "lpc2900",
NULL, COMMAND_ANY, NULL);
- register_command(
- cmd_ctx,
- lpc2900_cmd,
- "signature",
- lpc2900_handle_signature_command,
- COMMAND_EXEC,
+ COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "signature",
+ &lpc2900_handle_signature_command, COMMAND_EXEC,
"<bank> | "
- "print device signature of flash bank");
-
- register_command(
- cmd_ctx,
- lpc2900_cmd,
- "read_custom",
- lpc2900_handle_read_custom_command,
- COMMAND_EXEC,
+ "print device signature of flash bank");
+
+ COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "read_custom",
+ &lpc2900_handle_read_custom_command, COMMAND_EXEC,
"<bank> <filename> | "
"read customer information from index sector to file");
- register_command(
- cmd_ctx,
- lpc2900_cmd,
- "password",
- lpc2900_handle_password_command,
- COMMAND_EXEC,
+ COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "password",
+ &lpc2900_handle_password_command, COMMAND_EXEC,
"<bank> <password> | "
"enter password to enable 'dangerous' options");
- register_command(
- cmd_ctx,
- lpc2900_cmd,
- "write_custom",
- lpc2900_handle_write_custom_command,
- COMMAND_EXEC,
+ COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "write_custom",
+ &lpc2900_handle_write_custom_command, COMMAND_EXEC,
"<bank> <filename> [<type>] | "
"write customer info from file to index sector");
- register_command(
- cmd_ctx,
- lpc2900_cmd,
- "secure_sector",
- lpc2900_handle_secure_sector_command,
- COMMAND_EXEC,
+ COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "secure_sector",
+ &lpc2900_handle_secure_sector_command, COMMAND_EXEC,
"<bank> <first> <last> | "
"activate sector security for a range of sectors");
- register_command(
- cmd_ctx,
- lpc2900_cmd,
- "secure_jtag",
- lpc2900_handle_secure_jtag_command,
- COMMAND_EXEC,
+ COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "secure_jtag",
+ &lpc2900_handle_secure_jtag_command, COMMAND_EXEC,
"<bank> <level> | "
"activate JTAG security");
diff --git a/src/flash/lpc3180_nand_controller.c b/src/flash/lpc3180_nand_controller.c
index 61bef90c..801607df 100644
--- a/src/flash/lpc3180_nand_controller.c
+++ b/src/flash/lpc3180_nand_controller.c
@@ -875,9 +875,9 @@ COMMAND_HANDLER(handle_lpc3180_select_command)
static int lpc3180_register_commands(struct command_context *cmd_ctx)
{
- struct command *lpc3180_cmd = register_command(cmd_ctx, NULL, "lpc3180", NULL, COMMAND_ANY, "commands specific to the LPC3180 NAND flash controllers");
+ struct command *lpc3180_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "lpc3180", NULL, COMMAND_ANY, "commands specific to the LPC3180 NAND flash controllers");
- register_command(cmd_ctx, lpc3180_cmd, "select", handle_lpc3180_select_command, COMMAND_EXEC, "select <'mlc'|'slc'> controller (default is mlc)");
+ COMMAND_REGISTER(cmd_ctx, lpc3180_cmd, "select", handle_lpc3180_select_command, COMMAND_EXEC, "select <'mlc'|'slc'> controller (default is mlc)");
return ERROR_OK;
}
diff --git a/src/flash/mflash.c b/src/flash/mflash.c
index 2a1fbe59..a4a45dca 100644
--- a/src/flash/mflash.c
+++ b/src/flash/mflash.c
@@ -1271,12 +1271,12 @@ COMMAND_HANDLER(mg_config_cmd)
int mflash_init_drivers(struct command_context *cmd_ctx)
{
if (mflash_bank) {
- register_command(cmd_ctx, mflash_cmd, "probe", mg_probe_cmd, COMMAND_EXEC, NULL);
- register_command(cmd_ctx, mflash_cmd, "write", mg_write_cmd, COMMAND_EXEC,
+ COMMAND_REGISTER(cmd_ctx, mflash_cmd, "probe", mg_probe_cmd, COMMAND_EXEC, NULL);
+ COMMAND_REGISTER(cmd_ctx, mflash_cmd, "write", mg_write_cmd, COMMAND_EXEC,
"mflash write <num> <file> <address>");
- register_command(cmd_ctx, mflash_cmd, "dump", mg_dump_cmd, COMMAND_EXEC,
+ COMMAND_REGISTER(cmd_ctx, mflash_cmd, "dump", mg_dump_cmd, COMMAND_EXEC,
"mflash dump <num> <file> <address> <size>");
- register_command(cmd_ctx, mflash_cmd, "config", mg_config_cmd,
+ COMMAND_REGISTER(cmd_ctx, mflash_cmd, "config", mg_config_cmd,
COMMAND_EXEC, "mflash config <num> <stage>");
}
@@ -1325,8 +1325,8 @@ COMMAND_HANDLER(mg_bank_cmd)
int mflash_register_commands(struct command_context *cmd_ctx)
{
- mflash_cmd = register_command(cmd_ctx, NULL, "mflash", NULL, COMMAND_ANY, NULL);
- register_command(cmd_ctx, mflash_cmd, "bank", mg_bank_cmd, COMMAND_CONFIG,
+ mflash_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "mflash", NULL, COMMAND_ANY, NULL);
+ COMMAND_REGISTER(cmd_ctx, mflash_cmd, "bank", mg_bank_cmd, COMMAND_CONFIG,
"mflash bank <soc> <base> <RST pin> <target #>");
return ERROR_OK;
}
diff --git a/src/flash/nand.c b/src/flash/nand.c
index 77aa3e57..2438ddd5 100644
--- a/src/flash/nand.c
+++ b/src/flash/nand.c
@@ -281,13 +281,13 @@ COMMAND_HANDLER(handle_nand_device_command)
int nand_register_commands(struct command_context *cmd_ctx)
{
- nand_cmd = register_command(cmd_ctx, NULL, "nand",
+ nand_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "nand",
NULL, COMMAND_ANY, "NAND specific commands");
- register_command(cmd_ctx, nand_cmd, "device",
+ COMMAND_REGISTER(cmd_ctx, nand_cmd, "device",
&handle_nand_device_command, COMMAND_CONFIG,
"defines a new NAND bank");
- register_command(cmd_ctx, nand_cmd, "drivers",
+ COMMAND_REGISTER(cmd_ctx, nand_cmd, "drivers",
&handle_nand_list_drivers, COMMAND_ANY,
"lists available NAND drivers");
@@ -1705,36 +1705,36 @@ int nand_init(struct command_context *cmd_ctx)
if (!nand_devices)
return ERROR_OK;
- register_command(cmd_ctx, nand_cmd, "list",
+ COMMAND_REGISTER(cmd_ctx, nand_cmd, "list",
handle_nand_list_command, COMMAND_EXEC,
"list configured NAND flash devices");
- register_command(cmd_ctx, nand_cmd, "info",
+ COMMAND_REGISTER(cmd_ctx, nand_cmd, "info",
handle_nand_info_command, COMMAND_EXEC,
"print info about NAND flash device <num>");
- register_command(cmd_ctx, nand_cmd, "probe",
+ COMMAND_REGISTER(cmd_ctx, nand_cmd, "probe",
handle_nand_probe_command, COMMAND_EXEC,
"identify NAND flash device <num>");
- register_command(cmd_ctx, nand_cmd, "check_bad_blocks",
+ COMMAND_REGISTER(cmd_ctx, nand_cmd, "check_bad_blocks",
handle_nand_check_bad_blocks_command, COMMAND_EXEC,
"check NAND flash device <num> for bad blocks [<offset> <length>]");
- register_command(cmd_ctx, nand_cmd, "erase",
+ COMMAND_REGISTER(cmd_ctx, nand_cmd, "erase",
handle_nand_erase_command, COMMAND_EXEC,
"erase blocks on NAND flash device <num> [<offset> <length>]");
- register_command(cmd_ctx, nand_cmd, "dump",
+ COMMAND_REGISTER(cmd_ctx, nand_cmd, "dump",
handle_nand_dump_command, COMMAND_EXEC,
"dump from NAND flash device <num> <filename> "
"<offset> <length> [oob_raw | oob_only]");
- register_command(cmd_ctx, nand_cmd, "verify",
+ COMMAND_REGISTER(cmd_ctx, nand_cmd, "verify",
&handle_nand_verify_command, COMMAND_EXEC,
"verify NAND flash device <num> <filename> <offset> "
"[oob_raw | oob_only | oob_softecc | oob_softecc_kw]");
- register_command(cmd_ctx, nand_cmd, "write",
+ COMMAND_REGISTER(cmd_ctx, nand_cmd, "write",
handle_nand_write_command, COMMAND_EXEC,
"write to NAND flash device <num> <filename> <offset> "
"[oob_raw | oob_only | oob_softecc | oob_softecc_kw]");
- register_command(cmd_ctx, nand_cmd, "raw_access",
+ COMMAND_REGISTER(cmd_ctx, nand_cmd, "raw_access",
handle_nand_raw_access_command, COMMAND_EXEC,
"raw access to NAND flash device <num> ['enable'|'disable']");
diff --git a/src/flash/pic32mx.c b/src/flash/pic32mx.c
index fa5a4d67..c6d4615a 100644
--- a/src/flash/pic32mx.c
+++ b/src/flash/pic32mx.c
@@ -885,20 +885,20 @@ COMMAND_HANDLER(pic32mx_handle_pgm_word_command)
static int pic32mx_register_commands(struct command_context *cmd_ctx)
{
- struct command *pic32mx_cmd = register_command(cmd_ctx, NULL, "pic32mx",
+ struct command *pic32mx_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "pic32mx",
NULL, COMMAND_ANY, "pic32mx flash specific commands");
#if 0
- register_command(cmd_ctx, pic32mx_cmd, "lock",
+ COMMAND_REGISTER(cmd_ctx, pic32mx_cmd, "lock",
pic32mx_handle_lock_command, COMMAND_EXEC,
"lock device");
- register_command(cmd_ctx, pic32mx_cmd, "unlock",
+ COMMAND_REGISTER(cmd_ctx, pic32mx_cmd, "unlock",
pic32mx_handle_unlock_command, COMMAND_EXEC,
"unlock protected device");
#endif
- register_command(cmd_ctx, pic32mx_cmd, "chip_erase",
+ COMMAND_REGISTER(cmd_ctx, pic32mx_cmd, "chip_erase",
pic32mx_handle_chip_erase_command, COMMAND_EXEC,
"erase device");
- register_command(cmd_ctx, pic32mx_cmd, "pgm_word",
+ COMMAND_REGISTER(cmd_ctx, pic32mx_cmd, "pgm_word",
pic32mx_handle_pgm_word_command, COMMAND_EXEC,
"program a word");
return ERROR_OK;
diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c
index 32fa415e..2d653eca 100644
--- a/src/flash/stellaris.c
+++ b/src/flash/stellaris.c
@@ -1163,10 +1163,10 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command)
static int stellaris_register_commands(struct command_context *cmd_ctx)
{
- struct command *stm32x_cmd = register_command(cmd_ctx, NULL, "stellaris",
+ struct command *stm32x_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "stellaris",
NULL, COMMAND_ANY, "stellaris flash specific commands");
- register_command(cmd_ctx, stm32x_cmd, "mass_erase",
+ COMMAND_REGISTER(cmd_ctx, stm32x_cmd, "mass_erase",
stellaris_handle_mass_erase_command, COMMAND_EXEC,
"mass erase device");
return ERROR_OK;
diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c
index c96b49d7..c628f187 100644
--- a/src/flash/stm32x.c
+++ b/src/flash/stm32x.c
@@ -1184,22 +1184,22 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command)
static int stm32x_register_commands(struct command_context *cmd_ctx)
{
- struct command *stm32x_cmd = register_command(cmd_ctx, NULL, "stm32x",
+ struct command *stm32x_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "stm32x",
NULL, COMMAND_ANY, "stm32x flash specific commands");
- register_command(cmd_ctx, stm32x_cmd, "lock",
+ COMMAND_REGISTER(cmd_ctx, stm32x_cmd, "lock",
stm32x_handle_lock_command, COMMAND_EXEC,
"lock device");
- register_command(cmd_ctx, stm32x_cmd, "unlock",
+ COMMAND_REGISTER(cmd_ctx, stm32x_cmd, "unlock",
stm32x_handle_unlock_command, COMMAND_EXEC,
"unlock protected device");
- register_command(cmd_ctx, stm32x_cmd, "mass_erase",
+ COMMAND_REGISTER(cmd_ctx, stm32x_cmd, "mass_erase",
stm32x_handle_mass_erase_command, COMMAND_EXEC,
"mass erase device");
- register_command(cmd_ctx, stm32x_cmd, "options_read",
+ COMMAND_REGISTER(cmd_ctx, stm32x_cmd, "options_read",
stm32x_handle_options_read_command, COMMAND_EXEC,
"read device option bytes");
- register_command(cmd_ctx, stm32x_cmd, "options_write",
+ COMMAND_REGISTER(cmd_ctx, stm32x_cmd, "options_write",
stm32x_handle_options_write_command, COMMAND_EXEC,
"write device option bytes");
diff --git a/src/flash/str7x.c b/src/flash/str7x.c
index b79dd17f..b53ddf99 100644
--- a/src/flash/str7x.c
+++ b/src/flash/str7x.c
@@ -674,10 +674,10 @@ COMMAND_HANDLER(str7x_handle_disable_jtag_command)
static int str7x_register_commands(struct command_context *cmd_ctx)
{
- struct command *str7x_cmd = register_command(cmd_ctx, NULL, "str7x",
+ struct command *str7x_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "str7x",
NULL, COMMAND_ANY, "str7x flash specific commands");
- register_command(cmd_ctx, str7x_cmd, "disable_jtag",
+ COMMAND_REGISTER(cmd_ctx, str7x_cmd, "disable_jtag",
str7x_handle_disable_jtag_command, COMMAND_EXEC,
"disable jtag access");
diff --git a/src/flash/str9x.c b/src/flash/str9x.c
index 3bb89705..6d556d91 100644
--- a/src/flash/str9x.c
+++ b/src/flash/str9x.c
@@ -678,10 +678,10 @@ COMMAND_HANDLER(str9x_handle_flash_config_command)
static int str9x_register_commands(struct command_context *cmd_ctx)
{
- struct command *str9x_cmd = register_command(cmd_ctx, NULL, "str9x",
+ struct command *str9x_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "str9x",
NULL, COMMAND_ANY, "str9x flash commands");
- register_command(cmd_ctx, str9x_cmd, "flash_config",
+ COMMAND_REGISTER(cmd_ctx, str9x_cmd, "flash_config",
str9x_handle_flash_config_command, COMMAND_EXEC,
"configure str9 flash controller");
diff --git a/src/flash/str9xpec.c b/src/flash/str9xpec.c
index f7c705e8..7519413c 100644
--- a/src/flash/str9xpec.c
+++ b/src/flash/str9xpec.c
@@ -1165,40 +1165,40 @@ COMMAND_HANDLER(str9xpec_handle_flash_disable_turbo_command)
static int str9xpec_register_commands(struct command_context *cmd_ctx)
{
- struct command *str9xpec_cmd = register_command(cmd_ctx, NULL, "str9xpec",
+ struct command *str9xpec_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "str9xpec",
NULL, COMMAND_ANY, "str9xpec flash specific commands");
- register_command(cmd_ctx, str9xpec_cmd, "enable_turbo",
+ COMMAND_REGISTER(cmd_ctx, str9xpec_cmd, "enable_turbo",
str9xpec_handle_flash_enable_turbo_command,
COMMAND_EXEC, "enable str9xpec turbo mode");
- register_command(cmd_ctx, str9xpec_cmd, "disable_turbo",
+ COMMAND_REGISTER(cmd_ctx, str9xpec_cmd, "disable_turbo",
str9xpec_handle_flash_disable_turbo_command,
COMMAND_EXEC, "disable str9xpec turbo mode");
- register_command(cmd_ctx, str9xpec_cmd, "options_cmap",
+ COMMAND_REGISTER(cmd_ctx, str9xpec_cmd, "options_cmap",
str9xpec_handle_flash_options_cmap_command,
COMMAND_EXEC, "configure str9xpec boot sector");
- register_command(cmd_ctx, str9xpec_cmd, "options_lvdthd",
+ COMMAND_REGISTER(cmd_ctx, str9xpec_cmd, "options_lvdthd",
str9xpec_handle_flash_options_lvdthd_command,
COMMAND_EXEC, "configure str9xpec lvd threshold");
- register_command(cmd_ctx, str9xpec_cmd, "options_lvdsel",
+ COMMAND_REGISTER(cmd_ctx, str9xpec_cmd, "options_lvdsel",
str9xpec_handle_flash_options_lvdsel_command,
COMMAND_EXEC, "configure str9xpec lvd selection");
- register_command(cmd_ctx, str9xpec_cmd, "options_lvdwarn",
+ COMMAND_REGISTER(cmd_ctx, str9xpec_cmd, "options_lvdwarn",
str9xpec_handle_flash_options_lvdwarn_command,
COMMAND_EXEC, "configure str9xpec lvd warning");
- register_command(cmd_ctx, str9xpec_cmd, "options_read",
+ COMMAND_REGISTER(cmd_ctx, str9xpec_cmd, "options_read",
str9xpec_handle_flash_options_read_command,
COMMAND_EXEC, "read str9xpec options");
- register_command(cmd_ctx, str9xpec_cmd, "options_write",
+ COMMAND_REGISTER(cmd_ctx, str9xpec_cmd, "options_write",
str9xpec_handle_flash_options_write_command,
COMMAND_EXEC, "write str9xpec options");
- register_command(cmd_ctx, str9xpec_cmd, "lock",
+ COMMAND_REGISTER(cmd_ctx, str9xpec_cmd, "lock",
str9xpec_handle_flash_lock_command,
COMMAND_EXEC, "lock str9xpec device");
- register_command(cmd_ctx, str9xpec_cmd, "unlock",
+ COMMAND_REGISTER(cmd_ctx, str9xpec_cmd, "unlock",
str9xpec_handle_flash_unlock_command,
COMMAND_EXEC, "unlock str9xpec device");
- register_command(cmd_ctx, str9xpec_cmd, "part_id",
+ COMMAND_REGISTER(cmd_ctx, str9xpec_cmd, "part_id",
str9xpec_handle_part_id_command,
COMMAND_EXEC, "print part id of str9xpec flash bank <num>");
diff --git a/src/flash/tms470.c b/src/flash/tms470.c
index f6f3900f..bf58f1db 100644
--- a/src/flash/tms470.c
+++ b/src/flash/tms470.c
@@ -819,11 +819,11 @@ static int tms470_erase_sector(struct flash_bank *bank, int sector)
static int tms470_register_commands(struct command_context *cmd_ctx)
{
- struct command *tms470_cmd = register_command(cmd_ctx, NULL, "tms470", NULL, COMMAND_ANY, "applies to TI tms470 family");
+ struct command *tms470_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "tms470", NULL, COMMAND_ANY, "applies to TI tms470 family");
- register_command(cmd_ctx, tms470_cmd, "flash_keyset", tms470_handle_flash_keyset_command, COMMAND_ANY, "tms470 flash_keyset <key0> <key1> <key2> <key3>");
- register_command(cmd_ctx, tms470_cmd, "osc_megahertz", tms470_handle_osc_megahertz_command, COMMAND_ANY, "tms470 osc_megahertz <MHz>");
- register_command(cmd_ctx, tms470_cmd, "plldis", tms470_handle_plldis_command, COMMAND_ANY, "tms470 plldis <0/1>");
+ COMMAND_REGISTER(cmd_ctx, tms470_cmd, "flash_keyset", tms470_handle_flash_keyset_command, COMMAND_ANY, "tms470 flash_keyset <key0> <key1> <key2> <key3>");
+ COMMAND_REGISTER(cmd_ctx, tms470_cmd, "osc_megahertz", tms470_handle_osc_megahertz_command, COMMAND_ANY, "tms470 osc_megahertz <MHz>");
+ COMMAND_REGISTER(cmd_ctx, tms470_cmd, "plldis", tms470_handle_plldis_command, COMMAND_ANY, "tms470 plldis <0/1>");
return ERROR_OK;
}