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
(16) |
Sep
|
Oct
|
Nov
|
Dec
|
From: openocd-gerrit <ope...@us...> - 2023-01-15 14:47: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 0c28006cf2cf2d98ba2d73a73bf629e781f4ffb8 (commit) from 95603fae18f81eebdafc5b318e70f9e2cdefab9e (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 0c28006cf2cf2d98ba2d73a73bf629e781f4ffb8 Author: Kyle Schwarz <ze...@gm...> Date: Sun Jul 10 15:58:14 2022 -0400 flash/nor/avrf: add ATmega32U4 support Add new chip info and tcl target Change-Id: Ib9d33d1b145a8659857b7a6cc9c5acba047f41d1 Signed-off-by: Kyle Schwarz <ze...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7081 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/avrf.c b/src/flash/nor/avrf.c index 0e2e263ce..1d317a10c 100644 --- a/src/flash/nor/avrf.c +++ b/src/flash/nor/avrf.c @@ -64,6 +64,7 @@ static const struct avrf_type avft_chips_info[] = { {"atmega324pa", 0x9511, 128, 256, 4, 256}, {"atmega644p", 0x960a, 256, 256, 8, 256}, {"atmega1284p", 0x9705, 256, 512, 8, 512}, + {"atmega32u4", 0x9587, 128, 256, 4, 256}, }; /* avr program functions */ diff --git a/tcl/target/atmega32u4.cfg b/tcl/target/atmega32u4.cfg new file mode 100644 index 000000000..9199c741e --- /dev/null +++ b/tcl/target/atmega32u4.cfg @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# ATmega32U4 + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME avr +} + +if { [info exists ENDIAN] } { + set _ENDIAN $ENDIAN +} else { + set _ENDIAN little +} + +if { [info exists CPUTAPID] } { + set _CPUTAPID $CPUTAPID +} else { + set _CPUTAPID 0x4958703f +} + +adapter speed 4500 + +jtag newtap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID + +set _TARGETNAME $_CHIPNAME.cpu +target create $_TARGETNAME avr -endian $_ENDIAN -chain-position $_TARGETNAME + +set _FLASHNAME $_CHIPNAME.flash +flash bank $_FLASHNAME avr 0 0 0 0 $_TARGETNAME ----------------------------------------------------------------------- Summary of changes: src/flash/nor/avrf.c | 1 + tcl/target/{atmega128rfa1.cfg => atmega32u4.cfg} | 26 +++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) copy tcl/target/{atmega128rfa1.cfg => atmega32u4.cfg} (53%) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2023-01-15 14:47: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 95603fae18f81eebdafc5b318e70f9e2cdefab9e (commit) from da34e36cdb542eac9370957b10853184f870e495 (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 95603fae18f81eebdafc5b318e70f9e2cdefab9e Author: Antonio Borneo <bor...@gm...> Date: Sun Dec 18 19:15:57 2022 +0100 openocd: revert workarounds for 'expr' syntax change With OpenOCD v0.12.0 released, drop the workarounds for 'expr' syntax change by reverting: - commit 320043c054dc ("openocd: fix for polling during "expr" computation"); - commit c7eaaf620488 ("openocd: prepare for jimtcl 0.81 'expr' syntax change"). Replace the call to target_call_timer_callbacks_now() with call to target_call_timer_callbacks(). Change-Id: Iae5afc50e3f688e11176a52648efc9a6577a9a11 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7405 Tested-by: jenkins diff --git a/src/helper/command.c b/src/helper/command.c index 6898e2d7c..ca66cf7dd 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -936,19 +936,7 @@ static int jim_command_dispatch(Jim_Interp *interp, int argc, Jim_Obj * const *a if (!command_can_run(cmd_ctx, c, Jim_GetString(argv[0], NULL))) return JIM_ERR; - /* - * TODO: to be removed after v0.12.0 - * workaround for https://sourceforge.net/p/openocd/tickets/362/ - * After syntax change of "expr" in jimtcl 0.81 - * the replacement of jimtcl "expr" with openocd version in - * https://review.openocd.org/6510/ - * introduces too many target polling during math expressions with - * "expr" commands. - * After v0.12.0 replace the following two lines with - * target_call_timer_callbacks(); - */ - if (strcmp(c->name, "expr")) - target_call_timer_callbacks_now(); + target_call_timer_callbacks(); /* * Black magic of overridden current target: diff --git a/src/openocd.c b/src/openocd.c index bef084f98..875da5a62 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -230,65 +230,6 @@ static int openocd_register_commands(struct command_context *cmd_ctx) return register_commands(cmd_ctx, NULL, openocd_command_handlers); } -/* - * TODO: to be removed after v0.12.0 - * workaround for syntax change of "expr" in jimtcl 0.81 - * replace "expr" with openocd version that prints the deprecated msg - */ -struct jim_scriptobj { - void *token; - Jim_Obj *filename_obj; - int len; - int subst_flags; - int in_use; - int firstline; - int linenr; - int missing; -}; - -static int jim_expr_command(Jim_Interp *interp, int argc, Jim_Obj * const *argv) -{ - if (argc == 2) - return Jim_EvalExpression(interp, argv[1]); - - if (argc > 2) { - Jim_Obj *obj = Jim_ConcatObj(interp, argc - 1, argv + 1); - Jim_IncrRefCount(obj); - const char *s = Jim_String(obj); - struct jim_scriptobj *script = Jim_GetIntRepPtr(interp->currentScriptObj); - if (interp->currentScriptObj == interp->emptyObj || - strcmp(interp->currentScriptObj->typePtr->name, "script") || - script->subst_flags || - script->filename_obj == interp->emptyObj) - LOG_WARNING("DEPRECATED! use 'expr { %s }' not 'expr %s'", s, s); - else - LOG_WARNING("DEPRECATED! (%s:%d) use 'expr { %s }' not 'expr %s'", - Jim_String(script->filename_obj), script->linenr, s, s); - int retcode = Jim_EvalExpression(interp, obj); - Jim_DecrRefCount(interp, obj); - return retcode; - } - - Jim_WrongNumArgs(interp, 1, argv, "expression ?...?"); - return JIM_ERR; -} - -static const struct command_registration expr_handler[] = { - { - .name = "expr", - .jim_handler = jim_expr_command, - .mode = COMMAND_ANY, - .help = "", - .usage = "", - }, - COMMAND_REGISTRATION_DONE -}; - -static int workaround_for_jimtcl_expr(struct command_context *cmd_ctx) -{ - return register_commands(cmd_ctx, NULL, expr_handler); -} - struct command_context *global_cmd_ctx; static struct command_context *setup_command_handler(Jim_Interp *interp) @@ -301,7 +242,6 @@ static struct command_context *setup_command_handler(Jim_Interp *interp) /* register subsystem commands */ typedef int (*command_registrant_t)(struct command_context *cmd_ctx_value); static const command_registrant_t command_registrants[] = { - &workaround_for_jimtcl_expr, &openocd_register_commands, &server_register_commands, &gdb_register_commands, ----------------------------------------------------------------------- Summary of changes: src/helper/command.c | 14 +----------- src/openocd.c | 60 ---------------------------------------------------- 2 files changed, 1 insertion(+), 73 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2023-01-15 14:47: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 da34e36cdb542eac9370957b10853184f870e495 (commit) from 8bb926eb01022998ceefe666f8df102e59404015 (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 da34e36cdb542eac9370957b10853184f870e495 Author: Antonio Borneo <bor...@gm...> Date: Mon Sep 19 23:14:41 2022 +0200 nds32: drop it, together with aice adapter driver The target nds32 and its companion adapter aice have not received any real improvement since 2013. It has been hard to keep them aligned during the evolution of OpenOCD code, with no way for maintainers to really check if they are still working. No real documentation is present for them in OpenOCD. The nds32 code triggers ~50 errors/warnings with scan-build. The arch nds32 has been dropped from Linux kernel v5.18-rc1. For all the reasons above, this code has been deprecated with commit 2e5df83de7f2 ("nds32: deprecate it, together with aice adapter driver") and tagged to be dropped before v0.13.0. Let it r.i.p. in OpenOCD git history. While there, drop from checkpatch list the camelcase symbols that where only used in this code. Change-Id: Ide52a217f2228e9da2f1cc5036c48f3536f26952 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7382 Tested-by: jenkins diff --git a/README b/README index 08b8117db..2f71cfc6a 100644 --- a/README +++ b/README @@ -101,7 +101,7 @@ Supported hardware JTAG adapters ------------- -AICE, AM335x, ARM-JTAG-EW, ARM-USB-OCD, ARM-USB-TINY, AT91RM9200, axm0432, BCM2835, +AM335x, ARM-JTAG-EW, ARM-USB-OCD, ARM-USB-TINY, AT91RM9200, axm0432, BCM2835, Bus Blaster, Buspirate, Cadence DPI, Cadence vdebug, Chameleon, CMSIS-DAP, Cortino, Cypress KitProg, DENX, Digilent JTAG-SMT2, DLC 5, DLP-USB1232H, embedded projects, Espressif USB JTAG Programmer, @@ -122,7 +122,7 @@ Debug targets ARM: AArch64, ARM11, ARM7, ARM9, Cortex-A/R (v7-A/R), Cortex-M (ARMv{6/7/8}-M), FA526, Feroceon/Dragonite, XScale. ARCv2, AVR32, DSP563xx, DSP5680xx, EnSilica eSi-RISC, EJTAG (MIPS32, MIPS64), -ESP32, ESP32-S2, ESP32-S3, Intel Quark, LS102x-SAP, NDS32, RISC-V, ST STM8, +ESP32, ESP32-S2, ESP32-S3, Intel Quark, LS102x-SAP, RISC-V, ST STM8, Xtensa. Flash drivers diff --git a/configure.ac b/configure.ac index 4fcc91528..cc7139c7c 100644 --- a/configure.ac +++ b/configure.ac @@ -130,9 +130,6 @@ m4_define([USB1_ADAPTERS], [[usbprog], [USBProg JTAG Programmer], [USBPROG]], [[esp_usb_jtag], [Espressif JTAG Programmer], [ESP_USB_JTAG]]]) -m4_define([DEPRECATED_USB1_ADAPTERS], - [[[aice], [Andes JTAG Programmer (deprecated)], [AICE]]]) - m4_define([HIDAPI_ADAPTERS], [[[cmsis_dap], [CMSIS-DAP Compliant Debugger], [CMSIS_DAP_HID]], [[nulink], [Nu-Link Programmer], [HLADAPTER_NULINK]]]) @@ -264,8 +261,6 @@ AC_ARG_ADAPTERS([ LIBJAYLINK_ADAPTERS ],[auto]) -AC_ARG_ADAPTERS([DEPRECATED_USB1_ADAPTERS],[no]) - AC_ARG_ENABLE([parport], AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]), [build_parport=$enableval], [build_parport=no]) @@ -684,7 +679,6 @@ m4_define([PROCESS_ADAPTERS], [ ]) PROCESS_ADAPTERS([USB1_ADAPTERS], ["x$use_libusb1" = "xyes"], [libusb-1.x]) -PROCESS_ADAPTERS([DEPRECATED_USB1_ADAPTERS], ["x$use_libusb1" = "xyes"], [libusb-1.x]) PROCESS_ADAPTERS([HIDAPI_ADAPTERS], ["x$use_hidapi" = "xyes"], [hidapi]) PROCESS_ADAPTERS([HIDAPI_USB1_ADAPTERS], ["x$use_hidapi" = "xyes" -a "x$use_libusb1" = "xyes"], [hidapi and libusb-1.x]) PROCESS_ADAPTERS([LIBFTDI_ADAPTERS], ["x$use_libftdi" = "xyes"], [libftdi]) @@ -834,7 +828,6 @@ echo echo OpenOCD configuration summary echo -------------------------------------------------- m4_foreach([adapter], [USB1_ADAPTERS, - DEPRECATED_USB1_ADAPTERS, HIDAPI_ADAPTERS, HIDAPI_USB1_ADAPTERS, LIBFTDI_ADAPTERS, LIBFTDI_USB1_ADAPTERS, LIBGPIOD_ADAPTERS, diff --git a/contrib/buildroot/openocd_be_defconfig b/contrib/buildroot/openocd_be_defconfig index 2fe28f647..49a6ec2ac 100644 --- a/contrib/buildroot/openocd_be_defconfig +++ b/contrib/buildroot/openocd_be_defconfig @@ -12,7 +12,6 @@ BR2_PACKAGE_OPENOCD_UBLASTER2=y BR2_PACKAGE_OPENOCD_JLINK=y BR2_PACKAGE_OPENOCD_OSDBM=y BR2_PACKAGE_OPENOCD_OPENDOUS=y -BR2_PACKAGE_OPENOCD_AICE=y BR2_PACKAGE_OPENOCD_VSLLINK=y BR2_PACKAGE_OPENOCD_USBPROG=y BR2_PACKAGE_OPENOCD_RLINK=y diff --git a/doc/openocd.texi b/doc/openocd.texi index d8a5e86b4..c7fee3e71 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2480,7 +2480,7 @@ This command is only available if your libusb1 is at least version 1.0.16. Specifies the @var{serial_string} of the adapter to use. If this command is not specified, serial strings are not checked. Only the following adapter drivers use the serial string from this command: -aice (aice_usb), arm-jtag-ew, cmsis_dap, ft232r, ftdi, hla (stlink, ti-icdi), jlink, kitprog, opendus, +arm-jtag-ew, cmsis_dap, ft232r, ftdi, hla (stlink, ti-icdi), jlink, kitprog, opendus, openjtag, osbdm, presto, rlink, st-link, usb_blaster (ublast2), usbprog, vsllink, xds110. @end deffn @@ -4825,9 +4825,6 @@ specified, @xref{gdbportoverride,,option -gdb-port}.), and a fake ARM core will be emulated to comply to GDB remote protocol. @item @code{mips_m4k} -- a MIPS core. @item @code{mips_mips64} -- a MIPS64 core. -@item @code{nds32_v2} -- this is an Andes NDS32 v2 core (deprecated; would be removed in v0.13.0). -@item @code{nds32_v3} -- this is an Andes NDS32 v3 core (deprecated; would be removed in v0.13.0). -@item @code{nds32_v3m} -- this is an Andes NDS32 v3m core (deprecated; would be removed in v0.13.0). @item @code{or1k} -- this is an OpenRISC 1000 core. The current implementation supports three JTAG TAP cores: @itemize @minus diff --git a/src/jtag/Makefile.am b/src/jtag/Makefile.am index 43c6f8b27..7ce4adc29 100644 --- a/src/jtag/Makefile.am +++ b/src/jtag/Makefile.am @@ -9,11 +9,6 @@ include %D%/hla/Makefile.am %C%_libjtag_la_LIBADD += $(top_builddir)/%D%/hla/libocdhla.la endif -if AICE -include %D%/aice/Makefile.am -%C%_libjtag_la_LIBADD += $(top_builddir)/%D%/aice/libocdaice.la -endif - include %D%/drivers/Makefile.am %C%_libjtag_la_LIBADD += $(top_builddir)/%D%/drivers/libocdjtagdrivers.la diff --git a/src/jtag/aice/Makefile.am b/src/jtag/aice/Makefile.am deleted file mode 100644 index bc5dac1e2..000000000 --- a/src/jtag/aice/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later - -noinst_LTLIBRARIES += %D%/libocdaice.la - -%C%_libocdaice_la_CPPFLAGS = -I$(top_srcdir)/src/jtag/drivers $(AM_CPPFLAGS) $(LIBUSB1_CFLAGS) -%C%_libocdaice_la_SOURCES = \ - %D%/aice_transport.c \ - %D%/aice_interface.c \ - %D%/aice_port.c \ - %D%/aice_usb.c \ - %D%/aice_pipe.c \ - %D%/aice_transport.h \ - %D%/aice_interface.h \ - %D%/aice_port.h \ - %D%/aice_usb.h \ - %D%/aice_pipe.h diff --git a/src/jtag/aice/aice_interface.c b/src/jtag/aice/aice_interface.c deleted file mode 100644 index 89f82a0ae..000000000 --- a/src/jtag/aice/aice_interface.c +++ /dev/null @@ -1,507 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -/*************************************************************************** - * Copyright (C) 2013 by Andes Technology * - * Hsiangkai Wang <hk...@an...> * - ***************************************************************************/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <jtag/adapter.h> -#include <jtag/interface.h> -#include <jtag/commands.h> -#include <transport/transport.h> -#include <target/target.h> -#include <jtag/aice/aice_transport.h> -#include "aice_usb.h" - -#define AICE_KHZ_TO_SPEED_MAP_SIZE 16 -static const int aice_khz_to_speed_map[AICE_KHZ_TO_SPEED_MAP_SIZE] = { - 30000, - 15000, - 7500, - 3750, - 1875, - 937, - 468, - 234, - 48000, - 24000, - 12000, - 6000, - 3000, - 1500, - 750, - 375, -}; - -static const struct aice_port *aice_port; -static struct aice_port_param_s param; -static uint32_t retry_times; -static uint32_t count_to_check_dbger; - -/***************************************************************************/ -/* External interface implementation */ -static uint32_t aice_target_id_codes[AICE_MAX_NUM_CORE]; -static uint8_t aice_num_of_target_id_codes; - -/***************************************************************************/ -/* AICE operations */ -int aice_init_targets(void) -{ - int res; - struct target *target; - struct aice_port_s *aice; - - LOG_DEBUG("aice_init_targets"); - - if (aice_num_of_target_id_codes == 0) { - res = aice_port->api->idcode(aice_target_id_codes, &aice_num_of_target_id_codes); - if (res != ERROR_OK) { - LOG_ERROR("<-- TARGET ERROR! Failed to identify AndesCore " - "JTAG Manufacture ID in the JTAG scan chain. " - "Failed to access EDM registers. -->"); - return res; - } - } - - for (target = all_targets; target; target = target->next) { - target->tap->idcode = aice_target_id_codes[target->tap->abs_chain_position]; - - unsigned ii, limit = target->tap->expected_ids_cnt; - int found = 0; - - for (ii = 0; ii < limit; ii++) { - uint32_t expected = target->tap->expected_ids[ii]; - - /* treat "-expected-id 0" as a "don't-warn" wildcard */ - if (!expected || (target->tap->idcode == expected)) { - found = 1; - break; - } - } - - if (found == 0) { - LOG_ERROR - ("aice_init_targets: target not found: idcode: %" PRIx32, - target->tap->idcode); - return ERROR_FAIL; - } - - aice = calloc(1, sizeof(struct aice_port_s)); - aice->port = aice_port; - aice->coreid = target->tap->abs_chain_position; - - target->tap->priv = aice; - target->tap->hasidcode = 1; - } - - return ERROR_OK; -} - -/***************************************************************************/ -/* End of External interface implementation */ - -/* initial aice - * 1. open usb - * 2. get/show version number - * 3. reset - */ -static int aice_init(void) -{ - if (aice_port->api->open(¶m) != ERROR_OK) { - LOG_ERROR("Cannot find AICE Interface! Please check " - "connection and permissions."); - return ERROR_JTAG_INIT_FAILED; - } - - aice_port->api->set_retry_times(retry_times); - aice_port->api->set_count_to_check_dbger(count_to_check_dbger); - - LOG_INFO("AICE JTAG Interface ready"); - - return ERROR_OK; -} - -/* cleanup aice resource - * close usb - */ -static int aice_quit(void) -{ - aice_port->api->close(); - return ERROR_OK; -} - -static int aice_execute_reset(struct jtag_command *cmd) -{ - static int last_trst; - int retval = ERROR_OK; - - LOG_DEBUG_IO("reset trst: %d", cmd->cmd.reset->trst); - - if (cmd->cmd.reset->trst != last_trst) { - if (cmd->cmd.reset->trst) - retval = aice_port->api->reset(); - - last_trst = cmd->cmd.reset->trst; - } - - return retval; -} - -static int aice_execute_command(struct jtag_command *cmd) -{ - int retval; - - switch (cmd->type) { - case JTAG_RESET: - retval = aice_execute_reset(cmd); - break; - default: - retval = ERROR_OK; - break; - } - return retval; -} - -/* aice has no need to implement jtag execution model -*/ -static int aice_execute_queue(void) -{ - struct jtag_command *cmd = jtag_command_queue; /* currently processed command */ - int retval; - - retval = ERROR_OK; - - while (cmd) { - if (aice_execute_command(cmd) != ERROR_OK) - retval = ERROR_JTAG_QUEUE_FAILED; - - cmd = cmd->next; - } - - return retval; -} - -/* set jtag frequency(base frequency/frequency divider) to your jtag adapter */ -static int aice_speed(int speed) -{ - return aice_port->api->set_jtag_clock(speed); -} - -/* convert jtag adapter frequency(base frequency/frequency divider) to - * human readable KHz value */ -static int aice_speed_div(int speed, int *khz) -{ - *khz = aice_khz_to_speed_map[speed]; - - return ERROR_OK; -} - -/* convert human readable KHz value to jtag adapter frequency - * (base frequency/frequency divider) */ -static int aice_khz(int khz, int *jtag_speed) -{ - int i; - for (i = 0 ; i < AICE_KHZ_TO_SPEED_MAP_SIZE ; i++) { - if (khz == aice_khz_to_speed_map[i]) { - if (i >= 8) - *jtag_speed = i | AICE_TCK_CONTROL_TCK3048; - else - *jtag_speed = i; - break; - } - } - - if (i == AICE_KHZ_TO_SPEED_MAP_SIZE) { - LOG_INFO("No support the jtag clock: %d", khz); - LOG_INFO("Supported jtag clocks are:"); - - for (i = 0 ; i < AICE_KHZ_TO_SPEED_MAP_SIZE ; i++) - LOG_INFO("* %d", aice_khz_to_speed_map[i]); - - return ERROR_FAIL; - } - - return ERROR_OK; -} - -int aice_scan_jtag_chain(void) -{ - LOG_DEBUG("=== %s ===", __func__); - uint8_t num_of_idcode = 0; - struct target *target; - - int res = aice_port->api->idcode(aice_target_id_codes, &num_of_idcode); - if (res != ERROR_OK) { - LOG_ERROR("<-- TARGET ERROR! Failed to identify AndesCore " - "JTAG Manufacture ID in the JTAG scan chain. " - "Failed to access EDM registers. -->"); - return res; - } - - for (unsigned int i = 0; i < num_of_idcode; i++) - LOG_DEBUG("id_codes[%u] = 0x%" PRIx32, i, aice_target_id_codes[i]); - - /* Update tap idcode */ - for (target = all_targets; target; target = target->next) - target->tap->idcode = aice_target_id_codes[target->tap->abs_chain_position]; - - return ERROR_OK; -} - -/***************************************************************************/ -/* Command handlers */ -COMMAND_HANDLER(aice_handle_aice_info_command) -{ - LOG_DEBUG("aice_handle_aice_info_command"); - - command_print(CMD, "Description: %s", param.device_desc); - command_print(CMD, "Serial number: %s", adapter_get_required_serial()); - if (strncmp(aice_port->name, "aice_pipe", 9) == 0) - command_print(CMD, "Adapter: %s", param.adapter_name); - - return ERROR_OK; -} - -COMMAND_HANDLER(aice_handle_aice_port_command) -{ - LOG_DEBUG("aice_handle_aice_port_command"); - - if (CMD_ARGC != 1) { - LOG_ERROR("Need exactly one argument to 'aice port'"); - return ERROR_COMMAND_SYNTAX_ERROR; - } - - for (const struct aice_port *l = aice_port_get_list(); l->name; l++) { - if (strcmp(l->name, CMD_ARGV[0]) == 0) { - aice_port = l; - return ERROR_OK; - } - } - - LOG_ERROR("No AICE port '%s' found", CMD_ARGV[0]); - return ERROR_FAIL; -} - -COMMAND_HANDLER(aice_handle_aice_desc_command) -{ - LOG_DEBUG("aice_handle_aice_desc_command"); - - if (CMD_ARGC == 1) - param.device_desc = strdup(CMD_ARGV[0]); - else - LOG_ERROR("expected exactly one argument to aice desc <description>"); - - return ERROR_OK; -} - -COMMAND_HANDLER(aice_handle_aice_vid_pid_command) -{ - LOG_DEBUG("aice_handle_aice_vid_pid_command"); - - if (CMD_ARGC != 2) { - LOG_WARNING("ignoring extra IDs in aice vid_pid (maximum is 1 pair)"); - return ERROR_COMMAND_SYNTAX_ERROR; - } - - COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], param.vid); - COMMAND_PARSE_NUMBER(u16, CMD_ARGV[1], param.pid); - - return ERROR_OK; -} - -COMMAND_HANDLER(aice_handle_aice_adapter_command) -{ - LOG_DEBUG("aice_handle_aice_adapter_command"); - - if (CMD_ARGC == 1) - param.adapter_name = strdup(CMD_ARGV[0]); - else - LOG_ERROR("expected exactly one argument to aice adapter <adapter-name>"); - - return ERROR_OK; -} - -COMMAND_HANDLER(aice_handle_aice_retry_times_command) -{ - LOG_DEBUG("aice_handle_aice_retry_times_command"); - - if (CMD_ARGC == 1) - COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], retry_times); - else - LOG_ERROR("expected exactly one argument to aice retry_times <num_of_retry>"); - - return ERROR_OK; -} - -COMMAND_HANDLER(aice_handle_aice_count_to_check_dbger_command) -{ - LOG_DEBUG("aice_handle_aice_count_to_check_dbger_command"); - - if (CMD_ARGC == 1) - COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], count_to_check_dbger); - else - LOG_ERROR("expected exactly one argument to aice count_to_check_dbger " - "<count_of_checking>"); - - return ERROR_OK; -} - -COMMAND_HANDLER(aice_handle_aice_custom_srst_script_command) -{ - LOG_DEBUG("aice_handle_aice_custom_srst_script_command"); - - if (CMD_ARGC > 0) { - aice_port->api->set_custom_srst_script(CMD_ARGV[0]); - return ERROR_OK; - } - - return ERROR_FAIL; -} - -COMMAND_HANDLER(aice_handle_aice_custom_trst_script_command) -{ - LOG_DEBUG("aice_handle_aice_custom_trst_script_command"); - - if (CMD_ARGC > 0) { - aice_port->api->set_custom_trst_script(CMD_ARGV[0]); - return ERROR_OK; - } - - return ERROR_FAIL; -} - -COMMAND_HANDLER(aice_handle_aice_custom_restart_script_command) -{ - LOG_DEBUG("aice_handle_aice_custom_restart_script_command"); - - if (CMD_ARGC > 0) { - aice_port->api->set_custom_restart_script(CMD_ARGV[0]); - return ERROR_OK; - } - - return ERROR_FAIL; -} - -COMMAND_HANDLER(aice_handle_aice_reset_command) -{ - LOG_DEBUG("aice_handle_aice_reset_command"); - - return aice_port->api->reset(); -} - - -static const struct command_registration aice_subcommand_handlers[] = { - { - .name = "info", - .handler = &aice_handle_aice_info_command, - .mode = COMMAND_EXEC, - .help = "show aice info", - .usage = "", - }, - { - .name = "port", - .handler = &aice_handle_aice_port_command, - .mode = COMMAND_CONFIG, - .help = "set the port of the AICE", - .usage = "['aice_pipe'|'aice_usb']", - }, - { - .name = "desc", - .handler = &aice_handle_aice_desc_command, - .mode = COMMAND_CONFIG, - .help = "set the aice device description", - .usage = "[description string]", - }, - { - .name = "vid_pid", - .handler = &aice_handle_aice_vid_pid_command, - .mode = COMMAND_CONFIG, - .help = "the vendor and product ID of the AICE device", - .usage = "(vid pid)*", - }, - { - .name = "adapter", - .handler = &aice_handle_aice_adapter_command, - .mode = COMMAND_CONFIG, - .help = "set the file name of adapter", - .usage = "[adapter name]", - }, - { - .name = "retry_times", - .handler = &aice_handle_aice_retry_times_command, - .mode = COMMAND_CONFIG, - .help = "set retry times as AICE timeout", - .usage = "num_of_retry", - }, - { - .name = "count_to_check_dbger", - .handler = &aice_handle_aice_count_to_check_dbger_command, - .mode = COMMAND_CONFIG, - .help = "set retry times as checking $DBGER status", - .usage = "count_of_checking", - }, - { - .name = "custom_srst_script", - .handler = &aice_handle_aice_custom_srst_script_command, - .mode = COMMAND_CONFIG, - .usage = "script_file_name", - .help = "set custom srst script", - }, - { - .name = "custom_trst_script", - .handler = &aice_handle_aice_custom_trst_script_command, - .mode = COMMAND_CONFIG, - .usage = "script_file_name", - .help = "set custom trst script", - }, - { - .name = "custom_restart_script", - .handler = &aice_handle_aice_custom_restart_script_command, - .mode = COMMAND_CONFIG, - .usage = "script_file_name", - .help = "set custom restart script", - }, - { - .name = "reset", - .handler = &aice_handle_aice_reset_command, - .mode = COMMAND_EXEC, - .usage = "", - .help = "reset AICE", - }, - COMMAND_REGISTRATION_DONE -}; - -static const struct command_registration aice_command_handlers[] = { - { - .name = "aice", - .mode = COMMAND_ANY, - .help = "perform aice management", - .usage = "[subcommand]", - .chain = aice_subcommand_handlers, - }, - COMMAND_REGISTRATION_DONE -}; -/***************************************************************************/ -/* End of Command handlers */ - -static struct jtag_interface aice_interface = { - .execute_queue = aice_execute_queue, -}; - -struct adapter_driver aice_adapter_driver = { - .name = "aice", - .transports = aice_transports, - .commands = aice_command_handlers, - - .init = aice_init, - .quit = aice_quit, - .speed = aice_speed, /* set interface speed */ - .khz = aice_khz, /* convert khz to interface speed value */ - .speed_div = aice_speed_div, /* return readable value */ - - .jtag_ops = &aice_interface, -}; diff --git a/src/jtag/aice/aice_interface.h b/src/jtag/aice/aice_interface.h deleted file mode 100644 index 615e90f2e..000000000 --- a/src/jtag/aice/aice_interface.h +++ /dev/null @@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -/*************************************************************************** - * Copyright (C) 2013 by Andes Technology * - * Hsiangkai Wang <hk...@an...> * - ***************************************************************************/ - -#ifndef OPENOCD_JTAG_AICE_AICE_INTERFACE_H -#define OPENOCD_JTAG_AICE_AICE_INTERFACE_H - -int aice_init_targets(void); -int aice_scan_jtag_chain(void); - -#endif /* OPENOCD_JTAG_AICE_AICE_INTERFACE_H */ diff --git a/src/jtag/aice/aice_pipe.c b/src/jtag/aice/aice_pipe.c deleted file mode 100644 index 1ee2d88b4..000000000 --- a/src/jtag/aice/aice_pipe.c +++ /dev/null @@ -1,884 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -/*************************************************************************** - * Copyright (C) 2013 by Andes Technology * - * Hsiangkai Wang <hk...@an...> * - ***************************************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <helper/system.h> - -#ifdef _WIN32 -#include <windows.h> -#else -#include <signal.h> -#endif - -#include <helper/log.h> -#include <helper/time_support.h> -#include "aice_port.h" -#include "aice_pipe.h" - -#define AICE_PIPE_MAXLINE 8192 - -#ifdef _WIN32 -PROCESS_INFORMATION proc_info; - -static HANDLE aice_pipe_output[2]; -static HANDLE aice_pipe_input[2]; - -static int aice_pipe_write(const void *buffer, int count) -{ - BOOL success; - DWORD written; - - success = WriteFile(aice_pipe_output[1], buffer, count, &written, NULL); - if (!success) { - LOG_ERROR("(WIN32) write to pipe failed, error code: 0x%08l" PRIx32, GetLastError()); - return -1; - } - - return written; -} - -static int aice_pipe_read(void *buffer, int count) -{ - BOOL success; - DWORD has_read; - - success = ReadFile(aice_pipe_input[0], buffer, count, &has_read, NULL); - if (!success || (has_read == 0)) { - LOG_ERROR("(WIN32) read from pipe failed, error code: 0x%08l" PRIx32, GetLastError()); - return -1; - } - - return has_read; -} - -static int aice_pipe_child_init(struct aice_port_param_s *param) -{ - STARTUPINFO start_info; - BOOL success; - - ZeroMemory(&proc_info, sizeof(PROCESS_INFORMATION)); - ZeroMemory(&start_info, sizeof(STARTUPINFO)); - start_info.cb = sizeof(STARTUPINFO); - start_info.hStdError = aice_pipe_input[1]; - start_info.hStdOutput = aice_pipe_input[1]; - start_info.hStdInput = aice_pipe_output[0]; - start_info.dwFlags |= STARTF_USESTDHANDLES; - - success = CreateProcess(NULL, - param->adapter_name, - NULL, - NULL, - TRUE, - 0, - NULL, - NULL, - &start_info, - &proc_info); - - if (!success) { - LOG_ERROR("Create new process failed"); - return ERROR_FAIL; - } - - return ERROR_OK; -} - -static int aice_pipe_parent_init(struct aice_port_param_s *param) -{ - /* send open to adapter */ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_OPEN; - set_u16(command + 1, param->vid); - set_u16(command + 3, param->pid); - - if (aice_pipe_write(command, 5) != 5) { - LOG_ERROR("write failed\n"); - return ERROR_FAIL; - } - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) { - LOG_ERROR("read failed\n"); - return ERROR_FAIL; - } - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_open(struct aice_port_param_s *param) -{ - SECURITY_ATTRIBUTES attribute; - - attribute.nLength = sizeof(SECURITY_ATTRIBUTES); - attribute.bInheritHandle = TRUE; - attribute.lpSecurityDescriptor = NULL; - - if (!CreatePipe(&aice_pipe_output[0], &aice_pipe_output[1], - &attribute, AICE_PIPE_MAXLINE)) { - LOG_ERROR("Create pipes failed"); - return ERROR_FAIL; - } - if (!CreatePipe(&aice_pipe_input[0], &aice_pipe_input[1], - &attribute, AICE_PIPE_MAXLINE)) { - LOG_ERROR("Create pipes failed"); - return ERROR_FAIL; - } - - /* do not inherit aice_pipe_output[1] & aice_pipe_input[0] to child process */ - if (!SetHandleInformation(aice_pipe_output[1], HANDLE_FLAG_INHERIT, 0)) - return ERROR_FAIL; - if (!SetHandleInformation(aice_pipe_input[0], HANDLE_FLAG_INHERIT, 0)) - return ERROR_FAIL; - - aice_pipe_child_init(param); - - aice_pipe_parent_init(param); - - return ERROR_OK; -} - -#else - -static int aice_pipe_output[2]; -static int aice_pipe_input[2]; - -static int aice_pipe_write(const void *buffer, int count) -{ - if (write(aice_pipe_output[1], buffer, count) != count) { - LOG_ERROR("write to pipe failed"); - return -1; - } - - return count; -} - -static int aice_pipe_read(void *buffer, int count) -{ - int n; - int64_t then, cur; - - then = timeval_ms(); - - while (1) { - n = read(aice_pipe_input[0], buffer, count); - - if ((n == -1) && (errno == EAGAIN)) { - cur = timeval_ms(); - if (cur - then > 500) - keep_alive(); - continue; - } else if (n > 0) - break; - else { - LOG_ERROR("read from pipe failed"); - break; - } - } - - return n; -} - -static int aice_pipe_child_init(struct aice_port_param_s *param) -{ - close(aice_pipe_output[1]); - close(aice_pipe_input[0]); - - if (aice_pipe_output[0] != STDIN_FILENO) { - if (dup2(aice_pipe_output[0], STDIN_FILENO) != STDIN_FILENO) { - LOG_ERROR("Map aice_pipe to STDIN failed"); - return ERROR_FAIL; - } - close(aice_pipe_output[0]); - } - - if (aice_pipe_input[1] != STDOUT_FILENO) { - if (dup2(aice_pipe_input[1], STDOUT_FILENO) != STDOUT_FILENO) { - LOG_ERROR("Map aice_pipe to STDOUT failed"); - return ERROR_FAIL; - } - close(aice_pipe_input[1]); - } - - if (execl(param->adapter_name, param->adapter_name, (char *)0) < 0) { - LOG_ERROR("Execute aice_pipe failed"); - return ERROR_FAIL; - } - - return ERROR_OK; -} - -static int aice_pipe_parent_init(struct aice_port_param_s *param) -{ - close(aice_pipe_output[0]); - close(aice_pipe_input[1]); - - /* set read end of pipe as non-blocking */ - if (fcntl(aice_pipe_input[0], F_SETFL, O_NONBLOCK)) - return ERROR_FAIL; - - /* send open to adapter */ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_OPEN; - set_u16(command + 1, param->vid); - set_u16(command + 3, param->pid); - - if (aice_pipe_write(command, 5) != 5) { - LOG_ERROR("write failed\n"); - return ERROR_FAIL; - } - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) { - LOG_ERROR("read failed\n"); - return ERROR_FAIL; - } - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static void sig_pipe(int signo) -{ - exit(1); -} - -static int aice_pipe_open(struct aice_port_param_s *param) -{ - pid_t pid; - - if (signal(SIGPIPE, sig_pipe) == SIG_ERR) { - LOG_ERROR("Register SIGPIPE handler failed"); - return ERROR_FAIL; - } - - if (pipe(aice_pipe_output) < 0 || pipe(aice_pipe_input) < 0) { - LOG_ERROR("Create pipes failed"); - return ERROR_FAIL; - } - - pid = fork(); - if (pid < 0) { - LOG_ERROR("Fork new process failed"); - return ERROR_FAIL; - } else if (pid == 0) { - if (aice_pipe_child_init(param) != ERROR_OK) { - LOG_ERROR("AICE_PIPE child process initial error"); - return ERROR_FAIL; - } else { - if (aice_pipe_parent_init(param) != ERROR_OK) { - LOG_ERROR("AICE_PIPE parent process initial error"); - return ERROR_FAIL; - } - } - } - - return ERROR_OK; -} -#endif - -static int aice_pipe_close(void) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_CLOSE; - - if (aice_pipe_write(command, 1) != 1) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) { -#ifdef _WIN32 - WaitForSingleObject(proc_info.hProcess, INFINITE); - CloseHandle(proc_info.hProcess); - CloseHandle(proc_info.hThread); -#endif - return ERROR_OK; - } else - return ERROR_FAIL; -} - -static int aice_pipe_idcode(uint32_t *idcode, uint8_t *num_of_idcode) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_IDCODE; - - if (aice_pipe_write(command, 1) != 1) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - *num_of_idcode = line[0]; - - if ((*num_of_idcode == 0) || (*num_of_idcode >= 16)) - return ERROR_FAIL; - - for (int i = 0 ; i < *num_of_idcode ; i++) - idcode[i] = get_u32(line + i * 4 + 1); - - return ERROR_OK; -} - -static int aice_pipe_state(uint32_t coreid, enum aice_target_state_s *state) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_STATE; - - if (aice_pipe_write(command, 1) != 1) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - *state = (enum aice_target_state_s)line[0]; - - return ERROR_OK; -} - -static int aice_pipe_reset(void) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_RESET; - - if (aice_pipe_write(command, 1) != 1) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_assert_srst(uint32_t coreid, enum aice_srst_type_s srst) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_ASSERT_SRST; - command[1] = srst; - - if (aice_pipe_write(command, 2) != 2) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_run(uint32_t coreid) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_RUN; - - if (aice_pipe_write(command, 1) != 1) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_halt(uint32_t coreid) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_HALT; - - if (aice_pipe_write(command, 1) != 1) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_read_reg(uint32_t coreid, uint32_t num, uint32_t *val) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_READ_REG; - set_u32(command + 1, num); - - if (aice_pipe_write(command, 5) != 5) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - *val = get_u32(line); - - return ERROR_OK; -} - -static int aice_pipe_write_reg(uint32_t coreid, uint32_t num, uint32_t val) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_WRITE_REG; - set_u32(command + 1, num); - set_u32(command + 5, val); - - if (aice_pipe_write(command, 9) != 9) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_read_reg_64(uint32_t coreid, uint32_t num, uint64_t *val) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_READ_REG_64; - set_u32(command + 1, num); - - if (aice_pipe_write(command, 5) != 5) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - *val = (((uint64_t)get_u32(line + 4)) << 32) | get_u32(line); - - return ERROR_OK; -} - -static int aice_pipe_write_reg_64(uint32_t coreid, uint32_t num, uint64_t val) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_WRITE_REG_64; - set_u32(command + 1, num); - set_u32(command + 5, val & 0xFFFFFFFF); - set_u32(command + 9, (val >> 32) & 0xFFFFFFFF); - - if (aice_pipe_write(command, 13) != 9) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_step(uint32_t coreid) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_STEP; - - if (aice_pipe_write(command, 1) != 1) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_read_mem_unit(uint32_t coreid, uint32_t addr, uint32_t size, - uint32_t count, uint8_t *buffer) -{ - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_READ_MEM_UNIT; - set_u32(command + 1, addr); - set_u32(command + 5, size); - set_u32(command + 9, count); - - if (aice_pipe_write(command, 13) != 13) - return ERROR_FAIL; - - if (aice_pipe_read(buffer, size * count) < 0) - return ERROR_FAIL; - - return ERROR_OK; -} - -static int aice_pipe_write_mem_unit(uint32_t coreid, uint32_t addr, uint32_t size, - uint32_t count, const uint8_t *buffer) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_WRITE_MEM_UNIT; - set_u32(command + 1, addr); - set_u32(command + 5, size); - set_u32(command + 9, count); - - /* WRITE_MEM_UNIT|addr|size|count|data */ - memcpy(command + 13, buffer, size * count); - - if (aice_pipe_write(command, 13 + size * count) < 0) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; - - return ERROR_OK; -} - -static int aice_pipe_read_mem_bulk(uint32_t coreid, uint32_t addr, - uint32_t length, uint8_t *buffer) -{ - char line[AICE_PIPE_MAXLINE + 1]; - char command[AICE_PIPE_MAXLINE]; - uint32_t remain_len = length; - uint32_t prepare_len; - char *received_line; - uint32_t received_len; - int read_len; - - command[0] = AICE_READ_MEM_BULK; - set_u32(command + 1, addr); - set_u32(command + 5, length); - - if (aice_pipe_write(command, 9) < 0) - return ERROR_FAIL; - - while (remain_len > 0) { - if (remain_len > AICE_PIPE_MAXLINE) - prepare_len = AICE_PIPE_MAXLINE; - else - prepare_len = remain_len; - - prepare_len++; - received_len = 0; - received_line = line; - do { - read_len = aice_pipe_read(received_line, prepare_len - received_len); - if (read_len < 0) - return ERROR_FAIL; - received_line += read_len; - received_len += read_len; - } while (received_len < prepare_len); - - if (line[0] != AICE_OK) - return ERROR_FAIL; - - prepare_len--; - memcpy(buffer, line + 1, prepare_len); - remain_len -= prepare_len; - buffer += prepare_len; - } - - return ERROR_OK; -} - -static int aice_pipe_write_mem_bulk(uint32_t coreid, uint32_t addr, - uint32_t length, const uint8_t *buffer) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE + 4]; - uint32_t remain_len = length; - uint32_t written_len = 0; - uint32_t write_len; - - command[0] = AICE_WRITE_MEM_BULK; - set_u32(command + 1, addr); - set_u32(command + 5, length); - - /* Send command first */ - if (aice_pipe_write(command, 9) < 0) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_ERROR) - return ERROR_FAIL; - - while (remain_len > 0) { - if (remain_len > AICE_PIPE_MAXLINE) - write_len = AICE_PIPE_MAXLINE; - else - write_len = remain_len; - - set_u32(command, write_len); - memcpy(command + 4, buffer + written_len, write_len); /* data only */ - - if (aice_pipe_write(command, write_len + 4) < 0) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_ERROR) - return ERROR_FAIL; - - remain_len -= write_len; - written_len += write_len; - } - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_read_debug_reg(uint32_t coreid, uint32_t addr, uint32_t *val) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_READ_DEBUG_REG; - set_u32(command + 1, addr); - - if (aice_pipe_write(command, 5) != 5) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - *val = get_u32(line); - - return ERROR_OK; -} - -static int aice_pipe_write_debug_reg(uint32_t coreid, uint32_t addr, const uint32_t val) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_WRITE_DEBUG_REG; - set_u32(command + 1, addr); - set_u32(command + 5, val); - - if (aice_pipe_write(command, 9) != 9) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_set_jtag_clock(uint32_t a_clock) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_SET_JTAG_CLOCK; - set_u32(command + 1, a_clock); - - if (aice_pipe_write(command, 5) != 5) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_memory_access(uint32_t coreid, enum nds_memory_access access_channel) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_MEMORY_ACCESS; - set_u32(command + 1, access_channel); - - if (aice_pipe_write(command, 5) != 5) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_memory_mode(uint32_t coreid, enum nds_memory_select mem_select) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_MEMORY_MODE; - set_u32(command + 1, mem_select); - - if (aice_pipe_write(command, 5) != 5) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_read_tlb(uint32_t coreid, target_addr_t virtual_address, - target_addr_t *physical_address) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_READ_TLB; - set_u32(command + 1, virtual_address); - - if (aice_pipe_write(command, 5) != 5) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) { - *physical_address = get_u32(line + 1); - return ERROR_OK; - } else - return ERROR_FAIL; -} - -static int aice_pipe_cache_ctl(uint32_t coreid, uint32_t subtype, uint32_t address) -{ - char line[AICE_PIPE_MAXLINE]; - char command[AICE_PIPE_MAXLINE]; - - command[0] = AICE_CACHE_CTL; - set_u32(command + 1, subtype); - set_u32(command + 5, address); - - if (aice_pipe_write(command, 9) != 9) - return ERROR_FAIL; - - if (aice_pipe_read(line, AICE_PIPE_MAXLINE) < 0) - return ERROR_FAIL; - - if (line[0] == AICE_OK) - return ERROR_OK; - else - return ERROR_FAIL; -} - -static int aice_pipe_set_retry_times(uint32_t a_retry_times) -{ - return ERROR_OK; -} - -/** */ -struct aice_port_api_s aice_pipe = { - /** */ - .open = aice_pipe_open, - /** */ - .close = aice_pipe_close, - /** */ - .idcode = aice_pipe_idcode, - /** */ - .set_jtag_clock = aice_pipe_set_jtag_clock, - /** */ - .state = aice_pipe_state, - /** */ - .reset = aice_pipe_reset, - /** */ - .assert_srst = aice_pipe_assert_srst, - /** */ - .run = aice_pipe_run, - /** */ - .halt = aice_pipe_halt, - /** */ - .step = aice_pipe_step, - /** */ - .read_reg = aice_pipe_read_reg, - /** */ - .write_reg = aice_pipe_write_reg, - /** */ - .read_reg_64 = aice_pipe_read_reg_64, - /** */ - .write_reg_64 = aice_pipe_write_reg_64, - /** */ - .read_mem_unit = aice_pipe_read_mem_unit, - /** */ - .write_mem_unit = aice_pipe_write_mem_unit, - /** */ - .read_mem_bulk = aice_pipe_read_mem_bulk, - /** */ - .write_mem_bulk = aice_pipe_write_mem_bulk, - /** */ - .read_debug_reg = aice_pipe_read_debug_reg, - /** */ - .write_debug_reg = aice_pipe_write_debug_reg, - - /** */ - .memory_access = aice_pipe_memory_access, - /** */ - .memory_mode = aice_pipe_memory_mode, - - /** */ - .read_tlb = aice_pipe_read_tlb, - - /** */ - .cache_ctl = aice_pipe_cache_ctl, - - /** */ - .set_retry_times = aice_pipe_set_retry_times, -}; diff --git a/src/jtag/aice/aice_pipe.h b/src/jtag/aice/aice_pipe.h deleted file mode 100644 index 5a1f4107f..000000000 --- a/src/jtag/aice/aice_pipe.h +++ /dev/null @@ -1,20 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -/*************************************************************************** - * Copyright (C) 2013 by Andes Technology * - * Hsiangkai Wang <hk...@an...> * - ***************************************************************************/ - -#ifndef OPENOCD_JTAG_AICE_AICE_PIPE_H -#define OPENOCD_JTAG_AICE_AICE_PIPE_H - -#include <helper/types.h> - -#define set_u32(buffer, value) h_u32_to_le((uint8_t *)buffer, value) -#define set_u16(buffer, value) h_u16_to_le((uint8_t *)buffer, value) -#define get_u32(buffer) le_to_h_u32((const uint8_t *)buffer) -#define get_u16(buffer) le_to_h_u16((const uint8_t *)buffer) - -extern struct aice_port_api_s aice_pipe; - -#endif /* OPENOCD_JTAG_AICE_AICE_PIPE_H */ diff --git a/src/jtag/aice/aice_port.c b/src/jtag/aice/aice_port.c deleted file mode 100644 index ac38cec3a..000000000 --- a/src/jtag/aice/aice_port.c +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -/*************************************************************************** - * Copyright (C) 2013 by Andes Technology * - * Hsiangkai Wang <hk...@an...> * - ***************************************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <helper/log.h> -#include "aice_usb.h" -#include "aice_pipe.h" -#include "aice_port.h" - -static const struct aice_port aice_ports[] = { - { - .name = "aice_usb", - .type = AICE_PORT_AICE_USB, - .api = &aice_usb_api, - }, - { - .name = "aice_pipe", - .type = AICE_PORT_AICE_PIPE, - .api = &aice_pipe, - }, - {.name = NULL, /* END OF TABLE */ }, -}; - -/** */ -const struct aice_port *aice_port_get_list(void) -{ - return aice_ports; -} diff --git a/src/jtag/aice/aice_port.h b/src/jtag/aice/aice_port.h deleted file mode 100644 index fb914d853..000000000 --- a/src/jtag/aice/aice_port.h +++ /dev/null @@ -1,224 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -/*************************************************************************** - * Copyright (C) 2013 by Andes Technology * - * Hsiangkai Wang <hk...@an...> * - ***************************************************************************/ - -#ifndef OPENOCD_JTAG_AICE_AICE_PORT_H -#define OPENOCD_JTAG_AICE_AICE_PORT_H - -#include <target/nds32_edm.h> - -#define AICE_MAX_NUM_CORE (0x10) - -#define ERROR_AICE_DISCONNECT (-200) -#define ERROR_AICE_TIMEOUT (-201) - -enum aice_target_state_s { - AICE_DISCONNECT = 0, - AICE_TARGET_DETACH, - AICE_TARGET_UNKNOWN, - AICE_TARGET_RUNNING, - AICE_TARGET_HALTED, - AICE_TARGET_RESET, - AICE_TARGET_DEBUG_RUNNING, -}; - -enum aice_srst_type_s { - AICE_SRST = 0x1, - AICE_RESET_HOLD = 0x8, -}; - -enum aice_target_endian { - AICE_LITTLE_ENDIAN = 0, - AICE_BIG_ENDIAN, -}; - -enum aice_api_s { - AICE_OPEN = 0x0, - AICE_CLOSE, - AICE_RESET, - AICE_IDCODE, - AICE_SET_JTAG_CLOCK, - AICE_ASSERT_SRST, - AICE_RUN, - AICE_HALT, - AICE_STEP, - AICE_READ_REG, - AICE_WRITE_REG, - AICE_READ_REG_64, - AICE_WRITE_REG_64, - AICE_READ_MEM_UNIT, - AICE_WRITE_MEM_UNIT, - AICE_READ_MEM_BULK, - AICE_WRITE_MEM_BULK, - AICE_READ_DEBUG_REG, - AICE_WRITE_DEBUG_REG, - AICE_STATE, - AICE_MEMORY_ACCESS, - AICE_MEMORY_MODE, - AICE_READ_TLB, - AICE_CACHE_CTL, - AICE_SET_RETRY_TIMES, - AICE_PROGRAM_EDM, - AICE_SET_COMMAND_MODE, - AICE_EXECUTE, - AICE_SET_CUSTOM_SRST_SCRIPT, - AICE_SET_CUSTOM_TRST_SCRIPT, - AICE_SET_CUSTOM_RESTART_SCRIPT, - AICE_SET_COUNT_TO_CHECK_DBGER, - AICE_SET_DATA_ENDIAN, -}; - -enum aice_error_s { - AICE_OK, - AICE_ACK, - AICE_ERROR, -}; - -enum aice_cache_ctl_type { - AICE_CACHE_CTL_L1D_INVALALL = 0, - AICE_CACHE_CTL_L1D_VA_INVAL, - AICE_CACHE_CTL_L1D_WBALL, - AICE_CACHE_CTL_L1D_VA_WB, - AICE_CACHE_CTL_L1I_INVALALL, - AICE_CACHE_CTL_L1I_VA_INVAL, -}; - -enum aice_command_mode { - AICE_COMMAND_MODE_NORMAL, - AICE_COMMAND_MODE_PACK, - AICE_COMMAND_MODE_BATCH, -}; - -struct aice_port_param_s { - /** */ - const char *device_desc; - /** */ - uint16_t vid; - /** */ - uint16_t pid; - /** */ - char *adapter_name; -}; - -struct aice_port_s { - /** */ - uint32_t coreid; - /** */ - const struct aice_port *port; -}; - -/** */ -extern struct aice_port_api_s aice_usb_layout_api; - -/** */ -struct aice_port_api_s { - /** */ - int (*open)(struct aice_port_param_s *param); - /** */ - int (*close)(void); - /** */ - int (*reset)(void); - /** */ - int (*idcode)(uint32_t *idcode, uint8_t *num_of_idcode); - /** */ - int (*set_jtag_clock)(uint32_t a_clock); - /** */ - int (*assert_srst)(uint32_t coreid, enum aice_srst_type_s srst); - /** */ - int (*run)(uint32_t coreid); - /** */ - int (*halt)(uint32_t coreid); - /** */ - int (*step)(uint32_t coreid); - /** */ - int (*read_reg)(uint32_t coreid, uint32_t num, uint32_t *val); - /** */ - int (*write_reg)(uint32_t coreid, uint32_t num, uint32_t val); - /** */ - int (*read_reg_64)(uint32_t coreid, uint32_t num, uint64_t *val); - /** */ - int (*write_reg_64)(uint32_t coreid, uint32_t num, uint64_t val); - /** */ - int (*read_mem_unit)(uint32_t coreid, uint32_t addr, uint32_t size, - uint32_t count, uint8_t *buffer); - /** */ - int (*write_mem_unit)(uint32_t coreid, uint32_t addr, uint32_t size, - uint32_t count, const uint8_t *buffer); - /** */ - int (*read_mem_bulk)(uint32_t coreid, uint32_t addr, uint32_t length, - uint8_t *buffer); - /** */ - int (*write_mem_bulk)(uint32_t coreid, uint32_t addr, uint32_t length, - const uint8_t *buffer); - /** */ - int (*read_debug_reg)(uint32_t coreid, uint32_t addr, uint32_t *val); - /** */ - int (*write_debug_reg)(uint32_t coreid, uint32_t addr, const uint32_t val); - - /** */ - int (*state)(uint32_t coreid, enum aice_target_state_s *state); - - /** */ - int (*memory_access)(uint32_t coreid, enum nds_memory_access a_access); - /** */ - int (*memory_mode)(uint32_t coreid, enum nds_memory_select mem_select); - - /** */ - int (*read_tlb)(uint32_t coreid, target_addr_t virtual_address, target_addr_t *physical_address); - - /** */ - int (*cache_ctl)(uint32_t coreid, uint32_t subtype, uint32_t address); - - /** */ - int (*set_retry_times)(uint32_t a_retry_times); - - /** */ - int (*program_edm)(uint32_t coreid, char *command_sequence); - - /** */ - int (*set_command_mode)(enum aice_command_mode command_mode); - - /** */ - int (*execute)(uint32_t coreid, uint32_t *instructions, uint32_t instruction_num); - - /** */ - int (*set_custom_srst_script)(const char *script); - - /** */ - int (*set_custom_trst_script)(const char *script); - - /** */ - int (*set_custom_restart_script)(const char *script); - - /** */ - int (*set_count_to_check_dbger)(uint32_t count_to_check); - - /** */ - int (*set_data_endian)(uint32_t coreid, enum aice_target_endian target_data_endian); - - /** */ - int (*profiling)(uint32_t coreid, uint32_t interval, uint32_t iteration, - uint32_t reg_no, uint32_t *samples, uint32_t *num_samples); -}; - -#define AICE_PORT_UNKNOWN 0 -#define AICE_PORT_AICE_USB 1 -#define AICE_PORT_AICE_PIPE 2 - -/** */ -struct aice_port { - /** */ - const char *name; - /** */ - int type; - /** */ - struct aice_port_api_s *const api; -}; - -/** */ -const struct aice_port *aice_port_get_list(void); - -#endif /* OPENOCD_JTAG_AICE_AICE_PORT_H */ diff --git a/src/jtag/aice/aice_transport.c b/src/jtag/aice/aice_transport.c deleted file mode 100644 index 49f899ddc..000000000 --- a/src/jtag/aice/aice_transport.c +++ /dev/null @@ -1,432 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -/*************************************************************************** - * Copyright (C) 2013 by Andes Technology * - * Hsiangkai Wang <hk...@an...> * - ***************************************************************************/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -/* project specific includes */ -#include <jtag/interface.h> -#include <jtag/tcl.h> -#include <transport/transport.h> -#include <target/target.h> -#include <jtag/aice/aice_interface.h> -#include <jtag/aice/aice_transport.h> -#include <string.h> - -/* */ -static int jim_newtap_expected_id(struct jim_nvp *n, struct jim_getopt_info *goi, - struct jtag_tap *tap) -{ - jim_wide w; - int e = jim_getopt_wide(goi, &w); - if (e != JIM_OK) { - Jim_SetResultFormatted(goi->interp, "option: %s bad parameter", - n->name); - return e; - } - - unsigned expected_len = sizeof(uint32_t) * tap->expected_ids_cnt; - uint32_t *new_expected_ids = malloc(expected_len + sizeof(uint32_t)); - if (!new_expected_ids) { - Jim_SetResultFormatted(goi->interp, "no memory"); - return JIM_ERR; - } - - assert(tap->expected_ids); - memcpy(new_expected_ids, tap->expected_ids, expected_len); - - new_expected_ids[tap->expected_ids_cnt] = w; - - free(tap->expected_ids); - tap->expected_ids = new_expected_ids; - tap->expected_ids_cnt++; - - return JIM_OK; -} - -#define NTAP_OPT_EXPECTED_ID 0 - -/* */ -static int jim_aice_newtap_cmd(struct jim_getopt_info *goi) -{ - struct jtag_tap *tap; - int x; - int e; - struct jim_nvp *n; - char *cp; - const struct jim_nvp opts[] = { - {.name = "-expected-id", .value = NTAP_OPT_EXPECTED_ID}, - {.name = NULL, .value = -1}, - }; - - tap = calloc(1, sizeof(struct jtag_tap)); - if (!tap) { - Jim_SetResultFormatted(goi->interp, "no memory"); - return JIM_ERR; - } - - /* - * we expect CHIP + TAP + OPTIONS - * */ - if (goi->argc < 3) { - Jim_SetResultFormatted(goi->interp, - "Missing CHIP TAP OPTIONS ...."); - free(tap); - return JIM_ERR; - } - - const char *tmp; - jim_getopt_string(goi, &tmp, NULL); - tap->chip = strdup(tmp); - - jim_getopt_string(goi, &tmp, NULL); - tap->tapname = strdup(tmp); - - /* name + dot + name + null */ - x = strlen(tap->chip) + 1 + strlen(tap->tapname) + 1; - cp = malloc(x); - sprintf(cp, "%s.%s", tap->chip, tap->tapname); - tap->dotted_name = cp; - - LOG_DEBUG("Creating New Tap, Chip: %s, Tap: %s, Dotted: %s, %d params", - tap->chip, tap->tapname, tap->dotted_name, goi->argc); - - while (goi->argc) { - e = jim_getopt_nvp(goi, opts, &n); - if (e != JIM_OK) { - jim_getopt_nvp_unknown(goi, opts, 0); - free(cp); - free(tap); - return e; - } - LOG_DEBUG("Processing option: %s", n->name); - switch (n->value) { - case NTAP_OPT_EXPECTED_ID: - e = jim_newtap_expected_id(n, goi, tap); - if (e != JIM_OK) { - free(cp); - free(tap); - return e; - } - break; - } /* switch (n->value) */ - } /* while (goi->argc) */ - - /* default is enabled-after-reset */ - tap->enabled = !tap->disabled_after_reset; - - jtag_tap_init(tap); - return JIM_OK; -} - -/* */ -static int jim_aice_newtap(Jim_Interp *interp, int argc, Jim_Obj * const *argv) -{ - struct jim_getopt_info goi; - jim_getopt_setup(&goi, interp, argc - 1, argv + 1); - return jim_aice_newtap_cmd(&goi); -} - -/* */ -COMMAND_HANDLER(handle_aice_init_command) -{ - if (CMD_ARGC != 0) - return ERROR_COMMAND_SYNTAX_ERROR; - - static bool jtag_initialized; - if (jtag_initialized) { - LOG_INFO("'jtag init' has already been called"); - return ERROR_OK; - } - jtag_initialized = true; - - LOG_DEBUG("Initializing jtag devices..."); - return jtag_init(CMD_CTX); -} - -COMMAND_HANDLER(handle_scan_chain_command) -{ - struct jtag_tap *tap; - char expected_id[12]; - - aice_scan_jtag_chain(); - tap = jtag_all_taps(); - command_print(CMD, - " TapName Enabled IdCode Expected IrLen IrCap IrMask"); - command_print(CMD, - "-- ------------------- -------- ---------- ---------- ----- ----- ------"); - - while (tap) { - uint32_t expected, expected_mask, ii; - - snprintf(expected_id, sizeof(expected_id), "0x%08x", - (unsigned)((tap->expected_ids_cnt > 0) - ? tap->expected_ids[0] - : 0)); - if (tap->ignore_version) - expected_id[2] = '*'; - - expected = buf_get_u32(tap->expected, 0, tap->ir_length); - expected_mask = buf_get_u32(tap->expected_mask, 0, tap->ir_length); - - command_print(CMD, - "%2d %-18s %c 0x%08x %s %5d 0x%02x 0x%02x", - tap->abs_chain_position, - tap->dotted_name, - tap->enabled ? 'Y' : 'n', - (unsigned int)(tap->idcode), - expected_id, - (unsigned int)(tap->ir_length), - (unsigned int)(expected), - (unsigned int)(expected_mask)); - - for (ii = 1; ii < tap->expected_ids_cnt; ii++) { - snprintf(expected_id, sizeof(expected_id), "0x%08x", - (unsigned) tap->expected_ids[ii]); - if (tap->ignore_version) - expected_id[2] = '*'; - - command_print(CMD, - " %s", - expected_id); - } - - tap = tap->next_tap; - } - - return ERROR_OK; -} - -static int jim_aice_arp_init(Jim_Interp *interp, int argc, Jim_Obj * const *argv) -{ - LOG_DEBUG("No implement: jim_aice_arp_init"); - - return JIM_OK; -} - -/* */ -static int aice_init_reset(struct command_context *cmd_ctx) -{ - LOG_DEBUG("Initializing with hard TRST+SRST reset"); - - int retval; - enum reset_types jtag_reset_config = jtag_get_reset_config(); - - jtag_add_reset(1, 0); /* TAP_RESET */ - if (jtag_reset_config & RESET_HAS_SRST) { - jtag_add_reset(1, 1); - if ((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0) - jtag_add_reset(0, 1); - } - jtag_add_reset(0, 0); - retval = jtag_execute_queue(); - if (retval != ERROR_OK) - return retval; - - return ERROR_OK; -} - -/* */ -static int jim_aice_arp_init_reset(Jim_Interp *interp, int argc, Jim_Obj * const *argv) -{ - int e = ERROR_OK; - struct jim_getopt_info goi; - jim_getopt_setup(&goi, interp, argc - 1, argv + 1); - if (goi.argc != 0) { - Jim_WrongNumArgs(goi.interp, 1, goi.argv - 1, "(no params)"); - return JIM_ERR; - } - struct command_context *context = current_command_context(interp); - e = aice_init_reset(context); - - if (e != ERROR_OK) { - Jim_Obj *obj = Jim_NewIntObj(goi.interp, e); - Jim_SetResultFormatted(goi.interp, "error: %#s", obj); - return JIM_ERR; - } - return JIM_OK; -} - -static int jim_aice_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv) -{ - struct jim_getopt_info goi; - jim_getopt_setup(&goi, interp, argc - 1, argv + 1); - if (goi.argc != 0) { - Jim_WrongNumArgs(goi.interp, 1, goi.argv, "Too many parameters"); - return JIM_ERR; - } - Jim_SetResult(goi.interp, Jim_NewListObj(goi.interp, NULL, 0)); - struct jtag_tap *tap; - - for (tap = jtag_all_taps(); tap; tap = tap->next_tap) - Jim_ListAppendElement(goi.interp, - Jim_GetResult(goi.interp), - Jim_NewStringObj(goi.interp, - tap->dotted_name, -1)); - - return JIM_OK; -} - -/* */ -static const struct command_registration aice_transport_jtag_subcommand_handlers[] = { - { - .name = "init", - .mode = COMMAND_ANY, - .handler = handle_aice_init_command, - .help = "initialize jtag scan chain", - .usage = "" - }, - { - .name = "arp_init", - .mode = COMMAND_ANY, - .jim_handler = jim_aice_arp_init, - .help = "Validates JTAG scan chain against the list of " - "declared TAPs.", - }, - { - .name = "arp_init-reset", - .mode = COMMAND_ANY, - .jim_handler = jim_aice_arp_init_reset, - .help = "Uses TRST and SRST to try resetting everything on " - "the JTAG scan chain, then performs 'jtag arp_init'." - }, - { - .name = "newtap", - .mode = COMMAND_CONFIG, - .jim_handler = jim_aice_newtap, - .help = "Create a new TAP instance named basename.tap_type, " - "and appends it to the scan chain.", - .usage = "basename tap_type ['-expected_id' number]" - }, - { - .name = "tapisenabled", - .mode = COMMAND_EXEC, - .jim_handler = jim_jtag_tap_enabler, - .help = "Returns a Tcl boolean (0/1) indicating whether " - "the TAP is enabled (1) or not (0).", - .usage = "tap_name", - }, - { - .name = "tapenable", - .mode = COMMAND_EXEC, - .jim_handler = jim_jtag_tap_enabler, - .help = "Try to enable the specified TAP using the " - "'tap-enable' TAP event.", - .usage = "tap_name", - }, - { - .name = "tapdisable", - .mode = COMMAND_EXEC, - .jim_handler = jim_jtag_tap_enabler, - .help = "Try to disable the specified TAP using the " - "'tap-disable' TAP event.", - .usage = "tap_name", - }, - { - .name = "configure", - .mode = COMMAND_ANY, - .jim_handler = jim_jtag_configure, - .help = "Provide a Tcl handler for the specified " - "TAP event.", - .usage = "tap_name '-event' event_name handler", - }, - { - .name = "cget", - .mode = COMMAND_EXEC, - .jim_handler = jim_jtag_configure, - .help = "Return any Tcl handler for the specified " - "TAP event.", - .usage = "tap_name '-event' event_name", - }, - { - .name = "names", - .mode = COMMAND_ANY, - .jim_handler = jim_aice_names, - .help = "Returns list of all JTAG tap names.", - }, - { - .name = "scan_chain", - .handler = handle_scan_chain_command, - .mode = COMMAND_ANY, - .help = "print current scan chain configuration", - .usage = "" - }, - - COMMAND_REGISTRATION_DONE -}; - -/* */ -static const struct command_registration aice_transport_command_handlers[] = { - { - .name = "jtag", - .mode = COMMAND_ANY, - .usage = "", - .chain = aice_transport_jtag_subcommand_handlers, - }, - COMMAND_REGISTRATION_DONE - -}; - -/* */ -static int aice_transport_register_commands(struct command_context *cmd_ctx) -{ - return register_commands(cmd_ctx, NULL, aice_transport_command_handlers); -} - -/* */ -static int aice_transport_init(struct command_context *cmd_ctx) -{ - LOG_DEBUG("aice_transport_init"); - struct target *t = get_current_target(cmd_ctx); - struct transport *transport; - - if (!t) { - LOG_ERROR("no current target"); - return ERROR_FAIL; - } - - transport = get_current_transport(); - - if (!transport) { - LOG_ERROR("no transport selected"); - return ERROR_FAIL; - } - - LOG_DEBUG("current transport %s", transport->name); - - return aice_init_targets(); -} - -/* */ -static int aice_transport_select(struct command_context *ctx) -{ - LOG_DEBUG("aice_transport_select"); - - int retval; - - retval = aice_transport_register_commands(ctx); - - if (retval != ERROR_OK) - return retval; - - return ERROR_OK; -} - -static struct transport aice_jtag_transport = { - .name = "aice_jtag", - .select = aice_transport_select, - .init = aice_transport_init, -}; - -const char *aice_transports[] = { "aice_jtag", NULL }; - -static void aice_constructor(void) __attribute__((constructor)); -static void aice_constructor(void) -{ - transport_register(&aice_jtag_transport); -} diff --git a/src/jtag/aice/aice_transport.h b/src/jtag/aice/aice_transport.h deleted file mode 100644 index b00003198..000000000 --- a/src/jtag/aice/aice_transport.h +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -/*************************************************************************** - * Copyright (C) 2013 by Andes Technology * - * Hsiangkai Wang <hk...@an...> * - ***************************************************************************/ - -#ifndef OPENOCD_JTAG_AICE_AICE_TRANSPORT_H -#define OPENOCD_JTAG_AICE_AICE_TRANSPORT_H - -extern const char *aice_transports[]; - -#endif /* OPENOCD_JTAG_AICE_AICE_TRANSPORT_H */ diff --git a/src/jtag/aice/aice_usb.c b/src/jtag/aice/aice_usb.c deleted file mode 100644 index b5d0f0b6e..000000000 --- a/src/jtag/aice/aice_usb.c +++ /dev/null @@ -1,4099 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -/*************************************************************************** - * Copyright (C) 2013 by Andes Technology * - * Hsiangkai Wang <hk...@an...> * - ***************************************************************************/ -#ifdef HAVE_CONFIG_H -#include ... [truncated message content] |
From: openocd-gerrit <ope...@us...> - 2023-01-15 14:46: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 8bb926eb01022998ceefe666f8df102e59404015 (commit) from f8a6553e82919bcfd37436dd6b95e99bb261d04c (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 8bb926eb01022998ceefe666f8df102e59404015 Author: Marc Schink <de...@za...> Date: Sun May 22 16:15:00 2022 +0200 Deprecate libjaylink Git submodule libjaylink was integrated into OpenOCD as a Git submodule, because at that time there was no official release and no packages for it. Today there are libjaylink packages for most popular distributions [1]. Removing libjaylink from OpenOCD reduces build complexity in both projects and makes them more flexible with respect to the build system, for example. Disable the libjaylink submodule by default and announce it as deprecated feature that will be removed in the future. This gives package maintainers time to package libjaylink if not already done. [1] https://repology.org/project/libjaylink/versions Change-Id: I6166ba4757aee5c89a0506de867072f58fa5ec4b Signed-off-by: Marc Schink <de...@za...> Reviewed-on: https://review.openocd.org/c/openocd/+/7129 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/configure.ac b/configure.ac index 7f0955f13..4fcc91528 100644 --- a/configure.ac +++ b/configure.ac @@ -373,9 +373,9 @@ AC_ARG_ENABLE([jimtcl-maintainer], [use_internal_jimtcl_maintainer=$enableval], [use_internal_jimtcl_maintainer=no]) AC_ARG_ENABLE([internal-libjaylink], - AS_HELP_STRING([--disable-internal-libjaylink], - [Disable building internal libjaylink]), - [use_internal_libjaylink=$enableval], [use_internal_libjaylink=yes]) + AS_HELP_STRING([--enable-internal-libjaylink], + [Enable building internal libjaylink]), + [use_internal_libjaylink=$enableval], [use_internal_libjaylink=no]) AC_ARG_ENABLE([remote-bitbang], AS_HELP_STRING([--enable-remote-bitbang], [Enable building support for the Remote Bitbang jtag driver]), @@ -713,7 +713,7 @@ AS_IF([test "x$enable_jlink" != "xno"], [ AX_CONFIG_SUBDIR_OPTION([src/jtag/drivers/libjaylink], [--enable-subproject-build]) ], [ - AC_MSG_ERROR([Internal libjaylink not found, run either 'git submodule init' and 'git submodule update' or disable internal libjaylink with --disable-internal-libjaylink.]) + AC_MSG_ERROR([Internal libjaylink not found, run 'git submodule init' and 'git submodule update'.]) ]) ]) ]) @@ -823,6 +823,12 @@ AC_CONFIG_FILES([ ]) AC_OUTPUT +AS_IF([test "x$enable_jlink" != "xno"], [ + AS_IF([test "x$use_internal_libjaylink" = "xyes"], [ + AC_MSG_WARN([Using the internal libjaylink is deprecated and will not be possible in the future.]) + ]]) +) + echo echo echo OpenOCD configuration summary ----------------------------------------------------------------------- Summary of changes: configure.ac | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2023-01-14 23:35:36
|
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 f8a6553e82919bcfd37436dd6b95e99bb261d04c (commit) via 9ea7f3d647c8ecf6b0f1424002dfc3f4504a162c (commit) from f71b5f5a37fde4b22cd8eb379c2bc8454c636145 (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 f8a6553e82919bcfd37436dd6b95e99bb261d04c Author: Paul Fertser <fer...@gm...> Date: Sun Jan 15 02:33:06 2023 +0300 Restore normal development cycle Signed-off-by: Paul Fertser <fer...@gm...> diff --git a/NEWS b/NEWS index 208146a46..9db6c5fee 100644 --- a/NEWS +++ b/NEWS @@ -2,126 +2,29 @@ This file includes highlights of the changes made in the OpenOCD source archive release. JTAG Layer: - * add default to adapter speed when unspecified (100 kHz) - * AM335X gpio (BeagleBones) adapter driver - * BCM2835 support for SWD - * Cadence Virtual Debug (vdebug) adapter driver - * CMSIS-DAP support for SWO and SWD multidrop - * Espressif USB JTAG Programmer adapter driver - * Remote bitbang support for Windows host - * ST-LINK add TCP server support to adapter driver - * SWD multidrop support Boundary Scan: Target Layer: - * aarch64: support watchpoints - * arm: support independent TPIU and SWO for trace - * arm adi v5: support Large Physical Address Extension - * arm adi v6: support added, for jtag and swd transport - * cortex_a: support watchpoints - * elf 64bit load support - * Espressif: support ESP32, ESP32-S2 and ESP32-S3 cores - * semihosting: support user defined operations - * Xtensa: support Xtensa LX architecture via JTAG and ADIv5 DAP Flash Layer: - * Atmel/Microchip SAM E51G18A, E51G19A, R35J18B, LAN9255 support - * GigaDevice GD32E23x, GD32F1x0/3x0, GD32VF103 support - * Nuvoton NPCX series support - * onsemi RSL10 support - * Raspberry Pi Pico RP2040 support - * ST BlueNRG-LPS support - * ST STM32 G05x, G06x, G0Bx, G0Cx, U57x, U58x, WB1x, WL5x support - * ST STM32 G0, G4, L4, L4+, L5, WB, WL OTP support Board, Target, and Interface Configuration Scripts: - * Ampere Computing eMAG8180, Altra ("Quicksilver") and Altra Max ("Mystique") board config - * Cadence KC705 FPGA (Xtensa Development Platform) via JTAG and ADIv5 DAP board config - * Digilent Nexys Video board config - * Espressif ESP32 ETHERNET-KIT and WROVER-KIT board config - * Espressif ESP32 via ESP USB Bridge generic board config - * Espressif ESP32-S2 Kaluga 1 board config - * Espressif ESP32-S2 with ESP USB Bridge board config - * Espressif ESP32-S3 example board config - * Kontron SMARC-sAL28 board config - * LambdaConcept ECPIX-5 board config - * Microchip ATSAMA5D27-SOM1-EK1 board config - * Microchip EVB-LAN9255 board config - * Microchip SAME51 Curiosity Nano board config - * NXP FRDM-K64F, LS1046ARDB and LS1088ARDB board config - * NXP RT6XX board config - * Olimex H405 board config - * Radiona ULX3S board config - * Raspberry Pi 3 and Raspberry Pi 4 model B board config - * Raspberry Pi Pico-Debug board config - * Renesas R-Car V3U Falcon board config - * ST BlueNRG-LPS steval-idb012v1 board config - * ST NUCLEO-8S208RB board config - * ST NUCLEO-G031K8, NUCLEO-G070RB, NUCLEO-G071RB board config - * ST NUCLEO-G431KB, NUCLEO-G431RB, NUCLEO-G474RE board config - * ST STM32MP13x-DK board config - * TI AM625 EVM, AM642 EVM and AM654 EVM board config - * TI J721E EVM, J721S2 EVM and J7200 EVM board config - * Ampere Computing eMAG, Altra ("Quicksilver") and Altra Max ("Mystique") target config - * Cadence Xtensa generic and Xtensa VDebug target config - * Broadcom BCM2711, BCM2835, BCM2836 and BCM2837 target config - * Espressif ESP32, ESP32-S2 and ESP32-S3 target config - * Microchip ATSAMA5D2 series target config - * NanoXplore NG-Ultra SoC target config - * NXP IMX8QM target config - * NXP LS1028A, LS1046A and LS1088A target config - * NXP RT600 (Xtensa HiFi DSP) target config - * onsemi RSL10 target config - * Raspberry Pi Pico RP2040 target config - * Renesas R8A779A0 V3U target config - * Renesas RZ/Five target config - * Renesas RZ/G2 MPU family target config - * Rockchip RK3399 target config - * ST BlueNRG-LPS target config - * ST STM32MP13x target config - * TI AM625, AM654, J721E and J721S2 target config - * Ashling Opella-LD interface config - * Aspeed AST2600 linuxgpiod based interface config - * Blinkinlabs JTAG_Hat interface config - * Cadence Virtual Debug (vdebug) interface config - * Espressif ESP32-S2 Kaluga 1 board's interface config - * Espressif USB Bridge jtag interface config - * Infineon DAP miniWiggler V3 interface config - * PLS SPC5 interface config - * Tigard interface config - * Lattice MachXO3 family FPGA config Server Layer: - * GDB: add per-target remote protocol extensions - * GDB: more 'Z' packets support - * IPDBG JtagHost server functionality - * semihosting: I/O redirection to TCP server - * telnet: support for command's autocomplete RTOS: - * 'none' rtos support - * Zephyr rtos support Documentation: Build and Release: - * Add json extension to jimtcl build - * Drop dependency from libusb0 - * Drop repository repo.or.cz for submodules - * Move gerrit to https://review.openocd.org/ - * Require autoconf 2.69 or newer - * Update jep106 to revision JEP106BF.01 - * Update jimtcl to version 0.81 - * Update libjaylink to version 0.3.1 - * New configure flag '--enable-jimtcl-maintainer' for jimtcl build This release also contains a number of other important functional and cosmetic bugfixes. For more details about what has changed since the last release, see the git repository history: -http://sourceforge.net/p/openocd/code/ci/v0.12.0/log/?path= +http://sourceforge.net/p/openocd/code/ci/v0.x.0/log/?path= For older NEWS, see the NEWS files associated with each release diff --git a/NEWS b/NEWS-0.12.0 similarity index 100% copy from NEWS copy to NEWS-0.12.0 diff --git a/configure.ac b/configure.ac index eee42d424..7f0955f13 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later AC_PREREQ([2.69]) -AC_INIT([openocd], [0.12.0], +AC_INIT([openocd], [0.12.0+dev], [OpenOCD Mailing List <ope...@li...>]) AC_CONFIG_SRCDIR([src/openocd.c]) AC_CONFIG_AUX_DIR([build-aux]) commit 9ea7f3d647c8ecf6b0f1424002dfc3f4504a162c Author: Paul Fertser <fer...@gm...> Date: Sat Jan 14 23:14:31 2023 +0300 The openocd-0.12.0 release Signed-off-by: Paul Fertser <fer...@gm...> diff --git a/NEWS b/NEWS index 4ebb831ce..208146a46 100644 --- a/NEWS +++ b/NEWS @@ -121,7 +121,7 @@ This release also contains a number of other important functional and cosmetic bugfixes. For more details about what has changed since the last release, see the git repository history: -http://sourceforge.net/p/openocd/code/ci/v0.12.0-rc3/log/?path= +http://sourceforge.net/p/openocd/code/ci/v0.12.0/log/?path= For older NEWS, see the NEWS files associated with each release diff --git a/configure.ac b/configure.ac index a8535213d..eee42d424 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later AC_PREREQ([2.69]) -AC_INIT([openocd], [0.12.0-rc3+dev], +AC_INIT([openocd], [0.12.0], [OpenOCD Mailing List <ope...@li...>]) AC_CONFIG_SRCDIR([src/openocd.c]) AC_CONFIG_AUX_DIR([build-aux]) ----------------------------------------------------------------------- Summary of changes: NEWS | 99 +---------------------------------------------------- NEWS => NEWS-0.12.0 | 2 +- configure.ac | 2 +- 3 files changed, 3 insertions(+), 100 deletions(-) copy NEWS => NEWS-0.12.0 (98%) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2023-01-14 23:35:27
|
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 annotated tag, v0.12.0 has been created at 5cc204e035530d806f308be5ac22552fdb298a02 (tag) tagging 9ea7f3d647c8ecf6b0f1424002dfc3f4504a162c (commit) replaces v0.12.0-rc3 tagged by Paul Fertser on Sat Jan 14 23:14:42 2023 +0300 - Log ----------------------------------------------------------------- The openocd-0.12.0 release. Antonio Borneo (2): jtag: esp_usb_jtag: remove macro __packed configure.ac: fix check for jimtcl submodule Marcin Niestroj (1): rtt: fix corner-cases of finding control block Paul Fertser (2): Restore +dev suffix The openocd-0.12.0 release ----------------------------------------------------------------------- hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2023-01-14 20:06:39
|
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 f71b5f5a37fde4b22cd8eb379c2bc8454c636145 (commit) from d92ebb5ab43f6c6a900c6beb0bc426573058c359 (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 f71b5f5a37fde4b22cd8eb379c2bc8454c636145 Author: Antonio Borneo <bor...@gm...> Date: Sat Jan 14 15:18:02 2023 +0100 configure.ac: fix check for jimtcl submodule The file configure.ac checks if jimtcl submodule is present by looking for the file jimtcl/configure.ac . But jimtcl has switched to its own build system in 2011 and thus dropped configure.ac . This cause a build issue on OpenOCD that was incorrectly fixed by adding a dummy configure.ac in jimtcl. Fix OpenOCD configure.ac to look for the correct file jimtcl/configure . After this fix, another fix would be proposed to jimtcl to drop its useless dummy file configure.ac . Change-Id: I705f72d83e374c8dd700baaa0c0bbe041f153605 Signed-off-by: Antonio Borneo <bor...@gm...> Reported-by: Paul Fertser <fer...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7437 Tested-by: jenkins Reviewed-by: Paul Fertser <fer...@gm...> diff --git a/configure.ac b/configure.ac index bcacfb240..a8535213d 100644 --- a/configure.ac +++ b/configure.ac @@ -574,7 +574,7 @@ AS_IF([test "x$enable_buspirate" != "xno"], [ ]) AS_IF([test "x$use_internal_jimtcl" = "xyes"], [ - AS_IF([test -f "$srcdir/jimtcl/configure.ac"], [ + AS_IF([test -f "$srcdir/jimtcl/configure"], [ AS_IF([test "x$use_internal_jimtcl_maintainer" = "xyes"], [ jimtcl_config_options="--disable-install-jim --with-ext=json --maintainer" ], [ ----------------------------------------------------------------------- Summary of changes: configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2023-01-11 17:03:04
|
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 d92ebb5ab43f6c6a900c6beb0bc426573058c359 (commit) via 7dd5b6a4645cf0ce9c635a7fc8b140575385c827 (commit) from dfe57baa16cdbc0dc2ae7182b5b3831028637223 (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 d92ebb5ab43f6c6a900c6beb0bc426573058c359 Author: Antonio Borneo <bor...@gm...> Date: Fri Jan 6 12:40:01 2023 +0100 jtag: esp_usb_jtag: remove macro __packed In FreeBSB 13.0 the build fails due to redefined macro __packed. src/jtag/drivers/esp_usb_jtag.c:19:9: error: '__packed' macro redefined [-Werror,-Wmacro-redefined] #define __packed __attribute__((packed)) ^ /usr/include/sys/cdefs.h:223:9: note: previous definition is here #define __packed __attribute__((__packed__)) ^ 1 error generated. Drop the macro and align the code with the other files in OpenOCD project, where the attribute is directly applied without using a macro. Change-Id: I89ae943e77036206d40d4d54172cd4a73e76e5c5 Signed-off-by: Antonio Borneo <bor...@gm...> Reported-by: Wojciech Puchar <wo...@pu...> Reviewed-on: https://review.openocd.org/c/openocd/+/7435 Tested-by: jenkins Reviewed-by: Erhan Kurubas <erh...@es...> diff --git a/src/jtag/drivers/esp_usb_jtag.c b/src/jtag/drivers/esp_usb_jtag.c index 65293ee37..dd96f4b39 100644 --- a/src/jtag/drivers/esp_usb_jtag.c +++ b/src/jtag/drivers/esp_usb_jtag.c @@ -16,8 +16,6 @@ #include "bitq.h" #include "libusb_helper.h" -#define __packed __attribute__((packed)) - /* Holy Crap, it's protocol documentation, and it's even vendor-provided! @@ -110,7 +108,7 @@ descriptor. struct jtag_proto_caps_hdr { uint8_t proto_ver; /* Protocol version. Expects JTAG_PROTO_CAPS_VER for now. */ uint8_t length; /* of this plus any following descriptors */ -} __packed; +} __attribute__((packed)); /* start of the descriptor headers */ #define JTAG_BUILTIN_DESCR_START_OFF 0 /* Devices with builtin usb jtag */ @@ -133,7 +131,7 @@ of caps header to assume this. If no such caps exist, assume a minimum (in) buff struct jtag_gen_hdr { uint8_t type; uint8_t length; -} __packed; +} __attribute__((packed)); struct jtag_proto_caps_speed_apb { uint8_t type; /* Type, always JTAG_PROTO_CAPS_SPEED_APB_TYPE */ @@ -141,7 +139,7 @@ struct jtag_proto_caps_speed_apb { uint8_t apb_speed_10khz[2]; /* ABP bus speed, in 10KHz increments. Base speed is half this. */ uint8_t div_min[2]; /* minimum divisor (to base speed), inclusive */ uint8_t div_max[2]; /* maximum divisor (to base speed), inclusive */ -} __packed; +} __attribute__((packed)); #define JTAG_PROTO_CAPS_DATA_LEN 255 #define JTAG_PROTO_CAPS_SPEED_APB_TYPE 1 commit 7dd5b6a4645cf0ce9c635a7fc8b140575385c827 Author: Marcin Niestroj <m.n...@em...v> Date: Mon Jan 2 08:04:06 2023 +0100 rtt: fix corner-cases of finding control block This patch fixes two corner-cases of finding RTT control block. The first one is when there was a partial match (even single byte) at the end of loaded buffer (uint8_t buf[1024]), but this was not part of full match. In that case `cb_offset` was not updated correctly and the returned `*address` was lower by the legth of the partial match. In case of searched 'SEGGER RTT' (the default control block ID) string, it was enough to match `buf[1023] == 'S'`, which is quite likely to happen, and the `*address` was offset by 1 (e.g. it was 0x20000fff instead of 0x20010000). Updating (or even maintaining) `cb_offset` is not needed, as start address of control block can be calculated based on memory address that was loaded into `uint8_t buf[1024]`, the offset within this buffer and the length of expected string. The second issue is when control block is prepended with a byte that matches first ID character, e.g. there is `SEGGER RTT` control block ID is prepended by another `S`, making memory contents be `SSEGGER RTT`. In that case there was no match found. Fix that issue by making sure that tested byte is always compared with first byte of expected control block ID. While at it, change names of local variables to better describe their meaning. Signed-off-by: Marcin Niestroj <m.n...@em...v> Change-Id: I12aa6e202bf12bedcbb888ab595751a2a2518a24 Reviewed-on: https://review.openocd.org/c/openocd/+/7429 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/rtt.c b/src/target/rtt.c index ef2c45d69..b14c42f91 100644 --- a/src/target/rtt.c +++ b/src/target/rtt.c @@ -241,43 +241,37 @@ int target_rtt_find_control_block(struct target *target, target_addr_t *address, size_t size, const char *id, bool *found, void *user_data) { + target_addr_t address_end = *address + size; uint8_t buf[1024]; *found = false; - size_t j = 0; - size_t cb_offset = 0; + size_t id_matched_length = 0; const size_t id_length = strlen(id); LOG_INFO("rtt: Searching for control block '%s'", id); - for (target_addr_t addr = 0; addr < size; addr = addr + sizeof(buf)) { + for (target_addr_t addr = *address; addr < address_end; addr += sizeof(buf)) { int ret; - const size_t buf_size = MIN(sizeof(buf), size - addr); - ret = target_read_buffer(target, *address + addr, buf_size, buf); + const size_t buf_size = MIN(sizeof(buf), address_end - addr); + ret = target_read_buffer(target, addr, buf_size, buf); if (ret != ERROR_OK) return ret; - size_t start = 0; - size_t i = 0; - - while (i < buf_size) { - if (buf[i] != id[j]) { - start++; - cb_offset++; - i = start; - j = 0; - - continue; + for (size_t buf_off = 0; buf_off < buf_size; buf_off++) { + if (id_matched_length > 0 && + buf[buf_off] != id[id_matched_length]) { + /* Start from beginning */ + id_matched_length = 0; } - i++; - j++; + if (buf[buf_off] == id[id_matched_length]) + id_matched_length++; - if (j == id_length) { - *address = *address + cb_offset; + if (id_matched_length == id_length) { + *address = addr + buf_off + 1 - id_length; *found = true; return ERROR_OK; } ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/esp_usb_jtag.c | 8 +++----- src/target/rtt.c | 34 ++++++++++++++-------------------- 2 files changed, 17 insertions(+), 25 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-20 12:51:59
|
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 dfe57baa16cdbc0dc2ae7182b5b3831028637223 (commit) via fcb40f49b10fef01debf4ccf1d0faca71a1108fa (commit) from 77c281d2df25621782b48d0a45846b93fba3860d (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 dfe57baa16cdbc0dc2ae7182b5b3831028637223 Author: Paul Fertser <fer...@gm...> Date: Tue Dec 20 15:49:44 2022 +0300 Restore +dev suffix Signed-off-by: Paul Fertser <fer...@gm...> diff --git a/configure.ac b/configure.ac index 23c524359..bcacfb240 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later AC_PREREQ([2.69]) -AC_INIT([openocd], [0.12.0-rc3], +AC_INIT([openocd], [0.12.0-rc3+dev], [OpenOCD Mailing List <ope...@li...>]) AC_CONFIG_SRCDIR([src/openocd.c]) AC_CONFIG_AUX_DIR([build-aux]) commit fcb40f49b10fef01debf4ccf1d0faca71a1108fa Author: Antonio Borneo <bor...@gm...> Date: Tue Nov 15 22:46:27 2022 +0100 The openocd-0.12.0-rc3 release candidate Change-Id: Id7ddf232593e1aa7cb36f2b30fe832ebf79c1535 Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/NEWS b/NEWS index 5bb6e5e7b..4ebb831ce 100644 --- a/NEWS +++ b/NEWS @@ -111,7 +111,7 @@ Build and Release: * Drop repository repo.or.cz for submodules * Move gerrit to https://review.openocd.org/ * Require autoconf 2.69 or newer - * Update jep106 to revision JEP106BE + * Update jep106 to revision JEP106BF.01 * Update jimtcl to version 0.81 * Update libjaylink to version 0.3.1 * New configure flag '--enable-jimtcl-maintainer' for jimtcl build @@ -121,7 +121,7 @@ This release also contains a number of other important functional and cosmetic bugfixes. For more details about what has changed since the last release, see the git repository history: -http://sourceforge.net/p/openocd/code/ci/v0.12.0-rc2/log/?path= +http://sourceforge.net/p/openocd/code/ci/v0.12.0-rc3/log/?path= For older NEWS, see the NEWS files associated with each release diff --git a/configure.ac b/configure.ac index 503e79169..23c524359 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later AC_PREREQ([2.69]) -AC_INIT([openocd], [0.12.0-rc2+dev], +AC_INIT([openocd], [0.12.0-rc3], [OpenOCD Mailing List <ope...@li...>]) AC_CONFIG_SRCDIR([src/openocd.c]) AC_CONFIG_AUX_DIR([build-aux]) ----------------------------------------------------------------------- Summary of changes: NEWS | 4 ++-- configure.ac | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-20 12:51:55
|
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 annotated tag, v0.12.0-rc3 has been created at e758ddc77236c03e9759115dcafacb7f6d776728 (tag) tagging fcb40f49b10fef01debf4ccf1d0faca71a1108fa (commit) replaces v0.12.0-rc2 tagged by Paul Fertser on Tue Dec 20 13:52:22 2022 +0300 - Log ----------------------------------------------------------------- The openocd-0.12.0-rc3 release. Andreas Bolsch (1): Fix for segfault and some clang reported problems in stmqspi Antonio Borneo (17): helper/types: use unsigned type for all h_u64_to_le() and similar openrisc: fix clang error core.CallAndMessage esirisc_jtag: fix clang error core.VLASize dsp5680xx: fix clang error core.UndefinedBinaryOperatorResult flash: stmqspi: fix clang error 'dead assignment' rtos: hwthread: fix clang error core.NullDereference jep106: update to revision JEP106BF.01 Oct 2022 flash: lpc2900: fix clang error 'dead assignment' jtag: xds110: fix clang error core.StackAddressEscape arm_adi_v5: fix SIGSEGV due to failing re-examine target: cortex_a: fix clang error core.CallAndMessage target: fix unsigned computation in 'monitor profile' target: fix assert in 'monitor profile' on constant PC driver: vdebug: fix mode of cmd 'vdebug mem_path' jtag: fix build with configure --enable-verbose cortex_m: handle armv8m cores without security extension The openocd-0.12.0-rc3 release candidate Ben McMorran (1): ThreadX: set current_thread for kernel execution Dan Stahlke (1): at91samd: wait for nvm ready Daniel Anselmi (1): pld/virtex2: small doc extension Evgeniy Naydanov (1): Fix jim_target_smp for smp rtos target George Voicu (1): tcl/cpld/xilinx-xcu: fix typo Giulio Fieramosca (1): rtos/ThreadX: added check for NULL-named tasks Karl Palsson (1): doc: describe tcl port consistently. Koudai Iwahori (2): hwthread: Add register validity check in get_thread_reg_list hwthread: Restore current_threadid in hwthread_update_threads Marc Schink (1): flash/nor/stm32lx: Add revision '1, X' for Cat.2 devices Nick Kraus (1): jtag/drivers/cmsis_dap.c: Fix Length of SWO Baudrate Command Nima Palizban (1): src/target/mips_m4k.c: set missing flag in set_watchpoint Paul Fertser (1): Restore +dev suffix Rocco Marco Guglielmi (1): tcl: max326xx: fix target scripts for latest version of OpenOCD Simon Smiganovski (1): flash/nor/stm32f1x: adjust size of the flash loader buffer Tomas Vanek (5): jtag/drivers/cmsis_dap: prevent CDC missdetect as CMSIS-DAP bulk Revert "Remove duplicate of a counter in hwthread_update_threads" tcl/interface: fix raspberrypi2-native.cfg speed coefficient target/armv7m: prevent saving and restoring non existent regs target/armv7m: fix feature name of ARMv8M security extension regs ----------------------------------------------------------------------- hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-18 21:53: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 77c281d2df25621782b48d0a45846b93fba3860d (commit) from c913e4d5a6cafab9a19735c440be8d0c111b2088 (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 77c281d2df25621782b48d0a45846b93fba3860d Author: Antonio Borneo <bor...@gm...> Date: Wed Dec 14 15:54:53 2022 +0100 cortex_m: handle armv8m cores without security extension Cores armv8m, e.g. Cortex-M33, can be instantiated without the optional Security Extension. In this case, the secure registers are not present and when GDB try accessing them it triggers a set of errors. For armv8m cores without security extension, don't provide to GDB the description of the secure registers. Change-Id: I254478a4cf883e85b786df3f62c726b2f40d88d9 Signed-off-by: Antonio Borneo <bor...@gm...> Reported-by: Torbjörn SVENSSON <tor...@fo...> Reviewed-on: https://review.openocd.org/c/openocd/+/7402 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 2472e38e2..017a6d3a1 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -2270,6 +2270,22 @@ static void cortex_m_dwt_free(struct target *target) cm->dwt_cache = NULL; } +static bool cortex_m_has_tz(struct target *target) +{ + struct armv7m_common *armv7m = target_to_armv7m(target); + uint32_t dauthstatus; + + if (armv7m->arm.arch != ARM_ARCH_V8M) + return false; + + int retval = target_read_u32(target, DAUTHSTATUS, &dauthstatus); + if (retval != ERROR_OK) { + LOG_WARNING("Error reading DAUTHSTATUS register"); + return false; + } + return (dauthstatus & DAUTHSTATUS_SID_MASK) != 0; +} + #define MVFR0 0xe000ef40 #define MVFR1 0xe000ef44 @@ -2398,7 +2414,7 @@ int cortex_m_examine(struct target *target) for (size_t idx = ARMV7M_FPU_FIRST_REG; idx <= ARMV7M_FPU_LAST_REG; idx++) armv7m->arm.core_cache->reg_list[idx].exist = false; - if (armv7m->arm.arch != ARM_ARCH_V8M) + if (!cortex_m_has_tz(target)) for (size_t idx = ARMV8M_FIRST_REG; idx <= ARMV8M_LAST_REG; idx++) armv7m->arm.core_cache->reg_list[idx].exist = false; diff --git a/src/target/cortex_m.h b/src/target/cortex_m.h index b1de26ebc..a1c43b56d 100644 --- a/src/target/cortex_m.h +++ b/src/target/cortex_m.h @@ -68,6 +68,9 @@ struct cortex_m_part_info { #define DCB_DEMCR 0xE000EDFC #define DCB_DSCSR 0xE000EE08 +#define DAUTHSTATUS 0xE000EFB8 +#define DAUTHSTATUS_SID_MASK 0x00000030 + #define DCRSR_WNR BIT(16) #define DWT_CTRL 0xE0001000 ----------------------------------------------------------------------- Summary of changes: src/target/cortex_m.c | 18 +++++++++++++++++- src/target/cortex_m.h | 3 +++ 2 files changed, 20 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-18 21:52:21
|
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 c913e4d5a6cafab9a19735c440be8d0c111b2088 (commit) from 77c7abe4e7569ca8bb23dad6110c7209c8c55558 (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 c913e4d5a6cafab9a19735c440be8d0c111b2088 Author: Antonio Borneo <bor...@gm...> Date: Sat Dec 17 23:05:23 2022 +0100 jtag: fix build with configure --enable-verbose With flag --enable-verbose, configure enables compiling some conditional code that with new gcc triggers an error: error: '%04x' directive output may be truncated writing between 4 and 8 bytes into a region of size 5 [-Werror=format-truncation=] Extend the buffer to contain the full 8 bytes of %04x on a 'int' and change the limit in snprintf. Skip the intermediate buffer 's[4]'. Align the code to the coding style. Change-Id: Ifc8a6e4686555578a7355a1f6049471fd5e31913 Signed-off-by: Antonio Borneo <bor...@gm...> Reported-by: Karl Hammar <ka...@as...> Reported-by: Tommy Murphy <tom...@ho...> Fixes: https://sourceforge.net/p/openocd/tickets/376/ Reviewed-on: https://review.openocd.org/c/openocd/+/7403 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/jtag/drivers/arm-jtag-ew.c b/src/jtag/drivers/arm-jtag-ew.c index a3e9e1712..7db3c7b15 100644 --- a/src/jtag/drivers/arm-jtag-ew.c +++ b/src/jtag/drivers/arm-jtag-ew.c @@ -776,17 +776,12 @@ static int armjtagew_usb_read(struct armjtagew *armjtagew, int exp_in_length) static void armjtagew_debug_buffer(uint8_t *buffer, int length) { - char line[81]; - char s[4]; - int i; - int j; + char line[8 + 3 * BYTES_PER_LINE + 1]; - for (i = 0; i < length; i += BYTES_PER_LINE) { - snprintf(line, 5, "%04x", i); - for (j = i; j < i + BYTES_PER_LINE && j < length; j++) { - snprintf(s, 4, " %02x", buffer[j]); - strcat(line, s); - } + for (int i = 0; i < length; i += BYTES_PER_LINE) { + int n = snprintf(line, 9, "%04x", i); + for (int j = i; j < i + BYTES_PER_LINE && j < length; j++) + n += snprintf(line + n, 4, " %02x", buffer[j]); LOG_DEBUG("%s", line); /* Prevent GDB timeout (writing to log might take some time) */ diff --git a/src/jtag/drivers/opendous.c b/src/jtag/drivers/opendous.c index d0c527788..c353aef40 100644 --- a/src/jtag/drivers/opendous.c +++ b/src/jtag/drivers/opendous.c @@ -796,17 +796,12 @@ int opendous_usb_read(struct opendous_jtag *opendous_jtag) void opendous_debug_buffer(uint8_t *buffer, int length) { - char line[81]; - char s[4]; - int i; - int j; + char line[8 + 3 * BYTES_PER_LINE + 1]; - for (i = 0; i < length; i += BYTES_PER_LINE) { - snprintf(line, 5, "%04x", i); - for (j = i; j < i + BYTES_PER_LINE && j < length; j++) { - snprintf(s, 4, " %02x", buffer[j]); - strcat(line, s); - } + for (int i = 0; i < length; i += BYTES_PER_LINE) { + int n = snprintf(line, 9, "%04x", i); + for (int j = i; j < i + BYTES_PER_LINE && j < length; j++) + n += snprintf(line + n, 4, " %02x", buffer[j]); LOG_DEBUG("%s", line); } } ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/arm-jtag-ew.c | 15 +++++---------- src/jtag/drivers/opendous.c | 15 +++++---------- 2 files changed, 10 insertions(+), 20 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-17 09:33:55
|
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 77c7abe4e7569ca8bb23dad6110c7209c8c55558 (commit) via 0a829efda5c254ceca2371edb38e9b0e4a998706 (commit) from 2b6fe8f1ab739798309b47f7b3a664894ba43a19 (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 77c7abe4e7569ca8bb23dad6110c7209c8c55558 Author: Dan Stahlke <da...@st...> Date: Sun Dec 4 18:12:16 2022 -0800 at91samd: wait for nvm ready Flashing a SAMD21J17D was failing during NVM erase. The samd21 datasheet specifies that one cause of error conditions is executing an NVM command while the previous command is still running. The solution is to wait for INTFLAG.READY after a command is issued. SAMD21J17A was not exhibiting this problem. Perhaps the later silicon revision has slower NVM erase times. Signed-off-by: Dan Stahlke <da...@st...> Change-Id: I19745dae4d3fc6e3a7611dcac628e067cb41e0f0 Reviewed-on: https://review.openocd.org/c/openocd/+/7391 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/flash/nor/at91samd.c b/src/flash/nor/at91samd.c index f213444d1..33e86c76e 100644 --- a/src/flash/nor/at91samd.c +++ b/src/flash/nor/at91samd.c @@ -12,6 +12,7 @@ #include "imp.h" #include "helper/binarybuffer.h" +#include <helper/time_support.h> #include <jtag/jtag.h> #include <target/cortex_m.h> @@ -31,7 +32,7 @@ #define SAMD_NVMCTRL_CTRLA 0x00 /* NVM control A register */ #define SAMD_NVMCTRL_CTRLB 0x04 /* NVM control B register */ #define SAMD_NVMCTRL_PARAM 0x08 /* NVM parameters register */ -#define SAMD_NVMCTRL_INTFLAG 0x18 /* NVM Interrupt Flag Status & Clear */ +#define SAMD_NVMCTRL_INTFLAG 0x14 /* NVM Interrupt Flag Status & Clear */ #define SAMD_NVMCTRL_STATUS 0x18 /* NVM status register */ #define SAMD_NVMCTRL_ADDR 0x1C /* NVM address register */ #define SAMD_NVMCTRL_LOCK 0x20 /* NVM Lock section register */ @@ -55,6 +56,9 @@ /* NVMCTRL bits */ #define SAMD_NVM_CTRLB_MANW 0x80 +/* NVMCTRL_INTFLAG bits */ +#define SAMD_NVM_INTFLAG_READY 0x01 + /* Known identifiers */ #define SAMD_PROCESSOR_M0 0x01 #define SAMD_FAMILY_D 0x00 @@ -497,7 +501,27 @@ static int samd_probe(struct flash_bank *bank) static int samd_check_error(struct target *target) { int ret, ret2; + uint8_t intflag; uint16_t status; + int timeout_ms = 1000; + int64_t ts_start = timeval_ms(); + + do { + ret = target_read_u8(target, + SAMD_NVMCTRL + SAMD_NVMCTRL_INTFLAG, &intflag); + if (ret != ERROR_OK) { + LOG_ERROR("Can't read NVM intflag"); + return ret; + } + if (intflag & SAMD_NVM_INTFLAG_READY) + break; + keep_alive(); + } while (timeval_ms() - ts_start < timeout_ms); + + if (!(intflag & SAMD_NVM_INTFLAG_READY)) { + LOG_ERROR("SAMD: NVM programming timed out"); + return ERROR_FLASH_OPERATION_FAILED; + } ret = target_read_u16(target, SAMD_NVMCTRL + SAMD_NVMCTRL_STATUS, &status); commit 0a829efda5c254ceca2371edb38e9b0e4a998706 Author: Antonio Borneo <bor...@gm...> Date: Sun Dec 11 11:08:32 2022 +0100 driver: vdebug: fix mode of cmd 'vdebug mem_path' The command 'vdebug mem_path' is reported in the documentation as '{Config Command}', but the code sets mode = COMMAND_ANY. The code of the commands sets some value that is only used during the init phase, so the documentation is correct. Change mode of command 'vdebug mem_path' to COMMAND_CONFIG. Change-Id: Icb940fe382cbc75015273b35dcc8a88fc2a7d0ac Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7395 Tested-by: jenkins Reviewed-by: Jacek Wuwer <jac...@gm...> diff --git a/src/jtag/drivers/vdebug.c b/src/jtag/drivers/vdebug.c index ef7a49332..7898e9d9b 100644 --- a/src/jtag/drivers/vdebug.c +++ b/src/jtag/drivers/vdebug.c @@ -1246,7 +1246,7 @@ static const struct command_registration vdebug_command_handlers[] = { { .name = "mem_path", .handler = &vdebug_set_mem, - .mode = COMMAND_ANY, + .mode = COMMAND_CONFIG, .help = "set the design memory for the code load", .usage = "<path> <base_address> <size>", }, ----------------------------------------------------------------------- Summary of changes: src/flash/nor/at91samd.c | 26 +++++++++++++++++++++++++- src/jtag/drivers/vdebug.c | 2 +- 2 files changed, 26 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-17 09:33:43
|
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 2b6fe8f1ab739798309b47f7b3a664894ba43a19 (commit) from a51ac964c6160646f2c28db854aa8faf096eb314 (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 2b6fe8f1ab739798309b47f7b3a664894ba43a19 Author: Antonio Borneo <bor...@gm...> Date: Wed Dec 14 15:21:43 2022 +0100 target: fix assert in 'monitor profile' on constant PC When target is stopped in WFI/WFE or is in an infinite loop, the sampled PC will always return the same value. Command 'profile' requires that distance between min and max PC should be at least 2, which is not the case for constant PC, and incorrectly enforces the check through as assert(). Move the code that reads the optional parameters 'start' and 'end' and check the gap 'end - start' before running the profile. For self-computed min and max, increase max (or decrease min) to match the required constraint. Drop the assert(). Change-Id: I2be8df8568ce8c889923888c492e4f7ce354b16b Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: https://sourceforge.net/p/openocd/tickets/370/ Reviewed-on: https://review.openocd.org/c/openocd/+/7400 Tested-by: jenkins diff --git a/src/target/target.c b/src/target/target.c index 755a8e283..e3a6f955e 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4253,10 +4253,17 @@ static void write_gmon(uint32_t *samples, uint32_t sample_num, const char *filen * Refer to binutils/gprof/hist.c (find_histogram_for_pc) */ if (max < UINT32_MAX) max++; + + /* gprof requires (max - min) >= 2 */ + while ((max - min) < 2) { + if (max < UINT32_MAX) + max++; + else + min--; + } } uint32_t address_space = max - min; - assert(address_space >= 2); /* FIXME: What is the reasonable number of buckets? * The profiling result will be more accurate if there are enough buckets. */ @@ -4332,6 +4339,19 @@ COMMAND_HANDLER(handle_profile_command) COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], offset); + uint32_t start_address = 0; + uint32_t end_address = 0; + bool with_range = false; + if (CMD_ARGC == 4) { + with_range = true; + COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], start_address); + COMMAND_PARSE_NUMBER(u32, CMD_ARGV[3], end_address); + if (start_address > end_address || (end_address - start_address) < 2) { + command_print(CMD, "Error: end - start < 2"); + return ERROR_COMMAND_ARGUMENT_INVALID; + } + } + uint32_t *samples = malloc(sizeof(uint32_t) * MAX_PROFILE_SAMPLE_NUM); if (!samples) { LOG_ERROR("No memory to store samples."); @@ -4384,15 +4404,6 @@ COMMAND_HANDLER(handle_profile_command) return retval; } - uint32_t start_address = 0; - uint32_t end_address = 0; - bool with_range = false; - if (CMD_ARGC == 4) { - with_range = true; - COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], start_address); - COMMAND_PARSE_NUMBER(u32, CMD_ARGV[3], end_address); - } - write_gmon(samples, num_of_samples, CMD_ARGV[1], with_range, start_address, end_address, target, duration_ms); command_print(CMD, "Wrote %s", CMD_ARGV[1]); ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-17 09:32: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 a51ac964c6160646f2c28db854aa8faf096eb314 (commit) from a6b02219529d1d48d130e4bed9c8d55395662ff6 (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 a51ac964c6160646f2c28db854aa8faf096eb314 Author: Antonio Borneo <bor...@gm...> Date: Sun Dec 11 10:11:58 2022 +0100 target: fix unsigned computation in 'monitor profile' The implementation of command 'monitor profile' has few issues: - the address_space is a signed int, so cannot wrap-around on space over INT_MAX; - max address is incremented without check for overflow; - assert() used on errors instead of returning error codes; - only handles 32 bits PC; - output file created and left empty on error. This patch fixes the first two issues, as a wider fix would be too invasive and should be postponed in a following series. Change-Id: Id8ead3f6db0fd5730682a0d1638f11836d06a632 Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: https://sourceforge.net/p/openocd/tickets/370/ Reviewed-on: https://review.openocd.org/c/openocd/+/7394 Tested-by: jenkins diff --git a/src/target/target.c b/src/target/target.c index e4fe20f72..755a8e283 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4251,10 +4251,11 @@ static void write_gmon(uint32_t *samples, uint32_t sample_num, const char *filen /* max should be (largest sample + 1) * Refer to binutils/gprof/hist.c (find_histogram_for_pc) */ - max++; + if (max < UINT32_MAX) + max++; } - int address_space = max - min; + uint32_t address_space = max - min; assert(address_space >= 2); /* FIXME: What is the reasonable number of buckets? ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-17 09:32: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 a6b02219529d1d48d130e4bed9c8d55395662ff6 (commit) from c6fe10de75763623dfdaaf2fe3fff7e78a4ca146 (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 a6b02219529d1d48d130e4bed9c8d55395662ff6 Author: Antonio Borneo <bor...@gm...> Date: Sat Dec 10 22:15:44 2022 +0100 target: cortex_a: fix clang error core.CallAndMessage Clang complains about the variable 'orig_dfsr' that can be used uninitialized both in cortex_a_read_cpu_memory() and in cortex_a_write_cpu_memory(). The issue is caused by an incorrect error path that used to jump through 'goto out'. The code after the label 'out' is specific to handle the case of an error during memory R/W; it is incorrect to jump there to handle an error during the initialization that precedes the memory R/W. Replace the 'goto out' with 'return retval'. Remove the label 'out' that is now unused. Change-Id: Ib4b140221d1c1b63419de109579bde8b63fc2e8c Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7393 Tested-by: jenkins diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c index 07796d57c..3db9c62a5 100644 --- a/src/target/cortex_a.c +++ b/src/target/cortex_a.c @@ -2246,7 +2246,7 @@ static int cortex_a_write_cpu_memory(struct target *target, /* Switch to non-blocking mode if not already in that mode. */ retval = cortex_a_set_dcc_mode(target, DSCR_EXT_DCC_NON_BLOCKING, &dscr); if (retval != ERROR_OK) - goto out; + return retval; /* Mark R0 as dirty. */ arm_reg_current(arm, 0)->dirty = true; @@ -2254,16 +2254,16 @@ static int cortex_a_write_cpu_memory(struct target *target, /* Read DFAR and DFSR, as they will be modified in the event of a fault. */ retval = cortex_a_read_dfar_dfsr(target, &orig_dfar, &orig_dfsr, &dscr); if (retval != ERROR_OK) - goto out; + return retval; /* Get the memory address into R0. */ retval = mem_ap_write_atomic_u32(armv7a->debug_ap, armv7a->debug_base + CPUDBG_DTRRX, address); if (retval != ERROR_OK) - goto out; + return retval; retval = cortex_a_exec_opcode(target, ARMV4_5_MRC(14, 0, 0, 0, 5, 0), &dscr); if (retval != ERROR_OK) - goto out; + return retval; if (size == 4 && (address % 4) == 0) { /* We are doing a word-aligned transfer, so use fast mode. */ @@ -2288,7 +2288,6 @@ static int cortex_a_write_cpu_memory(struct target *target, retval = cortex_a_write_cpu_memory_slow(target, size, count, buffer, &dscr); } -out: final_retval = retval; /* Switch to non-blocking mode if not already in that mode. */ @@ -2564,7 +2563,7 @@ static int cortex_a_read_cpu_memory(struct target *target, /* Switch to non-blocking mode if not already in that mode. */ retval = cortex_a_set_dcc_mode(target, DSCR_EXT_DCC_NON_BLOCKING, &dscr); if (retval != ERROR_OK) - goto out; + return retval; /* Mark R0 as dirty. */ arm_reg_current(arm, 0)->dirty = true; @@ -2572,16 +2571,16 @@ static int cortex_a_read_cpu_memory(struct target *target, /* Read DFAR and DFSR, as they will be modified in the event of a fault. */ retval = cortex_a_read_dfar_dfsr(target, &orig_dfar, &orig_dfsr, &dscr); if (retval != ERROR_OK) - goto out; + return retval; /* Get the memory address into R0. */ retval = mem_ap_write_atomic_u32(armv7a->debug_ap, armv7a->debug_base + CPUDBG_DTRRX, address); if (retval != ERROR_OK) - goto out; + return retval; retval = cortex_a_exec_opcode(target, ARMV4_5_MRC(14, 0, 0, 0, 5, 0), &dscr); if (retval != ERROR_OK) - goto out; + return retval; if (size == 4 && (address % 4) == 0) { /* We are doing a word-aligned transfer, so use fast mode. */ @@ -2607,7 +2606,6 @@ static int cortex_a_read_cpu_memory(struct target *target, retval = cortex_a_read_cpu_memory_slow(target, size, count, buffer, &dscr); } -out: final_retval = retval; /* Switch to non-blocking mode if not already in that mode. */ ----------------------------------------------------------------------- Summary of changes: src/target/cortex_a.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-17 09:32: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 c6fe10de75763623dfdaaf2fe3fff7e78a4ca146 (commit) from 2278878a05d8dfbbed3e59f0cfbeeb598af3129c (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 c6fe10de75763623dfdaaf2fe3fff7e78a4ca146 Author: Antonio Borneo <bor...@gm...> Date: Sat Dec 10 18:19:54 2022 +0100 arm_adi_v5: fix SIGSEGV due to failing re-examine Commit 35a503b08d14 ("arm_adi_v5: add ap refcount and add get/put around ap use") modifies the examine functions of mem_ap, cortex_m, cortex_a and aarch64 by calling dap_put_ap() and then looking again for the mem-ap and calling dap_get_ap(). This causes an issue if the system is irresponsive and the examine fails and left the AP pointer to NULL. If the system was already examined the NULL pointer will cause a SIGSEGV. Commit b6dad912b85d ("target/cortex_m: prevent segmentation fault in cortex_m_poll()") proposes a fix for one specific case and only on cortex_m. Modify all the examine functions by skipping look-up for the AP if it was already set in a previous examine; the target's AP is not supposed to change during runtime. Remove the partial fix for cortex_m as it is not needed anymore. Change-Id: I806ec3b1b02fcc76e141c8dd3a65044febbf0a8c Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: 35a503b08d14 ("arm_adi_v5: add ap refcount and add get/put around ap use") Reviewed-on: https://review.openocd.org/c/openocd/+/7392 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/target/aarch64.c b/src/target/aarch64.c index 8592daa16..8e90e6400 100644 --- a/src/target/aarch64.c +++ b/src/target/aarch64.c @@ -2546,23 +2546,20 @@ static int aarch64_examine_first(struct target *target) if (!pc) return ERROR_FAIL; - if (armv8->debug_ap) { - dap_put_ap(armv8->debug_ap); - armv8->debug_ap = NULL; - } - - if (pc->adiv5_config.ap_num == DP_APSEL_INVALID) { - /* Search for the APB-AB */ - retval = dap_find_get_ap(swjdp, AP_TYPE_APB_AP, &armv8->debug_ap); - if (retval != ERROR_OK) { - LOG_ERROR("Could not find APB-AP for debug access"); - return retval; - } - } else { - armv8->debug_ap = dap_get_ap(swjdp, pc->adiv5_config.ap_num); - if (!armv8->debug_ap) { - LOG_ERROR("Cannot get AP"); - return ERROR_FAIL; + if (!armv8->debug_ap) { + if (pc->adiv5_config.ap_num == DP_APSEL_INVALID) { + /* Search for the APB-AB */ + retval = dap_find_get_ap(swjdp, AP_TYPE_APB_AP, &armv8->debug_ap); + if (retval != ERROR_OK) { + LOG_ERROR("Could not find APB-AP for debug access"); + return retval; + } + } else { + armv8->debug_ap = dap_get_ap(swjdp, pc->adiv5_config.ap_num); + if (!armv8->debug_ap) { + LOG_ERROR("Cannot get AP"); + return ERROR_FAIL; + } } } diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c index 7286a305b..07796d57c 100644 --- a/src/target/cortex_a.c +++ b/src/target/cortex_a.c @@ -2874,23 +2874,20 @@ static int cortex_a_examine_first(struct target *target) int retval = ERROR_OK; uint32_t didr, cpuid, dbg_osreg, dbg_idpfr1; - if (armv7a->debug_ap) { - dap_put_ap(armv7a->debug_ap); - armv7a->debug_ap = NULL; - } - - if (pc->ap_num == DP_APSEL_INVALID) { - /* Search for the APB-AP - it is needed for access to debug registers */ - retval = dap_find_get_ap(swjdp, AP_TYPE_APB_AP, &armv7a->debug_ap); - if (retval != ERROR_OK) { - LOG_ERROR("Could not find APB-AP for debug access"); - return retval; - } - } else { - armv7a->debug_ap = dap_get_ap(swjdp, pc->ap_num); - if (!armv7a->debug_ap) { - LOG_ERROR("Cannot get AP"); - return ERROR_FAIL; + if (!armv7a->debug_ap) { + if (pc->ap_num == DP_APSEL_INVALID) { + /* Search for the APB-AP - it is needed for access to debug registers */ + retval = dap_find_get_ap(swjdp, AP_TYPE_APB_AP, &armv7a->debug_ap); + if (retval != ERROR_OK) { + LOG_ERROR("Could not find APB-AP for debug access"); + return retval; + } + } else { + armv7a->debug_ap = dap_get_ap(swjdp, pc->ap_num); + if (!armv7a->debug_ap) { + LOG_ERROR("Cannot get AP"); + return ERROR_FAIL; + } } } diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 186344167..2472e38e2 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -879,16 +879,6 @@ static int cortex_m_poll(struct target *target) struct cortex_m_common *cortex_m = target_to_cm(target); struct armv7m_common *armv7m = &cortex_m->armv7m; - /* Check if debug_ap is available to prevent segmentation fault. - * If the re-examination after an error does not find a MEM-AP - * (e.g. the target stopped communicating), debug_ap pointer - * can suddenly become NULL. - */ - if (!armv7m->debug_ap) { - target->state = TARGET_UNKNOWN; - return ERROR_TARGET_NOT_EXAMINED; - } - /* Read from Debug Halting Control and Status Register */ retval = cortex_m_read_dhcsr_atomic_sticky(target); if (retval != ERROR_OK) { @@ -2311,23 +2301,20 @@ int cortex_m_examine(struct target *target) /* hla_target shares the examine handler but does not support * all its calls */ if (!armv7m->is_hla_target) { - if (armv7m->debug_ap) { - dap_put_ap(armv7m->debug_ap); - armv7m->debug_ap = NULL; - } - - if (cortex_m->apsel == DP_APSEL_INVALID) { - /* Search for the MEM-AP */ - retval = cortex_m_find_mem_ap(swjdp, &armv7m->debug_ap); - if (retval != ERROR_OK) { - LOG_TARGET_ERROR(target, "Could not find MEM-AP to control the core"); - return retval; - } - } else { - armv7m->debug_ap = dap_get_ap(swjdp, cortex_m->apsel); - if (!armv7m->debug_ap) { - LOG_ERROR("Cannot get AP"); - return ERROR_FAIL; + if (!armv7m->debug_ap) { + if (cortex_m->apsel == DP_APSEL_INVALID) { + /* Search for the MEM-AP */ + retval = cortex_m_find_mem_ap(swjdp, &armv7m->debug_ap); + if (retval != ERROR_OK) { + LOG_TARGET_ERROR(target, "Could not find MEM-AP to control the core"); + return retval; + } + } else { + armv7m->debug_ap = dap_get_ap(swjdp, cortex_m->apsel); + if (!armv7m->debug_ap) { + LOG_ERROR("Cannot get AP"); + return ERROR_FAIL; + } } } diff --git a/src/target/mem_ap.c b/src/target/mem_ap.c index a66250693..50dc91c7b 100644 --- a/src/target/mem_ap.c +++ b/src/target/mem_ap.c @@ -136,15 +136,12 @@ static int mem_ap_examine(struct target *target) struct mem_ap *mem_ap = target->arch_info; if (!target_was_examined(target)) { - if (mem_ap->ap) { - dap_put_ap(mem_ap->ap); - mem_ap->ap = NULL; - } - - mem_ap->ap = dap_get_ap(mem_ap->dap, mem_ap->ap_num); if (!mem_ap->ap) { - LOG_ERROR("Cannot get AP"); - return ERROR_FAIL; + mem_ap->ap = dap_get_ap(mem_ap->dap, mem_ap->ap_num); + if (!mem_ap->ap) { + LOG_ERROR("Cannot get AP"); + return ERROR_FAIL; + } } target_set_examined(target); target->state = TARGET_UNKNOWN; ----------------------------------------------------------------------- Summary of changes: src/target/aarch64.c | 31 ++++++++++++++----------------- src/target/cortex_a.c | 31 ++++++++++++++----------------- src/target/cortex_m.c | 41 ++++++++++++++--------------------------- src/target/mem_ap.c | 13 +++++-------- 4 files changed, 47 insertions(+), 69 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-17 09:30:24
|
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 2278878a05d8dfbbed3e59f0cfbeeb598af3129c (commit) from 9501b263e0ae127b012f5c5e3ba5dffcc7daa8d1 (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 2278878a05d8dfbbed3e59f0cfbeeb598af3129c Author: Nima Palizban <n.p...@gm...> Date: Thu Dec 1 12:41:30 2022 -0500 src/target/mips_m4k.c: set missing flag in set_watchpoint Without the fix, will see "Can not find free FP Comparator" error log Change-Id: Id0d91cc02b7055e44d27507f9c05ccd48ff49838 Signed-off-by: Nima Palizban <n.p...@gm...> Fixes: fb43f1ff4e2f (target: Rework 'set' variable of break-/watchpoints) Reviewed-on: https://review.openocd.org/c/openocd/+/7389 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c index e85018c87..491b247b1 100644 --- a/src/target/mips_m4k.c +++ b/src/target/mips_m4k.c @@ -900,7 +900,7 @@ static int mips_m4k_set_watchpoint(struct target *target, LOG_ERROR("BUG: watchpoint->rw neither read, write nor access"); } - watchpoint->number = wp_num; + watchpoint_set(watchpoint, wp_num); comparator_list[wp_num].used = 1; comparator_list[wp_num].bp_value = watchpoint->address; ----------------------------------------------------------------------- Summary of changes: src/target/mips_m4k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-03 09:28:18
|
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 9501b263e0ae127b012f5c5e3ba5dffcc7daa8d1 (commit) from 04887d3b688aef999f83eebf9c521d1bb7d29b0b (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 9501b263e0ae127b012f5c5e3ba5dffcc7daa8d1 Author: Karl Palsson <ka...@tw...> Date: Tue Nov 29 13:12:14 2022 +0000 doc: describe tcl port consistently. One place described the tcl port as 5555, which was changed in 163bd86071a Reported on IRC. Change-Id: If740a29443793d6a4d4f8c9db54f0fc8344a6c1c Signed-off-by: Karl Palsson <ka...@tw...> Reviewed-on: https://review.openocd.org/c/openocd/+/7385 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index e9f93614c..d8a5e86b4 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -8523,7 +8523,7 @@ command. All output is relayed through the GDB session. @item @b{Machine Interface} The Tcl interface's intent is to be a machine interface. The default Tcl -port is 5555. +port is 6666. @end itemize ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-03 09:27: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 04887d3b688aef999f83eebf9c521d1bb7d29b0b (commit) from 4fe3997294e24d9a7bb41290088d6410f7ba1eca (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 04887d3b688aef999f83eebf9c521d1bb7d29b0b Author: Evgeniy Naydanov <evg...@sy...> Date: Fri Sep 16 16:01:46 2022 +0300 Fix jim_target_smp for smp rtos target If multiple targets are specified as -rtos <rtos_type>, the rtos_update_threads was called only if the last target was specified as rtos, which is inconsistent with other checks of whether or not smp target is an rtos one. Signed-off-by: Evgeniy Naydanov <evg...@sy...> Change-Id: Ie52bc6b6c8f841d31b9590fcbc44e985d3cba0eb Reviewed-on: https://review.openocd.org/c/openocd/+/7244 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/target.c b/src/target/target.c index 783159fec..e4fe20f72 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -6433,16 +6433,52 @@ static int jim_target_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return JIM_OK; } +static struct target_list * +__attribute__((warn_unused_result)) +create_target_list_node(Jim_Obj *const name) { + int len; + const char *targetname = Jim_GetString(name, &len); + struct target *target = get_target(targetname); + LOG_DEBUG("%s ", targetname); + if (!target) + return NULL; + + struct target_list *new = malloc(sizeof(struct target_list)); + if (!new) { + LOG_ERROR("Out of memory"); + return new; + } + + new->target = target; + return new; +} + +static int get_target_with_common_rtos_type(struct list_head *lh, struct target **result) +{ + struct target *target = NULL; + struct target_list *curr; + foreach_smp_target(curr, lh) { + struct rtos *curr_rtos = curr->target->rtos; + if (curr_rtos) { + if (target && target->rtos && target->rtos->type != curr_rtos->type) { + LOG_ERROR("Different rtos types in members of one smp target!"); + return JIM_ERR; + } + target = curr->target; + } + } + *result = target; + return JIM_OK; +} + static int jim_target_smp(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - int i; - const char *targetname; - int retval, len; static int smp_group = 1; - struct target *target = NULL; - struct target_list *head, *new; - retval = 0; + if (argc == 1) { + LOG_DEBUG("Empty SMP target"); + return JIM_OK; + } LOG_DEBUG("%d", argc); /* argv[1] = target to associate in smp * argv[2] = target to associate in smp @@ -6456,27 +6492,24 @@ static int jim_target_smp(Jim_Interp *interp, int argc, Jim_Obj *const *argv) } INIT_LIST_HEAD(lh); - for (i = 1; i < argc; i++) { - - targetname = Jim_GetString(argv[i], &len); - target = get_target(targetname); - LOG_DEBUG("%s ", targetname); - if (target) { - new = malloc(sizeof(struct target_list)); - new->target = target; + for (int i = 1; i < argc; i++) { + struct target_list *new = create_target_list_node(argv[i]); + if (new) list_add_tail(&new->lh, lh); - } } /* now parse the list of cpu and put the target in smp mode*/ - foreach_smp_target(head, lh) { - target = head->target; + struct target_list *curr; + foreach_smp_target(curr, lh) { + struct target *target = curr->target; target->smp = smp_group; target->smp_targets = lh; } smp_group++; - if (target && target->rtos) - retval = rtos_smp_init(target); + struct target *rtos_target; + int retval = get_target_with_common_rtos_type(lh, &rtos_target); + if (retval == JIM_OK && rtos_target) + retval = rtos_smp_init(rtos_target); return retval; } ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 71 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 19 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-03 09:26:44
|
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 4fe3997294e24d9a7bb41290088d6410f7ba1eca (commit) via a9d74285358b2e2c8adc822b6151e9e548920c64 (commit) from 3ea1bfce4faf656d0506c194084807f1e498abff (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 4fe3997294e24d9a7bb41290088d6410f7ba1eca Author: Koudai Iwahori <ko...@go...> Date: Fri Nov 18 06:18:17 2022 -0800 hwthread: Restore current_threadid in hwthread_update_threads When OpenOCD receives a step-execution command from GDB and the target is configured as rtos=hwthread, OpenOCD reconstructs the thread-info. However, OpenOCD does not restore the thread id which is currently selected by GDB. Due to this issue, OpenOCD sends the information of wrong thread to GDB after the step execution. This commit fixes the above issue by adding a code to save/restore the thread id selected by GDB. Signed-off-by: Koudai Iwahori <ko...@go...> Change-Id: I761a1141c04d48f1290e4f09baa7c7024f86f36a Reviewed-on: https://review.openocd.org/c/openocd/+/7358 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c index 1540168c3..03c4d8550 100644 --- a/src/rtos/hwthread.c +++ b/src/rtos/hwthread.c @@ -82,6 +82,7 @@ static int hwthread_update_threads(struct rtos *rtos) struct target_list *head; struct target *target; int64_t current_thread = 0; + int64_t current_threadid = rtos->current_threadid; /* thread selected by GDB */ enum target_debug_reason current_reason = DBG_REASON_UNDEFINED; if (!rtos) @@ -105,6 +106,15 @@ static int hwthread_update_threads(struct rtos *rtos) } else thread_list_size = 1; + /* restore the threadid which is currently selected by GDB + * because rtos_free_threadlist() wipes out it + * (GDB thread id is 1-based indexing) */ + if (current_threadid <= thread_list_size) + rtos->current_threadid = current_threadid; + else + LOG_WARNING("SMP node change, disconnect GDB from core/thread %" PRId64, + current_threadid); + /* create space for new thread details */ rtos->thread_details = malloc(sizeof(struct thread_detail) * thread_list_size); commit a9d74285358b2e2c8adc822b6151e9e548920c64 Author: Koudai Iwahori <ko...@go...> Date: Fri Nov 18 01:23:43 2022 -0800 hwthread: Add register validity check in get_thread_reg_list When OpenOCD receives 'g' packet (read general registers) from GDB and target is configured as rtos=hwthread, hwthread_get_thread_reg_list is called. However, it does not check if the register valid or not. Due to this issue, OpenOCD returns invalid register values to GDB. This commit adds a validity check to hwthread_get_thread_reg_list. If the register is not valid, it tries to read the register from the target. Signed-off-by: Koudai Iwahori <ko...@go...> Change-Id: Iad6424b62124271ec411b1dfc044b57dfc460280 Reviewed-on: https://review.openocd.org/c/openocd/+/7357 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c index 50e7bae51..1540168c3 100644 --- a/src/rtos/hwthread.c +++ b/src/rtos/hwthread.c @@ -255,6 +255,15 @@ static int hwthread_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, for (int i = 0; i < reg_list_size; i++) { if (!reg_list[i] || reg_list[i]->exist == false || reg_list[i]->hidden) continue; + 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); + free(reg_list); + free(*rtos_reg_list); + return retval; + } + } (*rtos_reg_list)[j].number = reg_list[i]->number; (*rtos_reg_list)[j].size = reg_list[i]->size; memcpy((*rtos_reg_list)[j].value, reg_list[i]->value, ----------------------------------------------------------------------- Summary of changes: src/rtos/hwthread.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-03 09:26:36
|
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 3ea1bfce4faf656d0506c194084807f1e498abff (commit) from 0f034868f2c90741e57c5e27121e292b1774c080 (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 3ea1bfce4faf656d0506c194084807f1e498abff Author: Antonio Borneo <bor...@gm...> Date: Wed Nov 16 23:06:12 2022 +0100 jtag: xds110: fix clang error core.StackAddressEscape Clang ignores that xds110_swd_write_reg() is always called with bit SWD_CMD_RNW in 'cmd' set to zero. It then complains that the local variable 'value' gets passed by address to xds110_swd_queue_cmd() and in case of 'read request' such stack address get stored for later use: src/jtag/drivers/xds110.c:1363:1: warning: Address of stack memory associated with local variable 'value' is still referred to by the global variable 'xds110' upon returning to the caller. This will be a dangling reference [core.StackAddressEscape] To both xds110_swd_write_reg() and xds110_swd_read_reg(), add an assert() to inform Clang about the state of bit SWD_CMD_RNW. Change-Id: I7687c055ec71424b642e152f478723a930966e3a Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7380 Tested-by: jenkins diff --git a/src/jtag/drivers/xds110.c b/src/jtag/drivers/xds110.c index ecba36bb9..8e5d638db 100644 --- a/src/jtag/drivers/xds110.c +++ b/src/jtag/drivers/xds110.c @@ -1354,11 +1354,13 @@ static void xds110_swd_queue_cmd(uint8_t cmd, uint32_t *value) static void xds110_swd_read_reg(uint8_t cmd, uint32_t *value, uint32_t ap_delay_clk) { + assert(cmd & SWD_CMD_RNW); xds110_swd_queue_cmd(cmd, value); } static void xds110_swd_write_reg(uint8_t cmd, uint32_t value, uint32_t ap_delay_clk) { + assert(!(cmd & SWD_CMD_RNW)); xds110_swd_queue_cmd(cmd, &value); } ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/xds110.c | 2 ++ 1 file changed, 2 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2022-12-03 09:25: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 0f034868f2c90741e57c5e27121e292b1774c080 (commit) from 6ea1ccf3e6dd84c600c4ae9fb70347872634ded4 (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 0f034868f2c90741e57c5e27121e292b1774c080 Author: Antonio Borneo <bor...@gm...> Date: Wed Nov 16 01:02:02 2022 +0100 flash: lpc2900: fix clang error 'dead assignment' The variable retval is assigned a value that is never used. Scan-build reports: Although the value stored to 'retval' is used in the enclosing expression, the value is never actually read from 'retval'. Drop the dead assignment. Change-Id: I11588dee748a55d52aa7f35bc1967b7df55af7fc Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7379 Tested-by: jenkins diff --git a/src/flash/nor/lpc2900.c b/src/flash/nor/lpc2900.c index c30fa7637..948def982 100644 --- a/src/flash/nor/lpc2900.c +++ b/src/flash/nor/lpc2900.c @@ -1132,9 +1132,9 @@ static int lpc2900_write(struct flash_bank *bank, const uint8_t *buffer, * reduced size if that fails. */ struct working_area *warea; uint32_t buffer_size = lpc2900_info->max_ram_block - 1 * KiB; - while ((retval = target_alloc_working_area_try(target, + while (target_alloc_working_area_try(target, buffer_size + target_code_size, - &warea)) != ERROR_OK) { + &warea) != ERROR_OK) { /* Try a smaller buffer now, and stop if it's too small. */ buffer_size -= 1 * KiB; if (buffer_size < 2 * KiB) { ----------------------------------------------------------------------- Summary of changes: src/flash/nor/lpc2900.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-11-28 22:24:21
|
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 6ea1ccf3e6dd84c600c4ae9fb70347872634ded4 (commit) from 5193f61cf5562587ada989ae84005efa62d1b155 (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 6ea1ccf3e6dd84c600c4ae9fb70347872634ded4 Author: Marc Schink <de...@za...> Date: Thu Nov 24 12:54:57 2022 +0100 flash/nor/stm32lx: Add revision '1, X' for Cat.2 devices Change-Id: I0ff1e2102175ee952b066b325c9acbcb598b3af7 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: https://review.openocd.org/c/openocd/+/7378 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/stm32lx.c b/src/flash/nor/stm32lx.c index 42b52c5c2..1459e942d 100644 --- a/src/flash/nor/stm32lx.c +++ b/src/flash/nor/stm32lx.c @@ -132,7 +132,7 @@ static const struct stm32lx_rev stm32_417_revs[] = { { 0x1000, "A" }, { 0x1008, "Z" }, { 0x1018, "Y" }, { 0x1038, "X" } }; static const struct stm32lx_rev stm32_425_revs[] = { - { 0x1000, "A" }, { 0x2000, "B" }, { 0x2008, "Y" }, + { 0x1000, "A" }, { 0x2000, "B" }, { 0x2008, "Y" }, { 0x2018, "1, X" }, }; static const struct stm32lx_rev stm32_427_revs[] = { { 0x1000, "A" }, { 0x1018, "Y" }, { 0x1038, "X" }, { 0x10f8, "V" }, ----------------------------------------------------------------------- Summary of changes: src/flash/nor/stm32lx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-11-28 22:24:05
|
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 5193f61cf5562587ada989ae84005efa62d1b155 (commit) from e345cefabdda4e14c64b2206105e99b2fa0b9b6b (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 5193f61cf5562587ada989ae84005efa62d1b155 Author: Rocco Marco Guglielmi <roc...@gm...> Date: Wed Nov 23 09:54:30 2022 +0100 tcl: max326xx: fix target scripts for latest version of OpenOCD Change-Id: Iec5aba3a082f2e25f21d7ca173ed710894b370a4 Signed-off-by: Rocco Marco Guglielmi <roc...@gm...> Change-Id: Ia83850e326661c8acb0712a280fdf961258322a4 Reviewed-on: https://review.openocd.org/c/openocd/+/7373 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/target/max32620.cfg b/tcl/target/max32620.cfg index 9f0f4929d..f3a9f84c8 100644 --- a/tcl/target/max32620.cfg +++ b/tcl/target/max32620.cfg @@ -16,8 +16,10 @@ if {[using_jtag]} { swd newdap max32620 cpu -irlen 4 -irmask 0xf -expected-id 0x2ba01477 -ignore-version } +dap create max32620.dap -chain-position max32620.cpu + # target configuration -target create max32620.cpu cortex_m -chain-position max32620.cpu +target create max32620.cpu cortex_m -dap max32620.dap max32620.cpu configure -work-area-phys 0x20005000 -work-area-size 0x2000 # Config Command: flash bank name driver base size chip_width bus_width target [driver_options] diff --git a/tcl/target/max32625.cfg b/tcl/target/max32625.cfg index 35e1c3bbd..90eb39266 100644 --- a/tcl/target/max32625.cfg +++ b/tcl/target/max32625.cfg @@ -16,8 +16,10 @@ if {[using_jtag]} { swd newdap max32625 cpu -irlen 4 -irmask 0xf -expected-id 0x2ba01477 -ignore-version } +dap create max32625.dap -chain-position max32625.cpu + # target configuration -target create max32625.cpu cortex_m -chain-position max32625.cpu +target create max32625.cpu cortex_m -dap max32625.dap max32625.cpu configure -work-area-phys 0x20005000 -work-area-size 0x2000 # Config Command: flash bank name driver base size chip_width bus_width target [driver_options] diff --git a/tcl/target/max3263x.cfg b/tcl/target/max3263x.cfg index 52a5a770e..852e04af1 100644 --- a/tcl/target/max3263x.cfg +++ b/tcl/target/max3263x.cfg @@ -16,8 +16,10 @@ if {[using_jtag]} { swd newdap max3263x cpu -irlen 4 -irmask 0xf -expected-id 0x2ba01477 -ignore-version } +dap create max3263x.dap -chain-position max3263x.cpu + # target configuration -target create max3263x.cpu cortex_m -chain-position max3263x.cpu +target create max3263x.cpu cortex_m -dap max3263x.dap max3263x.cpu configure -work-area-phys 0x20005000 -work-area-size 0x2000 # Config Command: flash bank name driver base size chip_width bus_width target [driver_options] ----------------------------------------------------------------------- Summary of changes: tcl/target/max32620.cfg | 4 +++- tcl/target/max32625.cfg | 4 +++- tcl/target/max3263x.cfg | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |