diff options
author | Alex Crawford <openocd@code.acrawford.com> | 2021-09-25 08:52:50 -0700 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2021-11-05 22:43:48 +0000 |
commit | 6fef2eca381ddcda593aca27290706873a9bcde2 (patch) | |
tree | 8bdff88267c196e22731ffd8f9957d5367cdfd0e | |
parent | bac3ef96b79ac7b7b44585f2c3a2adcd8732f7a2 (diff) | |
download | riscv-openocd-6fef2eca381ddcda593aca27290706873a9bcde2.zip riscv-openocd-6fef2eca381ddcda593aca27290706873a9bcde2.tar.gz riscv-openocd-6fef2eca381ddcda593aca27290706873a9bcde2.tar.bz2 |
drivers/linuxgpiod: add support for opendrain trst
This is a follow-up to 2f424b7eb, which added support for opendrain
srst, finishing up support for opendrain reset signals.
Signed-off-by: Alex Crawford <openocd@code.acrawford.com>
Change-Id: Ib79b2e12f2a9469fd6c53bb839c0d2e8e46103a4
Reviewed-on: https://review.openocd.org/c/openocd/+/6598
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
-rw-r--r-- | src/jtag/drivers/linuxgpiod.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jtag/drivers/linuxgpiod.c b/src/jtag/drivers/linuxgpiod.c index dd50b44..75f6152 100644 --- a/src/jtag/drivers/linuxgpiod.c +++ b/src/jtag/drivers/linuxgpiod.c @@ -360,7 +360,11 @@ static int linuxgpiod_init(void) goto out_error; if (is_gpio_valid(trst_gpio)) { - gpiod_trst = helper_get_output_line("trst", trst_gpio, 1); + if (jtag_get_reset_config() & RESET_TRST_OPEN_DRAIN) + gpiod_trst = helper_get_open_drain_output_line("trst", trst_gpio, 1); + else + gpiod_trst = helper_get_output_line("trst", trst_gpio, 1); + if (!gpiod_trst) goto out_error; } |