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[])
#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);
#endif
......
......@@ -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,
......
......@@ -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");
......
......@@ -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");
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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 ...]");
......
......@@ -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>");
......
......@@ -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,
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");
......
......@@ -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;
}
......
......@@ -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;
}
......@@ -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']");
......
......@@ -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;
......
......@@ -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;
......
......@@ -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");
......
......@@ -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");
......
......@@ -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");
......
......@@ -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>");
......
......@@ -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;
}
......
......@@ -56,17 +56,17 @@ COMMAND_HANDLER(handle_flag_command)
int foo_register_commands(struct command_context *cmd_ctx)
{
// register several commands under the foo command
struct command *cmd = register_command(cmd_ctx, NULL, "foo",
struct command *cmd = COMMAND_REGISTER(cmd_ctx, NULL, "foo",
NULL, COMMAND_ANY, "foo: command handler skeleton");
register_command(cmd_ctx, cmd, "bar",
COMMAND_REGISTER(cmd_ctx, cmd, "bar",
&handle_foo_command, COMMAND_ANY,
"<address> [enable|disable] - an example command");
register_command(cmd_ctx, cmd, "baz",
COMMAND_REGISTER(cmd_ctx, cmd, "baz",
&handle_foo_command, COMMAND_ANY,
"<address> [enable|disable] - a sample command");
register_command(cmd_ctx, cmd, "flag",
COMMAND_REGISTER(cmd_ctx, cmd, "flag",
&handle_flag_command, COMMAND_ANY,
"[on|off] - set a flag");
......@@ -103,7 +103,7 @@ int hello_register_commands(struct command_context *cmd_ctx)
{
foo_register_commands(cmd_ctx);
struct command *cmd = register_command(cmd_ctx, NULL, "hello",
struct command *cmd = COMMAND_REGISTER(cmd_ctx, NULL, "hello",
&handle_hello_command, COMMAND_ANY,
"[<name>] - prints a warm welcome");
return cmd ? ERROR_OK : -ENOMEM;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment