You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: openocd-gerrit <ope...@us...> - 2025-02-22 18:34:10
|
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 f63b41bbe4ce33449ec18106620f57ba69ce7549 (commit) from 0d7d178ed4fe2e99de804412fde9bb11c872f10a (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 f63b41bbe4ce33449ec18106620f57ba69ce7549 Author: Tomas Vanek <va...@fb...> Date: Sat Feb 15 08:11:02 2025 +0100 drivers/linuxspidev: fix compilation on Linux older than 3.15 Although the commit [1] which introduced SPI_IOC_WR_MODE32 is 10 years old, some hardware may enforce old Linux because the vendor didn't bother with system updates. Change-Id: I76d0b38c8646b1be329418860916b9f01b90990d Link: [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/include/uapi/linux/spi/spidev.h?h=linux-3.15.y&id=dc64d39b54c1e9db97a6fb1ca52598c981728157 Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/8759 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/jtag/drivers/linuxspidev.c b/src/jtag/drivers/linuxspidev.c index 6a149a977..18abdc7db 100644 --- a/src/jtag/drivers/linuxspidev.c +++ b/src/jtag/drivers/linuxspidev.c @@ -302,8 +302,20 @@ static int spidev_init(void) return ERROR_JTAG_INIT_FAILED; } + int ret; // Set SPI mode. - int ret = ioctl(spi_fd, SPI_IOC_WR_MODE32, &spi_mode); +#ifdef SPI_IOC_WR_MODE32 + ret = ioctl(spi_fd, SPI_IOC_WR_MODE32, &spi_mode); +#else + // Linux pre 3.15 does not support MODE32, use 8-bit ioctl + if (spi_mode & ~0xff) { + LOG_ERROR("SPI mode 0x%" PRIx32 ", system permits 8 bits only", spi_mode); + return ERROR_JTAG_INIT_FAILED; + } + + uint8_t mode = (uint8_t)spi_mode; + ret = ioctl(spi_fd, SPI_IOC_WR_MODE, &mode); +#endif if (ret == -1) { LOG_ERROR("Failed to set SPI mode 0x%" PRIx32, spi_mode); return ERROR_JTAG_INIT_FAILED; ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/linuxspidev.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-21 21:22:09
|
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 0d7d178ed4fe2e99de804412fde9bb11c872f10a (commit) from 583506730d00cd88d2b8741993fa604c43a71658 (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 0d7d178ed4fe2e99de804412fde9bb11c872f10a Author: Evgeniy Naydanov <evg...@sy...> Date: Wed Feb 12 21:12:30 2025 +0300 flash/nor/rsl10: drop unused `rsl10_info` in `rsl10_protect_check()` `struct rsl10_info *chip` is only used in `rsl10_protect_check()` in an assertion triggerring `-Wunused-variable` when compiled with `DNDEBUG`. Drop it. Change-Id: Ib302aea742131479f04f32e8fe8a88a3230ae203 Signed-off-by: Evgeniy Naydanov <evg...@sy...> Reviewed-on: https://review.openocd.org/c/openocd/+/8755 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/flash/nor/rsl10.c b/src/flash/nor/rsl10.c index c286e9ac8..c33099787 100644 --- a/src/flash/nor/rsl10.c +++ b/src/flash/nor/rsl10.c @@ -155,11 +155,6 @@ static int rsl10_get_probed_chip_if_halted(struct flash_bank *bank, struct rsl10 static int rsl10_protect_check(struct flash_bank *bank) { - struct rsl10_bank *nbank = bank->driver_priv; - struct rsl10_info *chip = nbank->chip; - - assert(chip); - uint32_t status; int retval = target_read_u32(bank->target, RSL10_FLASH_REG_IF_STATUS, &status); ----------------------------------------------------------------------- Summary of changes: src/flash/nor/rsl10.c | 5 ----- 1 file changed, 5 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:32:13
|
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 1f3f635693a1ddc85f362dc324cb49c3e7b75f27 (commit) from ed4e58410446343a485625ee2722144cc23d55a6 (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 1f3f635693a1ddc85f362dc324cb49c3e7b75f27 Author: Antonio Borneo <bor...@gm...> Date: Thu Feb 6 11:48:30 2025 +0100 build: drop space after 'angie' folder name The makefile consider the two white spaces between the end of the folder name and the '#' character for the beginning of the comment as part of the folder name. This cause 'make install' to create a folder named 'angie ' that is not welcome on all the OS. Drop the comment and the space after the folder name. Reported-by: Liviu Ionescu <il...@li...> Change-Id: Iadd6803431edb83d0d84f4e4dc6d36b454f912ac Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: 0ed03df6e95b ("amend angie build definitions to fix make dist") Reviewed-on: https://review.openocd.org/c/openocd/+/8740 Reviewed-by: Liviu Ionescu Tested-by: jenkins Reviewed-by: Adrien Charruel <ach...@na...> diff --git a/src/jtag/drivers/Makefile.am b/src/jtag/drivers/Makefile.am index ec233b247..b0dd8e3ad 100644 --- a/src/jtag/drivers/Makefile.am +++ b/src/jtag/drivers/Makefile.am @@ -125,7 +125,7 @@ dist_ulink_DATA = $(ULINK_FIRMWARE)/ulink_firmware.hex endif if ANGIE - angiedir = $(pkgdatadir)/angie # This is only for dist_angie_DATA. + angiedir = $(pkgdatadir)/angie DRIVERFILES += %D%/angie.c DRIVERFILES += %D%/angie/include/msgtypes.h EXTRA_DIST += %D%/angie/README ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:31:38
|
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 ed4e58410446343a485625ee2722144cc23d55a6 (commit) from 71f92c94468f370be80ce60dd76d5d924ddba69a (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 ed4e58410446343a485625ee2722144cc23d55a6 Author: Tomas Vanek <va...@fb...> Date: Mon Feb 3 21:45:07 2025 +0100 jtag/core: fix segfault when adapter driver has no reset method xlnx-pcie-xvc and linuxspidev adapter drivers does not implement the reset method. Although it is likely both adapters will implement the method in the near future, avoid segfault and return an error instead. Change-Id: If8ddf165dbc563cf6d64b2094968151075778ba7 Signed-off-by: Tomas Vanek <va...@fb...> Fixes: commit 8850eb8f2c51 ("swd: get rid of jtag queue to assert/deassert srst") Reviewed-on: https://review.openocd.org/c/openocd/+/8735 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/jtag/core.c b/src/jtag/core.c index 89d53aecb..030c173be 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -631,6 +631,13 @@ static int adapter_system_reset(int req_srst) /* Maybe change SRST signal state */ if (jtag_srst != req_srst) { + if (!adapter_driver->reset) { + if (req_srst) + LOG_ERROR("Adapter driver does not implement SRST handling"); + + return ERROR_NOT_IMPLEMENTED; + } + retval = adapter_driver->reset(0, req_srst); if (retval != ERROR_OK) { LOG_ERROR("SRST error"); ----------------------------------------------------------------------- Summary of changes: src/jtag/core.c | 7 +++++++ 1 file changed, 7 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:31:01
|
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 71f92c94468f370be80ce60dd76d5d924ddba69a (commit) from dcf02f46ff8355eb3f889aaa9d660f73dacede4f (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 71f92c94468f370be80ce60dd76d5d924ddba69a Author: Tomas Vanek <va...@fb...> Date: Tue Jan 28 20:43:33 2025 +0100 target/cortex_m: call adapter_deassert_reset() only if srst is configured Deasserting is useless if reset was not asserted except the very corner case: changed reset_config during reset processing. Change-Id: I1d1ea142980d67293daa348a2869b68ffd78d0eb Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/8734 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 2cea203a2..9314d6675 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -1849,10 +1849,12 @@ static int cortex_m_deassert_reset(struct target *target) target_state_name(target), target_was_examined(target) ? "" : " not"); + enum reset_types jtag_reset_config = jtag_get_reset_config(); + /* deassert reset lines */ - adapter_deassert_reset(); + if (jtag_reset_config & RESET_HAS_SRST) + adapter_deassert_reset(); - enum reset_types jtag_reset_config = jtag_get_reset_config(); if ((jtag_reset_config & RESET_HAS_SRST) && !(jtag_reset_config & RESET_SRST_NO_GATING) && ----------------------------------------------------------------------- Summary of changes: src/target/cortex_m.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:29:35
|
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 dcf02f46ff8355eb3f889aaa9d660f73dacede4f (commit) from 5e4ad24ba610e81ee6e9358154ef176e15c36fe7 (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 dcf02f46ff8355eb3f889aaa9d660f73dacede4f Author: R. Diez <rdi...@ya...> Date: Sat Jan 25 23:04:50 2025 +0100 Makefile.am: DISTCHECK_CONFIGURE_FLAGS -> AM_DISTCHECK_CONFIGURE_FLAGS The Automake manual states: "The user can still extend or override the flags provided there by defining the DISTCHECK_CONFIGURE_FLAGS variable". Overriding variable DISTCHECK_CONFIGURE_FLAGS in Makefile.am makes it impossible for the user to do that. I discovered this when trying to pass --enable-internal-jimtcl to distcheck. Change-Id: Ibe5b1f23ccf3fbaa21c48b574a1b3f3e9f6fb916 Signed-off-by: R. Diez <rdi...@ya...> Reviewed-on: https://review.openocd.org/c/openocd/+/8724 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/Makefile.am b/Makefile.am index 155a2b3bb..271a2c165 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,7 +7,7 @@ AUTOMAKE_OPTIONS = gnu 1.6 .DELETE_ON_ERROR: # make sure we pass the correct jimtcl flags to distcheck -DISTCHECK_CONFIGURE_FLAGS = --disable-install-jim +AM_DISTCHECK_CONFIGURE_FLAGS = --disable-install-jim # do not run Jim Tcl tests (esp. during distcheck) check-recursive: SUBDIRS := ----------------------------------------------------------------------- Summary of changes: Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:29:06
|
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 5e4ad24ba610e81ee6e9358154ef176e15c36fe7 (commit) from 4deb76fc9d48aff71b1f2875eecc4b6964c0a0c7 (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 5e4ad24ba610e81ee6e9358154ef176e15c36fe7 Author: R. Diez <rdi...@ya...> Date: Sat Jan 25 21:04:05 2025 +0100 configure.ac: show vdebug in the config summary Also enable this adapter by default (auto). Change-Id: Id011168b93c4cdc602ab78eabfb9a64ca8d8a7df Signed-off-by: R. Diez <rdi...@ya...> Reviewed-on: https://review.openocd.org/c/openocd/+/8601 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/configure.ac b/configure.ac index 4b10aabd5..fda0b2a36 100644 --- a/configure.ac +++ b/configure.ac @@ -172,6 +172,8 @@ m4_define([SERIAL_PORT_ADAPTERS], m4_define([LINUXSPIDEV_ADAPTER], [[[linuxspidev], [Linux spidev driver], [LINUXSPIDEV]]]) +m4_define([VDEBUG_ADAPTER], + [[[vdebug], [Cadence Virtual Debug Interface], [VDEBUG]]]) # The word 'Adapter' in "Dummy Adapter" below must begin with a capital letter # because there is an M4 macro called 'adapter'. @@ -302,6 +304,7 @@ AC_ARG_ADAPTERS([ LINUXSPIDEV_ADAPTER, SERIAL_PORT_ADAPTERS, DUMMY_ADAPTER, + VDEBUG_ADAPTER, PCIE_ADAPTERS, LIBJAYLINK_ADAPTERS ],[auto]) @@ -324,10 +327,6 @@ AC_ARG_ENABLE([jtag_vpi], AS_HELP_STRING([--enable-jtag_vpi], [Enable building support for JTAG VPI]), [build_jtag_vpi=$enableval], [build_jtag_vpi=no]) -AC_ARG_ENABLE([vdebug], - AS_HELP_STRING([--enable-vdebug], [Enable building support for Cadence Virtual Debug Interface]), - [build_vdebug=$enableval], [build_vdebug=no]) - AC_ARG_ENABLE([jtag_dpi], AS_HELP_STRING([--enable-jtag_dpi], [Enable building support for JTAG DPI]), [build_jtag_dpi=$enableval], [build_jtag_dpi=no]) @@ -581,12 +580,6 @@ AS_IF([test "x$build_jtag_vpi" = "xyes"], [ AC_DEFINE([BUILD_JTAG_VPI], [0], [0 if you don't want JTAG VPI.]) ]) -AS_IF([test "x$build_vdebug" = "xyes"], [ - AC_DEFINE([BUILD_VDEBUG], [1], [1 if you want Cadence vdebug interface.]) -], [ - AC_DEFINE([BUILD_VDEBUG], [0], [0 if you don't want Cadence vdebug interface.]) -]) - AS_IF([test "x$build_jtag_dpi" = "xyes"], [ AC_DEFINE([BUILD_JTAG_DPI], [1], [1 if you want JTAG DPI.]) ], [ @@ -738,6 +731,7 @@ PROCESS_ADAPTERS([PCIE_ADAPTERS], ["x$is_linux" = "xyes"], [Linux build]) PROCESS_ADAPTERS([SERIAL_PORT_ADAPTERS], ["x$can_build_buspirate" = "xyes"], [internal error: validation should happen beforehand]) PROCESS_ADAPTERS([LINUXSPIDEV_ADAPTER], ["x$is_linux" = "xyes"], [Linux spidev]) +PROCESS_ADAPTERS([VDEBUG_ADAPTER], [true], [unused]) PROCESS_ADAPTERS([DUMMY_ADAPTER], [true], [unused]) AS_IF([test "x$enable_linuxgpiod" != "xno"], [ @@ -786,7 +780,6 @@ AM_CONDITIONAL([IMX_GPIO], [test "x$build_imx_gpio" = "xyes"]) AM_CONDITIONAL([AM335XGPIO], [test "x$build_am335xgpio" = "xyes"]) AM_CONDITIONAL([BITBANG], [test "x$build_bitbang" = "xyes"]) AM_CONDITIONAL([JTAG_VPI], [test "x$build_jtag_vpi" = "xyes"]) -AM_CONDITIONAL([VDEBUG], [test "x$build_vdebug" = "xyes"]) AM_CONDITIONAL([JTAG_DPI], [test "x$build_jtag_dpi" = "xyes"]) AM_CONDITIONAL([USB_BLASTER_DRIVER], [test "x$enable_usb_blaster" != "xno" -o "x$enable_usb_blaster_2" != "xno"]) AM_CONDITIONAL([AMTJTAGACCEL], [test "x$build_amtjtagaccel" = "xyes"]) @@ -892,6 +885,7 @@ m4_foreach([adapter], [USB1_ADAPTERS, LIBGPIOD_ADAPTERS, LIBJAYLINK_ADAPTERS, PCIE_ADAPTERS, SERIAL_PORT_ADAPTERS, LINUXSPIDEV_ADAPTER, + VDEBUG_ADAPTER, DUMMY_ADAPTER, OPTIONAL_LIBRARIES, COVERAGE], ----------------------------------------------------------------------- Summary of changes: configure.ac | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:28:37
|
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 4deb76fc9d48aff71b1f2875eecc4b6964c0a0c7 (commit) from a71f2b70894a8118730d912edf27fe488580bd4c (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 4deb76fc9d48aff71b1f2875eecc4b6964c0a0c7 Author: R. Diez <rdi...@ya...> Date: Sat Jan 25 22:06:22 2025 +0100 options.c: option --help should yield exit code 0 --help is supported and there is no reason to signal failure Change-Id: I59fda5336df47ec0b8172541a5fbfe60014bba7e Signed-off-by: R. Diez <rdi...@ya...> Reviewed-on: https://review.openocd.org/c/openocd/+/8723 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/helper/options.c b/src/helper/options.c index 50977a610..735b8af5f 100644 --- a/src/helper/options.c +++ b/src/helper/options.c @@ -334,7 +334,7 @@ int parse_cmdline_args(struct command_context *cmd_ctx, int argc, char *argv[]) LOG_OUTPUT(" | -d<n>\tset debug level to <level>\n"); LOG_OUTPUT("--log_output | -l\tredirect log output to file <name>\n"); LOG_OUTPUT("--command | -c\trun <command>\n"); - exit(-1); + exit(0); } if (version_flag) { ----------------------------------------------------------------------- Summary of changes: src/helper/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:27:52
|
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 a71f2b70894a8118730d912edf27fe488580bd4c (commit) from 44e782d55bf1ce0d924c082281082496cdc2495e (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 a71f2b70894a8118730d912edf27fe488580bd4c Author: Antonio Borneo <bor...@gm...> Date: Sat Jan 25 17:26:16 2025 +0100 README: report dependency from libjim The support for jimtcl submodule is deprecated. Report libjim as a dependency for building OpenOCD. Change-Id: Iaaeb03dc810451c0d72add281016c81b8cbf7059 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8722 Reviewed-by: zapb <de...@za...> Tested-by: jenkins diff --git a/README b/README index 950c71f70..fba758cfe 100644 --- a/README +++ b/README @@ -209,9 +209,7 @@ You'll also need: - make - libtool - pkg-config >= 0.23 or pkgconf - -OpenOCD uses jimtcl library; build from git can retrieve jimtcl as git -submodule. +- libjim >= 0.79 Additionally, for building from git: ----------------------------------------------------------------------- Summary of changes: README | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:27:15
|
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 44e782d55bf1ce0d924c082281082496cdc2495e (commit) from 9bb0a4558bc84b8be63aa937d4b7b9283614f132 (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 44e782d55bf1ce0d924c082281082496cdc2495e Author: Daniel DeGrasse <dde...@te...> Date: Thu Jan 16 22:33:48 2025 -0500 target/arc: allow reading memory while target runs There is no reason that ARC can't support reading from memory over JTAG while the target is executing, and this is in fact required for RTT support. Remove this check from arc_mem_read and arc_mem_write Change-Id: I2accfb4b99bf77c5473d133623e0eb0632cb45f6 Signed-off-by: Daniel DeGrasse <dde...@te...> Reviewed-on: https://review.openocd.org/c/openocd/+/8721 Tested-by: jenkins Reviewed-by: Evgeniy Didin <di...@sy...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/arc_mem.c b/src/target/arc_mem.c index 3daed1cbb..5132aca3d 100644 --- a/src/target/arc_mem.c +++ b/src/target/arc_mem.c @@ -161,11 +161,6 @@ int arc_mem_write(struct target *target, target_addr_t address, uint32_t size, LOG_TARGET_DEBUG(target, "address: 0x%08" TARGET_PRIxADDR ", size: %" PRIu32 ", count: %" PRIu32, address, size, count); - if (target->state != TARGET_HALTED) { - LOG_TARGET_ERROR(target, "not halted"); - return ERROR_TARGET_NOT_HALTED; - } - /* sanitize arguments */ if (((size != 4) && (size != 2) && (size != 1)) || !(count) || !(buffer)) return ERROR_COMMAND_SYNTAX_ERROR; @@ -246,11 +241,6 @@ int arc_mem_read(struct target *target, target_addr_t address, uint32_t size, LOG_TARGET_DEBUG(target, "Read memory: addr=0x%08" TARGET_PRIxADDR ", size=%" PRIu32 ", count=%" PRIu32, address, size, count); - if (target->state != TARGET_HALTED) { - LOG_TARGET_WARNING(target, "target not halted"); - return ERROR_TARGET_NOT_HALTED; - } - /* Sanitize arguments */ if (((size != 4) && (size != 2) && (size != 1)) || !(count) || !(buffer)) return ERROR_COMMAND_SYNTAX_ERROR; ----------------------------------------------------------------------- Summary of changes: src/target/arc_mem.c | 10 ---------- 1 file changed, 10 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:25:12
|
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 9bb0a4558bc84b8be63aa937d4b7b9283614f132 (commit) from 9ccd6265dd56c75cc8d58359d33bf6d65a7524ab (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 9bb0a4558bc84b8be63aa937d4b7b9283614f132 Author: Chris Friedt <cf...@te...> Date: Mon Dec 9 16:11:03 2024 -0500 target/arc: add RTT commands Since RTT is architecture agnostic, add support for using it on the ARC architecture as well. Change-Id: Icd0dec105177a1a224bfb1a63f0be5f03561b166 Signed-off-by: Chris Friedt <cf...@te...> Reviewed-on: https://review.openocd.org/c/openocd/+/8720 Reviewed-by: zapb <de...@za...> Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/arc.h b/src/target/arc.h index a351802ac..4255840d1 100644 --- a/src/target/arc.h +++ b/src/target/arc.h @@ -22,6 +22,7 @@ #include "target_request.h" #include "target_type.h" #include "helper/bits.h" +#include "rtt/rtt.h" #include "arc_jtag.h" #include "arc_cmd.h" diff --git a/src/target/arc_cmd.c b/src/target/arc_cmd.c index e7760b037..bf8a8aa28 100644 --- a/src/target/arc_cmd.c +++ b/src/target/arc_cmd.c @@ -906,5 +906,8 @@ const struct command_registration arc_monitor_command_handlers[] = { .usage = "", .chain = arc_core_command_handlers, }, + { + .chain = rtt_target_command_handlers, + }, COMMAND_REGISTRATION_DONE }; ----------------------------------------------------------------------- Summary of changes: src/target/arc.h | 1 + src/target/arc_cmd.c | 3 +++ 2 files changed, 4 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:23:53
|
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 9ccd6265dd56c75cc8d58359d33bf6d65a7524ab (commit) from 4895a556fa6bafce14237b7e4c821d18fc55df02 (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 9ccd6265dd56c75cc8d58359d33bf6d65a7524ab Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 17:11:24 2025 +0100 checkpatch: enable check for new typedefs We should strictly check for every new typedef. Let checkpatch detect them and let developer use Checkpatch-ignore: NEW_TYPEDEFS if it's really needed to add a new typedef. With this change chackpatch will not complain for typedef on function's type but only on enum, struct, variable's type. Change-Id: I644a753e97de877d892af3a0219716f022fb1c59 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8710 Reviewed-by: zapb <de...@za...> Tested-by: jenkins diff --git a/.checkpatch.conf b/.checkpatch.conf index 8cb9a3729..f432503e1 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -17,7 +17,6 @@ --ignore LINE_SPACING --ignore LOGICAL_CONTINUATIONS --ignore MACRO_WITH_FLOW_CONTROL ---ignore NEW_TYPEDEFS --ignore PARENTHESIS_ALIGNMENT --ignore PREFER_DEFINED_ATTRIBUTE_MACRO --ignore PREFER_FALLTHROUGH ----------------------------------------------------------------------- Summary of changes: .checkpatch.conf | 1 - 1 file changed, 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:23:41
|
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 4895a556fa6bafce14237b7e4c821d18fc55df02 (commit) from 0d1932520b535270d1b454d1aad28819d359e6a5 (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 4895a556fa6bafce14237b7e4c821d18fc55df02 Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 17:05:29 2025 +0100 jtag: drop useless typedef tap_state_t No need to use a typedef for an enum. Drop it. Change-Id: I9eb2dc4f926671c5bb44e61453d92880e3036848 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8709 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/flash/nor/str9xpec.c b/src/flash/nor/str9xpec.c index c39eb3aa8..eff7df5a1 100644 --- a/src/flash/nor/str9xpec.c +++ b/src/flash/nor/str9xpec.c @@ -68,7 +68,7 @@ static int str9xpec_erase_area(struct flash_bank *bank, unsigned int first, static int str9xpec_set_address(struct flash_bank *bank, uint8_t sector); static int str9xpec_write_options(struct flash_bank *bank); -static int str9xpec_set_instr(struct jtag_tap *tap, uint32_t new_instr, tap_state_t end_state) +static int str9xpec_set_instr(struct jtag_tap *tap, uint32_t new_instr, enum tap_state end_state) { if (!tap) return ERROR_TARGET_INVALID; diff --git a/src/jtag/commands.h b/src/jtag/commands.h index 29fa8426e..2923df1e6 100644 --- a/src/jtag/commands.h +++ b/src/jtag/commands.h @@ -40,26 +40,26 @@ struct scan_command { /** pointer to an array of data scan fields */ struct scan_field *fields; /** state in which JTAG commands should finish */ - tap_state_t end_state; + enum tap_state end_state; }; struct statemove_command { /** state in which JTAG commands should finish */ - tap_state_t end_state; + enum tap_state end_state; }; struct pathmove_command { /** number of states in *path */ unsigned int num_states; /** states that have to be passed */ - tap_state_t *path; + enum tap_state *path; }; struct runtest_command { /** number of cycles to spend in Run-Test/Idle state */ unsigned int num_cycles; /** state in which JTAG commands should finish */ - tap_state_t end_state; + enum tap_state end_state; }; @@ -78,7 +78,7 @@ struct reset_command { struct end_state_command { /** state in which JTAG commands should finish */ - tap_state_t end_state; + enum tap_state end_state; }; struct sleep_command { diff --git a/src/jtag/core.c b/src/jtag/core.c index 769e07571..89d53aecb 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -48,8 +48,8 @@ static void jtag_add_scan_check(struct jtag_tap *active, void (*jtag_add_scan)(struct jtag_tap *active, int in_num_fields, const struct scan_field *in_fields, - tap_state_t state), - int in_num_fields, struct scan_field *in_fields, tap_state_t state); + enum tap_state state), + int in_num_fields, struct scan_field *in_fields, enum tap_state state); static int jtag_error_clear(void); @@ -87,7 +87,7 @@ static int jtag_srst = -1; static struct jtag_tap *__jtag_all_taps; static enum reset_types jtag_reset_config = RESET_NONE; -tap_state_t cmd_queue_cur_state = TAP_RESET; +enum tap_state cmd_queue_cur_state = TAP_RESET; static bool jtag_verify_capture_ir = true; static bool jtag_verify = true; @@ -350,7 +350,7 @@ static void jtag_checks(void) assert(jtag_trst == 0); } -static void jtag_prelude(tap_state_t state) +static void jtag_prelude(enum tap_state state) { jtag_checks(); @@ -360,7 +360,7 @@ static void jtag_prelude(tap_state_t state) } void jtag_add_ir_scan_noverify(struct jtag_tap *active, const struct scan_field *in_fields, - tap_state_t state) + enum tap_state state) { jtag_prelude(state); @@ -371,13 +371,13 @@ void jtag_add_ir_scan_noverify(struct jtag_tap *active, const struct scan_field static void jtag_add_ir_scan_noverify_callback(struct jtag_tap *active, int dummy, const struct scan_field *in_fields, - tap_state_t state) + enum tap_state state) { jtag_add_ir_scan_noverify(active, in_fields, state); } /* If fields->in_value is filled out, then the captured IR value will be checked */ -void jtag_add_ir_scan(struct jtag_tap *active, struct scan_field *in_fields, tap_state_t state) +void jtag_add_ir_scan(struct jtag_tap *active, struct scan_field *in_fields, enum tap_state state) { assert(state != TAP_RESET); @@ -396,7 +396,7 @@ void jtag_add_ir_scan(struct jtag_tap *active, struct scan_field *in_fields, tap } void jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, - tap_state_t state) + enum tap_state state) { assert(out_bits); assert(state != TAP_RESET); @@ -426,8 +426,8 @@ static void jtag_add_scan_check(struct jtag_tap *active, void (*jtag_add_scan)( struct jtag_tap *active, int in_num_fields, const struct scan_field *in_fields, - tap_state_t state), - int in_num_fields, struct scan_field *in_fields, tap_state_t state) + enum tap_state state), + int in_num_fields, struct scan_field *in_fields, enum tap_state state) { jtag_add_scan(active, in_num_fields, in_fields, state); @@ -445,7 +445,7 @@ static void jtag_add_scan_check(struct jtag_tap *active, void (*jtag_add_scan)( void jtag_add_dr_scan_check(struct jtag_tap *active, int in_num_fields, struct scan_field *in_fields, - tap_state_t state) + enum tap_state state) { if (jtag_verify) jtag_add_scan_check(active, jtag_add_dr_scan, in_num_fields, in_fields, state); @@ -457,7 +457,7 @@ void jtag_add_dr_scan_check(struct jtag_tap *active, void jtag_add_dr_scan(struct jtag_tap *active, int in_num_fields, const struct scan_field *in_fields, - tap_state_t state) + enum tap_state state) { assert(state != TAP_RESET); @@ -469,7 +469,7 @@ void jtag_add_dr_scan(struct jtag_tap *active, } void jtag_add_plain_dr_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, - tap_state_t state) + enum tap_state state) { assert(out_bits); assert(state != TAP_RESET); @@ -520,9 +520,9 @@ int jtag_add_tms_seq(unsigned int nbits, const uint8_t *seq, enum tap_state stat return retval; } -void jtag_add_pathmove(unsigned int num_states, const tap_state_t *path) +void jtag_add_pathmove(unsigned int num_states, const enum tap_state *path) { - tap_state_t cur_state = cmd_queue_cur_state; + enum tap_state cur_state = cmd_queue_cur_state; /* the last state has to be a stable state */ if (!tap_is_state_stable(path[num_states - 1])) { @@ -554,9 +554,9 @@ void jtag_add_pathmove(unsigned int num_states, const tap_state_t *path) cmd_queue_cur_state = path[num_states - 1]; } -int jtag_add_statemove(tap_state_t goal_state) +int jtag_add_statemove(enum tap_state goal_state) { - tap_state_t cur_state = cmd_queue_cur_state; + enum tap_state cur_state = cmd_queue_cur_state; if (goal_state != cur_state) { LOG_DEBUG("cur_state=%s goal_state=%s", @@ -575,7 +575,7 @@ int jtag_add_statemove(tap_state_t goal_state) else if (tap_is_state_stable(cur_state) && tap_is_state_stable(goal_state)) { unsigned int tms_bits = tap_get_tms_path(cur_state, goal_state); unsigned int tms_count = tap_get_tms_path_len(cur_state, goal_state); - tap_state_t moves[8]; + enum tap_state moves[8]; assert(tms_count < ARRAY_SIZE(moves)); for (unsigned int i = 0; i < tms_count; i++, tms_bits >>= 1) { @@ -595,7 +595,7 @@ int jtag_add_statemove(tap_state_t goal_state) return ERROR_OK; } -void jtag_add_runtest(unsigned int num_cycles, tap_state_t state) +void jtag_add_runtest(unsigned int num_cycles, enum tap_state state) { jtag_prelude(state); jtag_set_error(interface_jtag_add_runtest(num_cycles, state)); diff --git a/src/jtag/drivers/amt_jtagaccel.c b/src/jtag/drivers/amt_jtagaccel.c index 489cb2471..80254ff07 100644 --- a/src/jtag/drivers/amt_jtagaccel.c +++ b/src/jtag/drivers/amt_jtagaccel.c @@ -146,7 +146,7 @@ static int amt_jtagaccel_speed(int speed) return ERROR_OK; } -static void amt_jtagaccel_end_state(tap_state_t state) +static void amt_jtagaccel_end_state(enum tap_state state) { if (tap_is_state_stable(state)) tap_set_end_state(state); @@ -179,8 +179,8 @@ static void amt_jtagaccel_state_move(void) uint8_t aw_scan_tms_5; uint8_t tms_scan[2]; - tap_state_t cur_state = tap_get_state(); - tap_state_t end_state = tap_get_end_state(); + enum tap_state cur_state = tap_get_state(); + enum tap_state end_state = tap_get_end_state(); tms_scan[0] = amt_jtagaccel_tap_move[tap_move_ndx(cur_state)][tap_move_ndx(end_state)][0]; tms_scan[1] = amt_jtagaccel_tap_move[tap_move_ndx(cur_state)][tap_move_ndx(end_state)][1]; @@ -209,7 +209,7 @@ static void amt_jtagaccel_runtest(unsigned int num_cycles) uint8_t aw_scan_tms_5; uint8_t aw_scan_tms_1to4; - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); /* only do a state_move when we're not already in IDLE */ if (tap_get_state() != TAP_IDLE) { @@ -237,7 +237,7 @@ static void amt_jtagaccel_scan(bool ir_scan, enum scan_type type, uint8_t *buffe { int bits_left = scan_size; int bit_count = 0; - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); uint8_t aw_tdi_option; uint8_t dw_tdi_scan; uint8_t dr_tdo; diff --git a/src/jtag/drivers/angie.c b/src/jtag/drivers/angie.c index 47628fef7..46a4c82e5 100644 --- a/src/jtag/drivers/angie.c +++ b/src/jtag/drivers/angie.c @@ -219,7 +219,7 @@ static int angie_append_test_cmd(struct angie *device); static int angie_calculate_delay(enum angie_delay_type type, long f, int *delay); /* Interface between ANGIE and OpenOCD */ -static void angie_set_end_state(tap_state_t endstate); +static void angie_set_end_state(enum tap_state endstate); static int angie_queue_statemove(struct angie *device); static int angie_queue_scan(struct angie *device, struct jtag_command *cmd); @@ -1519,7 +1519,7 @@ static long angie_calculate_frequency(enum angie_delay_type type, int delay) * * @param endstate the state the end state follower should be set to. */ -static void angie_set_end_state(tap_state_t endstate) +static void angie_set_end_state(enum tap_state endstate) { if (tap_is_state_stable(endstate)) tap_set_end_state(endstate); @@ -1837,7 +1837,7 @@ static int angie_reset(int trst, int srst) static int angie_queue_pathmove(struct angie *device, struct jtag_command *cmd) { int ret, state_count; - tap_state_t *path; + enum tap_state *path; uint8_t tms_sequence; unsigned int num_states = cmd->cmd.pathmove->num_states; diff --git a/src/jtag/drivers/arm-jtag-ew.c b/src/jtag/drivers/arm-jtag-ew.c index aaed16db6..45e03840e 100644 --- a/src/jtag/drivers/arm-jtag-ew.c +++ b/src/jtag/drivers/arm-jtag-ew.c @@ -42,9 +42,9 @@ static uint8_t usb_in_buffer[ARMJTAGEW_IN_BUFFER_SIZE]; static uint8_t usb_out_buffer[ARMJTAGEW_OUT_BUFFER_SIZE]; /* Queue command functions */ -static void armjtagew_end_state(tap_state_t state); +static void armjtagew_end_state(enum tap_state state); static void armjtagew_state_move(void); -static void armjtagew_path_move(unsigned int num_states, tap_state_t *path); +static void armjtagew_path_move(unsigned int num_states, enum tap_state *path); static void armjtagew_runtest(unsigned int num_cycles); static void armjtagew_scan(bool ir_scan, enum scan_type type, @@ -253,7 +253,7 @@ static int armjtagew_quit(void) /************************************************************************** * Queue command implementations */ -static void armjtagew_end_state(tap_state_t state) +static void armjtagew_end_state(enum tap_state state) { if (tap_is_state_stable(state)) tap_set_end_state(state); @@ -279,7 +279,7 @@ static void armjtagew_state_move(void) tap_set_state(tap_get_end_state()); } -static void armjtagew_path_move(unsigned int num_states, tap_state_t *path) +static void armjtagew_path_move(unsigned int num_states, enum tap_state *path) { for (unsigned int i = 0; i < num_states; i++) { /* @@ -305,7 +305,7 @@ static void armjtagew_path_move(unsigned int num_states, tap_state_t *path) static void armjtagew_runtest(unsigned int num_cycles) { - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); /* only do a state_move when we're not already in IDLE */ if (tap_get_state() != TAP_IDLE) { @@ -329,7 +329,7 @@ static void armjtagew_scan(bool ir_scan, int scan_size, struct scan_command *command) { - tap_state_t saved_end_state; + enum tap_state saved_end_state; armjtagew_tap_ensure_space(1, scan_size + 8); diff --git a/src/jtag/drivers/bitbang.c b/src/jtag/drivers/bitbang.c index 0a49feb00..c2e763ddb 100644 --- a/src/jtag/drivers/bitbang.c +++ b/src/jtag/drivers/bitbang.c @@ -60,7 +60,7 @@ const struct bitbang_interface *bitbang_interface; #define CLOCK_IDLE() 0 /* The bitbang driver leaves the TCK 0 when in idle */ -static void bitbang_end_state(tap_state_t state) +static void bitbang_end_state(enum tap_state state) { assert(tap_is_state_stable(state)); tap_set_end_state(state); @@ -149,7 +149,7 @@ static int bitbang_path_move(struct pathmove_command *cmd) static int bitbang_runtest(unsigned int num_cycles) { - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); /* only do a state_move when we're not already in IDLE */ if (tap_get_state() != TAP_IDLE) { @@ -195,7 +195,7 @@ static int bitbang_stableclocks(unsigned int num_cycles) static int bitbang_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, unsigned int scan_size) { - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); unsigned int bit_cnt; if (!((!ir_scan && diff --git a/src/jtag/drivers/bitq.c b/src/jtag/drivers/bitq.c index ef870e648..84acff835 100644 --- a/src/jtag/drivers/bitq.c +++ b/src/jtag/drivers/bitq.c @@ -76,7 +76,7 @@ static void bitq_io(int tms, int tdi, int tdo_req) bitq_in_proc(); } -static void bitq_end_state(tap_state_t state) +static void bitq_end_state(enum tap_state state) { if (!tap_is_state_stable(state)) { LOG_ERROR("BUG: %i is not a valid end state", state); @@ -85,7 +85,7 @@ static void bitq_end_state(tap_state_t state) tap_set_end_state(state); } -static void bitq_state_move(tap_state_t new_state) +static void bitq_state_move(enum tap_state new_state) { int i = 0; uint8_t tms_scan; diff --git a/src/jtag/drivers/buspirate.c b/src/jtag/drivers/buspirate.c index 6f8df5ada..93f0ba383 100644 --- a/src/jtag/drivers/buspirate.c +++ b/src/jtag/drivers/buspirate.c @@ -25,9 +25,9 @@ static int buspirate_init(void); static int buspirate_quit(void); static int buspirate_reset(int trst, int srst); -static void buspirate_end_state(tap_state_t state); +static void buspirate_end_state(enum tap_state state); static void buspirate_state_move(void); -static void buspirate_path_move(unsigned int num_states, tap_state_t *path); +static void buspirate_path_move(unsigned int num_states, enum tap_state *path); static void buspirate_runtest(unsigned int num_cycles); static void buspirate_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, struct scan_command *command); @@ -554,7 +554,7 @@ struct adapter_driver buspirate_adapter_driver = { }; /*************** jtag execute commands **********************/ -static void buspirate_end_state(tap_state_t state) +static void buspirate_end_state(enum tap_state state) { if (tap_is_state_stable(state)) tap_set_end_state(state); @@ -580,7 +580,7 @@ static void buspirate_state_move(void) tap_set_state(tap_get_end_state()); } -static void buspirate_path_move(unsigned int num_states, tap_state_t *path) +static void buspirate_path_move(unsigned int num_states, enum tap_state *path) { for (unsigned int i = 0; i < num_states; i++) { if (tap_state_transition(tap_get_state(), false) == path[i]) { @@ -604,7 +604,7 @@ static void buspirate_path_move(unsigned int num_states, tap_state_t *path) static void buspirate_runtest(unsigned int num_cycles) { - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); /* only do a state_move when we're not already in IDLE */ if (tap_get_state() != TAP_IDLE) { @@ -628,7 +628,7 @@ static void buspirate_runtest(unsigned int num_cycles) static void buspirate_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, struct scan_command *command) { - tap_state_t saved_end_state; + enum tap_state saved_end_state; buspirate_tap_make_space(1, scan_size+8); /* is 8 correct ? (2 moves = 16) */ diff --git a/src/jtag/drivers/cmsis_dap.c b/src/jtag/drivers/cmsis_dap.c index e9fd93ad1..c8a7cf8fc 100644 --- a/src/jtag/drivers/cmsis_dap.c +++ b/src/jtag/drivers/cmsis_dap.c @@ -1502,7 +1502,7 @@ static int cmsis_dap_execute_tlr_reset(struct jtag_command *cmd) } /* Set new end state */ -static void cmsis_dap_end_state(tap_state_t state) +static void cmsis_dap_end_state(enum tap_state state) { if (tap_is_state_stable(state)) tap_set_end_state(state); @@ -1831,7 +1831,7 @@ static void cmsis_dap_execute_scan(struct jtag_command *cmd) tap_state_name(tap_get_end_state())); } -static void cmsis_dap_pathmove(int num_states, tap_state_t *path) +static void cmsis_dap_pathmove(int num_states, enum tap_state *path) { uint8_t tms0 = 0x00; uint8_t tms1 = 0xff; @@ -1873,7 +1873,7 @@ static void cmsis_dap_stableclocks(unsigned int num_cycles) static void cmsis_dap_runtest(unsigned int num_cycles) { - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); /* Only do a state_move when we're not already in IDLE. */ if (tap_get_state() != TAP_IDLE) { diff --git a/src/jtag/drivers/driver.c b/src/jtag/drivers/driver.c index 58e59a559..43101b865 100644 --- a/src/jtag/drivers/driver.c +++ b/src/jtag/drivers/driver.c @@ -49,7 +49,7 @@ static void jtag_callback_queue_reset(void) * */ int interface_jtag_add_ir_scan(struct jtag_tap *active, - const struct scan_field *in_fields, tap_state_t state) + const struct scan_field *in_fields, enum tap_state state) { size_t num_taps = jtag_tap_count_enabled(); @@ -111,7 +111,7 @@ int interface_jtag_add_ir_scan(struct jtag_tap *active, * */ int interface_jtag_add_dr_scan(struct jtag_tap *active, int in_num_fields, - const struct scan_field *in_fields, tap_state_t state) + const struct scan_field *in_fields, enum tap_state state) { /* count devices in bypass */ @@ -184,7 +184,7 @@ int interface_jtag_add_dr_scan(struct jtag_tap *active, int in_num_fields, } static int jtag_add_plain_scan(int num_bits, const uint8_t *out_bits, - uint8_t *in_bits, tap_state_t state, bool ir_scan) + uint8_t *in_bits, enum tap_state state, bool ir_scan) { struct jtag_command *cmd = cmd_queue_alloc(sizeof(struct jtag_command)); struct scan_command *scan = cmd_queue_alloc(sizeof(struct scan_command)); @@ -207,19 +207,19 @@ static int jtag_add_plain_scan(int num_bits, const uint8_t *out_bits, return ERROR_OK; } -int interface_jtag_add_plain_dr_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, tap_state_t state) +int interface_jtag_add_plain_dr_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, enum tap_state state) { return jtag_add_plain_scan(num_bits, out_bits, in_bits, state, false); } -int interface_jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, tap_state_t state) +int interface_jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, enum tap_state state) { return jtag_add_plain_scan(num_bits, out_bits, in_bits, state, true); } int interface_jtag_add_tlr(void) { - tap_state_t state = TAP_RESET; + enum tap_state state = TAP_RESET; /* allocate memory for a new list member */ struct jtag_command *cmd = cmd_queue_alloc(sizeof(struct jtag_command)); @@ -259,7 +259,7 @@ int interface_add_tms_seq(unsigned int num_bits, const uint8_t *seq, enum tap_st return ERROR_OK; } -int interface_jtag_add_pathmove(unsigned int num_states, const tap_state_t *path) +int interface_jtag_add_pathmove(unsigned int num_states, const enum tap_state *path) { /* allocate memory for a new list member */ struct jtag_command *cmd = cmd_queue_alloc(sizeof(struct jtag_command)); @@ -270,7 +270,7 @@ int interface_jtag_add_pathmove(unsigned int num_states, const tap_state_t *path cmd->cmd.pathmove = cmd_queue_alloc(sizeof(struct pathmove_command)); cmd->cmd.pathmove->num_states = num_states; - cmd->cmd.pathmove->path = cmd_queue_alloc(sizeof(tap_state_t) * num_states); + cmd->cmd.pathmove->path = cmd_queue_alloc(sizeof(enum tap_state) * num_states); for (unsigned int i = 0; i < num_states; i++) cmd->cmd.pathmove->path[i] = path[i]; @@ -278,7 +278,7 @@ int interface_jtag_add_pathmove(unsigned int num_states, const tap_state_t *path return ERROR_OK; } -int interface_jtag_add_runtest(unsigned int num_cycles, tap_state_t state) +int interface_jtag_add_runtest(unsigned int num_cycles, enum tap_state state) { /* allocate memory for a new list member */ struct jtag_command *cmd = cmd_queue_alloc(sizeof(struct jtag_command)); diff --git a/src/jtag/drivers/dummy.c b/src/jtag/drivers/dummy.c index bfd6e8c54..79b29fbae 100644 --- a/src/jtag/drivers/dummy.c +++ b/src/jtag/drivers/dummy.c @@ -14,7 +14,7 @@ #include "hello.h" /* my private tap controller state, which tracks state for calling code */ -static tap_state_t dummy_state = TAP_RESET; +static enum tap_state dummy_state = TAP_RESET; static int dummy_clock; /* edge detector */ @@ -34,7 +34,7 @@ static int dummy_write(int tck, int tms, int tdi) /* TAP standard: "state transitions occur on rising edge of clock" */ if (tck != dummy_clock) { if (tck) { - tap_state_t old_state = dummy_state; + enum tap_state old_state = dummy_state; dummy_state = tap_state_transition(old_state, tms); if (old_state != dummy_state) { diff --git a/src/jtag/drivers/ft232r.c b/src/jtag/drivers/ft232r.c index 6dc130493..f4e5af4dd 100644 --- a/src/jtag/drivers/ft232r.c +++ b/src/jtag/drivers/ft232r.c @@ -622,7 +622,7 @@ static const struct command_registration ft232r_command_handlers[] = { * Synchronous bitbang protocol implementation. */ -static void syncbb_end_state(tap_state_t state) +static void syncbb_end_state(enum tap_state state) { if (tap_is_state_stable(state)) tap_set_end_state(state); @@ -705,7 +705,7 @@ static void syncbb_path_move(struct pathmove_command *cmd) static void syncbb_runtest(unsigned int num_cycles) { - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); /* only do a state_move when we're not already in IDLE */ if (tap_get_state() != TAP_IDLE) { @@ -747,7 +747,7 @@ static void syncbb_stableclocks(unsigned int num_cycles) static void syncbb_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size) { - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); int bit_cnt, bit0_index; if (!((!ir_scan && (tap_get_state() == TAP_DRSHIFT)) || (ir_scan && (tap_get_state() == TAP_IRSHIFT)))) { diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c index 42ecda117..ec0ae4c00 100644 --- a/src/jtag/drivers/ftdi.c +++ b/src/jtag/drivers/ftdi.c @@ -238,9 +238,9 @@ static int ftdi_get_signal(const struct signal *s, uint16_t *value_out) * * @param goal_state is the destination state for the move. */ -static void move_to_state(tap_state_t goal_state) +static void move_to_state(enum tap_state goal_state) { - tap_state_t start_state = tap_get_state(); + enum tap_state start_state = tap_get_state(); /* goal_state is 1/2 of a tuple/pair of states which allow convenient lookup of the required TMS pattern to move to this state from the @@ -299,7 +299,7 @@ static int ftdi_khz(int khz, int *jtag_speed) return ERROR_OK; } -static void ftdi_end_state(tap_state_t state) +static void ftdi_end_state(enum tap_state state) { if (tap_is_state_stable(state)) tap_set_end_state(state); @@ -370,7 +370,7 @@ static void ftdi_execute_tms(struct jtag_command *cmd) static void ftdi_execute_pathmove(struct jtag_command *cmd) { - tap_state_t *path = cmd->cmd.pathmove->path; + enum tap_state *path = cmd->cmd.pathmove->path; unsigned int num_states = cmd->cmd.pathmove->num_states; LOG_DEBUG_IO("pathmove: %u states, current: %s end: %s", num_states, diff --git a/src/jtag/drivers/gw16012.c b/src/jtag/drivers/gw16012.c index d0fe43fdb..7200e757c 100644 --- a/src/jtag/drivers/gw16012.c +++ b/src/jtag/drivers/gw16012.c @@ -133,7 +133,7 @@ static void gw16012_reset(int trst, int srst) gw16012_control(0x0b); } -static void gw16012_end_state(tap_state_t state) +static void gw16012_end_state(enum tap_state state) { if (tap_is_state_stable(state)) tap_set_end_state(state); @@ -187,7 +187,7 @@ static void gw16012_path_move(struct pathmove_command *cmd) static void gw16012_runtest(unsigned int num_cycles) { - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); /* only do a state_move when we're not already in IDLE */ if (tap_get_state() != TAP_IDLE) { @@ -209,7 +209,7 @@ static void gw16012_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int { int bits_left = scan_size; int bit_count = 0; - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); uint8_t scan_out, scan_in; /* only if we're not already in the correct Shift state */ diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c index 74660744a..4d15cf5e6 100644 --- a/src/jtag/drivers/jlink.c +++ b/src/jtag/drivers/jlink.c @@ -78,9 +78,9 @@ static struct device_config config; static struct device_config tmp_config; /* Queue command functions */ -static void jlink_end_state(tap_state_t state); +static void jlink_end_state(enum tap_state state); static void jlink_state_move(void); -static void jlink_path_move(unsigned int num_states, tap_state_t *path); +static void jlink_path_move(unsigned int num_states, enum tap_state *path); static void jlink_stableclocks(unsigned int num_cycles); static void jlink_runtest(unsigned int num_cycles); static void jlink_reset(int trst, int srst); @@ -875,7 +875,7 @@ static int jlink_quit(void) /***************************************************************************/ /* Queue command implementations */ -static void jlink_end_state(tap_state_t state) +static void jlink_end_state(enum tap_state state) { if (tap_is_state_stable(state)) tap_set_end_state(state); @@ -899,7 +899,7 @@ static void jlink_state_move(void) tap_set_state(tap_get_end_state()); } -static void jlink_path_move(unsigned int num_states, tap_state_t *path) +static void jlink_path_move(unsigned int num_states, enum tap_state *path) { uint8_t tms = 0xff; @@ -930,7 +930,7 @@ static void jlink_stableclocks(unsigned int num_cycles) static void jlink_runtest(unsigned int num_cycles) { - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); /* Only do a state_move when we're not already in IDLE. */ if (tap_get_state() != TAP_IDLE) { diff --git a/src/jtag/drivers/jtag_vpi.c b/src/jtag/drivers/jtag_vpi.c index 079bb1d0a..f6cb3de5d 100644 --- a/src/jtag/drivers/jtag_vpi.c +++ b/src/jtag/drivers/jtag_vpi.c @@ -272,7 +272,7 @@ static int jtag_vpi_tms(struct tms_command *cmd) return jtag_vpi_tms_seq(cmd->bits, cmd->num_bits); } -static int jtag_vpi_state_move(tap_state_t state) +static int jtag_vpi_state_move(enum tap_state state) { if (tap_get_state() == state) return ERROR_OK; @@ -440,7 +440,7 @@ static int jtag_vpi_scan(struct scan_command *cmd) return ERROR_OK; } -static int jtag_vpi_runtest(unsigned int num_cycles, tap_state_t state) +static int jtag_vpi_runtest(unsigned int num_cycles, enum tap_state state) { int retval; diff --git a/src/jtag/drivers/opendous.c b/src/jtag/drivers/opendous.c index e828d46d0..999afb3fc 100644 --- a/src/jtag/drivers/opendous.c +++ b/src/jtag/drivers/opendous.c @@ -104,9 +104,9 @@ static int opendous_init(void); static int opendous_quit(void); /* Queue command functions */ -static void opendous_end_state(tap_state_t state); +static void opendous_end_state(enum tap_state state); static void opendous_state_move(void); -static void opendous_path_move(unsigned int num_states, tap_state_t *path); +static void opendous_path_move(unsigned int num_states, enum tap_state *path); static void opendous_runtest(unsigned int num_cycles); static void opendous_scan(int ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, struct scan_command *command); @@ -393,7 +393,7 @@ static int opendous_quit(void) /***************************************************************************/ /* Queue command implementations */ -void opendous_end_state(tap_state_t state) +void opendous_end_state(enum tap_state state) { if (tap_is_state_stable(state)) tap_set_end_state(state); @@ -419,7 +419,7 @@ void opendous_state_move(void) tap_set_state(tap_get_end_state()); } -void opendous_path_move(unsigned int num_states, tap_state_t *path) +void opendous_path_move(unsigned int num_states, enum tap_state *path) { for (unsigned int i = 0; i < num_states; i++) { if (path[i] == tap_state_transition(tap_get_state(), false)) @@ -440,7 +440,7 @@ void opendous_path_move(unsigned int num_states, tap_state_t *path) void opendous_runtest(unsigned int num_cycles) { - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); /* only do a state_move when we're not already in IDLE */ if (tap_get_state() != TAP_IDLE) { @@ -460,7 +460,7 @@ void opendous_runtest(unsigned int num_cycles) void opendous_scan(int ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, struct scan_command *command) { - tap_state_t saved_end_state; + enum tap_state saved_end_state; opendous_tap_ensure_space(1, scan_size + 8); diff --git a/src/jtag/drivers/openjtag.c b/src/jtag/drivers/openjtag.c index a3fbd204e..14bcc171e 100644 --- a/src/jtag/drivers/openjtag.c +++ b/src/jtag/drivers/openjtag.c @@ -748,7 +748,7 @@ static void openjtag_execute_scan(struct jtag_command *cmd) static void openjtag_execute_runtest(struct jtag_command *cmd) { - tap_state_t end_state = cmd->cmd.runtest->end_state; + enum tap_state end_state = cmd->cmd.runtest->end_state; tap_set_end_state(end_state); /* only do a state_move when we're not already in IDLE */ diff --git a/src/jtag/drivers/osbdm.c b/src/jtag/drivers/osbdm.c index c41a0e13c..80f66d197 100644 --- a/src/jtag/drivers/osbdm.c +++ b/src/jtag/drivers/osbdm.c @@ -380,7 +380,7 @@ static int osbdm_quit(void) static int osbdm_add_pathmove( struct queue *queue, - tap_state_t *path, + enum tap_state *path, unsigned int num_states) { assert(num_states <= 32); @@ -415,7 +415,7 @@ static int osbdm_add_pathmove( static int osbdm_add_statemove( struct queue *queue, - tap_state_t new_state, + enum tap_state new_state, int skip_first) { int len = 0; @@ -490,7 +490,7 @@ static int osbdm_add_scan( struct queue *queue, struct scan_field *fields, unsigned int num_fields, - tap_state_t end_state, + enum tap_state end_state, bool ir_scan) { /* Move to desired shift state */ @@ -537,7 +537,7 @@ static int osbdm_add_scan( static int osbdm_add_runtest( struct queue *queue, unsigned int num_cycles, - tap_state_t end_state) + enum tap_state end_state) { if (osbdm_add_statemove(queue, TAP_IDLE, 0) != ERROR_OK) return ERROR_FAIL; diff --git a/src/jtag/drivers/rlink.c b/src/jtag/drivers/rlink.c index f4a4fcba9..6ea3729a5 100644 --- a/src/jtag/drivers/rlink.c +++ b/src/jtag/drivers/rlink.c @@ -842,7 +842,7 @@ static int tap_state_queue_append(uint8_t tms) return 0; } -static void rlink_end_state(tap_state_t state) +static void rlink_end_state(enum tap_state state) { if (tap_is_state_stable(state)) tap_set_end_state(state); @@ -898,7 +898,7 @@ static void rlink_path_move(struct pathmove_command *cmd) static void rlink_runtest(unsigned int num_cycles) { - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); /* only do a state_move when we're not already in RTI */ if (tap_get_state() != TAP_IDLE) { @@ -1019,7 +1019,7 @@ static int rlink_scan(struct jtag_command *cmd, enum scan_type type, uint8_t *buffer, int scan_size) { bool ir_scan; - tap_state_t saved_end_state; + enum tap_state saved_end_state; int byte_bits; int extra_bits; int chunk_bits; diff --git a/src/jtag/drivers/ulink.c b/src/jtag/drivers/ulink.c index 3a248e388..0a13bf6d4 100644 --- a/src/jtag/drivers/ulink.c +++ b/src/jtag/drivers/ulink.c @@ -212,7 +212,7 @@ static int ulink_append_test_cmd(struct ulink *device); static int ulink_calculate_delay(enum ulink_delay_type type, long f, int *delay); /* Interface between OpenULINK and OpenOCD */ -static void ulink_set_end_state(tap_state_t endstate); +static void ulink_set_end_state(enum tap_state endstate); static int ulink_queue_statemove(struct ulink *device); static int ulink_queue_scan(struct ulink *device, struct jtag_command *cmd); @@ -1393,7 +1393,7 @@ static long ulink_calculate_frequency(enum ulink_delay_type type, int delay) * * @param endstate the state the end state follower should be set to. */ -static void ulink_set_end_state(tap_state_t endstate) +static void ulink_set_end_state(enum tap_state endstate) { if (tap_is_state_stable(endstate)) tap_set_end_state(endstate); @@ -1702,7 +1702,7 @@ static int ulink_queue_reset(struct ulink *device, struct jtag_command *cmd) static int ulink_queue_pathmove(struct ulink *device, struct jtag_command *cmd) { int ret, state_count; - tap_state_t *path; + enum tap_state *path; uint8_t tms_sequence; unsigned int num_states = cmd->cmd.pathmove->num_states; diff --git a/src/jtag/drivers/usb_blaster/usb_blaster.c b/src/jtag/drivers/usb_blaster/usb_blaster.c index 496466ca3..1782cc424 100644 --- a/src/jtag/drivers/usb_blaster/usb_blaster.c +++ b/src/jtag/drivers/usb_blaster/usb_blaster.c @@ -494,7 +494,7 @@ static void ublast_path_move(struct pathmove_command *cmd) * Input the correct TMS sequence to the JTAG TAP so that we end up in the * target state. This assumes the current state (tap_get_state()) is correct. */ -static void ublast_state_move(tap_state_t state, int skip) +static void ublast_state_move(enum tap_state state, int skip) { uint8_t tms_scan; int tms_len; @@ -673,7 +673,7 @@ static void ublast_queue_tdi(uint8_t *bits, int nb_bits, enum scan_type scan) ublast_idle_clock(); } -static void ublast_runtest(unsigned int num_cycles, tap_state_t state) +static void ublast_runtest(unsigned int num_cycles, enum tap_state state) { LOG_DEBUG_IO("%s(cycles=%u, end_state=%d)", __func__, num_cycles, state); diff --git a/src/jtag/drivers/usbprog.c b/src/jtag/drivers/usbprog.c index 6e3b3ba24..24407f003 100644 --- a/src/jtag/drivers/usbprog.c +++ b/src/jtag/drivers/usbprog.c @@ -34,7 +34,7 @@ #define TCK_BIT 2 #define TMS_BIT 1 -static void usbprog_end_state(tap_state_t state); +static void usbprog_end_state(enum tap_state state); static void usbprog_state_move(void); static void usbprog_path_move(struct pathmove_command *cmd); static void usbprog_runtest(unsigned int num_cycles); @@ -168,7 +168,7 @@ static int usbprog_quit(void) } /*************** jtag execute commands **********************/ -static void usbprog_end_state(tap_state_t state) +static void usbprog_end_state(enum tap_state state) { if (tap_is_state_stable(state)) tap_set_end_state(state); @@ -257,7 +257,7 @@ static void usbprog_runtest(unsigned int num_cycles) static void usbprog_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size) { - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); if (ir_scan) usbprog_end_state(TAP_IRSHIFT); diff --git a/src/jtag/drivers/vdebug.c b/src/jtag/drivers/vdebug.c index 20819f70b..fd1e6a7e7 100644 --- a/src/jtag/drivers/vdebug.c +++ b/src/jtag/drivers/vdebug.c @@ -944,11 +944,11 @@ static int vdebug_jtag_path_move(struct pathmove_command *cmd, uint8_t f_flush) return vdebug_jtag_tms_seq(tms, cmd->num_states, f_flush); } -static int vdebug_jtag_tlr(tap_state_t state, uint8_t f_flush) +static int vdebug_jtag_tlr(enum tap_state state, uint8_t f_flush) { int rc = ERROR_OK; - tap_state_t cur = tap_get_state(); + enum tap_state cur = tap_get_state(); uint8_t tms_pre = tap_get_tms_path(cur, state); uint8_t num_pre = tap_get_tms_path_len(cur, state); LOG_DEBUG_IO("tlr from %x to %x", cur, state); @@ -964,7 +964,7 @@ static int vdebug_jtag_scan(struct scan_command *cmd, uint8_t f_flush) { int rc = ERROR_OK; - tap_state_t cur = tap_get_state(); + enum tap_state cur = tap_get_state(); uint8_t state = cmd->ir_scan ? TAP_IRSHIFT : TAP_DRSHIFT; uint8_t tms_pre = tap_get_tms_path(cur, state); uint8_t num_pre = tap_get_tms_path_len(cur, state); @@ -992,9 +992,9 @@ static int vdebug_jtag_scan(struct scan_command *cmd, uint8_t f_flush) return rc; } -static int vdebug_jtag_runtest(unsigned int num_cycles, tap_state_t state, uint8_t f_flush) +static int vdebug_jtag_runtest(unsigned int num_cycles, enum tap_state state, uint8_t f_flush) { - tap_state_t cur = tap_get_state(); + enum tap_state cur = tap_get_state(); uint8_t tms_pre = tap_get_tms_path(cur, state); uint8_t num_pre = tap_get_tms_path_len(cur, state); LOG_DEBUG_IO("idle len:%u state cur:%x end:%x", num_cycles, cur, state); diff --git a/src/jtag/drivers/vsllink.c b/src/jtag/drivers/vsllink.c index ca142177e..c10ed1380 100644 --- a/src/jtag/drivers/vsllink.c +++ b/src/jtag/drivers/vsllink.c @@ -41,9 +41,9 @@ static struct pending_scan_result pending_scan_results_buffer[MAX_PENDING_SCAN_RESULTS]; /* Queue command functions */ -static void vsllink_end_state(tap_state_t state); +static void vsllink_end_state(enum tap_state state); static void vsllink_state_move(void); -static void vsllink_path_move(unsigned int num_states, tap_state_t *path); +static void vsllink_path_move(unsigned int num_states, enum tap_state *path); static void vsllink_tms(int num_bits, const uint8_t *bits); static void vsllink_runtest(unsigned int num_cycles); static void vsllink_stableclocks(unsigned int num_cycles, int tms); @@ -346,7 +346,7 @@ static int vsllink_init(void) /************************************************************************** * Queue command implementations */ -static void vsllink_end_state(tap_state_t state) +static void vsllink_end_state(enum tap_state state) { if (tap_is_state_stable(state)) tap_set_end_state(state); @@ -371,7 +371,7 @@ static void vsllink_state_move(void) tap_set_state(tap_get_end_state()); } -static void vsllink_path_move(unsigned int num_states, tap_state_t *path) +static void vsllink_path_move(unsigned int num_states, enum tap_state *path) { for (unsigned int i = 0; i < num_states; i++) { if (path[i] == tap_state_transition(tap_get_state(), false)) @@ -407,7 +407,7 @@ static void vsllink_stableclocks(unsigned int num_cycles, int tms) static void vsllink_runtest(unsigned int num_cycles) { - tap_state_t saved_end_state = tap_get_end_state(); + enum tap_state saved_end_state = tap_get_end_state(); if (tap_get_state() != TAP_IDLE) { /* enter IDLE state */ @@ -427,7 +427,7 @@ static void vsllink_runtest(unsigned int num_cycles) static void vsllink_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, struct scan_command *command) { - tap_state_t saved_end_state; + enum tap_state saved_end_state; saved_end_state = tap_get_end_state(); diff --git a/src/jtag/drivers/xds110.c b/src/jtag/drivers/xds110.c index 6e12b9a79..c84371001 100644 --- a/src/jtag/drivers/xds110.c +++ b/src/jtag/drivers/xds110.c @@ -172,7 +172,7 @@ #define CMD_RUNTEST 3 #define CMD_STABLECLOCKS 4 -/* Array to convert from OpenOCD tap_state_t to XDS JTAG state */ +/* Array to convert from OpenOCD enum tap_state to XDS JTAG state */ static const uint32_t xds_jtag_state[] = { XDS_JTAG_STATE_EXIT2_DR, /* TAP_DREXIT2 = 0x0 */ XDS_JTAG_STATE_EXIT1_DR, /* TAP_DREXIT1 = 0x1 */ diff --git a/src/jtag/drivers/xlnx-pcie-xvc.c b/src/jtag/drivers/xlnx-pcie-xvc.c index d90a022cd..37c6777e4 100644 --- a/src/jtag/drivers/xlnx-pcie-xvc.c +++ b/src/jtag/drivers/xlnx-pcie-xvc.c @@ -171,7 +171,7 @@ static int xlnx_pcie_xvc_execute_runtest(struct jtag_command *cmd) cmd->cmd.runtest->num_cycles, cmd->cmd.runtest->end_state); - tap_state_t tmp_state = tap_get_end_state(); + enum tap_state tmp_state = tap_get_end_state(); if (tap_get_state() != TAP_IDLE) { tap_set_end_state(TAP_IDLE); @@ -201,7 +201,7 @@ static int xlnx_pcie_xvc_execute_runtest(struct jtag_command *cmd) static int xlnx_pcie_xvc_execute_pathmove(struct jtag_command *cmd) { unsigned int num_states = cmd->cmd.pathmove->num_states; - tap_state_t *path = cmd->cmd.pathmove->path; + enum tap_state *path = cmd->cmd.pathmove->path; int err = ERROR_OK; LOG_DEBUG("pathmove: %u states, end in %i", @@ -232,7 +232,7 @@ static int xlnx_pcie_xvc_execute_pathmove(struct jtag_command *cmd) static int xlnx_pcie_xvc_execute_scan(struct jtag_command *cmd) { enum scan_type type = jtag_scan_type(cmd->cmd.scan); - tap_state_t saved_end_state = cmd->cmd.scan->end_state; + enum tap_state saved_end_state = cmd->cmd.scan->end_state; bool ir_scan = cmd->cmd.scan->ir_scan; uint32_t tdi, tms, tdo; uint8_t *buf, *rd_ptr; diff --git a/src/jtag/interface.c b/src/jtag/interface.c index 87d704db9..92c88ca93 100644 --- a/src/jtag/interface.c +++ b/src/jtag/interface.c @@ -26,15 +26,15 @@ * @see tap_set_state() and tap_get_state() accessors. * Actual name is not important since accessors hide it. */ -static tap_state_t state_follower = TAP_RESET; +static enum tap_state state_follower = TAP_RESET; -void tap_set_state_impl(tap_state_t new_state) +void tap_set_state_impl(enum tap_state new_state) { /* this is the state we think the TAPs are in now, was cur_state */ state_follower = new_state; } -tap_state_t tap_get_state(void) +enum tap_state tap_get_state(void) { return state_follower; } @@ -43,9 +43,9 @@ tap_state_t tap_get_state(void) * @see tap_set_end_state() and tap_get_end_state() accessors. * Actual name is not important because accessors hide it. */ -static tap_state_t end_state_follower = TAP_RESET; +static enum tap_state end_state_follower = TAP_RESET; -void tap_set_end_state(tap_state_t new_end_state) +void tap_set_end_state(enum tap_state new_end_state) { /* this is the state we think the TAPs will be in at completion of the * current TAP operation, was end_state @@ -53,12 +53,12 @@ void tap_set_end_state(tap_state_t new_end_state) end_state_follower = new_end_state; } -tap_state_t tap_get_end_state(void) +enum tap_state tap_get_end_state(void) { return end_state_follower; } -int tap_move_ndx(tap_state_t astate) +int tap_move_ndx(enum tap_state astate) { /* given a stable state, return the index into the tms_seqs[] * array within tap_get_tms_path() @@ -187,17 +187,17 @@ typedef const struct tms_sequences tms_table[6][6]; static tms_table *tms_seqs = &short_tms_seqs; -int tap_get_tms_path(tap_state_t from, tap_state_t to) +int tap_get_tms_path(enum tap_state from, enum tap_state to) { return (*tms_seqs)[tap_move_ndx(from)][tap_move_ndx(to)].bits; } -int tap_get_tms_path_len(tap_state_t from, tap_state_t to) +int tap_get_tms_path_len(enum tap_state from, enum tap_state to) { return (*tms_seqs)[tap_move_ndx(from)][tap_move_ndx(to)].bit_count; } -bool tap_is_state_stable(tap_state_t astate) +bool tap_is_state_stable(enum tap_state astate) { bool is_stable; @@ -220,9 +220,9 @@ bool tap_is_state_stable(tap_state_t astate) return is_stable; } -tap_state_t tap_state_transition(tap_state_t cur_state, bool tms) +enum tap_state tap_state_transition(enum tap_state cur_state, bool tms) { - tap_state_t new_state; + enum tap_state new_state; /* A switch is used because it is symbol dependent and not value dependent * like an array. Also it can check for out of range conditions. @@ -341,7 +341,7 @@ static const struct name_mapping { { TAP_IDLE, "IDLE", }, }; -const char *tap_state_name(tap_state_t state) +const char *tap_state_name(enum tap_state state) { unsigned int i; @@ -352,7 +352,7 @@ const char *tap_state_name(tap_state_t state) return "???"; } -tap_state_t tap_state_by_name(const char *name) +enum tap_state tap_state_by_name(const char *name) { unsigned int i; @@ -371,8 +371,8 @@ tap_state_t tap_state_by_name(const char *name) LOG_DEBUG_IO("TAP/SM: %9s -> %5s\tTMS: %s\tTDI: %s", \ tap_state_name(a), tap_state_name(b), astr, bstr) -tap_state_t jtag_debug_state_machine_(const void *tms_buf, const void *tdi_buf, - unsigned int tap_bits, tap_state_t next_state) +enum tap_state jtag_debug_state_machine_(const void *tms_buf, const void *tdi_buf, + unsigned int tap_bits, enum tap_state next_state) { const uint8_t *tms_buffer; const uint8_t *tdi_buffer; @@ -384,7 +384,7 @@ tap_state_t jtag_debug_state_machine_(const void *tms_buf, const void *tdi_buf, char tms_str[33]; char tdi_str[33]; - tap_state_t last_state; + enum tap_state last_state; /* set startstate (and possibly last, if tap_bits == 0) */ last_state = next_state; diff --git a/src/jtag/interface.h b/src/jtag/interface.h index f69326492..b2d7123fd 100644 --- a/src/jtag/interface.h +++ b/src/jtag/interface.h @@ -28,7 +28,7 @@ /** implementation of wrapper function tap_set_state() */ -void tap_set_state_impl(tap_state_t new_state); +void tap_set_state_impl(enum tap_state new_state); /** * This function sets the state of a "state follower" which tracks the @@ -55,9 +55,9 @@ void tap_set_state_impl(tap_state_t new_state); /** * This function gets the state of the "state follower" which tracks the * state of the TAPs connected to the cable. @see tap_set_state @return - * tap_state_t The state the TAPs are in now. + * enum tap_state The state the TAPs are in now. */ -tap_state_t tap_get_state(void); +enum tap_state tap_get_state(void); /** * This function sets the state of an "end state follower" which tracks @@ -70,13 +70,13 @@ tap_state_t tap_get_state(void); * @param new_end_state The state the TAPs should enter at completion of * a pending TAP operation. */ -void tap_set_end_state(tap_state_t new_end_state); +void tap_set_end_state(enum tap_state new_end_state); /** * For more information, @see tap_set_end_state - * @return tap_state_t - The state the TAPs should be in at completion of the current TAP operation. + * @return enum tap_state - The state the TAPs should be in at completion of the current TAP operation. */ -tap_state_t tap_get_end_state(void); +enum tap_state tap_get_end_state(void); /** * This function provides a "bit sequence" indicating what has to be @@ -91,7 +91,7 @@ tap_state_t tap_get_end_state(void); * @return int The required TMS bit sequence, with the first bit in the * sequence at bit 0. */ -int tap_get_tms_path(tap_state_t from, tap_state_t to); +int tap_get_tms_path(enum tap_state from, enum tap_state to); /** * Function int tap_get_tms_path_len @@ -109,7 +109,7 @@ int tap_get_tms_path(tap_state_t from, tap_state_t to); * @param to is the resultant or final state * @return int - the total number of bits in a transition. */ -int tap_get_tms_path_len(tap_state_t from, tap_state_t to); +int tap_get_tms_path_len(enum tap_state from, enum tap_state to); /** @@ -125,30 +125,30 @@ int tap_get_tms_path_len(tap_state_t from, tap_state_t to); * and terminate. * @return int - the array (or sequence) index as described above */ -int tap_move_ndx(tap_state_t astate); +int tap_move_ndx(enum tap_state astate); /** * Function tap_is_state_stable * returns true if the \a astate is stable. */ -bool tap_is_state_stable(tap_state_t astate); +bool tap_is_state_stable(enum tap_state astate); /** * Function tap_state_transition * takes a current TAP state and returns the next state according to the tms value. * @param current_state is the state of a TAP currently. * @param tms is either zero or non-zero, just like a real TMS line in a jtag interface. - * @return tap_state_t - the next state a TAP would enter. + * @return enum tap_state - the next state a TAP would enter. */ -tap_state_t tap_state_transition(tap_state_t current_state, bool tms); +enum tap_state tap_state_transition(enum tap_state current_state, bool tms); /** Allow switching between old and new TMS tables. @see tap_get_tms_path */ void tap_use_new_tms_table(bool use_new); /** @returns True if new TMS table is active; false otherwise. */ bool tap_uses_new_tms_table(void); -tap_state_t jtag_debug_state_machine_(const void *tms_buf, const void *tdi_buf, - unsigned int tap_len, tap_state_t start_tap_state); +enum tap_state jtag_debug_state_machine_(const void *tms_buf, const void *tdi_buf, + unsigned int tap_len, enum tap_state start_tap_state); /** * @brief Prints verbose TAP state transitions for the given TMS/TDI buffers. @@ -158,8 +158,8 @@ tap_state_t jtag_debug_state_machine_(const void *tms_buf, const void *tdi_buf, * @param start_tap_state must specify the current TAP state. * @returns the final TAP state; pass as @a start_tap_state in following call. */ -static inline tap_state_t jtag_debug_state_machine(const void *tms_buf, - const void *tdi_buf, unsigned int tap_len, tap_state_t start_tap_state) +static inline enum tap_state jtag_debug_state_machine(const void *tms_buf, + const void *tdi_buf, unsigned int tap_len, enum tap_state start_tap_state) { if (LOG_LEVEL_IS(LOG_LVL_DEBUG_IO)) return jtag_debug_state_machine_(tms_buf, tdi_buf, tap_len, start_tap_state); diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h index 86526a09a..47efdff37 100644 --- a/src/jtag/jtag.h +++ b/src/jtag/jtag.h @@ -34,7 +34,7 @@ * Fix those drivers to map as appropriate ... then pick some * sane set of numbers here (where 0/uninitialized == INVALID). */ -typedef enum tap_state { +enum tap_state { TAP_INVALID = -1, /* Proper ARM recommended numbers */ @@ -54,7 +54,7 @@ typedef enum tap_state { TAP_IRUPDATE = 0xd, TAP_IRCAPTURE = 0xe, TAP_RESET = 0x0f, -} tap_state_t; +}; /** * Defines arguments for reset functions @@ -68,13 +68,13 @@ typedef enum tap_state { * Function tap_state_name * Returns a string suitable for display representing the JTAG tap_state */ -const char *tap_state_name(tap_state_t state); +const char *tap_state_name(enum tap_state state); /** Provides user-friendly name lookup of TAP states. */ -tap_state_t tap_state_by_name(const char *name); +enum tap_state tap_state_by_name(const char *name); /** The current TAP state of the pending JTAG command queue. */ -extern tap_state_t cmd_queue_cur_state; +extern enum tap_state cmd_queue_cur_state; /** * This structure defines a single scan field in the scan. It provides @@ -295,20 +295,20 @@ int jtag_init_inner(struct command_context *cmd_ctx); * */ void jtag_add_ir_scan(struct jtag_tap *tap, - struct scan_field *fields, tap_state_t endstate); + struct scan_field *fields, enum tap_state endstate); /** * The same as jtag_add_ir_scan except no verification is performed out * the output values. */ void jtag_add_ir_scan_noverify(struct jtag_tap *tap, - const struct scan_field *fields, tap_state_t state); + const struct scan_field *fields, enum tap_state state); /** * Scan out the bits in ir scan mode. * * If in_bits == NULL, discard incoming bits. */ void jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, - tap_state_t endstate); + enum tap_state endstate); /** * Generate a DR SCAN using the fields passed to the function. @@ -317,17 +317,17 @@ void jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_b * 1-bit field. The bypass status of TAPs is set by jtag_add_ir_scan(). */ void jtag_add_dr_scan(struct jtag_tap *tap, int num_fields, - const struct scan_field *fields, tap_state_t endstate); + const struct scan_field *fields, enum tap_state endstate); /** A version of jtag_add_dr_scan() that uses the check_value/mask fields */ void jtag_add_dr_scan_check(struct jtag_tap *tap, int num_fields, - struct scan_field *fields, tap_state_t endstate); + struct scan_field *fields, enum tap_state endstate); /** * Scan out the bits in ir scan mode. * * If in_bits == NULL, discard incoming bits. */ void jtag_add_plain_dr_scan(int num_bits, - const uint8_t *out_bits, uint8_t *in_bits, tap_state_t endstate); + const uint8_t *out_bits, uint8_t *in_bits, enum tap_state endstate); /** * Defines the type of data passed to the jtag_callback_t interface. @@ -435,7 +435,7 @@ void jtag_add_tlr(void); * - ERROR_JTAG_TRANSITION_INVALID -- The path includes invalid * state transitions. */ -void jtag_add_pathmove(unsigned int num_states, const tap_state_t *path); +void jtag_add_pathmove(unsigned int num_states, const enum tap_state *path); /** * jtag_add_statemove() moves from the current state to @a goal_state. @@ -446,7 +446,7 @@ void jtag_add_pathmove(unsigned int num_states, const tap_state_t *path); * Moves from the current state to the goal \a state. * Both states must be stable. */ -int jtag_add_statemove(tap_state_t goal_state); +int jtag_add_statemove(enum tap_state goal_state); /** * Goes to TAP_IDLE (if we're not already there), cycle @@ -458,7 +458,7 @@ int jtag_add_statemove(tap_state_t goal_state); * via TAP_IDLE. * @param endstate The final state. */ -void jtag_add_runtest(unsigned int num_cycles, tap_state_t endstate); +void jtag_add_runtest(unsigned int num_cycles, enum tap_state endstate); /** * A reset of the TAP state machine can be requested. diff --git a/src/jtag/minidriver.h b/src/jtag/minidriver.h index 1b1094dd5..4b61bf125 100644 --- a/src/jtag/minidriver.h +++ b/src/jtag/minidriver.h @@ -38,21 +38,21 @@ int interface_jtag_add_ir_scan(struct jtag_tap *active, const struct scan_field *fields, - tap_state_t endstate); + enum tap_state endstate); int interface_jtag_add_plain_ir_scan( int num_bits, const uint8_t *out_bits, uint8_t *in_bits, - tap_state_t endstate); + enum tap_state endstate); int interface_jtag_add_dr_scan(struct jtag_tap *active, int num_fields, const struct scan_field *fields, - tap_state_t endstate); + enum tap_state endstate); int interface_jtag_add_plain_dr_scan( int num_bits, const uint8_t *out_bits, uint8_t *in_bits, - tap_state_t endstate); + enum tap_state endstate); int interface_jtag_add_tlr(void); -int interface_jtag_add_pathmove(unsigned int num_states, const tap_state_t *path); -int interface_jtag_add_runtest(unsigned int num_cycles, tap_state_t endstate); +int interface_jtag_add_pathmove(unsigned int num_states, const enum tap_state *path); +int interface_jtag_add_runtest(unsigned int num_cycles, enum tap_state endstate); int interface_add_tms_seq(unsigned int num_bits, const uint8_t *bits, enum tap_state state); diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index 790aedfc4..8b0bc7aff 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -61,7 +61,7 @@ struct jtag_tap *jtag_tap_by_jim_obj(Jim_Interp *interp, Jim_Obj *o) return t; } -static bool scan_is_safe(tap_state_t state) +static bool scan_is_safe(enum tap_state state) { switch (state) { case TAP_RESET: @@ -126,7 +126,7 @@ COMMAND_HANDLER(handle_jtag_command_drscan) return ERROR_FAIL; } - tap_state_t endstate = TAP_IDLE; + enum tap_state endstate = TAP_IDLE; if (CMD_ARGC > 3 && !strcmp("-endstate", CMD_ARGV[CMD_ARGC - 2])) { const char *state_name = CMD_ARGV[CMD_ARGC - 1]; endstate = tap_state_by_name(state_name); @@ -176,7 +176,7 @@ fail: COMMAND_HANDLER(handle_jtag_command_pathmove) { - tap_state_t states[8]; + enum tap_state states[8]; if (CMD_ARGC < 1 || CMD_ARGC > ARRAY_SIZE(states)) return ERROR_COMMAND_SYNTAX_ERROR; @@ -919,7 +919,7 @@ COMMAND_HANDLER(handle_irscan_command) int i; struct scan_field *fields; struct jtag_tap *tap = NULL; - tap_state_t endstate; + enum tap_state endstate; if ((CMD_ARGC < 2) || (CMD_ARGC % 2)) return ERROR_COMMAND_SYNTAX_ERROR; diff --git a/src/pld/lattice.c b/src/pld/lattice.c index 2997cdc39..93ef3565c 100644 --- a/src/pld/lattice.c +++ b/src/pld/lattice.c @@ -59,7 +59,7 @@ static const struct lattice_devices_elem lattice_devices[] = { {0x010f4043, 362, LATTICE_CERTUS /* LFCPNX-100 */}, }; -int lattice_set_instr(struct jtag_tap *tap, uint8_t new_instr, tap_state_t endstate) +int lattice_set_instr(struct jtag_tap *tap, uint8_t new_instr, enum tap_state endstate) { struct scan_field field; field.num_bits = tap->ir_length; diff --git a/src/pld/lattice.h b/src/pld/lattice.h index 9a76a4ec3..c21598966 100644 --- a/src/pld/lattice.h +++ b/src/pld/lattice.h @@ -20,7 +20,7 @@ struct lattice_pld_device { enum lattice_family_e family; }; -int lattice_set_instr(struct jtag_tap *tap, uint8_t new_instr, tap_state_t endstate); +int lattice_set_instr(struct jtag_tap *tap, uint8_t new_instr, enum tap_state endstate); int lattice_read_u32_register(struct jtag_tap *tap, uint8_t cmd, uint32_t *in_val, uint32_t out_val, bool do_idle); int lattice_read_u64_register(struct jtag_tap *tap, uint8_t cmd, uint64_t *in_val, diff --git a/src/svf/svf.c b/src/svf/svf.c index 9dd2463c0..ce994686f 100644 --- a/src/svf/svf.c +++ b/src/svf/svf.c @@ -75,10 +75,10 @@ static const char *svf_trst_mode_name[4] = { }; struct svf_statemove { - tap_state_t from; - tap_state_t to; + enum tap_state from; + enum tap_state to; uint32_t num_of_moves; - tap_state_t paths[8]; + enum tap_state paths[8]; }; /* @@ -155,10 +155,10 @@ struct svf_xxr_para { struct svf_para { float frequency; - tap_state_t ir_end_state; - tap_state_t dr_end_state; - tap_state_t runtest_run_state; - tap_state_t runtest_end_state; + enum tap_state ir_end_state; + enum tap_state dr_end_state; + enum tap_state runtest_run_state; + enum tap_state runtest_end_state; enum trst_mode trst_mode; struct svf_xxr_para hir_para; @@ -313,9 +313,9 @@ static void svf_free_xxd_para(struct svf_xxr_para *para) } } -int svf_add_statemove(tap_state_t state_to) +int svf_add_statemove(enum tap_state state_to) { - tap_state_t state_from = cmd_queue_cur_state; + enum tap_state state_from = cmd_queue_cur_state; unsigned int index_var; /* when resetting, be paranoid and ignore current state */ @@ -816,7 +816,7 @@ parse_char: return ERROR_OK; } -bool svf_tap_state_is_stable(tap_state_t state) +bool svf_tap_state_is_stable(enum tap_state state) { return (state == TAP_RESET) || (state == TAP_IDLE) || (state == TAP_DRPAUSE) || (state == TAP_IRPAUSE); @@ -995,7 +995,7 @@ static int svf_run_command(struct command_context *cmd_ctx, char *cmd_str) uint8_t **pbuffer_tmp; struct scan_field field; /* for STATE */ - tap_state_t *path = NULL, state; + enum tap_state *path = NULL, state; /* flag padding commands skipped due to -tap command */ int padding_command_skipped = 0; @@ -1498,7 +1498,7 @@ xxr_common: } if (num_of_argu > 2) { /* STATE pathstate1 ... stable_state */ - path = malloc((num_of_argu - 1) * sizeof(tap_state_t)); + path = malloc((num_of_argu - 1) * sizeof(enum tap_state)); if (!path) { LOG_ERROR("not enough memory"); return ERROR_FAIL; diff --git a/src/svf/svf.h b/src/svf/svf.h index 74f7d9ca9..77a0e0dcf 100644 --- a/src/svf/svf.h +++ b/src/svf/svf.h @@ -23,7 +23,7 @@ int svf_register_commands(struct command_context *cmd_ctx); * SVF specification for single-argument STATE commands (and also used * for various other state transitions). */ -int svf_add_state... [truncated message content] |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:23:03
|
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 0d1932520b535270d1b454d1aad28819d359e6a5 (commit) from 54d07de86ea6abf1123cc2b032316f0c1bb88b3e (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 0d1932520b535270d1b454d1aad28819d359e6a5 Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 15:26:50 2025 +0100 jtag: openjtag: drop useless typedef openjtag_tap_state_t No need to use a typedef for an enum. Drop it. Change-Id: I31531b80eaf7f3d0ee6cd22844e60a05c6b748dc Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8708 Reviewed-by: zapb <de...@za...> Tested-by: jenkins diff --git a/src/jtag/drivers/openjtag.c b/src/jtag/drivers/openjtag.c index 0ae885e87..a3fbd204e 100644 --- a/src/jtag/drivers/openjtag.c +++ b/src/jtag/drivers/openjtag.c @@ -50,7 +50,7 @@ static const char * const openjtag_variant_names[] = { /* * OpenJTAG-OpenOCD state conversion */ -typedef enum openjtag_tap_state { +enum openjtag_tap_state { OPENJTAG_TAP_INVALID = -1, OPENJTAG_TAP_RESET = 0, OPENJTAG_TAP_IDLE = 1, @@ -68,7 +68,7 @@ typedef enum openjtag_tap_state { OPENJTAG_TAP_PAUSE_IR = 13, OPENJTAG_TAP_EXIT2_IR = 14, OPENJTAG_TAP_UPDATE_IR = 15, -} openjtag_tap_state_t; +}; /* OPENJTAG access library includes */ #include "libftdi_helper.h" ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/openjtag.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:22:51
|
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 54d07de86ea6abf1123cc2b032316f0c1bb88b3e (commit) via 8a5c3318315324574196ae3320c7abf326d4df88 (commit) from 894a39eda30c1b0e8eff39b687333deb4b3b0891 (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 54d07de86ea6abf1123cc2b032316f0c1bb88b3e Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 15:25:15 2025 +0100 jtag: bitbang: drop useless typedef bb_value_t No need to use a typedef for an enum. Drop it. Change-Id: I8800c95f97d2bafe27c699d7d451fb9b54286d99 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8707 Tested-by: jenkins diff --git a/src/jtag/drivers/am335xgpio.c b/src/jtag/drivers/am335xgpio.c index 05a73aa53..cacf4e7c7 100644 --- a/src/jtag/drivers/am335xgpio.c +++ b/src/jtag/drivers/am335xgpio.c @@ -206,7 +206,7 @@ static void restore_gpio(enum adapter_gpio_config_index idx) } } -static bb_value_t am335xgpio_read(void) +static enum bb_value am335xgpio_read(void) { return get_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_TDO]) ? BB_HIGH : BB_LOW; } diff --git a/src/jtag/drivers/at91rm9200.c b/src/jtag/drivers/at91rm9200.c index 57dd54c11..a77e29aa6 100644 --- a/src/jtag/drivers/at91rm9200.c +++ b/src/jtag/drivers/at91rm9200.c @@ -98,7 +98,7 @@ static uint32_t *pio_base; /* low level command set */ -static bb_value_t at91rm9200_read(void); +static enum bb_value at91rm9200_read(void); static int at91rm9200_write(int tck, int tms, int tdi); static int at91rm9200_init(void); @@ -110,7 +110,7 @@ static const struct bitbang_interface at91rm9200_bitbang = { .blink = NULL, }; -static bb_value_t at91rm9200_read(void) +static enum bb_value at91rm9200_read(void) { return (pio_base[device->TDO_PIO + PIO_PDSR] & device->TDO_MASK) ? BB_HIGH : BB_LOW; } diff --git a/src/jtag/drivers/bcm2835gpio.c b/src/jtag/drivers/bcm2835gpio.c index 2c2061dae..095601fa6 100644 --- a/src/jtag/drivers/bcm2835gpio.c +++ b/src/jtag/drivers/bcm2835gpio.c @@ -182,7 +182,7 @@ static void initialize_gpio(enum adapter_gpio_config_index idx) bcm2835_gpio_synchronize(); } -static bb_value_t bcm2835gpio_read(void) +static enum bb_value bcm2835gpio_read(void) { unsigned int shift = adapter_gpio_config[ADAPTER_GPIO_IDX_TDO].gpio_num; uint32_t value = (GPIO_LEV >> shift) & 1; diff --git a/src/jtag/drivers/bitbang.h b/src/jtag/drivers/bitbang.h index d6fd95e27..6afa409e9 100644 --- a/src/jtag/drivers/bitbang.h +++ b/src/jtag/drivers/bitbang.h @@ -14,11 +14,11 @@ #include <jtag/swd.h> #include <jtag/commands.h> -typedef enum { +enum bb_value { BB_LOW, BB_HIGH, BB_ERROR -} bb_value_t; +}; /** Low level callbacks (for bitbang). * @@ -29,7 +29,7 @@ typedef enum { * increase throughput. */ struct bitbang_interface { /** Sample TDO and return the value. */ - bb_value_t (*read)(void); + enum bb_value (*read)(void); /** The number of TDO samples that can be buffered up before the caller has * to call read_sample. */ @@ -39,7 +39,7 @@ struct bitbang_interface { int (*sample)(void); /** Return the next unread value from the buffer. */ - bb_value_t (*read_sample)(void); + enum bb_value (*read_sample)(void); /** Set TCK, TMS, and TDI to the given values. */ int (*write)(int tck, int tms, int tdi); diff --git a/src/jtag/drivers/dummy.c b/src/jtag/drivers/dummy.c index 315e03697..bfd6e8c54 100644 --- a/src/jtag/drivers/dummy.c +++ b/src/jtag/drivers/dummy.c @@ -22,7 +22,7 @@ static int clock_count; /* count clocks in any stable state, only stable states static uint32_t dummy_data; -static bb_value_t dummy_read(void) +static enum bb_value dummy_read(void) { int data = 1 & dummy_data; dummy_data = (dummy_data >> 1) | (1 << 31); diff --git a/src/jtag/drivers/ep93xx.c b/src/jtag/drivers/ep93xx.c index ae35f4ac0..ea9faf19b 100644 --- a/src/jtag/drivers/ep93xx.c +++ b/src/jtag/drivers/ep93xx.c @@ -30,7 +30,7 @@ static volatile uint8_t *gpio_data_direction_register; /* low level command set */ -static bb_value_t ep93xx_read(void); +static enum bb_value ep93xx_read(void); static int ep93xx_write(int tck, int tms, int tdi); static int ep93xx_reset(int trst, int srst); @@ -61,7 +61,7 @@ static const struct bitbang_interface ep93xx_bitbang = { .blink = NULL, }; -static bb_value_t ep93xx_read(void) +static enum bb_value ep93xx_read(void) { return (*gpio_data_register & TDO_BIT) ? BB_HIGH : BB_LOW; } diff --git a/src/jtag/drivers/imx_gpio.c b/src/jtag/drivers/imx_gpio.c index 7aefbeb8a..18dc2ddf6 100644 --- a/src/jtag/drivers/imx_gpio.c +++ b/src/jtag/drivers/imx_gpio.c @@ -72,7 +72,7 @@ static inline bool gpio_level(int g) return pio_base[g / 32].dr >> (g & 0x1F) & 1; } -static bb_value_t imx_gpio_read(void); +static enum bb_value imx_gpio_read(void); static int imx_gpio_write(int tck, int tms, int tdi); static int imx_gpio_swdio_read(void); @@ -118,7 +118,7 @@ static int speed_coeff = 50000; static int speed_offset = 100; static unsigned int jtag_delay; -static bb_value_t imx_gpio_read(void) +static enum bb_value imx_gpio_read(void) { return gpio_level(tdo_gpio) ? BB_HIGH : BB_LOW; } diff --git a/src/jtag/drivers/linuxgpiod.c b/src/jtag/drivers/linuxgpiod.c index 5ffbf4d2f..eda7b1a80 100644 --- a/src/jtag/drivers/linuxgpiod.c +++ b/src/jtag/drivers/linuxgpiod.c @@ -42,7 +42,7 @@ static bool is_gpio_config_valid(enum adapter_gpio_config_index idx) } /* Bitbang interface read of TDO */ -static bb_value_t linuxgpiod_read(void) +static enum bb_value linuxgpiod_read(void) { int retval; diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index f3478db51..3b20fe247 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -115,7 +115,7 @@ static unsigned long dataport; static unsigned long statusport; #endif -static bb_value_t parport_read(void) +static enum bb_value parport_read(void) { int data = 0; diff --git a/src/jtag/drivers/remote_bitbang.c b/src/jtag/drivers/remote_bitbang.c index 66f995d57..bb608ba0a 100644 --- a/src/jtag/drivers/remote_bitbang.c +++ b/src/jtag/drivers/remote_bitbang.c @@ -176,7 +176,7 @@ static int remote_bitbang_quit(void) return ERROR_OK; } -static bb_value_t char_to_int(int c) +static enum bb_value char_to_int(int c) { switch (c) { case '0': @@ -198,7 +198,7 @@ static int remote_bitbang_sample(void) return remote_bitbang_queue('R', NO_FLUSH); } -static bb_value_t remote_bitbang_read_sample(void) +static enum bb_value remote_bitbang_read_sample(void) { if (remote_bitbang_recv_buf_empty()) { if (remote_bitbang_fill_buf(BLOCK) != ERROR_OK) diff --git a/src/jtag/drivers/sysfsgpio.c b/src/jtag/drivers/sysfsgpio.c index c47754bd1..ccd3974a4 100644 --- a/src/jtag/drivers/sysfsgpio.c +++ b/src/jtag/drivers/sysfsgpio.c @@ -255,7 +255,7 @@ static int sysfsgpio_swd_write(int swclk, int swdio) * The sysfs value will read back either '0' or '1'. The trick here is to call * lseek to bypass buffering in the sysfs kernel driver. */ -static bb_value_t sysfsgpio_read(void) +static enum bb_value sysfsgpio_read(void) { char buf[1]; commit 8a5c3318315324574196ae3320c7abf326d4df88 Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 15:22:17 2025 +0100 jtag: remote_bitbang: drop useless typedef flush_bool_t No need to use a typedef for an enum. Drop it. Change-Id: I122784ddd7b81ccd86da258b08526685c3d70033 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8706 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/jtag/drivers/remote_bitbang.c b/src/jtag/drivers/remote_bitbang.c index 037c1f27f..66f995d57 100644 --- a/src/jtag/drivers/remote_bitbang.c +++ b/src/jtag/drivers/remote_bitbang.c @@ -145,12 +145,12 @@ static int remote_bitbang_fill_buf(enum block_bool block) return ERROR_OK; } -typedef enum { +enum flush_bool { NO_FLUSH, FLUSH_SEND_BUF -} flush_bool_t; +}; -static int remote_bitbang_queue(int c, flush_bool_t flush) +static int remote_bitbang_queue(int c, enum flush_bool flush) { remote_bitbang_send_buf[remote_bitbang_send_buf_used++] = c; if (flush == FLUSH_SEND_BUF || ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/am335xgpio.c | 2 +- src/jtag/drivers/at91rm9200.c | 4 ++-- src/jtag/drivers/bcm2835gpio.c | 2 +- src/jtag/drivers/bitbang.h | 8 ++++---- src/jtag/drivers/dummy.c | 2 +- src/jtag/drivers/ep93xx.c | 4 ++-- src/jtag/drivers/imx_gpio.c | 4 ++-- src/jtag/drivers/linuxgpiod.c | 2 +- src/jtag/drivers/parport.c | 2 +- src/jtag/drivers/remote_bitbang.c | 10 +++++----- src/jtag/drivers/sysfsgpio.c | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:22:33
|
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 894a39eda30c1b0e8eff39b687333deb4b3b0891 (commit) from c50b54147170b70a794f39aa4850a61d3b52cb49 (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 894a39eda30c1b0e8eff39b687333deb4b3b0891 Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 15:20:35 2025 +0100 target_request: drop useless typedef target_req_cmd_t No need to use a typedef for an enum. Drop it. Change-Id: Ib5a872b52a6f3d7379d2662e4ff84f32c2bd2ef8 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8705 Reviewed-by: zapb <de...@za...> Tested-by: jenkins diff --git a/src/target/target_request.c b/src/target/target_request.c index bccae07b4..8d51dc3d6 100644 --- a/src/target/target_request.c +++ b/src/target/target_request.c @@ -107,7 +107,7 @@ static int target_hexmsg(struct target *target, int size, uint32_t length) */ int target_request(struct target *target, uint32_t request) { - target_req_cmd_t target_req_cmd = request & 0xff; + enum target_req_cmd target_req_cmd = request & 0xff; assert(target->type->target_request_data); diff --git a/src/target/target_request.h b/src/target/target_request.h index 62d5c74b1..97edd9ede 100644 --- a/src/target/target_request.h +++ b/src/target/target_request.h @@ -17,12 +17,12 @@ struct target; struct command_context; -typedef enum target_req_cmd { +enum target_req_cmd { TARGET_REQ_TRACEMSG, TARGET_REQ_DEBUGMSG, TARGET_REQ_DEBUGCHAR, /* TARGET_REQ_SEMIHOSTING, */ -} target_req_cmd_t; +}; struct debug_msg_receiver { struct command_context *cmd_ctx; ----------------------------------------------------------------------- Summary of changes: src/target/target_request.c | 2 +- src/target/target_request.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:22:08
|
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 c50b54147170b70a794f39aa4850a61d3b52cb49 (commit) via ff5fb8f6100fdd630e698133f860fb02515f5cf5 (commit) from b023c4c6c51a90fb0f831c5725c44ee9061e80ab (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 c50b54147170b70a794f39aa4850a61d3b52cb49 Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 15:17:08 2025 +0100 target: trace: drop useless typedef trace_status_t No need to use a typedef for an enum. Drop it. Change-Id: I31e0e3869c7277bcb14e05cfcac82c9655963ae6 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8704 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/target/etb.c b/src/target/etb.c index 3b9004bb8..fb3112d70 100644 --- a/src/target/etb.c +++ b/src/target/etb.c @@ -454,12 +454,12 @@ static int etb_init(struct etm_context *etm_ctx) return ERROR_OK; } -static trace_status_t etb_status(struct etm_context *etm_ctx) +static enum trace_status etb_status(struct etm_context *etm_ctx) { struct etb *etb = etm_ctx->capture_driver_priv; struct reg *control = &etb->reg_cache->reg_list[ETB_CTRL]; struct reg *status = &etb->reg_cache->reg_list[ETB_STATUS]; - trace_status_t retval = 0; + enum trace_status retval = 0; int etb_timeout = 100; etb->etm_ctx = etm_ctx; diff --git a/src/target/etm.c b/src/target/etm.c index 53d5cb68c..d9a3cdc5e 100644 --- a/src/target/etm.c +++ b/src/target/etm.c @@ -1567,7 +1567,7 @@ COMMAND_HANDLER(handle_etm_status_command) struct target *target; struct arm *arm; struct etm_context *etm; - trace_status_t trace_status; + enum trace_status trace_status; target = get_current_target(CMD_CTX); arm = target_to_arm(target); diff --git a/src/target/etm.h b/src/target/etm.h index 6c5b5e595..e18549dfe 100644 --- a/src/target/etm.h +++ b/src/target/etm.h @@ -126,7 +126,7 @@ struct etm_capture_driver { const char *name; const struct command_registration *commands; int (*init)(struct etm_context *etm_ctx); - trace_status_t (*status)(struct etm_context *etm_ctx); + enum trace_status (*status)(struct etm_context *etm_ctx); int (*read_trace)(struct etm_context *etm_ctx); int (*start_capture)(struct etm_context *etm_ctx); int (*stop_capture)(struct etm_context *etm_ctx); @@ -153,7 +153,7 @@ struct etm_context { struct reg_cache *reg_cache; /* ETM register cache */ struct etm_capture_driver *capture_driver; /* driver used to access ETM data */ void *capture_driver_priv; /* capture driver private data */ - trace_status_t capture_status; /* current state of capture run */ + enum trace_status capture_status; /* current state of capture run */ struct etmv1_trace_data *trace_data; /* trace data */ uint32_t trace_depth; /* number of cycles to be analyzed, 0 if no data available */ uint32_t control; /* shadow of ETM_CTRL */ diff --git a/src/target/etm_dummy.c b/src/target/etm_dummy.c index 8deccf5f9..2709b6e9d 100644 --- a/src/target/etm_dummy.c +++ b/src/target/etm_dummy.c @@ -65,7 +65,7 @@ static int etm_dummy_init(struct etm_context *etm_ctx) return ERROR_OK; } -static trace_status_t etm_dummy_status(struct etm_context *etm_ctx) +static enum trace_status etm_dummy_status(struct etm_context *etm_ctx) { return TRACE_IDLE; } diff --git a/src/target/trace.h b/src/target/trace.h index e3d787edd..dc3ab5712 100644 --- a/src/target/trace.h +++ b/src/target/trace.h @@ -33,13 +33,13 @@ struct trace { * to *hardware* tracing ... split such "real" tracing out from * the contrib/libdcc support. */ -typedef enum trace_status { +enum trace_status { TRACE_IDLE = 0x0, TRACE_RUNNING = 0x1, TRACE_TRIGGERED = 0x2, TRACE_COMPLETED = 0x4, TRACE_OVERFLOWED = 0x8, -} trace_status_t; +}; int trace_point(struct target *target, uint32_t number); int trace_register_commands(struct command_context *cmd_ctx); commit ff5fb8f6100fdd630e698133f860fb02515f5cf5 Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 15:12:38 2025 +0100 target: etm: drop useless typedefs No need to use a typedef for an enum. Drop etmv1_pipestat_t and etmv1_branch_reason_t. Change-Id: I03ae4de3efe699d9635fc4f162649f6bedcef4c0 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8703 Reviewed-by: zapb <de...@za...> Tested-by: jenkins diff --git a/src/target/etm.h b/src/target/etm.h index be5f2c7d0..6c5b5e595 100644 --- a/src/target/etm.h +++ b/src/target/etm.h @@ -175,7 +175,7 @@ struct etm_context { }; /* PIPESTAT values */ -typedef enum { +enum etmv1_pipestat { STAT_IE = 0x0, STAT_ID = 0x1, STAT_IN = 0x2, @@ -184,10 +184,10 @@ typedef enum { STAT_BD = 0x5, STAT_TR = 0x6, STAT_TD = 0x7 -} etmv1_pipestat_t; +}; /* branch reason values */ -typedef enum { +enum etmv1_branch_reason { BR_NORMAL = 0x0, /* Normal PC change : periodic synchro (ETMv1.1) */ BR_ENABLE = 0x1, /* Trace has been enabled */ BR_RESTART = 0x2, /* Trace restarted after a FIFO overflow */ @@ -196,7 +196,7 @@ typedef enum { BR_RSVD5 = 0x5, /* reserved */ BR_RSVD6 = 0x6, /* reserved */ BR_RSVD7 = 0x7, /* reserved */ -} etmv1_branch_reason_t; +}; struct reg_cache *etm_build_reg_cache(struct target *target, struct arm_jtag *jtag_info, struct etm_context *etm_ctx); ----------------------------------------------------------------------- Summary of changes: src/target/etb.c | 4 ++-- src/target/etm.c | 2 +- src/target/etm.h | 12 ++++++------ src/target/etm_dummy.c | 2 +- src/target/trace.h | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:21:32
|
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 b023c4c6c51a90fb0f831c5725c44ee9061e80ab (commit) via e325b482b11d203423b44d44dd35b89e31ffb19d (commit) from 4140fa2a81b259fa99c76084fea78affb2511a08 (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 b023c4c6c51a90fb0f831c5725c44ee9061e80ab Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 15:09:49 2025 +0100 nor: lpc2000: drop useless typedef lpc2000_variant No need to use a typedef for an enum. Drop it. Change-Id: Iec690ebf6704f346d010cad1e6c65496f7bcc218 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8702 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/flash/nor/lpc2000.c b/src/flash/nor/lpc2000.c index f12eef7e4..09d35f604 100644 --- a/src/flash/nor/lpc2000.c +++ b/src/flash/nor/lpc2000.c @@ -272,7 +272,7 @@ #define LPC11XX_REG_SECTORS 24 -typedef enum { +enum lpc2000_variant { LPC2000_V1, LPC2000_V2, LPC1700, @@ -282,10 +282,10 @@ typedef enum { LPC1500, LPC54100, LPC_AUTO, -} lpc2000_variant; +}; struct lpc2000_flash_bank { - lpc2000_variant variant; + enum lpc2000_variant variant; uint32_t cclk; int cmd51_dst_boundary; int calc_checksum; commit e325b482b11d203423b44d44dd35b89e31ffb19d Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 15:01:20 2025 +0100 target: esp_algorithm: drop useless typedefs There is no need to use extra typedef for the functions in struct esp_algorithm_run_data. Declare the type of the functions in the struct. Split the comment lines to stay in the line limits. Change-Id: I0afa6242e57133f8bf1b13ba541abd6b067350b0 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8701 Reviewed-by: Erhan Kurubas <erh...@es...> Tested-by: jenkins diff --git a/src/target/espressif/esp_algorithm.h b/src/target/espressif/esp_algorithm.h index 11d275777..185234f97 100644 --- a/src/target/espressif/esp_algorithm.h +++ b/src/target/espressif/esp_algorithm.h @@ -36,11 +36,13 @@ * Procedure of executing stub on target includes: * 1) User prepares struct esp_algorithm_run_data and calls one of algorithm_run_xxx() functions. * 2) Routine allocates all necessary stub code and data sections. - * 3) If a user specifies an initializer func esp_algorithm_usr_func_init_t it is called just before the stub starts. - * 4) If user specifies stub communication func esp_algorithm_usr_func_t (@see esp_flash_write/read in ESP flash driver) + * 3) If a user specifies an initializer func esp_algorithm_run_data::usr_func_init + * it is called just before the stub starts. + * 4) If user specifies stub communication func esp_algorithm_run_data::usr_func + * (@see esp_flash_write/read in ESP flash driver) * it is called just after the stub starts. When communication with stub is finished this function must return. * 5) OpenOCD waits for the stub to finish (hit exit breakpoint). - * 6) If the user specified arguments cleanup func esp_algorithm_usr_func_done_t, + * 6) If the user specified arguments cleanup func esp_algorithm_run_data::usr_func_done, * it is called just after the stub finishes. * * There are two options to run code on target under OpenOCD control: @@ -190,60 +192,6 @@ struct esp_algorithm_reg_args { struct esp_algorithm_run_data; -/** - * @brief Algorithm run function. - * - * @param target Pointer to target. - * @param run Pointer to algo run data. - * @param arg Function specific argument. - * - * @return ERROR_OK on success, otherwise ERROR_XXX. - */ -typedef int (*esp_algorithm_func_t)(struct target *target, struct esp_algorithm_run_data *run, void *arg); - -/** - * @brief Host part of algorithm. - * This function will be called while stub is running on target. - * It can be used for communication with stub. - * - * @param target Pointer to target. - * @param usr_arg Function specific argument. - * - * @return ERROR_OK on success, otherwise ERROR_XXX. - */ -typedef int (*esp_algorithm_usr_func_t)(struct target *target, void *usr_arg); - -/** - * @brief Algorithm's arguments setup function. - * This function will be called just before stub start. - * It must return when all operations with running stub are completed. - * It can be used to prepare stub memory parameters. - * - * @param target Pointer to target. - * @param run Pointer to algo run data. - * @param usr_arg Function specific argument. The same as for esp_algorithm_usr_func_t. - * - * @return ERROR_OK on success, otherwise ERROR_XXX. - */ -typedef int (*esp_algorithm_usr_func_init_t)(struct target *target, - struct esp_algorithm_run_data *run, - void *usr_arg); - -/** - * @brief Algorithm's arguments cleanup function. - * This function will be called just after stub exit. - * It can be used to cleanup stub memory parameters. - * - * @param target Pointer to target. - * @param run Pointer to algo run data. - * @param usr_arg Function specific argument. The same as for esp_algorithm_usr_func_t. - * - * @return ERROR_OK on success, otherwise ERROR_XXX. - */ -typedef void (*esp_algorithm_usr_func_done_t)(struct target *target, - struct esp_algorithm_run_data *run, - void *usr_arg); - struct esp_algorithm_hw { int (*algo_init)(struct target *target, struct esp_algorithm_run_data *run, uint32_t num_args, va_list ap); int (*algo_cleanup)(struct target *target, struct esp_algorithm_run_data *run); @@ -283,14 +231,61 @@ struct esp_algorithm_run_data { }; /** Host side algorithm function argument. */ void *usr_func_arg; - /** Host side algorithm function. */ - esp_algorithm_usr_func_t usr_func; - /** Host side algorithm function setup routine. */ - esp_algorithm_usr_func_init_t usr_func_init; - /** Host side algorithm function cleanup routine. */ - esp_algorithm_usr_func_done_t usr_func_done; - /** Algorithm run function: see algorithm_run_xxx for example. */ - esp_algorithm_func_t algo_func; + + /** + * @brief Host part of algorithm. + * This function will be called while stub is running on target. + * It can be used for communication with stub. + * + * @param target Pointer to target. + * @param usr_arg Function specific argument. + * + * @return ERROR_OK on success, otherwise ERROR_XXX. + */ + int (*usr_func)(struct target *target, void *usr_arg); + + /** + * @brief Algorithm's arguments setup function. + * This function will be called just before stub start. + * It must return when all operations with running stub are completed. + * It can be used to prepare stub memory parameters. + * + * @param target Pointer to target. + * @param run Pointer to algo run data. + * @param usr_arg Function specific argument. The same as for usr_func. + * + * @return ERROR_OK on success, otherwise ERROR_XXX. + */ + int (*usr_func_init)(struct target *target, + struct esp_algorithm_run_data *run, + void *usr_arg); + + /** + * @brief Algorithm's arguments cleanup function. + * This function will be called just after stub exit. + * It can be used to cleanup stub memory parameters. + * + * @param target Pointer to target. + * @param run Pointer to algo run data. + * @param usr_arg Function specific argument. The same as for usr_func. + * + * @return ERROR_OK on success, otherwise ERROR_XXX. + */ + void (*usr_func_done)(struct target *target, + struct esp_algorithm_run_data *run, + void *usr_arg); + + /** + * @brief Algorithm run function. + * + * @param target Pointer to target. + * @param run Pointer to algo run data. + * @param arg Function specific argument. + * + * @return ERROR_OK on success, otherwise ERROR_XXX. + */ + int (*algo_func)(struct target *target, struct esp_algorithm_run_data *run, void *arg); + /** HW specific API */ const struct esp_algorithm_hw *hw; }; ----------------------------------------------------------------------- Summary of changes: src/flash/nor/lpc2000.c | 6 +- src/target/espressif/esp_algorithm.h | 125 +++++++++++++++++------------------ 2 files changed, 63 insertions(+), 68 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:21:00
|
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 4140fa2a81b259fa99c76084fea78affb2511a08 (commit) from 3e4512d62d1513a81905ff65f3d42477f0258f64 (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 4140fa2a81b259fa99c76084fea78affb2511a08 Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 13:55:18 2025 +0100 drivers: rshim: drop useless typedef Use 'struct name' instead of typedef. Change-Id: Ifff56811f53a260c314c8f5473d368599e0912e6 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8700 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/jtag/drivers/rshim.c b/src/jtag/drivers/rshim.c index 21fc7fd37..b37fe8c45 100644 --- a/src/jtag/drivers/rshim.c +++ b/src/jtag/drivers/rshim.c @@ -60,14 +60,14 @@ #ifdef HAVE_SYS_IOCTL_H /* Message used to program rshim via ioctl(). */ -typedef struct { +struct rshim_ioctl_msg { uint32_t addr; uint64_t data; -} __attribute__((packed)) rshim_ioctl_msg; +} __attribute__((packed)); enum { - RSH_IOC_READ = _IOWR('R', 0, rshim_ioctl_msg), - RSH_IOC_WRITE = _IOWR('R', 1, rshim_ioctl_msg), + RSH_IOC_READ = _IOWR('R', 0, struct rshim_ioctl_msg), + RSH_IOC_WRITE = _IOWR('R', 1, struct rshim_ioctl_msg), }; #endif @@ -104,7 +104,7 @@ static int rshim_dev_read(int chan, int addr, uint64_t *value) #ifdef HAVE_SYS_IOCTL_H if (rc < 0 && errno == ENOSYS) { - rshim_ioctl_msg msg; + struct rshim_ioctl_msg msg; msg.addr = addr; msg.data = 0; @@ -126,7 +126,7 @@ static int rshim_dev_write(int chan, int addr, uint64_t value) #ifdef HAVE_SYS_IOCTL_H if (rc < 0 && errno == ENOSYS) { - rshim_ioctl_msg msg; + struct rshim_ioctl_msg msg; msg.addr = addr; msg.data = value; ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/rshim.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-16 16:20:45
|
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 3e4512d62d1513a81905ff65f3d42477f0258f64 (commit) via 6e39af3b0e17ce0376db10bdca25ce60334448cd (commit) from 73e9b7898f5518e0cfe7bc2f66d135736558a9fd (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 3e4512d62d1513a81905ff65f3d42477f0258f64 Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 13:40:59 2025 +0100 openocd: drop useless typedef There is no need to use typedef for the array of functions. Drop it. While there, move the declaration outside the function and use the array size to drop the error-prone sentinel to NULL. Change-Id: I424964a6ef82ed1a7b27e78fbd19aa9f985b52c7 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8699 Reviewed-by: zapb <de...@za...> Tested-by: jenkins diff --git a/src/openocd.c b/src/openocd.c index 9fd709e32..3fbece395 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -232,6 +232,23 @@ static int openocd_register_commands(struct command_context *cmd_ctx) struct command_context *global_cmd_ctx; +static int (* const command_registrants[])(struct command_context *cmd_ctx_value) = { + openocd_register_commands, + server_register_commands, + gdb_register_commands, + log_register_commands, + rtt_server_register_commands, + transport_register_commands, + adapter_register_commands, + target_register_commands, + flash_register_commands, + nand_register_commands, + pld_register_commands, + cti_register_commands, + dap_register_commands, + arm_tpiu_swo_register_commands, +}; + static struct command_context *setup_command_handler(Jim_Interp *interp) { log_init(); @@ -240,25 +257,7 @@ static struct command_context *setup_command_handler(Jim_Interp *interp) struct command_context *cmd_ctx = command_init(openocd_startup_tcl, interp); /* register subsystem commands */ - typedef int (*command_registrant_t)(struct command_context *cmd_ctx_value); - static const command_registrant_t command_registrants[] = { - &openocd_register_commands, - &server_register_commands, - &gdb_register_commands, - &log_register_commands, - &rtt_server_register_commands, - &transport_register_commands, - &adapter_register_commands, - &target_register_commands, - &flash_register_commands, - &nand_register_commands, - &pld_register_commands, - &cti_register_commands, - &dap_register_commands, - &arm_tpiu_swo_register_commands, - NULL - }; - for (unsigned int i = 0; command_registrants[i]; i++) { + for (unsigned int i = 0; i < ARRAY_SIZE(command_registrants); i++) { int retval = (*command_registrants[i])(cmd_ctx); if (retval != ERROR_OK) { command_done(cmd_ctx); commit 6e39af3b0e17ce0376db10bdca25ce60334448cd Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 10 12:13:30 2025 +0100 rtt: drop useless typedefs There is no need to use extra typedef for the rtt functions. Declare the type of the functions in the struct. Change-Id: Idf2fee6e63ec3b3add38d042bbebe8d74613627c Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8698 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/rtt/rtt.h b/src/rtt/rtt.h index 49409074c..d84fdb40b 100644 --- a/src/rtt/rtt.h +++ b/src/rtt/rtt.h @@ -95,35 +95,27 @@ enum rtt_channel_type { RTT_CHANNEL_TYPE_DOWN }; -typedef int (*rtt_source_find_ctrl_block)(struct target *target, +/** RTT source. */ +struct rtt_source { + int (*find_cb)(struct target *target, target_addr_t *address, size_t size, const char *id, bool *found, void *user_data); -typedef int (*rtt_source_read_ctrl_block)(struct target *target, + int (*read_cb)(struct target *target, target_addr_t address, struct rtt_control *ctrl_block, void *user_data); -typedef int (*rtt_source_read_channel_info)(struct target *target, + int (*read_channel_info)(struct target *target, const struct rtt_control *ctrl, unsigned int channel, enum rtt_channel_type type, struct rtt_channel_info *info, void *user_data); -typedef int (*rtt_source_start)(struct target *target, + int (*start)(struct target *target, const struct rtt_control *ctrl, void *user_data); -typedef int (*rtt_source_stop)(struct target *target, void *user_data); -typedef int (*rtt_source_read)(struct target *target, + int (*stop)(struct target *target, void *user_data); + int (*read)(struct target *target, const struct rtt_control *ctrl, struct rtt_sink_list **sinks, size_t num_channels, void *user_data); -typedef int (*rtt_source_write)(struct target *target, + int (*write)(struct target *target, struct rtt_control *ctrl, unsigned int channel, const uint8_t *buffer, size_t *length, void *user_data); - -/** RTT source. */ -struct rtt_source { - rtt_source_find_ctrl_block find_cb; - rtt_source_read_ctrl_block read_cb; - rtt_source_read_channel_info read_channel_info; - rtt_source_start start; - rtt_source_stop stop; - rtt_source_read read; - rtt_source_write write; }; /** ----------------------------------------------------------------------- Summary of changes: src/openocd.c | 37 ++++++++++++++++++------------------- src/rtt/rtt.h | 26 +++++++++----------------- 2 files changed, 27 insertions(+), 36 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-12 16:49:58
|
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 73e9b7898f5518e0cfe7bc2f66d135736558a9fd (commit) from d09f53a930676817a49ae7c575c705487ea51861 (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 73e9b7898f5518e0cfe7bc2f66d135736558a9fd Author: Samuel Obuch <sam...@es...> Date: Tue Feb 11 09:56:38 2025 +0100 github/workflow: build jimtcl from sources JimTCL submodule was deprecated, this patch modifies the GitHub snapshot action to build from sources instead. Change-Id: Ie9ab20dbfd70506992d11a91489e82a9fa6e13ce Signed-off-by: Samuel Obuch <sam...@es...> Reviewed-on: https://review.openocd.org/c/openocd/+/8751 Reviewed-by: Marc Schink <de...@za...> Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Erhan Kurubas <erh...@es...> diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index f5cf56459..36b2f3bb3 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -18,7 +18,7 @@ jobs: sudo apt-get update sudo apt-get install autotools-dev autoconf automake libtool pkg-config cmake texinfo texlive g++-mingw-w64-i686 - name: Checkout Code - uses: actions/checkout@v1 + uses: actions/checkout@v4 - run: ./bootstrap - name: Prepare libusb1 env: @@ -66,6 +66,14 @@ jobs: cd libjaylink-${LIBJAYLINK_VER} ./autogen.sh echo "LIBJAYLINK_SRC=$PWD" >> $GITHUB_ENV + - name: Prepare jimtcl + env: + JIMTCL_VER: 0.83 + run: | + mkdir -p $DL_DIR && cd $DL_DIR + wget https://github.com/msteveb/jimtcl/archive/refs/tags/${JIMTCL_VER}.tar.gz + tar -xzf ${JIMTCL_VER}.tar.gz + echo "JIMTCL_SRC=$PWD/jimtcl-${JIMTCL_VER}" >> $GITHUB_ENV - name: Package OpenOCD for windows env: MAKE_JOBS: 2 @@ -75,6 +83,7 @@ jobs: LIBFTDI_CONFIG: -DSTATICLIBS=OFF -DEXAMPLES=OFF -DFTDI_EEPROM=OFF CAPSTONE_CONFIG: "CAPSTONE_BUILD_CORE_ONLY=yes CAPSTONE_STATIC=yes CAPSTONE_SHARED=no" LIBJAYLINK_CONFIG: --enable-shared --disable-static + JIMTCL_CONFIG: --with-ext=json --minimal --disable-ssl run: | # check if there is tag pointing at HEAD, otherwise take the HEAD SHA-1 as OPENOCD_TAG OPENOCD_TAG="`git tag --points-at HEAD`" @@ -102,11 +111,11 @@ jobs: echo "IS_PRE_RELEASE=$IS_PRE_RELEASE" >> $GITHUB_ENV echo "ARTIFACT_PATH=$PWD/$ARTIFACT" >> $GITHUB_ENV - name: Publish OpenOCD packaged for windows - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ${{ env.ARTIFACT_PATH }} - name: Delete 'latest' Release - uses: dev-drprasad/delete-tag-and-release@v0.2.1 + uses: dev-drprasad/delete-tag-and-release@v1.1 with: delete_release: true tag_name: ${{ env.RELEASE_NAME }} diff --git a/contrib/cross-build.sh b/contrib/cross-build.sh index bb8c8c47d..1784d79ad 100755 --- a/contrib/cross-build.sh +++ b/contrib/cross-build.sh @@ -42,6 +42,7 @@ WORK_DIR=$PWD : ${LIBFTDI_SRC:=/path/to/libftdi} : ${CAPSTONE_SRC:=/path/to/capstone} : ${LIBJAYLINK_SRC:=/path/to/libjaylink} +: ${JIMTCL_SRC:=/path/to/jimtcl} OPENOCD_SRC=`readlink -m $OPENOCD_SRC` LIBUSB1_SRC=`readlink -m $LIBUSB1_SRC` @@ -49,6 +50,7 @@ HIDAPI_SRC=`readlink -m $HIDAPI_SRC` LIBFTDI_SRC=`readlink -m $LIBFTDI_SRC` CAPSTONE_SRC=`readlink -m $CAPSTONE_SRC` LIBJAYLINK_SRC=`readlink -m $LIBJAYLINK_SRC` +JIMTCL_SRC=`readlink -m $JIMTCL_SRC` HOST_TRIPLET=$1 BUILD_DIR=$WORK_DIR/$HOST_TRIPLET-build @@ -57,6 +59,7 @@ HIDAPI_BUILD_DIR=$BUILD_DIR/hidapi LIBFTDI_BUILD_DIR=$BUILD_DIR/libftdi CAPSTONE_BUILD_DIR=$BUILD_DIR/capstone LIBJAYLINK_BUILD_DIR=$BUILD_DIR/libjaylink +JIMTCL_BUILD_DIR=$BUILD_DIR/jimtcl OPENOCD_BUILD_DIR=$BUILD_DIR/openocd ## Root of host file tree @@ -172,6 +175,18 @@ if [ -d $LIBJAYLINK_SRC ] ; then make install DESTDIR=$SYSROOT fi +# jimtcl build & install into sysroot +if [ -d $JIMTCL_SRC ] ; then + mkdir -p $JIMTCL_BUILD_DIR + cd $JIMTCL_BUILD_DIR + $JIMTCL_SRC/configure --host=$HOST_TRIPLET --prefix=$PREFIX \ + $JIMTCL_CONFIG + make -j $MAKE_JOBS + # Running "make" does not create this file for static builds on Windows but "make install" still expects it + touch $JIMTCL_BUILD_DIR/build-jim-ext + make install DESTDIR=$SYSROOT +fi + # OpenOCD build & install into sysroot mkdir -p $OPENOCD_BUILD_DIR cd $OPENOCD_BUILD_DIR ----------------------------------------------------------------------- Summary of changes: .github/workflows/snapshot.yml | 15 ++++++++++++--- contrib/cross-build.sh | 15 +++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-11 11:58:33
|
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 d09f53a930676817a49ae7c575c705487ea51861 (commit) from 82277462b91506a9e7ee4bdcee86d6b414d59149 (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 d09f53a930676817a49ae7c575c705487ea51861 Author: Richard Pasek <rp...@go...> Date: Thu Jan 30 05:38:08 2025 -0500 driver/linuxspidev: Clear queue on allocation SWD idle clocks are added to the queue by advancing the queue index assuming the queue is zeroed. If the queue isn't zeroed, these idle clocks end up being filled with junk data. Lets clear the queue and associated buffers on queue allocation. TEST: Connects successfully and ran the following TCL command: dump_image /dev/null 0x20000000 0x42000 Host: Unnamed Qualcomm SoC with QUPv3 based SPI port Target: RT500 Signed-off-by: Richard Pasek <rp...@go...> Change-Id: Ie660c10c27c4d0937ab0629138935ddbf5aeb0ae Fixes: 83e0293f7ba3 ("Add Linux SPI device SWD adapter support") Reviewed-on: https://review.openocd.org/c/openocd/+/8730 Reviewed-by: Tomas Vanek <va...@fb...> Reviewed-by: Jonathon Reinhart <jrr...@go...> Tested-by: jenkins diff --git a/src/jtag/drivers/linuxspidev.c b/src/jtag/drivers/linuxspidev.c index 73d5e8bed..6a149a977 100644 --- a/src/jtag/drivers/linuxspidev.c +++ b/src/jtag/drivers/linuxspidev.c @@ -230,10 +230,21 @@ static void spidev_free_queue(void) tx_flip_buf = NULL; } +static void spidev_clear_queue(void) +{ + queue_fill = 0; + queue_buf_fill = 0; + + memset(queue_infos, 0, sizeof(struct queue_info) * max_queue_entries); + memset(queue_tx_buf, 0, queue_buf_size); + memset(queue_rx_buf, 0, queue_buf_size); + memset(tx_flip_buf, 0, queue_buf_size); +} + static int spidev_alloc_queue(unsigned int new_queue_entries) { if (queue_fill || queue_buf_fill) { - LOG_ERROR("Can't realloc allocate queue when queue is in use"); + LOG_ERROR("Can't realloc queue when queue is in use"); return ERROR_FAIL; } @@ -259,6 +270,8 @@ static int spidev_alloc_queue(unsigned int new_queue_entries) max_queue_entries = new_queue_entries; queue_buf_size = new_queue_buf_size; + spidev_clear_queue(); + LOG_DEBUG("Set queue entries to %u (buffers %u bytes)", max_queue_entries, queue_buf_size); return ERROR_OK; @@ -400,12 +413,7 @@ static int spidev_swd_execute_queue(unsigned int end_idle_bytes) } skip: - // Clear everything in the queue - queue_fill = 0; - queue_buf_fill = 0; - memset(queue_infos, 0, sizeof(queue_infos[0]) * max_queue_entries); - memset(queue_tx_buf, 0, queue_buf_size); - memset(queue_rx_buf, 0, queue_buf_size); + spidev_clear_queue(); int retval = queue_retval; queue_retval = ERROR_OK; ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/linuxspidev.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-11 11:57: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 82277462b91506a9e7ee4bdcee86d6b414d59149 (commit) from 7dd875900ec252b5f332298cef3030f67a37150f (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 82277462b91506a9e7ee4bdcee86d6b414d59149 Author: Tomas Vanek <va...@fb...> Date: Mon Feb 3 20:28:49 2025 +0100 drivers/linuxspidev: fix use of uninitialized speed variable Valgrind reported == Syscall param ioctl(generic) points to uninitialised byte(s) == at 0x4ABF990: ioctl (ioctl.S:26) == by 0x19D00B: spidev_speed (linuxspidev.c:181) == by 0x19D00B: spidev_init (linuxspidev.c:307) Indeed, spidev_init() uses adapter_get_speed(), it calls adapter_khz_to_speed() and it returns early without setting the output parameter if adapter is not initialized. Of course the adapter initialized flag is not set until spidev_init() returns. Simply drop this code as the adapter infrastructure initializes adapter speed just after spidev_init() return. Change-Id: I26f011ae59fc942a34d9bb517f467c22f735091d Signed-off-by: Tomas Vanek <va...@fb...> Fixes: 83e0293f7ba3 ("Add Linux SPI device SWD adapter support") Reviewed-on: https://review.openocd.org/c/openocd/+/8733 Tested-by: jenkins Reviewed-by: Richard Pasek <rp...@go...> diff --git a/src/jtag/drivers/linuxspidev.c b/src/jtag/drivers/linuxspidev.c index 94a0c510a..73d5e8bed 100644 --- a/src/jtag/drivers/linuxspidev.c +++ b/src/jtag/drivers/linuxspidev.c @@ -307,18 +307,6 @@ static int spidev_init(void) LOG_INFO("Opened SPI device at %s in mode 0x%" PRIx32 " with %" PRIu8 " bits ", spi_path, spi_mode, spi_bits); - // Set SPI read and write max speed. - int speed; - ret = adapter_get_speed(&speed); - if (ret != ERROR_OK) { - LOG_ERROR("Failed to get adapter speed"); - return ERROR_JTAG_INIT_FAILED; - } - - ret = spidev_speed(speed); - if (ret != ERROR_OK) - return ERROR_JTAG_INIT_FAILED; - if (max_queue_entries == 0) { ret = spidev_alloc_queue(MAX_QUEUE_ENTRIES); if (ret != ERROR_OK) ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/linuxspidev.c | 12 ------------ 1 file changed, 12 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-11 11:56:41
|
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 7dd875900ec252b5f332298cef3030f67a37150f (commit) from 7f2db80ebc168d74a56dc8b76be5355ee4878be6 (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 7dd875900ec252b5f332298cef3030f67a37150f Author: Tomas Vanek <va...@fb...> Date: Mon Feb 3 20:23:08 2025 +0100 drivers/linuxspidev: fix minor memory leak free() strduped spi_path on quit. Found by valgrind. Change-Id: Iaa59c7258c920b5e60d615df790dfe815831b925 Signed-off-by: Tomas Vanek <va...@fb...> Fixes: 83e0293f7ba3 ("Add Linux SPI device SWD adapter support") Reviewed-on: https://review.openocd.org/c/openocd/+/8732 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Richard Pasek <rp...@go...> diff --git a/src/jtag/drivers/linuxspidev.c b/src/jtag/drivers/linuxspidev.c index 737d2bef8..94a0c510a 100644 --- a/src/jtag/drivers/linuxspidev.c +++ b/src/jtag/drivers/linuxspidev.c @@ -337,6 +337,10 @@ static int spidev_quit(void) close(spi_fd); spi_fd = -1; + + free(spi_path); + spi_path = NULL; + return ERROR_OK; } ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/linuxspidev.c | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-02-11 11:54:32
|
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 7f2db80ebc168d74a56dc8b76be5355ee4878be6 (commit) from eb6f2745b7d9924d0dddeab91c1743867c4e812c (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 7f2db80ebc168d74a56dc8b76be5355ee4878be6 Author: Marc Schink <de...@za...> Date: Sat Dec 7 10:53:56 2024 +0100 rtos/hwthread: Use LOG_TARGET_xxx() Use LOG_TARGET_xxx() to indicate which target the message belongs to. While at it, fix some coding style issues. Change-Id: Iac0296498557a689468a4a19d0bc64f03178a0d0 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: https://review.openocd.org/c/openocd/+/8727 Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Tomas Vanek <va...@fb...> Tested-by: jenkins diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c index c9f1a1792..6332bd8ad 100644 --- a/src/rtos/hwthread.c +++ b/src/rtos/hwthread.c @@ -119,7 +119,7 @@ static int hwthread_update_threads(struct rtos *rtos) if (current_threadid <= thread_list_size) rtos->current_threadid = current_threadid; else - LOG_WARNING("SMP node change, disconnect GDB from core/thread %" PRId64, + LOG_TARGET_WARNING(target, "SMP node change, disconnect GDB from core/thread %" PRId64, current_threadid); /* create space for new thread details */ @@ -204,7 +204,8 @@ static int hwthread_update_threads(struct rtos *rtos) else rtos->current_thread = threadid_from_target(target); - LOG_DEBUG("%s current_thread=%i", __func__, (int)rtos->current_thread); + LOG_TARGET_DEBUG(target, "%s current_thread=%i", __func__, + (int)rtos->current_thread); return 0; } @@ -270,7 +271,8 @@ static int hwthread_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, if (!reg_list[i]->valid) { retval = reg_list[i]->type->get(reg_list[i]); if (retval != ERROR_OK) { - LOG_ERROR("Couldn't get register %s.", reg_list[i]->name); + LOG_TARGET_ERROR(curr, "Couldn't get register %s", + reg_list[i]->name); free(reg_list); free(*rtos_reg_list); return retval; @@ -297,7 +299,8 @@ static int hwthread_get_thread_reg(struct rtos *rtos, int64_t thread_id, struct target *curr = hwthread_find_thread(target, thread_id); if (!curr) { - LOG_ERROR("Couldn't find RTOS thread for id %" PRId64 ".", thread_id); + LOG_TARGET_ERROR(target, "Couldn't find RTOS thread for id %" PRId64, + thread_id); return ERROR_FAIL; } @@ -308,8 +311,8 @@ static int hwthread_get_thread_reg(struct rtos *rtos, int64_t thread_id, struct reg *reg = register_get_by_number(curr->reg_cache, reg_num, true); if (!reg) { - LOG_ERROR("Couldn't find register %" PRIu32 " in thread %" PRId64 ".", reg_num, - thread_id); + LOG_TARGET_ERROR(curr, "Couldn't find register %" PRIu32 " in thread %" PRId64, + reg_num, thread_id); return ERROR_FAIL; } @@ -372,17 +375,17 @@ static bool hwthread_detect_rtos(struct target *target) static int hwthread_thread_packet(struct connection *connection, const char *packet, int packet_size) { - struct target *target = get_target_from_connection(connection); - - struct target *curr = NULL; - int64_t current_threadid; - if (packet[0] == 'H' && packet[1] == 'g') { + int64_t current_threadid; sscanf(packet, "Hg%16" SCNx64, ¤t_threadid); + struct target *target = get_target_from_connection(connection); + if (current_threadid > 0) { + struct target *curr = NULL; if (hwthread_target_for_threadid(connection, current_threadid, &curr) != ERROR_OK) { - LOG_ERROR("hwthread: cannot find thread id %"PRId64, current_threadid); + LOG_TARGET_ERROR(target, "hwthread: cannot find thread id %" PRId64, + current_threadid); gdb_put_packet(connection, "E01", 3); return ERROR_FAIL; } @@ -402,7 +405,7 @@ static int hwthread_thread_packet(struct connection *connection, const char *pac static int hwthread_create(struct target *target) { - LOG_INFO("Hardware thread awareness created"); + LOG_TARGET_INFO(target, "Hardware thread awareness created"); target->rtos->rtos_specific_params = NULL; target->rtos->current_thread = 0; ----------------------------------------------------------------------- Summary of changes: src/rtos/hwthread.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) hooks/post-receive -- Main OpenOCD repository |