From: OpenOCD-Gerrit <ope...@us...> - 2020-07-26 19:16:11
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 9b32a06dad0aa6fc9c3896b21d3c32015487a090 (commit) via d62b3c51df50e68e7f8f583f337538b1ea510d97 (commit) from 02ecd452c219a98b9da910b97755c5a326ab4cad (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9b32a06dad0aa6fc9c3896b21d3c32015487a090 Author: Antonio Borneo <bor...@gm...> Date: Sat Apr 4 19:46:38 2020 +0200 drivers/linuxgpiod: add led Bitbang interface allows having a LED on one of the GPIO. Let also linuxgpiod driver to specify and use the LED connection. Change-Id: Id3d8772ee1808b92354fd073ba3947bacd8253ef Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/5770 Tested-by: jenkins diff --git a/src/jtag/drivers/linuxgpiod.c b/src/jtag/drivers/linuxgpiod.c index 661a926f5..99422a116 100644 --- a/src/jtag/drivers/linuxgpiod.c +++ b/src/jtag/drivers/linuxgpiod.c @@ -27,6 +27,7 @@ static int trst_gpio = -1; static int srst_gpio = -1; static int swclk_gpio = -1; static int swdio_gpio = -1; +static int led_gpio = -1; static int gpiochip = -1; static struct gpiod_chip *gpiod_chip; @@ -38,6 +39,7 @@ static struct gpiod_line *gpiod_trst; static struct gpiod_line *gpiod_swclk; static struct gpiod_line *gpiod_swdio; static struct gpiod_line *gpiod_srst; +static struct gpiod_line *gpiod_led; static int last_swclk; static int last_swdio; @@ -171,13 +173,26 @@ static int linuxgpiod_swd_write(int swclk, int swdio) return ERROR_OK; } +static int linuxgpiod_blink(int on) +{ + int retval; + + if (!gpiod_led) + return ERROR_OK; + + retval = gpiod_line_set_value(gpiod_led, on); + if (retval < 0) + LOG_WARNING("Fail set led"); + return retval; +} + static struct bitbang_interface linuxgpiod_bitbang = { .read = linuxgpiod_read, .write = linuxgpiod_write, .swdio_read = linuxgpiod_swdio_read, .swdio_drive = linuxgpiod_swdio_drive, .swd_write = linuxgpiod_swd_write, - .blink = NULL, + .blink = linuxgpiod_blink, }; /* @@ -248,6 +263,7 @@ static inline void helper_release(struct gpiod_line *line) static int linuxgpiod_quit(void) { + helper_release(gpiod_led); helper_release(gpiod_srst); helper_release(gpiod_swdio); helper_release(gpiod_swclk); @@ -370,6 +386,12 @@ static int linuxgpiod_init(void) goto out_error; } + if (is_gpio_valid(led_gpio)) { + gpiod_led = helper_get_output_line("led", led_gpio, 0); + if (gpiod_led == NULL) + goto out_error; + } + return ERROR_OK; out_error: @@ -484,6 +506,15 @@ COMMAND_HANDLER(linuxgpiod_handle_swd_gpionum_swdio) return ERROR_OK; } +COMMAND_HANDLER(linuxgpiod_handle_gpionum_led) +{ + if (CMD_ARGC == 1) + COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], led_gpio); + + command_print(CMD, "LinuxGPIOD num: led = %d", led_gpio); + return ERROR_OK; +} + COMMAND_HANDLER(linuxgpiod_handle_gpiochip) { if (CMD_ARGC == 1) @@ -564,6 +595,13 @@ static const struct command_registration linuxgpiod_command_handlers[] = { .help = "gpio number for swdio.", .usage = "swdio", }, + { + .name = "linuxgpiod_led_num", + .handler = linuxgpiod_handle_gpionum_led, + .mode = COMMAND_CONFIG, + .help = "gpio number for LED.", + .usage = "led", + }, { .name = "linuxgpiod_gpiochip", .handler = linuxgpiod_handle_gpiochip, diff --git a/tcl/interface/dln-2-gpiod.cfg b/tcl/interface/dln-2-gpiod.cfg index 1859688be..5407a244e 100644 --- a/tcl/interface/dln-2-gpiod.cfg +++ b/tcl/interface/dln-2-gpiod.cfg @@ -11,6 +11,7 @@ # | TMS/SWDIO | J3.4 (PA3) | 3 | # | TDI | J3.5 (PA4) | 4 | # | nTRST | J3.6 (PA5) | 5 | +# | LED | J3.7 (PA6) | 6 | # | GND | J3.12 (GND) | | # +-----------+-------------+-------------+ @@ -21,5 +22,6 @@ linuxgpiod_jtag_nums 2 3 4 1 linuxgpiod_trst_num 5 linuxgpiod_swd_nums 2 3 linuxgpiod_srst_num 0 +linuxgpiod_led_num 6 reset_config trst_and_srst separate srst_push_pull commit d62b3c51df50e68e7f8f583f337538b1ea510d97 Author: Antonio Borneo <bor...@gm...> Date: Sun Jul 12 00:38:12 2020 +0200 svf: fix minor typos Change-Id: I40ac2d01c1feb2771ce96a26c4a4d05a1e816a61 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/5761 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/svf/svf.c b/src/svf/svf.c index 81400c530..010592076 100644 --- a/src/svf/svf.c +++ b/src/svf/svf.c @@ -18,11 +18,11 @@ /* The specification for SVF is available here: * http://www.asset-intertech.com/support/svf.pdf - * Below, this document is refered to as the "SVF spec". + * Below, this document is referred to as the "SVF spec". * * The specification for XSVF is available here: * http://www.xilinx.com/support/documentation/application_notes/xapp503.pdf - * Below, this document is refered to as the "XSVF spec". + * Below, this document is referred to as the "XSVF spec". */ #ifdef HAVE_CONFIG_H @@ -231,7 +231,7 @@ static int svf_quiet; static int svf_nil; static int svf_ignore_error; -/* Targetting particular tap */ +/* Targeting particular tap */ static int svf_tap_is_specified; static int svf_set_padding(struct svf_xxr_para *para, int len, unsigned char tdi); @@ -854,7 +854,7 @@ static int svf_copy_hexstring_to_binary(char *str, uint8_t **bin, int orig_bit_l /* check validity: we must have consumed everything */ if (str_len > 0 || (ch & ~((2 << ((bit_len - 1) % 4)) - 1)) != 0) { - LOG_ERROR("value execeeds length"); + LOG_ERROR("value exceeds length"); return ERROR_FAIL; } @@ -1078,7 +1078,7 @@ XXR_common: pbuffer_tmp = &xxr_para_tmp->smask; xxr_para_tmp->data_mask |= XXR_SMASK; } else { - LOG_ERROR("unknow parameter: %s", argus[i]); + LOG_ERROR("unknown parameter: %s", argus[i]); return ERROR_FAIL; } if (ERROR_OK != @@ -1524,7 +1524,7 @@ XXR_common: svf_para.trst_mode = i_tmp; LOG_DEBUG("\ttrst_mode = %s", svf_trst_mode_name[svf_para.trst_mode]); } else { - LOG_ERROR("can not accpet TRST command if trst_mode is ABSENT"); + LOG_ERROR("can not accept TRST command if trst_mode is ABSENT"); return ERROR_FAIL; } break; ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/linuxgpiod.c | 40 +++++++++++++++++++++++++++++++++++++++- src/svf/svf.c | 12 ++++++------ tcl/interface/dln-2-gpiod.cfg | 2 ++ 3 files changed, 47 insertions(+), 7 deletions(-) hooks/post-receive -- Main OpenOCD repository |