Browse Source

drivers/sysfsgpio: Group adapter commands

Use a command group 'sysfsgpio' with subcommands instead of individual
commands with 'sysfsgpio_' prefix.

The old commands are still available for backward compatibility but
marked as deprecated.

Change-Id: I103d8d9b0e3169a916d944a999579746f6f6a59c
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/6402
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
jim
Marc Schink 2 years ago
committed by Antonio Borneo
parent
commit
a369b6b87a
2 changed files with 82 additions and 11 deletions
  1. +22
    -11
      src/jtag/drivers/sysfsgpio.c
  2. +60
    -0
      src/jtag/startup.tcl

+ 22
- 11
src/jtag/drivers/sysfsgpio.c View File

@@ -468,72 +468,72 @@ COMMAND_HANDLER(sysfsgpio_handle_swd_gpionum_swdio)
return ERROR_OK;
}

static const struct command_registration sysfsgpio_command_handlers[] = {
static const struct command_registration sysfsgpio_subcommand_handlers[] = {
{
.name = "sysfsgpio_jtag_nums",
.name = "jtag_nums",
.handler = &sysfsgpio_handle_jtag_gpionums,
.mode = COMMAND_CONFIG,
.help = "gpio numbers for tck, tms, tdi, tdo. (in that order)",
.usage = "[tck tms tdi tdo]",
},
{
.name = "sysfsgpio_tck_num",
.name = "tck_num",
.handler = &sysfsgpio_handle_jtag_gpionum_tck,
.mode = COMMAND_CONFIG,
.help = "gpio number for tck.",
.usage = "[tck]",
},
{
.name = "sysfsgpio_tms_num",
.name = "tms_num",
.handler = &sysfsgpio_handle_jtag_gpionum_tms,
.mode = COMMAND_CONFIG,
.help = "gpio number for tms.",
.usage = "[tms]",
},
{
.name = "sysfsgpio_tdo_num",
.name = "tdo_num",
.handler = &sysfsgpio_handle_jtag_gpionum_tdo,
.mode = COMMAND_CONFIG,
.help = "gpio number for tdo.",
.usage = "[tdo]",
},
{
.name = "sysfsgpio_tdi_num",
.name = "tdi_num",
.handler = &sysfsgpio_handle_jtag_gpionum_tdi,
.mode = COMMAND_CONFIG,
.help = "gpio number for tdi.",
.usage = "[tdi]",
},
{
.name = "sysfsgpio_srst_num",
.name = "srst_num",
.handler = &sysfsgpio_handle_jtag_gpionum_srst,
.mode = COMMAND_CONFIG,
.help = "gpio number for srst.",
.usage = "[srst]",
},
{
.name = "sysfsgpio_trst_num",
.name = "trst_num",
.handler = &sysfsgpio_handle_jtag_gpionum_trst,
.mode = COMMAND_CONFIG,
.help = "gpio number for trst.",
.usage = "[trst]",
},
{
.name = "sysfsgpio_swd_nums",
.name = "swd_nums",
.handler = &sysfsgpio_handle_swd_gpionums,
.mode = COMMAND_CONFIG,
.help = "gpio numbers for swclk, swdio. (in that order)",
.usage = "[swclk swdio]",
},
{
.name = "sysfsgpio_swclk_num",
.name = "swclk_num",
.handler = &sysfsgpio_handle_swd_gpionum_swclk,
.mode = COMMAND_CONFIG,
.help = "gpio number for swclk.",
.usage = "[swclk]",
},
{
.name = "sysfsgpio_swdio_num",
.name = "swdio_num",
.handler = &sysfsgpio_handle_swd_gpionum_swdio,
.mode = COMMAND_CONFIG,
.help = "gpio number for swdio.",
@@ -542,6 +542,17 @@ static const struct command_registration sysfsgpio_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};

static const struct command_registration sysfsgpio_command_handlers[] = {
{
.name = "sysfsgpio",
.mode = COMMAND_ANY,
.help = "perform sysfsgpio management",
.chain = sysfsgpio_subcommand_handlers,
.usage = "",
},
COMMAND_REGISTRATION_DONE
};

static int sysfsgpio_init(void);
static int sysfsgpio_quit(void);



+ 60
- 0
src/jtag/startup.tcl View File

@@ -543,4 +543,64 @@ proc linuxgpiod_gpiochip args {
eval linuxgpiod gpiochip $args
}

lappend _telnet_autocomplete_skip sysfsgpio_jtag_nums
proc sysfsgpio_jtag_nums args {
echo "DEPRECATED! use 'sysfsgpio jtag_nums' not 'sysfsgpio_jtag_nums'"
eval sysfsgpio jtag_nums $args
}

lappend _telnet_autocomplete_skip sysfsgpio_tck_num
proc sysfsgpio_tck_num args {
echo "DEPRECATED! use 'sysfsgpio tck_num' not 'sysfsgpio_tck_num'"
eval sysfsgpio tck_num $args
}

lappend _telnet_autocomplete_skip sysfsgpio_tms_num
proc sysfsgpio_tms_num args {
echo "DEPRECATED! use 'sysfsgpio tms_num' not 'sysfsgpio_tms_num'"
eval sysfsgpio tms_num $args
}

lappend _telnet_autocomplete_skip sysfsgpio_tdo_num
proc sysfsgpio_tdo_num args {
echo "DEPRECATED! use 'sysfsgpio tdo_num' not 'sysfsgpio_tdo_num'"
eval sysfsgpio tdo_num $args
}

lappend _telnet_autocomplete_skip sysfsgpio_tdi_num
proc sysfsgpio_tdi_num args {
echo "DEPRECATED! use 'sysfsgpio tdi_num' not 'sysfsgpio_tdi_num'"
eval sysfsgpio tdi_num $args
}

lappend _telnet_autocomplete_skip sysfsgpio_srst_num
proc sysfsgpio_srst_num args {
echo "DEPRECATED! use 'sysfsgpio srst_num' not 'sysfsgpio_srst_num'"
eval sysfsgpio srst_num $args
}

lappend _telnet_autocomplete_skip sysfsgpio_trst_num
proc sysfsgpio_trst_num args {
echo "DEPRECATED! use 'sysfsgpio trst_num' not 'sysfsgpio_trst_num'"
eval sysfsgpio trst_num $args
}

lappend _telnet_autocomplete_skip sysfsgpio_swd_nums
proc sysfsgpio_swd_nums args {
echo "DEPRECATED! use 'sysfsgpio swd_nums' not 'sysfsgpio_swd_nums'"
eval sysfsgpio swd_nums $args
}

lappend _telnet_autocomplete_skip sysfsgpio_swclk_num
proc sysfsgpio_swclk_num args {
echo "DEPRECATED! use 'sysfsgpio swclk_num' not 'sysfsgpio_swclk_num'"
eval sysfsgpio swclk_num $args
}

lappend _telnet_autocomplete_skip sysfsgpio_swdio_num
proc sysfsgpio_swdio_num args {
echo "DEPRECATED! use 'sysfsgpio swdio_num' not 'sysfsgpio_swdio_num'"
eval sysfsgpio swdio_num $args
}

# END MIGRATION AIDS

Loading…
Cancel
Save