Commit 833e7f52 authored by Zachary T Welch's avatar Zachary T Welch
Browse files

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.
parent f7e1f2df
...@@ -1091,7 +1091,7 @@ int main(int argc, char *argv[]) ...@@ -1091,7 +1091,7 @@ int main(int argc, char *argv[])
#ifdef CYGPKG_PROFILE_GPROF #ifdef CYGPKG_PROFILE_GPROF
register_command(cmd_ctx, NULL, "ecosboard_profile", eCosBoard_handle_eCosBoard_profile_command, COMMAND_REGISTER(cmd_ctx, NULL, "ecosboard_profile", eCosBoard_handle_eCosBoard_profile_command,
COMMAND_ANY, NULL); COMMAND_ANY, NULL);
#endif #endif
......
...@@ -2478,18 +2478,18 @@ sam3_register_commands(struct command_context *cmd_ctx) ...@@ -2478,18 +2478,18 @@ sam3_register_commands(struct command_context *cmd_ctx)
if (!sam3_registered) { if (!sam3_registered) {
sam3_registered++; sam3_registered++;
pCmd = register_command(cmd_ctx, NULL, "at91sam3", NULL, COMMAND_ANY, NULL); pCmd = COMMAND_REGISTER(cmd_ctx, NULL, "at91sam3", NULL, COMMAND_ANY, NULL);
register_command(cmd_ctx, pCmd, COMMAND_REGISTER(cmd_ctx, pCmd,
"gpnvm", "gpnvm",
sam3_handle_gpnvm_command, sam3_handle_gpnvm_command,
COMMAND_EXEC, COMMAND_EXEC,
"at91sam3 gpnvm [action [<BIT>], by default 'show', otherwise set | clear BIT"); "at91sam3 gpnvm [action [<BIT>], by default 'show', otherwise set | clear BIT");
register_command(cmd_ctx, pCmd, COMMAND_REGISTER(cmd_ctx, pCmd,
"info", "info",
sam3_handle_info_command, sam3_handle_info_command,
COMMAND_EXEC, COMMAND_EXEC,
"at91sam3 info - print information about the current sam3 chip"); "at91sam3 info - print information about the current sam3 chip");
register_command(cmd_ctx, pCmd, COMMAND_REGISTER(cmd_ctx, pCmd,
"slowclk", "slowclk",
sam3_handle_slowclk_command, sam3_handle_slowclk_command,
COMMAND_EXEC, COMMAND_EXEC,
......
...@@ -1180,10 +1180,10 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command) ...@@ -1180,10 +1180,10 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command)
static int at91sam7_register_commands(struct command_context *cmd_ctx) 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); 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_handle_gpnvm_command, COMMAND_EXEC,
"at91sam7 gpnvm <bit> set | clear, " "at91sam7 gpnvm <bit> set | clear, "
"set or clear one gpnvm bit"); "set or clear one gpnvm bit");
......
...@@ -451,10 +451,10 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command) ...@@ -451,10 +451,10 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command)
static int avrf_register_commands(struct command_context *cmd_ctx) 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"); 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, avrf_handle_mass_erase_command, COMMAND_EXEC,
"mass erase device"); "mass erase device");
......
...@@ -592,9 +592,9 @@ static int cfi_intel_info(struct flash_bank *bank, char *buf, int buf_size) ...@@ -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) static int cfi_register_commands(struct command_context *cmd_ctx)
{ {
/*struct command *cfi_cmd = */ /*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>"); "print part id of cfi flash bank <num>");
*/ */
return ERROR_OK; return ERROR_OK;
......
...@@ -338,7 +338,7 @@ static int ecosflash_probe(struct flash_bank *bank) ...@@ -338,7 +338,7 @@ static int ecosflash_probe(struct flash_bank *bank)
static int ecosflash_register_commands(struct command_context *cmd_ctx) 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; return ERROR_OK;
} }
......
...@@ -1280,42 +1280,42 @@ int flash_init_drivers(struct command_context *cmd_ctx) ...@@ -1280,42 +1280,42 @@ int flash_init_drivers(struct command_context *cmd_ctx)
if (!flash_banks) if (!flash_banks)
return ERROR_OK; return ERROR_OK;
register_command(cmd_ctx, flash_cmd, "info", COMMAND_REGISTER(cmd_ctx, flash_cmd, "info",
handle_flash_info_command, COMMAND_EXEC, handle_flash_info_command, COMMAND_EXEC,
"print info about flash bank <num>"); "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, handle_flash_probe_command, COMMAND_EXEC,
"identify flash bank <num>"); "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, handle_flash_erase_check_command, COMMAND_EXEC,
"check erase state of sectors in flash bank <num>"); "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, handle_flash_protect_check_command, COMMAND_EXEC,
"check protection state of sectors in flash bank <num>"); "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, handle_flash_erase_command, COMMAND_EXEC,
"erase sectors at <bank> <first> <last>"); "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, handle_flash_erase_address_command, COMMAND_EXEC,
"erase address range <address> <length>"); "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, handle_flash_fill_command, COMMAND_EXEC,
"fill with pattern (no autoerase) <address> <word_pattern> <count>"); "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, handle_flash_fill_command, COMMAND_EXEC,
"fill with pattern <address> <halfword_pattern> <count>"); "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, handle_flash_fill_command, COMMAND_EXEC,
"fill with pattern <address> <byte_pattern> <count>"); "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, handle_flash_write_bank_command, COMMAND_EXEC,
"write binary data to <bank> <file> <offset>"); "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, handle_flash_write_image_command, COMMAND_EXEC,
"write_image [erase] [unlock] <file> [offset] [type]"); "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, handle_flash_protect_command, COMMAND_EXEC,
"set protection of sectors at <bank> <first> <last> <on | off>"); "set protection of sectors at <bank> <first> <last> <on | off>");
...@@ -1324,10 +1324,10 @@ int flash_init_drivers(struct command_context *cmd_ctx) ...@@ -1324,10 +1324,10 @@ int flash_init_drivers(struct command_context *cmd_ctx)
int flash_register_commands(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); NULL, COMMAND_ANY, NULL);
register_command(cmd_ctx, flash_cmd, "bank", COMMAND_REGISTER(cmd_ctx, flash_cmd, "bank",
handle_flash_bank_command, COMMAND_CONFIG, handle_flash_bank_command, COMMAND_CONFIG,
"flash bank <driver> <base> <size> " "flash bank <driver> <base> <size> "
"<chip_width> <bus_width> <target> [driver_options ...]"); "<chip_width> <bus_width> <target> [driver_options ...]");
......
...@@ -778,10 +778,10 @@ COMMAND_HANDLER(lpc2000_handle_part_id_command) ...@@ -778,10 +778,10 @@ COMMAND_HANDLER(lpc2000_handle_part_id_command)
static int lpc2000_register_commands(struct command_context *cmd_ctx) 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); 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, lpc2000_handle_part_id_command, COMMAND_EXEC,
"print part id of lpc2000 flash bank <num>"); "print part id of lpc2000 flash bank <num>");
......
...@@ -954,60 +954,36 @@ COMMAND_HANDLER(lpc2900_handle_secure_jtag_command) ...@@ -954,60 +954,36 @@ COMMAND_HANDLER(lpc2900_handle_secure_jtag_command)
*/ */
static int lpc2900_register_commands(struct command_context *cmd_ctx) 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); NULL, COMMAND_ANY, NULL);
register_command( COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "signature",
cmd_ctx, &lpc2900_handle_signature_command, COMMAND_EXEC,
lpc2900_cmd,
"signature",
lpc2900_handle_signature_command,
COMMAND_EXEC,
"<bank> | " "<bank> | "
"print device signature of flash bank"); "print device signature of flash bank");
register_command( COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "read_custom",
cmd_ctx, &lpc2900_handle_read_custom_command, COMMAND_EXEC,
lpc2900_cmd,
"read_custom",
lpc2900_handle_read_custom_command,
COMMAND_EXEC,
"<bank> <filename> | " "<bank> <filename> | "
"read customer information from index sector to file"); "read customer information from index sector to file");
register_command( COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "password",
cmd_ctx, &lpc2900_handle_password_command, COMMAND_EXEC,
lpc2900_cmd,
"password",
lpc2900_handle_password_command,
COMMAND_EXEC,
"<bank> <password> | " "<bank> <password> | "
"enter password to enable 'dangerous' options"); "enter password to enable 'dangerous' options");
register_command( COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "write_custom",
cmd_ctx, &lpc2900_handle_write_custom_command, COMMAND_EXEC,
lpc2900_cmd,
"write_custom",
lpc2900_handle_write_custom_command,
COMMAND_EXEC,
"<bank> <filename> [<type>] | " "<bank> <filename> [<type>] | "
"write customer info from file to index sector"); "write customer info from file to index sector");
register_command( COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "secure_sector",
cmd_ctx, &lpc2900_handle_secure_sector_command, COMMAND_EXEC,
lpc2900_cmd,
"secure_sector",
lpc2900_handle_secure_sector_command,
COMMAND_EXEC,
"<bank> <first> <last> | " "<bank> <first> <last> | "
"activate sector security for a range of sectors"); "activate sector security for a range of sectors");
register_command( COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "secure_jtag",
cmd_ctx, &lpc2900_handle_secure_jtag_command, COMMAND_EXEC,
lpc2900_cmd,
"secure_jtag",
lpc2900_handle_secure_jtag_command,
COMMAND_EXEC,
"<bank> <level> | " "<bank> <level> | "
"activate JTAG security"); "activate JTAG security");
......
...@@ -875,9 +875,9 @@ COMMAND_HANDLER(handle_lpc3180_select_command) ...@@ -875,9 +875,9 @@ COMMAND_HANDLER(handle_lpc3180_select_command)
static int lpc3180_register_commands(struct command_context *cmd_ctx) 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; return ERROR_OK;
} }
......
...@@ -1271,12 +1271,12 @@ COMMAND_HANDLER(mg_config_cmd) ...@@ -1271,12 +1271,12 @@ COMMAND_HANDLER(mg_config_cmd)
int mflash_init_drivers(struct command_context *cmd_ctx) int mflash_init_drivers(struct command_context *cmd_ctx)
{ {
if (mflash_bank) { if (mflash_bank) {
register_command(cmd_ctx, mflash_cmd, "probe", mg_probe_cmd, COMMAND_EXEC, NULL); COMMAND_REGISTER(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, "write", mg_write_cmd, COMMAND_EXEC,
"mflash write <num> <file> <address>"); "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>"); "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>"); COMMAND_EXEC, "mflash config <num> <stage>");
} }
...@@ -1325,8 +1325,8 @@ COMMAND_HANDLER(mg_bank_cmd) ...@@ -1325,8 +1325,8 @@ COMMAND_HANDLER(mg_bank_cmd)
int mflash_register_commands(struct command_context *cmd_ctx) int mflash_register_commands(struct command_context *cmd_ctx)
{ {
mflash_cmd = register_command(cmd_ctx, NULL, "mflash", NULL, COMMAND_ANY, NULL); mflash_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "mflash", NULL, COMMAND_ANY, NULL);
register_command(cmd_ctx, mflash_cmd, "bank", mg_bank_cmd, COMMAND_CONFIG, COMMAND_REGISTER(cmd_ctx, mflash_cmd, "bank", mg_bank_cmd, COMMAND_CONFIG,
"mflash bank <soc> <base> <RST pin> <target #>"); "mflash bank <soc> <base> <RST pin> <target #>");
return ERROR_OK; return ERROR_OK;
} }
...@@ -281,13 +281,13 @@ COMMAND_HANDLER(handle_nand_device_command) ...@@ -281,13 +281,13 @@ COMMAND_HANDLER(handle_nand_device_command)
int nand_register_commands(struct command_context *cmd_ctx) 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"); 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, &handle_nand_device_command, COMMAND_CONFIG,
"defines a new NAND bank"); "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, &handle_nand_list_drivers, COMMAND_ANY,
"lists available NAND drivers"); "lists available NAND drivers");
...@@ -1705,36 +1705,36 @@ int nand_init(struct command_context *cmd_ctx) ...@@ -1705,36 +1705,36 @@ int nand_init(struct command_context *cmd_ctx)
if (!nand_devices) if (!nand_devices)
return ERROR_OK; return ERROR_OK;
register_command(cmd_ctx, nand_cmd, "list", COMMAND_REGISTER(cmd_ctx, nand_cmd, "list",
handle_nand_list_command, COMMAND_EXEC, handle_nand_list_command, COMMAND_EXEC,
"list configured NAND flash devices"); "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, handle_nand_info_command, COMMAND_EXEC,
"print info about NAND flash device <num>"); "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, handle_nand_probe_command, COMMAND_EXEC,
"identify NAND flash device <num>"); "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, handle_nand_check_bad_blocks_command, COMMAND_EXEC,
"check NAND flash device <num> for bad blocks [<offset> <length>]"); "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, handle_nand_erase_command, COMMAND_EXEC,
"erase blocks on NAND flash device <num> [<offset> <length>]"); "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, handle_nand_dump_command, COMMAND_EXEC,
"dump from NAND flash device <num> <filename> " "dump from NAND flash device <num> <filename> "
"<offset> <length> [oob_raw | oob_only]"); "<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, &handle_nand_verify_command, COMMAND_EXEC,
"verify NAND flash device <num> <filename> <offset> " "verify NAND flash device <num> <filename> <offset> "
"[oob_raw | oob_only | oob_softecc | oob_softecc_kw]"); "[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, handle_nand_write_command, COMMAND_EXEC,
"write to NAND flash device <num> <filename> <offset> " "write to NAND flash device <num> <filename> <offset> "
"[oob_raw | oob_only | oob_softecc | oob_softecc_kw]"); "[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, handle_nand_raw_access_command, COMMAND_EXEC,
"raw access to NAND flash device <num> ['enable'|'disable']"); "raw access to NAND flash device <num> ['enable'|'disable']");
......
...@@ -885,20 +885,20 @@ COMMAND_HANDLER(pic32mx_handle_pgm_word_command) ...@@ -885,20 +885,20 @@ COMMAND_HANDLER(pic32mx_handle_pgm_word_command)
static int pic32mx_register_commands(struct command_context *cmd_ctx) 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"); NULL, COMMAND_ANY, "pic32mx flash specific commands");
#if 0 #if 0
register_command(cmd_ctx, pic32mx_cmd, "lock", COMMAND_REGISTER(cmd_ctx, pic32mx_cmd, "lock",
pic32mx_handle_lock_command, COMMAND_EXEC, pic32mx_handle_lock_command, COMMAND_EXEC,
"lock device"); "lock device");
register_command(cmd_ctx, pic32mx_cmd, "unlock", COMMAND_REGISTER(cmd_ctx, pic32mx_cmd, "unlock",
pic32mx_handle_unlock_command, COMMAND_EXEC, pic32mx_handle_unlock_command, COMMAND_EXEC,
"unlock protected device"); "unlock protected device");
#endif #endif
register_command(cmd_ctx, pic32mx_cmd, "chip_erase", COMMAND_REGISTER(cmd_ctx, pic32mx_cmd, "chip_erase",
pic32mx_handle_chip_erase_command, COMMAND_EXEC, pic32mx_handle_chip_erase_command, COMMAND_EXEC,
"erase device"); "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, pic32mx_handle_pgm_word_command, COMMAND_EXEC,
"program a word"); "program a word");
return ERROR_OK; return ERROR_OK;
......
...@@ -1163,10 +1163,10 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command) ...@@ -1163,10 +1163,10 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command)
static int stellaris_register_commands(struct command_context *cmd_ctx) 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"); 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, stellaris_handle_mass_erase_command, COMMAND_EXEC,
"mass erase device"); "mass erase device");
return ERROR_OK; return ERROR_OK;
......
...@@ -1184,22 +1184,22 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command) ...@@ -1184,22 +1184,22 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command)
static int stm32x_register_commands(struct command_context *cmd_ctx) 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"); 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, stm32x_handle_lock_command, COMMAND_EXEC,
"lock device"); "lock device");
register_command(cmd_ctx, stm32x_cmd, "unlock", COMMAND_REGISTER(cmd_ctx, stm32x_cmd, "unlock",
stm32x_handle_unlock_command, COMMAND_EXEC, stm32x_handle_unlock_command, COMMAND_EXEC,
"unlock protected device"); "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, stm32x_handle_mass_erase_command, COMMAND_EXEC,
"mass erase device"); "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, stm32x_handle_options_read_command, COMMAND_EXEC,
"read device option bytes"); "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, stm32x_handle_options_write_command, COMMAND_EXEC,
"write device option bytes"); "write device option bytes");
......
...@@ -674,10 +674,10 @@ COMMAND_HANDLER(str7x_handle_disable_jtag_command) ...@@ -674,10 +674,10 @@ COMMAND_HANDLER(str7x_handle_disable_jtag_command)
static int str7x_register_commands(struct command_context *cmd_ctx) 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"); 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, str7x_handle_disable_jtag_command, COMMAND_EXEC,
"disable jtag access"); "disable jtag access");
......
...@@ -678,10 +678,10 @@ COMMAND_HANDLER(str9x_handle_flash_config_command) ...@@ -678,10 +678,10 @@ COMMAND_HANDLER(str9x_handle_flash_config_command)
static int str9x_register_commands(struct command_context *cmd_ctx) 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",