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
(37) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Øyvind H. <go...@us...> - 2010-07-05 09:38:03
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 1e0f89841575de2b8b6313825ec8edd8bc7910a0 (commit) from db8b99aed6b4e6c046bf51853dacd8d511607984 (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 1e0f89841575de2b8b6313825ec8edd8bc7910a0 Author: Stacey Sheldon <st...@so...> Date: Sun Jul 4 16:19:02 2010 -0400 transport: fix segfault in setup_command_handler() Commit 93f2afa45f4c dropped the sentinel off the end of the command_registrants[] array. The loop immediately following the initialization will walk right off the end. Signed-off-by: Stacey Sheldon <st...@so...> diff --git a/src/openocd.c b/src/openocd.c index bba1e0b..04a6307 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -235,6 +235,7 @@ struct command_context *setup_command_handler(Jim_Interp *interp) &nand_register_commands, &pld_register_commands, &mflash_register_commands, + NULL }; for (unsigned i = 0; NULL != command_registrants[i]; i++) { ----------------------------------------------------------------------- Summary of changes: src/openocd.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-07-02 23:17: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 db8b99aed6b4e6c046bf51853dacd8d511607984 (commit) from 93f2afa45f4cfcb8afd08dae5a17996dba5c7a9c (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 db8b99aed6b4e6c046bf51853dacd8d511607984 Author: David Brownell <db@helium.(none)> Date: Fri Jul 2 17:14:52 2010 -0400 Fix minor openocd.texi bug ::X Signed-off-by: David Brownell <db@helium.(none)> diff --git a/doc/openocd.texi b/doc/openocd.texi index a765727..9feee03 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2425,6 +2425,7 @@ which are not currently documented here. @deffn {Interface Driver} {ZY1000} This is the Zylin ZY1000 JTAG debugger. +@end deffn @quotation Note This defines some driver-specific commands, ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-07-02 22:53:03
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 93f2afa45f4cfcb8afd08dae5a17996dba5c7a9c (commit) from deb176d33514eb6b702b14043c338b2d0053f11d (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 93f2afa45f4cfcb8afd08dae5a17996dba5c7a9c Author: David Brownell <dbr...@us...> Date: Fri Jul 2 16:45:28 2010 -0400 initial "transport" framework This adds the guts of a transport framework with initialization, which should work with current JTAG-only configurations (tested with FT2232). Each debug adapter can declare the transports it supports, and exactly one transport is initialized. (with its commands) in any given OpenOCD session. * Define a new "struct transport with init hooks and a few "transport" subcommands to support it: "list" ... list the transports configured (just "jtag" for now) "select" ... makes the debug session use that transport "init" ... initializes the selected transport (internal) * "interface_transports" ... declares transports the current interface can support. (Some will do this from C code instead, when there are no hardware versioning (or other) issues to prevent it. Plus some FT2232 tweaks, including a few to streamline upcoming support for an SWD transport (initially for Luminary adapters). Eventually src/jtag should probably become src/transport, moving jtag-specific stuff to transport/jtag. Signed-off-by: David Brownell <db@helium.(none)> diff --git a/NEWS b/NEWS index db4485d..2dd14cc 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,9 @@ JTAG Layer: Boundary Scan: +Transport framework core ... supporting future work for SWD, SPI, and other +non-JTAG ways to debug targets or program flash. + Target Layer: ARM: - basic semihosting support (ARMv7M). diff --git a/doc/openocd.texi b/doc/openocd.texi index a3ca124..a765727 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2096,6 +2096,14 @@ target. List the debug adapter drivers that have been built into the running copy of OpenOCD. @end deffn +@deffn Command {interface transports} transport_name+ +Specifies the transports supported by this debug adapter. +The adapter driver builds-in similar knowledge; use this only +when external configuration (such as jumpering) changes what +the hardware can support. +@end deffn + + @deffn Command {adapter_name} Returns the name of the debug adapter driver being used. @@ -2428,7 +2436,41 @@ Turn power switch to target on/off. No arguments: print status. @end deffn -@end deffn +@section Transport Configuration +As noted earlier, depending on the version of OpenOCD you use, +and the debug adapter you are using, +several transports may be available to +communicate with debug targets (or perhaps to program flash memory). +@deffn Command {transport list} +displays the names of the transports supported by this +version of OpenOCD. +@end deffn + +@deffn Command {transport select} transport_name +Select which of the supported transports to use in this OpenOCD session. +The transport must be supported by the debug adapter hardware and by the +version of OPenOCD you are using (including the adapter's driver). +No arguments: print selected transport.. +@end deffn + +@subsection JTAG Transport +JTAG is the original transport supported by OpenOCD, and most +of the OpenOCD commands support it. +JTAG transports expose a chain of one or more Test Access Points (TAPs), +each of which must be explicitly declared. +JTAG supports both debugging and boundary scan testing. +Flash programming support is built on top of debug support. +@subsection SWD ransport +SWD (Serial Wire Debug) is an ARM-specific transport which exposes one +Debug Access Point (DAP, which must be explicitly declared. +(SWD uses fewer signal wires than JTAG.) +SWD is debug-oriented, and does not support boundary scan testing. +Flash programming support is built on top of debug support. +(Some processors support both JTAG and SWD.) +@subsection SPI ransport +The Serial Peripheral Interface (SPI) is a general purpose transport +which uses four wire signaling. Some processors use it as part of a +solution for flash programming. @anchor{JTAG Speed} @section JTAG Speed diff --git a/src/jtag/Makefile.am b/src/jtag/Makefile.am index 910affc..59cd8ff 100644 --- a/src/jtag/Makefile.am +++ b/src/jtag/Makefile.am @@ -58,6 +58,7 @@ libjtag_la_SOURCES = \ interface.c \ interfaces.c \ tcl.c \ + transport.c \ $(DRIVERFILES) noinst_HEADERS = \ @@ -67,6 +68,7 @@ noinst_HEADERS = \ interfaces.h \ minidriver.h \ jtag.h \ + transport.h \ minidriver/minidriver_imp.h \ minidummy/jtag_minidriver.h diff --git a/src/jtag/adapter.c b/src/jtag/adapter.c index 50e2a02..15b3ddc 100644 --- a/src/jtag/adapter.c +++ b/src/jtag/adapter.c @@ -35,6 +35,7 @@ #include "minidriver.h" #include "interface.h" #include "interfaces.h" +#include "transport.h" #ifdef HAVE_STRINGS_H #include <strings.h> @@ -92,6 +93,25 @@ static int default_srst_asserted(int *srst_asserted) return ERROR_OK; } +COMMAND_HANDLER(interface_transport_command) +{ + char **transports; + int retval; + + retval = CALL_COMMAND_HANDLER(transport_list_parse, &transports); + if (retval != ERROR_OK) { + return retval; + + retval = allow_transports(CMD_CTX, (const char **)transports); + if (retval != ERROR_OK) { + for (unsigned i = 0; transports[i]; i++) + free(transports[i]); + free(transports); + } + } + return retval; +} + COMMAND_HANDLER(handle_interface_list_command) { if (strcmp(CMD_NAME, "interface_list") == 0 && CMD_ARGC > 0) @@ -452,6 +472,13 @@ static const struct command_registration interface_command_handlers[] = { .usage = "driver_name", }, { + .name = "interface_transports", + .handler = interface_transport_command, + .mode = COMMAND_CONFIG, + .help = "Declare transports the interface supports.", + .usage = "transport ... ", + }, + { .name = "interface_list", .handler = handle_interface_list_command, .mode = COMMAND_ANY, diff --git a/src/jtag/core.c b/src/jtag/core.c index 782f10f..1643d9b 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -33,11 +33,15 @@ #include "jtag.h" #include "interface.h" +#include "transport.h" #ifdef HAVE_STRINGS_H #include <strings.h> #endif +/* SVF and XSVF are higher level JTAG command sets (for boundary scan) */ +#include "svf/svf.h" +#include "xsvf/xsvf.h" /// The number of JTAG queue flushes (for profiling and debugging purposes). static int jtag_flush_queue_count; @@ -1348,6 +1352,21 @@ int adapter_init(struct command_context *cmd_ctx) return ERROR_JTAG_INIT_FAILED; } + /* LEGACY SUPPORT ... adapter drivers must declare what + * transports they allow. Until they all do so, assume + * the legacy drivers are JTAG-only + */ + if (!transports_are_declared()) { + static const char *jtag_only[] = { "jtag", NULL, }; + LOG_ERROR("Adapter driver '%s' did not declare " + "which transports it allows; assuming" + "JTAG-only", jtag->name); + int retval = allow_transports(cmd_ctx, jtag_only); + if (retval != ERROR_OK) + return retval; + } + + int requested_khz = jtag_get_speed_khz(); int actual_khz = requested_khz; int retval = jtag_get_speed_readable(&actual_khz); @@ -1706,3 +1725,45 @@ unsigned jtag_get_ntrst_assert_width(void) { return jtag_ntrst_assert_width; } + +static int jtag_select(struct command_context *ctx) +{ + int retval; + + /* NOTE: interface init must already have been done. + * That works with only C code ... no Tcl glue required. + */ + + + retval = jtag_register_commands(ctx); + + if (retval != ERROR_OK) + return retval; + + retval = svf_register_commands(ctx); + + if (retval != ERROR_OK) + return retval; + + return xsvf_register_commands(ctx); +} + +static struct transport jtag_transport = { + .name = "jtag", + .select = jtag_select, + .init = jtag_init, +}; + +static void jtag_constructor(void) __attribute__((constructor)); +static void jtag_constructor(void) +{ + transport_register(&jtag_transport); +} + +/** Returns true if the current debug session + * is using JTAG as its transport. + */ +bool transport_is_jtag(void) +{ + return get_current_transport() == &jtag_transport; +} diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c index f315d69..f02ae62 100644 --- a/src/jtag/drivers/ft2232.c +++ b/src/jtag/drivers/ft2232.c @@ -81,6 +81,7 @@ /* project specific includes */ #include <jtag/interface.h> +#include <jtag/transport.h> #include <helper/time_support.h> #if IS_CYGWIN == 1 @@ -167,6 +168,7 @@ struct ft2232_layout { void (*reset)(int trst, int srst); void (*blink)(void); int channel; + const char **transports; }; /* init procedures for supported layouts */ @@ -210,6 +212,13 @@ static void turtle_jtag_blink(void); static void signalyzer_h_blink(void); static void ktlink_blink(void); +/* common transport support options */ +static const char *jtag_only[] = { "jtag", NULL }; + + +//static const char *jtag_and_swd[] = { "jtag", "swd", NULL }; +#define jtag_and_swd NULL + static const struct ft2232_layout ft2232_layouts[] = { { .name = "usbjtag", @@ -235,10 +244,12 @@ static const struct ft2232_layout ft2232_layouts[] = { .name = "evb_lm3s811", .init = lm3s811_jtag_init, .reset = ftx23_reset, + .transports = jtag_and_swd, }, { .name = "luminary_icdi", .init = icdi_jtag_init, .reset = ftx23_reset, + .transports = jtag_and_swd, }, { .name = "olimex-jtag", .init = olimex_jtag_init, @@ -2393,7 +2404,7 @@ static int ft2232_init(void) /** Updates defaults for DBUS signals: the four JTAG signals * (TCK, TDI, TDO, TMS) and * the four GPIOL signals. */ -static inline void ftx232_init_head(void) +static inline void ftx232_dbus_init(void) { low_output = 0x08; low_direction = 0x0b; @@ -2403,7 +2414,7 @@ static inline void ftx232_init_head(void) * the four GPIOL signals. Initialization covers value and direction, * as customized for each layout. */ -static int ftx232_init_tail(void) +static int ftx232_dbus_write(void) { uint8_t buf[3]; uint32_t bytes_written; @@ -2452,19 +2463,19 @@ static int usbjtag_init(void) * NOTE: This is now _specific_ to the "usbjtag" layout. * Don't try cram any more layouts into this. */ - ftx232_init_head(); + ftx232_dbus_init(); nTRST = 0x10; nTRSTnOE = 0x10; nSRST = 0x40; nSRSTnOE = 0x40; - return ftx232_init_tail(); + return ftx232_dbus_write(); } static int lm3s811_jtag_init(void) { - ftx232_init_head(); + ftx232_dbus_init(); /* There are multiple revisions of LM3S811 eval boards: * - Rev B (and older?) boards have no SWO trace support. @@ -2478,12 +2489,12 @@ static int lm3s811_jtag_init(void) low_output = 0x88; low_direction = 0x8b; - return ftx232_init_tail(); + return ftx232_dbus_write(); } static int icdi_jtag_init(void) { - ftx232_init_head(); + ftx232_dbus_init(); /* Most Luminary eval boards support SWO trace output, * and should use this "luminary_icdi" layout. @@ -2495,18 +2506,18 @@ static int icdi_jtag_init(void) low_output = 0x88; low_direction = 0xcb; - return ftx232_init_tail(); + return ftx232_dbus_write(); } static int signalyzer_init(void) { - ftx232_init_head(); + ftx232_dbus_init(); nTRST = 0x10; nTRSTnOE = 0x10; nSRST = 0x20; nSRSTnOE = 0x20; - return ftx232_init_tail(); + return ftx232_dbus_write(); } static int axm0432_jtag_init(void) @@ -3195,7 +3206,11 @@ COMMAND_HANDLER(ft2232_handle_layout_command) for (const struct ft2232_layout *l = ft2232_layouts; l->name; l++) { if (strcmp(l->name, CMD_ARGV[0]) == 0) { layout = l; - return ERROR_OK; + /* This may also select the transport + * if we only suppport one of them. + */ + return allow_transports(CMD_CTX, + l->transports ? : jtag_only); } } diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h index 97ceb01..3b0a145 100644 --- a/src/jtag/jtag.h +++ b/src/jtag/jtag.h @@ -689,4 +689,6 @@ void jtag_poll_set_enabled(bool value); * level APIs that are used in inner loops. */ #include <jtag/minidriver.h> +bool transport_is_jtag(void); + #endif /* JTAG_H */ diff --git a/src/jtag/transport.c b/src/jtag/transport.c new file mode 100644 index 0000000..cee8ffb --- /dev/null +++ b/src/jtag/transport.c @@ -0,0 +1,373 @@ +/* + * Copyright (c) 2010 by David Brownell + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +/** @file + * Infrastructure for specifying and managing the transport protocol + * used in a given debug or programming session. + * + * Examples of "debug-capable" transports are JTAG or SWD. + * Additionally, JTAG supports boundary scan testing. + * + * Examples of "programming-capable" transports include SPI or UART; + * those are used (often mediated by a ROM bootloader) for ISP style + * programming, to perform an initial load of code into flash, or + * sometimes into SRAM. Target code could use "variant" options to + * decide how to use such protocols. For example, Cortex-M3 cores + * from TI/Luminary and from NXP use different protocols for for + * UART or SPI based firmware loading. + * + * As a rule, there are protocols layered on top of the transport. + * For example, different chip families use JTAG in different ways + * for debugging. Also, each family that supports programming over + * a UART link for initial firmware loading tends to define its own + * messaging and error handling. + */ + +#include <helper/log.h> + +#include "transport.h" + +/*-----------------------------------------------------------------------*/ + +/* + * Infrastructure internals + */ + +/** List of transports known to OpenOCD. */ +static struct transport *transport_list; + +/** + * NULL-terminated Vector of names of transports which the + * currently selected debug adapter supports. This is declared + * by the time that adapter is fully set up. + */ +static const char **allowed_transports; + +/** * The transport being used for the current OpenOCD session. */ +static struct transport *session; + +static int transport_select(struct command_context *ctx, const char *name) +{ + /* name may only identify a known transport; + * caller guarantees session's transport isn't yet set.*/ + for (struct transport *t = transport_list; t; t = t->next) { + if (strcmp(t->name, name) == 0) { + int retval = t->select(ctx); + /* select() registers commands specific to this + * transport, and may also reset the link, e.g. + * forcing it to JTAG or SWD mode. + */ + if (retval == ERROR_OK) + session = t; + else + LOG_ERROR("Error %d selecting '%s' as " + "transport", retval, t->name); + return retval; + } + } + + LOG_ERROR("No transport named '%s' is available.", name); + return ERROR_FAIL; +} + +/** + * Called by debug adapter drivers, or affiliated Tcl config scripts, + * to declare the set of transports supported by an adapter. When + * there is only one member of that set, it is automatically selected. + */ +int allow_transports(struct command_context *ctx, const char **vector) +{ + /* NOTE: caller is required to provide only a list + * of *valid* transport names + * + * REVISIT should we validate that? and insist there's + * at least one non-NULL element in that list? + */ + if (allowed_transports != NULL || session) { + LOG_ERROR("Can't modify the set of allowed transports."); + return ERROR_FAIL; + } + + + allowed_transports = vector; + + /* autoselect if there's no choice ... */ + if (!vector[1]) { + LOG_INFO("only one transport option; autoselect '%s'", + vector[0]); + return transport_select(ctx, vector [0]); + } else { + while (*vector) + LOG_DEBUG("allow transport '%s'", *vector++); + return ERROR_OK; + } +} + + +/** + * Used to verify corrrect adapter driver initialization. + * + * @returns true iff the adapter declared one or more transports. + */ +bool transports_are_declared(void) +{ + return allowed_transports != NULL; +} + +/** + * Registers a transport. There are general purpose transports + * (such as JTAG), as well as relatively proprietary ones which are + * specific to a given chip (or chip family). + * + * Code implementing a transport needs to register it before it can + * be selected and then activated. This is a dynamic process, so + * that chips (and families) can define transports as needed (without + * nneeding error-prone static tables). + * + * @param new_transport the transport being registered. On a + * successful return, this memory is owned by the transport framework. + * + * @returns ERROR_OK on success, else a fault code. + */ +int transport_register(struct transport *new_transport) +{ + struct transport *t; + + for (t = transport_list; t; t = t->next) { + if (strcmp(t->name, new_transport->name) == 0) { + LOG_ERROR("transport name already used"); + return ERROR_FAIL; + } + } + + if (!new_transport->select || !new_transport->init) { + LOG_ERROR("invalid transport %s", new_transport->name); + } + + /* splice this into the list */ + new_transport->next = transport_list; + transport_list = new_transport; + LOG_DEBUG("register '%s'", t->name); + + return ERROR_OK; +} + +/** + * Returns the transport currently being used by this debug or + * programming session. + * + * @returns handle to the read-only transport entity. + */ +struct transport *get_current_transport(void) +{ + + /* REVISIT -- constify */ + return session; +} + + +/*-----------------------------------------------------------------------*/ + +/* + * Infrastructure for Tcl interface to transports. + */ + +/** + * Makes and stores a copy of a set of transports passed as + * parameters to a command. + * + * @param vector where the resulting copy is stored, as an argv-style + * NULL-terminated vector. + */ +COMMAND_HELPER(transport_list_parse, char ***vector) +{ + char **argv; + unsigned n = CMD_ARGC; + unsigned j = 0; + + *vector = NULL; + + if (n < 1) + return ERROR_COMMAND_SYNTAX_ERROR; + + /* our return vector must be NULL terminated */ + argv = (char **) calloc(n + 1, sizeof(char *)); + if (argv == NULL) + return ERROR_FAIL; + + for (unsigned i = 0; i < n; i++) { + struct transport *t; + + for (t = transport_list; t; t = t->next) { + if (strcmp(t->name, CMD_ARGV[i]) != 0) + continue; + argv[j++] = strdup(CMD_ARGV[i]); + break; + } + if (!t) { + LOG_ERROR("no such transport '%s'", CMD_ARGV[i]); + goto fail; + } + } + + *vector = argv; + return ERROR_OK; + +fail: + for (unsigned i = 0; i < n; i++) + free(argv[i]); + free(argv); + return ERROR_FAIL; +} + +COMMAND_HANDLER(handle_transport_init) +{ + LOG_DEBUG("%s", __func__); + if (!session) { + LOG_ERROR("session's transport is not selected."); + return ERROR_FAIL; + } + + return session->init(CMD_CTX); +} + +COMMAND_HANDLER(handle_transport_list) +{ + if (CMD_ARGC != 0) + return ERROR_COMMAND_SYNTAX_ERROR; + + command_print(CMD_CTX, "The following transports are available:"); + + for (struct transport *t = transport_list; t; t = t->next) + command_print(CMD_CTX, "\t%s", t->name); + + return ERROR_OK; +} + +/** + * Implements the Tcl "transport select" command, choosing the + * transport to be used in this debug session from among the + * set supported by the debug adapter being used. + */ +COMMAND_HANDLER(handle_transport_select) +{ + int retval = ERROR_OK;; + + switch (CMD_ARGC) { + case 0: /* "select" */ + if (session) { + goto show; + } + LOG_ERROR("session's transport is not selected."); + return ERROR_FAIL; + + case 1: /* "select FOO" */ + if(strcmp(session->name, CMD_ARGV[0]) == 0) { + /* NOP */ + LOG_DEBUG("transport '%s' is already selected", + CMD_ARGV[0]); + return ERROR_OK; + } else { + + /* we can't change this session's transport after-the-fact */ + if (session) { + LOG_ERROR("session's transport is already selected."); + return ERROR_FAIL; + } + } + break; + + default: /* select FOO BAR */ + /* we only select *one* transport per session */ + LOG_ERROR("may only select one transport!"); + return ERROR_COMMAND_SYNTAX_ERROR; + } + + /* Is this transport supported by our debug adapter? + * Example, "JTAG-only" means SWD is not supported. + * + * NOTE: requires adapter to have been set up, including + * declaring transport via C code or Tcl script. + */ + if (!allowed_transports) { + LOG_ERROR("Debug adapter doesn't support any transports?"); + return ERROR_FAIL; + } + for (unsigned i = 0; allowed_transports[i]; i++) { + + if (strcmp(allowed_transports[i], CMD_ARGV[0]) == 0) + return transport_select(CMD_CTX, CMD_ARGV[0]); + } + + LOG_ERROR("Debug adapter doesn't support '%s' " + "transport?", CMD_ARGV[0]); + return ERROR_FAIL; + + +show: + /* report the current transport selection */ + command_print(CMD_CTX, "%s", session->name); + return retval; +} + +static const struct command_registration transport_commands[] = { + { + .name = "init", + .handler = handle_transport_init, + /* this would be COMMAND_CONFIG ... except that + * it needs to trigger event handlers that may + * require COMMAND_EXEC ... + */ + .mode = COMMAND_ANY, + .help = "Initialize this session's transport", + }, + { + .name = "list", + .handler = handle_transport_list, + .mode = COMMAND_ANY, + .help = "list all built-in transports", + }, + { + .name = "select", + .handler = handle_transport_select, + .mode = COMMAND_ANY, + .help = "Select this session's transport", + .usage = "[transport_name]", + }, + COMMAND_REGISTRATION_DONE +}; + +static const struct command_registration transport_group[] = { + { + .name = "transport", + .mode = COMMAND_ANY, + .help = "Transport command group", + .chain = transport_commands, + }, + COMMAND_REGISTRATION_DONE +}; + + +int transport_register_commands(struct command_context *ctx) +{ + return register_commands(ctx, NULL, transport_group); +} diff --git a/src/jtag/transport.h b/src/jtag/transport.h new file mode 100644 index 0000000..d2d38ec --- /dev/null +++ b/src/jtag/transport.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2010 by David Brownell + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "helper/command.h" + +/** + * Wrapper for transport lifecycle operations. + * + * OpenOCD talks to targets through some kind of debugging + * or programming adapter, using some protocol that probably + * has target-specific aspects. + * + * A "transport" reflects electrical protocol to the target, + * e..g jtag, swd, spi, uart, ... NOT the messaging protocols + * layered over it (e.g. JTAG has eICE, CoreSight, Nexus, OnCE, + * and more). + * + * In addition to the lifecycle operations packaged by this + * structure, a transport also involves an interface supported + * by debug adapters and used by components such as debug targets. + * For non-debug transports, there may be interfaces used to + * write to flash chips. + */ +struct transport { + /** + * Each transport has a unique name, used to select it + * from among the alternatives. Examples might include + * "jtag", * "swd", "AVR_ISP" and more. + */ + const char *name; + + /** + * When a transport is selected, this method registers + * its commands and activates the transport (e.g. resets + * the link). + * + * After those commands are registered, they will often + * be used for further configuration of the debug link. + */ + int (*select)(struct command_context *ctx); + + /** + * server startup uses this method to validate transport + * configuration. (For example, with JTAG this interrogates + * the scan chain against the list of expected TAPs.) + */ + int (*init)(struct command_context *ctx); + + /** + * Transports are stored in a singly linked list. + */ + struct transport *next; +}; + +int transport_register(struct transport *new_transport); + +struct transport *get_current_transport(void); + +int transport_register_commands(struct command_context *ctx); + +COMMAND_HELPER(transport_list_parse, char ***vector); + +int allow_transports(struct command_context *ctx, const char **vector); + +bool transports_are_declared(void); diff --git a/src/openocd.c b/src/openocd.c index 96de50c..bba1e0b 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -31,10 +31,9 @@ #include "openocd.h" #include <jtag/driver.h> #include <jtag/jtag.h> +#include <jtag/transport.h> #include <helper/ioutil.h> #include <helper/configuration.h> -#include <xsvf/xsvf.h> -#include <svf/svf.h> #include <flash/nor/core.h> #include <flash/nand/core.h> #include <pld/pld.h> @@ -120,22 +119,24 @@ COMMAND_HANDLER(handle_init_command) /* we must be able to set up the debug adapter */ return retval; } + LOG_DEBUG("Debug Adapter init complete"); - /* Try to initialize & examine the JTAG chain at this point, - * but continue startup regardless. Note that platforms - * need to be able to provide JTAG event handlers that use - * a variety of JTAG operations in order to do that... + /* "transport init" verifies the expected devices are present; + * for JTAG, it checks the list of configured TAPs against + * what's discoverable, possibly with help from the platform's + * JTAG event handlers. (which require COMMAND_EXEC) */ command_context_mode(CMD_CTX, COMMAND_EXEC); - if (command_run_line(CMD_CTX, "jtag init") == ERROR_OK) - { - LOG_DEBUG("Examining targets..."); - if (target_examine() != ERROR_OK) - LOG_DEBUG("target examination failed"); - } - else - LOG_WARNING("jtag initialization failed; try 'jtag init' again."); + + retval = command_run_line(CMD_CTX, "transport init"); + if (ERROR_OK != retval) + return ERROR_FAIL; + + LOG_DEBUG("Examining targets..."); + if (target_examine() != ERROR_OK) + LOG_DEBUG("target examination failed"); + command_context_mode(CMD_CTX, COMMAND_CONFIG); if (command_run_line(CMD_CTX, "flash init") != ERROR_OK) @@ -227,16 +228,13 @@ struct command_context *setup_command_handler(Jim_Interp *interp) &server_register_commands, &gdb_register_commands, &log_register_commands, + &transport_register_commands, &interface_register_commands, - &jtag_register_commands, - &xsvf_register_commands, - &svf_register_commands, &target_register_commands, &flash_register_commands, &nand_register_commands, &pld_register_commands, &mflash_register_commands, - NULL }; for (unsigned i = 0; NULL != command_registrants[i]; i++) { ----------------------------------------------------------------------- Summary of changes: NEWS | 3 + doc/openocd.texi | 42 +++++ src/jtag/Makefile.am | 2 + src/jtag/adapter.c | 27 ++++ src/jtag/core.c | 61 ++++++++ src/jtag/drivers/ft2232.c | 37 +++-- src/jtag/jtag.h | 2 + src/jtag/transport.c | 373 +++++++++++++++++++++++++++++++++++++++++++++ src/jtag/transport.h | 80 ++++++++++ src/openocd.c | 34 ++--- 10 files changed, 632 insertions(+), 29 deletions(-) create mode 100644 src/jtag/transport.c create mode 100644 src/jtag/transport.h hooks/post-receive -- Main OpenOCD repository |
From: Spencer O. <nt...@us...> - 2010-07-02 18:01:46
|
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 deb176d33514eb6b702b14043c338b2d0053f11d (commit) from f97b6b59abc878745bb54e8f44ec82897bacaf7d (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 deb176d33514eb6b702b14043c338b2d0053f11d Author: Spencer Oliver <nt...@us...> Date: Fri Jul 2 17:00:57 2010 +0100 ft2232: revert ft2232_read_scan changes Revert change made in commit dd88b461da1cb8642200dd5c96fb1ff384ca9f7b. Caused segfaults when using ftdi driver under win32. Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c index 90516a0..f315d69 100644 --- a/src/jtag/drivers/ft2232.c +++ b/src/jtag/drivers/ft2232.c @@ -714,24 +714,23 @@ static void ft2232_end_state(tap_state_t state) static void ft2232_read_scan(enum scan_type type, uint8_t* buffer, int scan_size) { - int num_bytes = scan_size / 8; - int bits_left = scan_size % 8; - int cur_byte; + int num_bytes = (scan_size + 7) / 8; + int bits_left = scan_size; + int cur_byte = 0; - for (cur_byte = 0; cur_byte < num_bytes; cur_byte++) + while (num_bytes-- > 1) { - buffer[cur_byte] = buffer_read(); + buffer[cur_byte++] = buffer_read(); + bits_left -= 8; } - /* Manage partial byte left from the clock data in/out instructions, if any */ + buffer[cur_byte] = 0x0; + + /* There is one more partial byte left from the clock data in/out instructions */ if (bits_left > 1) { buffer[cur_byte] = buffer_read() >> 1; } - else - { - buffer[cur_byte] = 0x0; - } /* This shift depends on the length of the clock data to tms instruction, insterted at end of the scan, now fixed to a two step transition in ft2232_add_scan */ buffer[cur_byte] = (buffer[cur_byte] | (((buffer_read()) << 1) & 0x80)) >> (8 - bits_left); } ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/ft2232.c | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Spencer O. <nt...@us...> - 2010-07-01 20:44:53
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via f97b6b59abc878745bb54e8f44ec82897bacaf7d (commit) from dd88b461da1cb8642200dd5c96fb1ff384ca9f7b (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 f97b6b59abc878745bb54e8f44ec82897bacaf7d Author: Spencer Oliver <nt...@us...> Date: Thu Jul 1 19:43:58 2010 +0100 ft2232: bugfix from previous commit fix build error with commit dd88b461da1cb8642200dd5c96fb1ff384ca9f7b Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c index 9d40b1c..90516a0 100644 --- a/src/jtag/drivers/ft2232.c +++ b/src/jtag/drivers/ft2232.c @@ -4022,7 +4022,7 @@ static int signalyzer_h_init(void) buf[1] = high_output; buf[2] = high_direction; - if ((retval = ft2232_write(buf, sizeof(buf), &bytes_written)) != ERROR_OK) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize Signalyzer-H layout"); return ERROR_JTAG_INIT_FAILED; ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/ft2232.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-07-01 09:34:29
|
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 dd88b461da1cb8642200dd5c96fb1ff384ca9f7b (commit) via cd7f4431036355213f8d3daa12c95be978f9e64a (commit) from 2986320cde399b0b0ee006a4fecbdec83bebc248 (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 dd88b461da1cb8642200dd5c96fb1ff384ca9f7b Author: Marc Pignat <mar...@he...> Date: Thu Jun 17 10:07:22 2010 +0200 ft2232: simplify ft2232_read_scan diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c index bc8463e..9d40b1c 100644 --- a/src/jtag/drivers/ft2232.c +++ b/src/jtag/drivers/ft2232.c @@ -714,23 +714,24 @@ static void ft2232_end_state(tap_state_t state) static void ft2232_read_scan(enum scan_type type, uint8_t* buffer, int scan_size) { - int num_bytes = (scan_size + 7) / 8; - int bits_left = scan_size; - int cur_byte = 0; + int num_bytes = scan_size / 8; + int bits_left = scan_size % 8; + int cur_byte; - while (num_bytes-- > 1) + for (cur_byte = 0; cur_byte < num_bytes; cur_byte++) { - buffer[cur_byte++] = buffer_read(); - bits_left -= 8; + buffer[cur_byte] = buffer_read(); } - buffer[cur_byte] = 0x0; - - /* There is one more partial byte left from the clock data in/out instructions */ + /* Manage partial byte left from the clock data in/out instructions, if any */ if (bits_left > 1) { buffer[cur_byte] = buffer_read() >> 1; } + else + { + buffer[cur_byte] = 0x0; + } /* This shift depends on the length of the clock data to tms instruction, insterted at end of the scan, now fixed to a two step transition in ft2232_add_scan */ buffer[cur_byte] = (buffer[cur_byte] | (((buffer_read()) << 1) & 0x80)) >> (8 - bits_left); } commit cd7f4431036355213f8d3daa12c95be978f9e64a Author: Marc Pignat <mar...@he...> Date: Thu Jun 17 09:54:34 2010 +0200 ft2232: cleanup ft2232_write * Include the size check into ft2232_write, so calling it is simpler. * Use sizeof(buffer) when possible diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c index 2ac410a..bc8463e 100644 --- a/src/jtag/drivers/ft2232.c +++ b/src/jtag/drivers/ft2232.c @@ -480,7 +480,6 @@ static int ft2232_write(uint8_t* buf, int size, uint32_t* bytes_written) else { *bytes_written = dw_bytes_written; - return ERROR_OK; } #elif BUILD_FT2232_LIBFTDI == 1 int retval; @@ -493,9 +492,15 @@ static int ft2232_write(uint8_t* buf, int size, uint32_t* bytes_written) else { *bytes_written = retval; - return ERROR_OK; } #endif + + if (*bytes_written != (uint32_t)size) + { + return ERROR_JTAG_DEVICE_ERROR; + } + + return ERROR_OK; } static int ft2232_read(uint8_t* buf, uint32_t size, uint32_t* bytes_read) @@ -569,8 +574,9 @@ static int ft2232h_ft4232h_adaptive_clocking(bool enable) LOG_DEBUG("%2.2x", buf); uint32_t bytes_written; - int retval = ft2232_write(&buf, 1, &bytes_written); - if ((ERROR_OK != retval) || (bytes_written != 1)) + int retval; + + if ((retval = ft2232_write(&buf, sizeof(buf), &bytes_written)) != ERROR_OK) { LOG_ERROR("couldn't write command to %s adaptive clocking" , enable ? "enable" : "disable"); @@ -589,8 +595,8 @@ static int ft2232h_ft4232h_clk_divide_by_5(bool enable) { uint32_t bytes_written; uint8_t buf = enable ? 0x8b : 0x8a; - int retval = ft2232_write(&buf, 1, &bytes_written); - if ((ERROR_OK != retval) || (bytes_written != 1)) + + if (ft2232_write(&buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't write command to %s clk divide by 5" , enable ? "enable" : "disable"); @@ -627,7 +633,7 @@ static int ft2232_speed(int speed) buf[2] = (speed >> 8) & 0xff; /* valueH */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((retval = ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if ((retval = ft2232_write(buf, sizeof(buf), &bytes_written)) != ERROR_OK) { LOG_ERROR("couldn't set FT2232 TCK speed"); return retval; @@ -737,7 +743,7 @@ static void ft2232_debug_dump_buffer(void) for (i = 0; i < ft2232_buffer_size; i++) { - line_p += snprintf(line_p, 256 - (line_p - line), "%2.2x ", ft2232_buffer[i]); + line_p += snprintf(line_p, sizeof(line) - (line_p - line), "%2.2x ", ft2232_buffer[i]); if (i % 16 == 15) { LOG_DEBUG("%s", line); @@ -2369,7 +2375,7 @@ static int ft2232_init(void) ft2232_speed(jtag_get_speed()); buf[0] = 0x85; /* Disconnect TDI/DO to TDO/DI for Loopback */ - if (((retval = ft2232_write(buf, 1, &bytes_written)) != ERROR_OK) || (bytes_written != 1)) + if ((retval = ft2232_write(buf, 1, &bytes_written)) != ERROR_OK) { LOG_ERROR("couldn't write to FT2232 to disable loopback"); return ERROR_JTAG_INIT_FAILED; @@ -2431,7 +2437,7 @@ static int ftx232_init_tail(void) buf[2] = low_direction; /* dir (output = 1), TCK/TDI/TMS = out, TDO = in */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 DBUS"); return ERROR_JTAG_INIT_FAILED; @@ -2517,7 +2523,7 @@ static int axm0432_jtag_init(void) buf[2] = low_direction; /* dir (output = 1), TCK/TDI/TMS = out, TDO = in, nOE = out */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'JTAGkey' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2564,7 +2570,7 @@ static int axm0432_jtag_init(void) buf[2] = high_direction; /* all outputs (xRST and xRSTnOE) */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'Dicarlo' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2590,8 +2596,7 @@ static int redbee_init(void) buf[1] = low_output; LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) - || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'redbee' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2630,8 +2635,7 @@ static int redbee_init(void) buf[2] = high_direction; /* all outputs (xRST and xRSTnOE) */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) - || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'redbee' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2654,7 +2658,7 @@ static int jtagkey_init(void) buf[2] = low_direction; /* dir (output = 1), TCK/TDI/TMS = out, TDO = in, nOE = out */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'JTAGkey' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2713,7 +2717,7 @@ static int jtagkey_init(void) buf[2] = high_direction; /* all outputs (xRST and xRSTnOE) */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'JTAGkey' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2736,7 +2740,7 @@ static int olimex_jtag_init(void) buf[2] = low_direction; /* dir (output = 1), TCK/TDI/TMS = out, TDO = in, nOE = out */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'Olimex' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2780,7 +2784,7 @@ static int olimex_jtag_init(void) buf[2] = high_direction; /* all outputs (xRST and xRSTnOE) */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if ((ft2232_write(buf, 3, &bytes_written) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'Olimex' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2803,7 +2807,7 @@ static int flyswatter_init(void) buf[2] = low_direction; /* dir (output = 1), TCK/TDI/TMS = out, TDO = in, nOE[12]=out, n[ST]srst = out */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'flyswatter' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2826,7 +2830,7 @@ static int flyswatter_init(void) buf[2] = high_direction; /* all outputs (xRST and xRSTnOE) */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'flyswatter' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2849,7 +2853,7 @@ static int turtle_init(void) buf[2] = low_direction; /* dir (output = 1), TCK/TDI/TMS = out, TDO = in, nOE = out */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'turtelizer2' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2866,7 +2870,7 @@ static int turtle_init(void) buf[2] = high_direction; LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'turtelizer2' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2889,7 +2893,7 @@ static int comstick_init(void) buf[2] = low_direction; /* dir (output = 1), TCK/TDI/TMS = out, TDO = in, nOE = out */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'comstick' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2909,7 +2913,7 @@ static int comstick_init(void) buf[2] = high_direction; LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'comstick' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2932,7 +2936,7 @@ static int stm32stick_init(void) buf[2] = low_direction; /* dir (output = 1), TCK/TDI/TMS = out, TDO = in, nOE = out */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'stm32stick' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2952,7 +2956,7 @@ static int stm32stick_init(void) buf[2] = high_direction; LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'stm32stick' layout"); return ERROR_JTAG_INIT_FAILED; @@ -2975,7 +2979,7 @@ static int sheevaplug_init(void) buf[2] = low_direction; /* dir (output = 1), TCK/TDI/TMS = out, TDO = in */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'sheevaplug' layout"); return ERROR_JTAG_INIT_FAILED; @@ -3003,7 +3007,7 @@ static int sheevaplug_init(void) buf[2] = high_direction; /* all outputs - xRST */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'sheevaplug' layout"); return ERROR_JTAG_INIT_FAILED; @@ -3026,7 +3030,7 @@ static int cortino_jtag_init(void) buf[2] = low_direction; /* dir (output = 1), TCK/TDI/TMS = out, TDO = in, nOE = out */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'cortino' layout"); return ERROR_JTAG_INIT_FAILED; @@ -3046,7 +3050,7 @@ static int cortino_jtag_init(void) buf[2] = high_direction; LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'stm32stick' layout"); return ERROR_JTAG_INIT_FAILED; @@ -3341,7 +3345,7 @@ static int icebear_jtag_init(void) { buf[2] = low_direction; LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) { + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'IceBear' layout (low)"); return ERROR_JTAG_INIT_FAILED; } @@ -3356,7 +3360,7 @@ static int icebear_jtag_init(void) { buf[2] = high_direction; /* all outputs (xRST and xRSTnOE) */ LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) { + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'IceBear' layout (high)"); return ERROR_JTAG_INIT_FAILED; } @@ -4003,8 +4007,7 @@ static int signalyzer_h_init(void) buf[1] = low_output; buf[2] = low_direction; - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) - || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize Signalyzer-H layout"); return ERROR_JTAG_INIT_FAILED; @@ -4018,8 +4021,7 @@ static int signalyzer_h_init(void) buf[1] = high_output; buf[2] = high_direction; - if ((ft2232_write(buf, 3, &bytes_written) != ERROR_OK) - || (bytes_written != 3)) + if ((retval = ft2232_write(buf, sizeof(buf), &bytes_written)) != ERROR_OK) { LOG_ERROR("couldn't initialize Signalyzer-H layout"); return ERROR_JTAG_INIT_FAILED; @@ -4033,8 +4035,7 @@ static int signalyzer_h_init(void) buf[1] = high_output; buf[2] = high_direction; - if ((ft2232_write(buf, 3, &bytes_written) != ERROR_OK) - || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize Signalyzer-H layout"); return ERROR_JTAG_INIT_FAILED; @@ -4218,7 +4219,7 @@ static int ktlink_init(void) buf[2] = low_direction; LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'ktlink' layout"); return ERROR_JTAG_INIT_FAILED; @@ -4256,7 +4257,7 @@ static int ktlink_init(void) buf[2] = high_direction; LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); - if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + if (ft2232_write(buf, sizeof(buf), &bytes_written) != ERROR_OK) { LOG_ERROR("couldn't initialize FT2232 with 'ktlink' layout"); return ERROR_JTAG_INIT_FAILED; ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/ft2232.c | 104 +++++++++++++++++++++++---------------------- 1 files changed, 53 insertions(+), 51 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-25 21:38: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 2986320cde399b0b0ee006a4fecbdec83bebc248 (commit) from fb96b8607a0c2a9038df3352b0ef828d78c5e418 (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 2986320cde399b0b0ee006a4fecbdec83bebc248 Author: Olaf Lüke <ol...@un...> Date: Fri Jun 25 20:21:31 2010 +0200 at91sam3s* support Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/flash/nor/at91sam3.c b/src/flash/nor/at91sam3.c index 8fa6dd4..221832c 100644 --- a/src/flash/nor/at91sam3.c +++ b/src/flash/nor/at91sam3.c @@ -2,6 +2,10 @@ * Copyright (C) 2009 by Duane Ellis * * op...@du... * * * + * Copyright (C) 2010 by Olaf Lüke (at91sam3s* support) * + * ol...@un... * + * * + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -63,9 +67,12 @@ #define REG_NAME_WIDTH (12) +// at91sam3u series (has one or two flash banks) +#define FLASH_BANK0_BASE_U 0x00080000 +#define FLASH_BANK1_BASE_U 0x00100000 -#define FLASH_BANK0_BASE 0x00080000 -#define FLASH_BANK1_BASE 0x00100000 +// at91sam3s series (has always one flash bank) +#define FLASH_BANK_BASE_S 0x00400000 #define AT91C_EFC_FCMD_GETD (0x0) // (EFC) Get Flash Descriptor #define AT91C_EFC_FCMD_WP (0x1) // (EFC) Write Page @@ -254,6 +261,7 @@ get_current_sam3(struct command_context *cmd_ctx) // these are used to *initialize* the "pChip->details" structure. static const struct sam3_chip_details all_sam3_details[] = { + // Start at91sam3u* series { .chipid_cidr = 0x28100960, .name = "at91sam3u4e", @@ -284,7 +292,7 @@ static const struct sam3_chip_details all_sam3_details[] = { .pChip = NULL, .pBank = NULL, .bank_number = 0, - .base_address = FLASH_BANK0_BASE, + .base_address = FLASH_BANK0_BASE_U, .controller_address = 0x400e0800, .present = 1, .size_bytes = 128 * 1024, @@ -299,7 +307,7 @@ static const struct sam3_chip_details all_sam3_details[] = { .pChip = NULL, .pBank = NULL, .bank_number = 1, - .base_address = FLASH_BANK1_BASE, + .base_address = FLASH_BANK1_BASE_U, .controller_address = 0x400e0a00, .present = 1, .size_bytes = 128 * 1024, @@ -333,7 +341,7 @@ static const struct sam3_chip_details all_sam3_details[] = { .pChip = NULL, .pBank = NULL, .bank_number = 0, - .base_address = FLASH_BANK0_BASE, + .base_address = FLASH_BANK0_BASE_U, .controller_address = 0x400e0800, .present = 1, .size_bytes = 128 * 1024, @@ -374,7 +382,7 @@ static const struct sam3_chip_details all_sam3_details[] = { .pChip = NULL, .pBank = NULL, .bank_number = 0, - .base_address = FLASH_BANK0_BASE, + .base_address = FLASH_BANK0_BASE_U, .controller_address = 0x400e0800, .present = 1, .size_bytes = 64 * 1024, @@ -422,7 +430,7 @@ static const struct sam3_chip_details all_sam3_details[] = { .pChip = NULL, .pBank = NULL, .bank_number = 0, - .base_address = FLASH_BANK0_BASE, + .base_address = FLASH_BANK0_BASE_U, .controller_address = 0x400e0800, .present = 1, .size_bytes = 128 * 1024, @@ -436,7 +444,7 @@ static const struct sam3_chip_details all_sam3_details[] = { .pChip = NULL, .pBank = NULL, .bank_number = 1, - .base_address = FLASH_BANK1_BASE, + .base_address = FLASH_BANK1_BASE_U, .controller_address = 0x400e0a00, .present = 1, .size_bytes = 128 * 1024, @@ -470,7 +478,7 @@ static const struct sam3_chip_details all_sam3_details[] = { .pChip = NULL, .pBank = NULL, .bank_number = 0, - .base_address = FLASH_BANK0_BASE, + .base_address = FLASH_BANK0_BASE_U, .controller_address = 0x400e0800, .present = 1, .size_bytes = 128 * 1024, @@ -511,7 +519,7 @@ static const struct sam3_chip_details all_sam3_details[] = { .pChip = NULL, .pBank = NULL, .bank_number = 0, - .base_address = FLASH_BANK0_BASE, + .base_address = FLASH_BANK0_BASE_U, .controller_address = 0x400e0800, .present = 1, .size_bytes = 64 * 1024, @@ -529,6 +537,300 @@ static const struct sam3_chip_details all_sam3_details[] = { }, }, + // Start at91sam3s* series + + // Note: The preliminary at91sam3s datasheet says on page 302 + // that the flash controller is at address 0x400E0800. + // This is _not_ the case, the controller resides at address 0x400e0a0. + { + .chipid_cidr = 0x28A00960, + .name = "at91sam3s4c", + .total_flash_size = 256 * 1024, + .total_sram_size = 48 * 1024, + .n_gpnvms = 2, + .n_banks = 1, + { +// .bank[0] = { + { + .probed = 0, + .pChip = NULL, + .pBank = NULL, + .bank_number = 0, + .base_address = FLASH_BANK_BASE_S, + + .controller_address = 0x400e0a00, + .present = 1, + .size_bytes = 256 * 1024, + .nsectors = 32, + .sector_size = 8192, + .page_size = 256, + }, +// .bank[1] = { + { + .present = 0, + .probed = 0, + .bank_number = 1, + + }, + }, + }, + + { + .chipid_cidr = 0x28900960, + .name = "at91sam3s4b", + .total_flash_size = 256 * 1024, + .total_sram_size = 48 * 1024, + .n_gpnvms = 2, + .n_banks = 1, + { +// .bank[0] = { + { + .probed = 0, + .pChip = NULL, + .pBank = NULL, + .bank_number = 0, + .base_address = FLASH_BANK_BASE_S, + + .controller_address = 0x400e0a00, + .present = 1, + .size_bytes = 256 * 1024, + .nsectors = 32, + .sector_size = 8192, + .page_size = 256, + }, +// .bank[1] = { + { + .present = 0, + .probed = 0, + .bank_number = 1, + + }, + }, + }, + { + .chipid_cidr = 0x28800960, + .name = "at91sam3s4a", + .total_flash_size = 256 * 1024, + .total_sram_size = 48 * 1024, + .n_gpnvms = 2, + .n_banks = 1, + { +// .bank[0] = { + { + .probed = 0, + .pChip = NULL, + .pBank = NULL, + .bank_number = 0, + .base_address = FLASH_BANK_BASE_S, + + .controller_address = 0x400e0a00, + .present = 1, + .size_bytes = 256 * 1024, + .nsectors = 32, + .sector_size = 8192, + .page_size = 256, + }, +// .bank[1] = { + { + .present = 0, + .probed = 0, + .bank_number = 1, + + }, + }, + }, + { + .chipid_cidr = 0x28AA0760, + .name = "at91sam3s2c", + .total_flash_size = 128 * 1024, + .total_sram_size = 32 * 1024, + .n_gpnvms = 2, + .n_banks = 1, + { +// .bank[0] = { + { + .probed = 0, + .pChip = NULL, + .pBank = NULL, + .bank_number = 0, + .base_address = FLASH_BANK_BASE_S, + + .controller_address = 0x400e0a00, + .present = 1, + .size_bytes = 128 * 1024, + .nsectors = 16, + .sector_size = 8192, + .page_size = 256, + }, +// .bank[1] = { + { + .present = 0, + .probed = 0, + .bank_number = 1, + + }, + }, + }, + { + .chipid_cidr = 0x289A0760, + .name = "at91sam3s2b", + .total_flash_size = 128 * 1024, + .total_sram_size = 32 * 1024, + .n_gpnvms = 2, + .n_banks = 1, + { +// .bank[0] = { + { + .probed = 0, + .pChip = NULL, + .pBank = NULL, + .bank_number = 0, + .base_address = FLASH_BANK_BASE_S, + + .controller_address = 0x400e0a00, + .present = 1, + .size_bytes = 128 * 1024, + .nsectors = 16, + .sector_size = 8192, + .page_size = 256, + }, +// .bank[1] = { + { + .present = 0, + .probed = 0, + .bank_number = 1, + + }, + }, + }, + { + .chipid_cidr = 0x288A0760, + .name = "at91sam3s2a", + .total_flash_size = 128 * 1024, + .total_sram_size = 32 * 1024, + .n_gpnvms = 2, + .n_banks = 1, + { +// .bank[0] = { + { + .probed = 0, + .pChip = NULL, + .pBank = NULL, + .bank_number = 0, + .base_address = FLASH_BANK_BASE_S, + + .controller_address = 0x400e0a00, + .present = 1, + .size_bytes = 128 * 1024, + .nsectors = 16, + .sector_size = 8192, + .page_size = 256, + }, +// .bank[1] = { + { + .present = 0, + .probed = 0, + .bank_number = 1, + + }, + }, + }, + { + .chipid_cidr = 0x28A90560, + .name = "at91sam3s1c", + .total_flash_size = 64 * 1024, + .total_sram_size = 16 * 1024, + .n_gpnvms = 2, + .n_banks = 1, + { +// .bank[0] = { + { + .probed = 0, + .pChip = NULL, + .pBank = NULL, + .bank_number = 0, + .base_address = FLASH_BANK_BASE_S, + + .controller_address = 0x400e0a00, + .present = 1, + .size_bytes = 64 * 1024, + .nsectors = 8, + .sector_size = 8192, + .page_size = 256, + }, +// .bank[1] = { + { + .present = 0, + .probed = 0, + .bank_number = 1, + + }, + }, + }, + { + .chipid_cidr = 0x28990560, + .name = "at91sam3s1b", + .total_flash_size = 64 * 1024, + .total_sram_size = 16 * 1024, + .n_gpnvms = 2, + .n_banks = 1, + { +// .bank[0] = { + { + .probed = 0, + .pChip = NULL, + .pBank = NULL, + .bank_number = 0, + .base_address = FLASH_BANK_BASE_S, + + .controller_address = 0x400e0a00, + .present = 1, + .size_bytes = 64 * 1024, + .nsectors = 8, + .sector_size = 8192, + .page_size = 256, + }, +// .bank[1] = { + { + .present = 0, + .probed = 0, + .bank_number = 1, + + }, + }, + }, + { + .chipid_cidr = 0x28890560, + .name = "at91sam3s1a", + .total_flash_size = 64 * 1024, + .total_sram_size = 16 * 1024, + .n_gpnvms = 2, + .n_banks = 1, + { +// .bank[0] = { + { + .probed = 0, + .pChip = NULL, + .pBank = NULL, + .bank_number = 0, + .base_address = FLASH_BANK_BASE_S, + + .controller_address = 0x400e0a00, + .present = 1, + .size_bytes = 64 * 1024, + .nsectors = 8, + .sector_size = 8192, + .page_size = 256, + }, +// .bank[1] = { + { + .present = 0, + .probed = 0, + .bank_number = 1, + + }, + }, + }, // terminate { .chipid_cidr = 0, @@ -1648,23 +1950,34 @@ FLASH_BANK_COMMAND_HANDLER(sam3_flash_bank_command) switch (bank->base) { default: - LOG_ERROR("Address 0x%08x invalid bank address (try 0x%08x or 0x%08x)", + LOG_ERROR("Address 0x%08x invalid bank address (try 0x%08x or 0x%08x \ + [at91sam3u series] or 0x%08x [at91sam3s series])", ((unsigned int)(bank->base)), - ((unsigned int)(FLASH_BANK0_BASE)), - ((unsigned int)(FLASH_BANK1_BASE))); + ((unsigned int)(FLASH_BANK0_BASE_U)), + ((unsigned int)(FLASH_BANK1_BASE_U)), + ((unsigned int)(FLASH_BANK_BASE_S))); return ERROR_FAIL; break; - case FLASH_BANK0_BASE: + + // at91sam3u series + case FLASH_BANK0_BASE_U: bank->driver_priv = &(pChip->details.bank[0]); bank->bank_number = 0; pChip->details.bank[0].pChip = pChip; pChip->details.bank[0].pBank = bank; break; - case FLASH_BANK1_BASE: + case FLASH_BANK1_BASE_U: bank->driver_priv = &(pChip->details.bank[1]); bank->bank_number = 1; pChip->details.bank[1].pChip = pChip; pChip->details.bank[1].pBank = bank; + + // at91sam3s series + case FLASH_BANK_BASE_S: + bank->driver_priv = &(pChip->details.bank[0]); + bank->bank_number = 0; + pChip->details.bank[0].pChip = pChip; + pChip->details.bank[0].pBank = bank; break; } diff --git a/tcl/board/atmel_sam3s_ek.cfg b/tcl/board/atmel_sam3s_ek.cfg new file mode 100644 index 0000000..38b54b7 --- /dev/null +++ b/tcl/board/atmel_sam3s_ek.cfg @@ -0,0 +1,3 @@ +source [find target/at91sam3sXX.cfg] + +$_TARGETNAME configure -event gdb-attach { reset init } diff --git a/tcl/target/at91sam3uXX.cfg b/tcl/target/at91sam3XXX.cfg similarity index 78% copy from tcl/target/at91sam3uXX.cfg copy to tcl/target/at91sam3XXX.cfg index b948c64..517a871 100644 --- a/tcl/target/at91sam3uXX.cfg +++ b/tcl/target/at91sam3XXX.cfg @@ -1,11 +1,21 @@ # script for ATMEL sam3, a CORTEX-M3 chip # -# at91sam3u4e -# at91sam3u2e -# at91sam3u1e -# at91sam3u4c -# at91sam3u2c -# at91sam3u1c +# at91sam3u4e +# at91sam3u2e +# at91sam3u1e +# at91sam3u4c +# at91sam3u2c +# at91sam3u1c +# +# at91sam3s4c +# at91sam3s4b +# at91sam3s4a +# at91sam3s2c +# at91sam3s2b +# at91sam3s2a +# at91sam3s1c +# at91sam3s1b +# at91sam3s1a if { [info exists CHIPNAME] } { set _CHIPNAME $CHIPNAME diff --git a/tcl/target/at91sam3sXX.cfg b/tcl/target/at91sam3sXX.cfg new file mode 100644 index 0000000..ca7092b --- /dev/null +++ b/tcl/target/at91sam3sXX.cfg @@ -0,0 +1,16 @@ +# script for ATMEL sam3, a CORTEX-M3 chip +# +# at91sam3s4c +# at91sam3s4b +# at91sam3s4a +# at91sam3s2c +# at91sam3s2b +# at91sam3s2a +# at91sam3s1c +# at91sam3s1b +# at91sam3s1a + +source [find target/at91sam3XXX.cfg] + +set _FLASHNAME $_CHIPNAME.flash +flash bank $_FLASHNAME at91sam3 0x00400000 0 1 1 $_TARGETNAME diff --git a/tcl/target/at91sam3uXX.cfg b/tcl/target/at91sam3uXX.cfg index b948c64..a11afc0 100644 --- a/tcl/target/at91sam3uXX.cfg +++ b/tcl/target/at91sam3uXX.cfg @@ -1,40 +1,11 @@ # script for ATMEL sam3, a CORTEX-M3 chip # -# at91sam3u4e -# at91sam3u2e -# at91sam3u1e -# at91sam3u4c -# at91sam3u2c -# at91sam3u1c +# at91sam3u4e +# at91sam3u2e +# at91sam3u1e +# at91sam3u4c +# at91sam3u2c +# at91sam3u1c -if { [info exists CHIPNAME] } { - set _CHIPNAME $CHIPNAME -} else { - set _CHIPNAME sam3 -} +source [find target/at91sam3XXX.cfg] -if { [info exists ENDIAN] } { - set _ENDIAN $ENDIAN -} else { - set _ENDIAN little -} - - -#jtag scan chain -if { [info exists CPUTAPID ] } { - set _CPUTAPID $CPUTAPID -} else { - set _CPUTAPID 0x4ba00477 -} - -jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID - -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME - -# 16K is plenty, the smallest chip has this much -$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size 16384 -work-area-backup 0 - -$_TARGETNAME configure -event gdb-flash-erase-start { - halt -} ----------------------------------------------------------------------- Summary of changes: src/flash/nor/at91sam3.c | 343 ++++++++++++++++++++++- tcl/board/atmel_sam3s_ek.cfg | 3 + tcl/target/{at91sam3uXX.cfg => at91sam3XXX.cfg} | 22 +- tcl/target/at91sam3sXX.cfg | 16 + tcl/target/at91sam3uXX.cfg | 43 +--- 5 files changed, 370 insertions(+), 57 deletions(-) create mode 100644 tcl/board/atmel_sam3s_ek.cfg copy tcl/target/{at91sam3uXX.cfg => at91sam3XXX.cfg} (78%) create mode 100644 tcl/target/at91sam3sXX.cfg hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-23 11:46:30
|
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 fb96b8607a0c2a9038df3352b0ef828d78c5e418 (commit) from e5d1befe43c1d666551cf2bc93de276d4e997476 (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 fb96b8607a0c2a9038df3352b0ef828d78c5e418 Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Jun 22 13:02:00 2010 +0200 openocd: setup_command_handler() must not be static when OpenOCD is linked with an app this fn can be used from the outside. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/openocd.c b/src/openocd.c index 623bd0c..96de50c 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -209,8 +209,10 @@ static int openocd_register_commands(struct command_context *cmd_ctx) struct command_context *global_cmd_ctx; -/* NB! this fn can be invoked outside this file for non PC hosted builds */ -static struct command_context *setup_command_handler(Jim_Interp *interp) +/* NB! this fn can be invoked outside this file for non PC hosted builds + * NB! do not change to 'static'!!!! + */ +struct command_context *setup_command_handler(Jim_Interp *interp) { log_init(); LOG_DEBUG("log_init: complete"); ----------------------------------------------------------------------- Summary of changes: src/openocd.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-23 11:10:26
|
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 e5d1befe43c1d666551cf2bc93de276d4e997476 (commit) from 6cb2d6dd7ae6049dce47dfb0b7c389dcf606119f (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 e5d1befe43c1d666551cf2bc93de276d4e997476 Author: Ãyvind Harboe <oyv...@zy...> Date: Wed Jun 23 10:47:54 2010 +0200 arm11: fix gaffe in no-ack transfers The code did not transfer the last word in no-ack transfers. The strange thing is that this did not lead to any observable errors. This gaffe was introduced in commit 1f5883ea56cb058221f Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/arm11_dbgtap.c b/src/target/arm11_dbgtap.c index 9ecd08f..b2c6287 100644 --- a/src/target/arm11_dbgtap.c +++ b/src/target/arm11_dbgtap.c @@ -679,7 +679,7 @@ int arm11_run_instr_data_to_core_noack(struct arm11_common * arm11, uint32_t opc int retval = arm11_run_instr_data_to_core_noack_inner(arm11->arm.target->tap, opcode, data, count); - if (retval != ERROR_FAIL) + if (retval != ERROR_OK) return retval; arm11_add_IR(arm11, ARM11_INTEST, ARM11_TAP_DEFAULT); ----------------------------------------------------------------------- Summary of changes: src/target/arm11_dbgtap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-23 08:01:14
|
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 6cb2d6dd7ae6049dce47dfb0b7c389dcf606119f (commit) from 4fa3cc7746d661f048f39a53c39b692369426e24 (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 6cb2d6dd7ae6049dce47dfb0b7c389dcf606119f Author: Antonio Borneo <bor...@gm...> Date: Wed Jun 23 00:53:17 2010 +0800 error number: review Review allocation of error numbers in openocd to avoid overlap. Put brackets around negative numbers to avoid issues during macro expansion. Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/common.h b/src/flash/common.h index 4098873..c78f24c 100644 --- a/src/flash/common.h +++ b/src/flash/common.h @@ -36,13 +36,13 @@ unsigned get_flash_name_index(const char *name); */ bool flash_driver_name_matches(const char *name, const char *expected); -#define ERROR_FLASH_BANK_INVALID -900 -#define ERROR_FLASH_SECTOR_INVALID -901 -#define ERROR_FLASH_OPERATION_FAILED -902 -#define ERROR_FLASH_DST_OUT_OF_BANK -903 -#define ERROR_FLASH_DST_BREAKS_ALIGNMENT -904 -#define ERROR_FLASH_BUSY -905 -#define ERROR_FLASH_SECTOR_NOT_ERASED -906 -#define ERROR_FLASH_BANK_NOT_PROBED -907 +#define ERROR_FLASH_BANK_INVALID (-900) +#define ERROR_FLASH_SECTOR_INVALID (-901) +#define ERROR_FLASH_OPERATION_FAILED (-902) +#define ERROR_FLASH_DST_OUT_OF_BANK (-903) +#define ERROR_FLASH_DST_BREAKS_ALIGNMENT (-904) +#define ERROR_FLASH_BUSY (-905) +#define ERROR_FLASH_SECTOR_NOT_ERASED (-906) +#define ERROR_FLASH_BANK_NOT_PROBED (-907) #endif // FLASH_COMMON_H diff --git a/src/target/trace.h b/src/target/trace.h index 5fbedc4..53502d4 100644 --- a/src/target/trace.h +++ b/src/target/trace.h @@ -59,7 +59,7 @@ typedef enum trace_status int trace_point(struct target *target, uint32_t number); int trace_register_commands(struct command_context *cmd_ctx); -#define ERROR_TRACE_IMAGE_UNAVAILABLE -(1500) -#define ERROR_TRACE_INSTRUCTION_UNAVAILABLE -(1501) +#define ERROR_TRACE_IMAGE_UNAVAILABLE (-1500) +#define ERROR_TRACE_INSTRUCTION_UNAVAILABLE (-1501) #endif /* TRACE_H */ diff --git a/src/target/xscale.h b/src/target/xscale.h index 82f4e37..d429336 100644 --- a/src/target/xscale.h +++ b/src/target/xscale.h @@ -176,6 +176,6 @@ enum XSCALE_TXRXCTRL, }; -#define ERROR_XSCALE_NO_TRACE_DATA (-1500) +#define ERROR_XSCALE_NO_TRACE_DATA (-700) #endif /* XSCALE_H */ ----------------------------------------------------------------------- Summary of changes: src/flash/common.h | 16 ++++++++-------- src/target/trace.h | 4 ++-- src/target/xscale.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-22 14:35:20
|
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 4fa3cc7746d661f048f39a53c39b692369426e24 (commit) via d236a48e8fd93504bf219fa9113a3af157ba5e1b (commit) via 33e7696cfaca149e83a471212394484054ff05b6 (commit) via 8b82171f75df84c1eb51e4824852079cb601df80 (commit) from f44eeba16f3e9bebfbc78fd0841124d8b2556246 (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 4fa3cc7746d661f048f39a53c39b692369426e24 Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Jun 22 12:49:56 2010 +0200 am3517 evm: use physical write to memory while target is running Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/tcl/board/am3517evm.cfg b/tcl/board/am3517evm.cfg index a639fa6..db76255 100644 --- a/tcl/board/am3517evm.cfg +++ b/tcl/board/am3517evm.cfg @@ -76,20 +76,20 @@ proc omap3_dbginit {target} { # General Cortex A8 debug initialisation cortex_a8 dbginit # Enable DBGU signal for OMAP353x - $target mww 0x5401d030 0x00002000 + $target mww phys 0x5401d030 0x00002000 } # be absolutely certain the JTAG clock will work with the worst-case # 16.8MHz/2 = 8.4MHz core clock, even before a bootloader kicks in. # OK to speed up *after* PLL and clock tree setup. -$_TARGETNAME configure -event "reset-start" { adapter_khz 10; halt; halt } +$_TARGETNAME configure -event "reset-start" { adapter_khz 10} # Assume SRST is unavailable (e.g. TI-14 JTAG), so we must assert reset # ourselves using PRM_RSTCTRL. RST_GS (2) is a warm reset, like ICEpick # would issue. RST_DPLL3 (4) is a cold reset. set PRM_RSTCTRL 0x48307250 -$_TARGETNAME configure -event reset-assert "$_TARGETNAME mww $PRM_RSTCTRL 2" +$_TARGETNAME configure -event reset-assert "$_TARGETNAME mww phys $PRM_RSTCTRL 2" $_TARGETNAME configure -event reset-assert-post "omap3_dbginit $_TARGETNAME; adapter_khz 1000" commit d236a48e8fd93504bf219fa9113a3af157ba5e1b Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Jun 22 12:47:30 2010 +0200 cortex a8: only physical read/write's are available when target is running Memory read/writes to virtual memory, requires that the CPU is halted. Use 'phys' option to write to memory while target is running. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index ea07579..afe5b6c 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -1381,12 +1381,16 @@ static int cortex_a8_read_memory(struct target *target, uint32_t address, { int enabled = 0; uint32_t virt, phys; + int retval; /* cortex_a8 handles unaligned memory access */ // ??? dap_ap_select(swjdp, swjdp_memoryap); LOG_DEBUG("Reading memory at address 0x%x; size %d; count %d", address, size, count); - cortex_a8_mmu(target, &enabled); + retval = cortex_a8_mmu(target, &enabled); + if (retval != ERROR_OK) + return retval; + if(enabled) { virt = address; @@ -1484,11 +1488,14 @@ static int cortex_a8_write_memory(struct target *target, uint32_t address, { int enabled = 0; uint32_t virt, phys; + int retval; // ??? dap_ap_select(swjdp, swjdp_memoryap); LOG_DEBUG("Writing memory to address 0x%x; size %d; count %d", address, size, count); - cortex_a8_mmu(target, &enabled); + retval = cortex_a8_mmu(target, &enabled); + if (retval != ERROR_OK) + return retval; if(enabled) { virt = address; commit 33e7696cfaca149e83a471212394484054ff05b6 Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Jun 22 12:35:00 2010 +0200 target: $_TARGET mdw now has a phys option just like the mdw command Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/target.c b/src/target/target.c index d6efe5b..3bf6824 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4021,23 +4021,36 @@ static int jim_target_md(Jim_Interp *interp, int argc, Jim_Obj *const *argv) Jim_GetOptInfo goi; Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1); - /* danger! goi.argc will be modified below! */ - argc = goi.argc; - - if ((argc != 1) && (argc != 2)) + if ((goi.argc < 1) || (goi.argc > 3)) { Jim_SetResult_sprintf(goi.interp, - "usage: %s <address> [<count>]", cmd_name); + "usage: %s [phys] <address> [<count>]", cmd_name); return JIM_ERR; } + int (*fn)(struct target *target, + uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); + fn=target_read_memory; + + int e; + if (strcmp(Jim_GetString(argv[1], NULL), "phys") == 0) + { + /* consume it */ + struct Jim_Obj *obj; + e = Jim_GetOpt_Obj(&goi, &obj); + if (e != JIM_OK) + return e; + + fn=target_read_phys_memory; + } + jim_wide a; - int e = Jim_GetOpt_Wide(&goi, &a); + e = Jim_GetOpt_Wide(&goi, &a); if (e != JIM_OK) { return JIM_ERR; } jim_wide c; - if (argc == 2) { + if (goi.argc == 1) { e = Jim_GetOpt_Wide(&goi, &c); if (e != JIM_OK) { return JIM_ERR; @@ -4045,6 +4058,13 @@ static int jim_target_md(Jim_Interp *interp, int argc, Jim_Obj *const *argv) } else { c = 1; } + + /* all args must be consumed */ + if (goi.argc != 0) + { + return JIM_ERR; + } + jim_wide b = 1; /* shut up gcc */ if (strcasecmp(cmd_name, "mdw") == 0) b = 4; @@ -4068,7 +4088,7 @@ static int jim_target_md(Jim_Interp *interp, int argc, Jim_Obj *const *argv) if (y > 16) { y = 16; } - e = target_read_memory(target, a, b, y / b, target_buf); + e = fn(target, a, b, y / b, target_buf); if (e != ERROR_OK) { Jim_SetResult_sprintf(interp, "error reading target @ 0x%08lx", (int)(a)); return JIM_ERR; commit 8b82171f75df84c1eb51e4824852079cb601df80 Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Jun 22 11:49:00 2010 +0200 target: mwX on target object now supporst phys argument $_TARGETNAME mww phys 0x10 0xdeadbeef => write 0xdeadbeef to physical address 0x10 Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/target.c b/src/target/target.c index 7513346..d6efe5b 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -3950,19 +3950,30 @@ static int jim_target_mw(Jim_Interp *interp, int argc, Jim_Obj *const *argv) Jim_GetOptInfo goi; Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1); - /* danger! goi.argc will be modified below! */ - argc = goi.argc; - - if (argc != 2 && argc != 3) + if (goi.argc < 2 || goi.argc > 4) { Jim_SetResult_sprintf(goi.interp, - "usage: %s <address> <data> [<count>]", cmd_name); + "usage: %s [phys] <address> <data> [<count>]", cmd_name); return JIM_ERR; } + target_write_fn fn; + fn = target_write_memory_fast; + + int e; + if (strcmp(Jim_GetString(argv[1], NULL), "phys") == 0) + { + /* consume it */ + struct Jim_Obj *obj; + e = Jim_GetOpt_Obj(&goi, &obj); + if (e != JIM_OK) + return e; + + fn = target_write_phys_memory; + } jim_wide a; - int e = Jim_GetOpt_Wide(&goi, &a); + e = Jim_GetOpt_Wide(&goi, &a); if (e != JIM_OK) return e; @@ -3972,13 +3983,19 @@ static int jim_target_mw(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return e; jim_wide c = 1; - if (argc == 3) + if (goi.argc == 1) { e = Jim_GetOpt_Wide(&goi, &c); if (e != JIM_OK) return e; } + /* all args must be consumed */ + if (goi.argc != 0) + { + return JIM_ERR; + } + struct target *target = Jim_CmdPrivData(goi.interp); unsigned data_size; if (strcasecmp(cmd_name, "mww") == 0) { @@ -3994,7 +4011,7 @@ static int jim_target_mw(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return JIM_ERR; } - return (target_fill_mem(target, a, target_write_memory_fast, data_size, b, c) == ERROR_OK) ? JIM_OK : JIM_ERR; + return (target_fill_mem(target, a, fn, data_size, b, c) == ERROR_OK) ? JIM_OK : JIM_ERR; } static int jim_target_md(Jim_Interp *interp, int argc, Jim_Obj *const *argv) ----------------------------------------------------------------------- Summary of changes: src/target/cortex_a8.c | 11 ++++++- src/target/target.c | 69 ++++++++++++++++++++++++++++++++++++----------- tcl/board/am3517evm.cfg | 6 ++-- 3 files changed, 65 insertions(+), 21 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-22 08:24:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via f44eeba16f3e9bebfbc78fd0841124d8b2556246 (commit) via bf8d954352465826e84a245bd4ec8c958eb91c21 (commit) via bef497aeb069314cae3a13dd339a181a3ecf67cd (commit) from fe1f7f63b628ae485609500b8710bfea3bac61a6 (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 f44eeba16f3e9bebfbc78fd0841124d8b2556246 Author: Edgar Grimberg <edg...@zy...> Date: Mon Jun 21 23:06:15 2010 +0200 xsvf: Fix shadow issues on Mac wait is declared in /usr/include/sys/wait.h Signed-off-by: Edgar Grimberg <edg...@zy...> diff --git a/src/xsvf/xsvf.c b/src/xsvf/xsvf.c index f4d09ff..157d728 100644 --- a/src/xsvf/xsvf.c +++ b/src/xsvf/xsvf.c @@ -760,7 +760,7 @@ COMMAND_HANDLER(handle_xsvf_command) XWAIT <uint8_t wait_state> <uint8_t end_state> <uint32_t usecs> */ - uint8_t wait; + uint8_t wait_local; uint8_t end; uint8_t delay_buf[4]; @@ -768,7 +768,7 @@ COMMAND_HANDLER(handle_xsvf_command) tap_state_t end_state; int delay; - if (read(xsvf_fd, &wait, 1) < 0 + if (read(xsvf_fd, &wait_local, 1) < 0 || read(xsvf_fd, &end, 1) < 0 || read(xsvf_fd, delay_buf, 4) < 0) { @@ -776,7 +776,7 @@ COMMAND_HANDLER(handle_xsvf_command) break; } - wait_state = xsvf_to_tap(wait); + wait_state = xsvf_to_tap(wait_local); end_state = xsvf_to_tap(end); delay = be_to_h_u32(delay_buf); @@ -804,14 +804,14 @@ COMMAND_HANDLER(handle_xsvf_command) uint8_t clock_buf[4]; uint8_t usecs_buf[4]; - uint8_t wait; + uint8_t wait_local; uint8_t end; tap_state_t wait_state; tap_state_t end_state; int clock_count; int usecs; - if (read(xsvf_fd, &wait, 1) < 0 + if (read(xsvf_fd, &wait_local, 1) < 0 || read(xsvf_fd, &end, 1) < 0 || read(xsvf_fd, clock_buf, 4) < 0 || read(xsvf_fd, usecs_buf, 4) < 0) @@ -820,7 +820,7 @@ COMMAND_HANDLER(handle_xsvf_command) break; } - wait_state = xsvf_to_tap(wait); + wait_state = xsvf_to_tap(wait_local); end_state = xsvf_to_tap(end); clock_count = be_to_h_u32(clock_buf); commit bf8d954352465826e84a245bd4ec8c958eb91c21 Author: Edgar Grimberg <edg...@zy...> Date: Mon Jun 21 23:04:16 2010 +0200 target: Fix shadow issues on Mac wait is declared in /usr/include/sys/wait.h Signed-off-by: Edgar Grimberg <edg...@zy...> diff --git a/src/target/target.c b/src/target/target.c index 9599fec..7513346 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -2135,11 +2135,11 @@ COMMAND_HANDLER(handle_halt_command) if (CMD_ARGC == 1) { - unsigned wait; - retval = parse_uint(CMD_ARGV[0], &wait); + unsigned wait_local; + retval = parse_uint(CMD_ARGV[0], &wait_local); if (ERROR_OK != retval) return ERROR_COMMAND_SYNTAX_ERROR; - if (!wait) + if (!wait_local) return ERROR_OK; } commit bef497aeb069314cae3a13dd339a181a3ecf67cd Author: Edgar Grimberg <edg...@zy...> Date: Mon Jun 21 23:02:41 2010 +0200 flash: fix shadow issues on Mac Wait is declared in /usr/include/sys/wait.h Signed-off-by: Edgar Grimberg <edg...@zy...> diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 90e9888..4372128 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -209,7 +209,7 @@ static int mg_init_gpio (void) return ret; } -static int mg_dsk_wait(mg_io_type_wait wait, uint32_t time_var) +static int mg_dsk_wait(mg_io_type_wait wait_local, uint32_t time_var) { uint8_t status, error; struct target *target = mflash_bank->target; @@ -228,10 +228,10 @@ static int mg_dsk_wait(mg_io_type_wait wait, uint32_t time_var) if (status & mg_io_rbit_status_busy) { - if (wait == mg_io_wait_bsy) + if (wait_local == mg_io_wait_bsy) return ERROR_OK; } else { - switch (wait) + switch (wait_local) { case mg_io_wait_not_bsy: return ERROR_OK; @@ -259,7 +259,7 @@ static int mg_dsk_wait(mg_io_type_wait wait, uint32_t time_var) return ERROR_MG_IO; } - switch (wait) + switch (wait_local) { case mg_io_wait_rdy: if (status & mg_io_rbit_status_ready) ----------------------------------------------------------------------- Summary of changes: src/flash/mflash.c | 8 ++++---- src/target/target.c | 6 +++--- src/xsvf/xsvf.c | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-22 08:21: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 fe1f7f63b628ae485609500b8710bfea3bac61a6 (commit) via 9a8fe44c83e466b93ef67d4c47b6fc84578d8e3d (commit) via b50bb632adbfaa21d7a4d3705932aeaebf889f23 (commit) via 4d238c7f91a73beebe1e71594b19ac39c62ff408 (commit) via 59bf45be1f37bd10c97bcfb1309f3c4c826b2a5a (commit) via 37cfbe491777a32a4e04b17620bd5f327a6aed92 (commit) via 19925e4d7f4ea3059c05e4ededa2e4f16eca67bf (commit) from f747b16e4e14f25f19e391b4811db9fa70be919a (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 fe1f7f63b628ae485609500b8710bfea3bac61a6 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jun 21 16:07:25 2010 +0200 board: add alpha am3517evm ti board config file Signs of life: reset(kinda), halt, resume and memory display/modify. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/tcl/board/am3517evm.cfg b/tcl/board/am3517evm.cfg new file mode 100644 index 0000000..a639fa6 --- /dev/null +++ b/tcl/board/am3517evm.cfg @@ -0,0 +1,97 @@ +# DANGER!!!! early work in progress for this PCB/target. +# +# The most basic operations work well enough that it is +# useful to have this in the repository for cooperation +# alpha testing purposes. +# +# TI AM3517 +# +# http://focus.ti.com/docs/prod/folders/print/am3517.html +# http://processors.wiki.ti.com/index.php/Debug_Access_Port_(DAP) +# http://processors.wiki.ti.com/index.php?title=How_to_Find_the_Silicon_Revision_of_your_OMAP35x + +# Slooow during startup +adapter_khz 10 + + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME am3517 +} + +set JRC_TAPID 0 + +set DAP_TAPID 0x0b86802f + +# Subsidiary TAP: CoreSight Debug Access Port (DAP) +if { [info exists DAP_TAPID ] } { + set _DAP_TAPID $DAP_TAPID +} else { + set _DAP_TAPID 0x0b6d602f +} + + +# Primary TAP: ICEpick-C (JTAG route controller) and boundary scan +if { [info exists JRC_TAPID ] } { + set _JRC_TAPID $JRC_TAPID +} else { + set _JRC_TAPID 0x0b7ae02f +} + +# ICEpick-C ... used to route Cortex, and more not shown here +source [find target/icepick.cfg] + + +jtag newtap $_CHIPNAME dap -irlen 4 -ircapture 0x1 -irmask 0xf \ + -expected-id $_DAP_TAPID -disable +jtag configure $_CHIPNAME.dap -event tap-enable \ + "icepick_c_tapenable $_CHIPNAME.jrc 3" + +jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f \ + -expected-id $_JRC_TAPID + + + +# GDB target: Cortex-A8, using DAP +set _TARGETNAME $_CHIPNAME.cpu +target create $_TARGETNAME cortex_a8 -chain-position $_CHIPNAME.dap + +# SRAM: 64K at 0x4020.0000; use the first 16K +$_TARGETNAME configure -work-area-phys 0x40200000 -work-area-size 0x4000 + +################### + +# the reset sequence is event-driven +# and kind of finicky... + +# some TCK tycles are required to activate the DEBUG power domain +jtag configure $_CHIPNAME.jrc -event post-reset "runtest 100" + +# have the DAP "always" be active +jtag configure $_CHIPNAME.jrc -event setup "jtag tapenable $_CHIPNAME.dap" + +proc omap3_dbginit {target} { + + # General Cortex A8 debug initialisation + cortex_a8 dbginit + # Enable DBGU signal for OMAP353x + $target mww 0x5401d030 0x00002000 +} + +# be absolutely certain the JTAG clock will work with the worst-case +# 16.8MHz/2 = 8.4MHz core clock, even before a bootloader kicks in. +# OK to speed up *after* PLL and clock tree setup. + +$_TARGETNAME configure -event "reset-start" { adapter_khz 10; halt; halt } + +# Assume SRST is unavailable (e.g. TI-14 JTAG), so we must assert reset +# ourselves using PRM_RSTCTRL. RST_GS (2) is a warm reset, like ICEpick +# would issue. RST_DPLL3 (4) is a cold reset. +set PRM_RSTCTRL 0x48307250 +$_TARGETNAME configure -event reset-assert "$_TARGETNAME mww $PRM_RSTCTRL 2" + +$_TARGETNAME configure -event reset-assert-post "omap3_dbginit $_TARGETNAME; adapter_khz 1000" + + +reset_config trst_only commit 9a8fe44c83e466b93ef67d4c47b6fc84578d8e3d Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jun 21 16:07:00 2010 +0200 gitignore: start list of emacs temp files to ignore Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/.gitignore b/.gitignore index e37ee5a..0491508 100644 --- a/.gitignore +++ b/.gitignore @@ -73,3 +73,6 @@ patches .project .cproject .settings + +# Emacs temp files +*~ commit b50bb632adbfaa21d7a4d3705932aeaebf889f23 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jun 21 14:34:07 2010 +0200 cortex a8: print message that locking debug access succeeded on second try when locking the debug access fails on the first try, it's a bit noisy, so print out message that it succeeded on second try. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index ee79d63..ea07579 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -92,6 +92,10 @@ static int cortex_a8_init_debug_access(struct target *target) { /* try again */ retval = mem_ap_write_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_LOCKACCESS, 0xC5ACCE55); + if (retval == ERROR_OK) + { + LOG_USER("Locking debug access failed on first, but succeeded on second try."); + } } if (retval != ERROR_OK) return retval; commit 4d238c7f91a73beebe1e71594b19ac39c62ff408 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jun 21 14:26:19 2010 +0200 cortex a8: add error propagation for poll/resume Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index c39dba3..ee79d63 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -98,12 +98,15 @@ static int cortex_a8_init_debug_access(struct target *target) /* Clear Sticky Power Down status Bit in PRSR to enable access to the registers in the Core Power Domain */ retval = mem_ap_read_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_PRSR, &dummy); + if (retval != ERROR_OK) + return retval; + /* Enabling of instruction execution in debug mode is done in debug_entry code */ /* Resync breakpoint registers */ /* Since this is likley called from init or reset, update targtet state information*/ - cortex_a8_poll(target); + retval = cortex_a8_poll(target); return retval; } @@ -1005,6 +1008,7 @@ static int cortex_a8_step(struct target *target, int current, uint32_t address, struct breakpoint *breakpoint = NULL; struct breakpoint stepbreakpoint; struct reg *r; + int retval; int timeout = 100; @@ -1048,15 +1052,19 @@ static int cortex_a8_step(struct target *target, int current, uint32_t address, target->debug_reason = DBG_REASON_SINGLESTEP; - cortex_a8_resume(target, 1, address, 0, 0); + retval = cortex_a8_resume(target, 1, address, 0, 0); + if (retval != ERROR_OK) + return retval; while (target->state != TARGET_HALTED) { - cortex_a8_poll(target); + retval = cortex_a8_poll(target); + if (retval != ERROR_OK) + return retval; if (--timeout == 0) { - LOG_WARNING("timeout waiting for target halt"); - break; + LOG_ERROR("timeout waiting for target halt"); + return ERROR_FAIL; } } @@ -1313,6 +1321,8 @@ static int cortex_a8_deassert_reset(struct target *target) jtag_add_reset(0, 0); retval = cortex_a8_poll(target); + if (retval != ERROR_OK) + return retval; if (target->reset_halt) { if (target->state != TARGET_HALTED) { commit 59bf45be1f37bd10c97bcfb1309f3c4c826b2a5a Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jun 21 14:14:31 2010 +0200 cortex a8: add timeouts waiting for restart, prepare and halt It would previously sit in an infinite loop rather than reporting an error. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 1577c26..c39dba3 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -39,6 +39,7 @@ #include "target_request.h" #include "target_type.h" #include "arm_opcodes.h" +#include <helper/time_support.h> static int cortex_a8_poll(struct target *target); static int cortex_a8_debug_entry(struct target *target); @@ -364,13 +365,22 @@ static int cortex_a8_dpm_prepare(struct arm_dpm *dpm) int retval; /* set up invariant: INSTR_COMP is set after ever DPM operation */ - do { + long long then = timeval_ms(); + for (;;) + { retval = mem_ap_read_atomic_u32(swjdp, a8->armv7a_common.debug_base + CPUDBG_DSCR, &dscr); if (retval != ERROR_OK) return retval; - } while ((dscr & DSCR_INSTR_COMP) == 0); + if ((dscr & DSCR_INSTR_COMP) != 0) + break; + if (timeval_ms() > then + 1000) + { + LOG_ERROR("Timeout waiting for dpm prepare"); + return ERROR_FAIL; + } + } /* this "should never happen" ... */ if (dscr & DSCR_DTR_RX_FULL) { @@ -668,12 +678,23 @@ static int cortex_a8_halt(struct target *target) if (retval != ERROR_OK) goto out; - do { + long long then = timeval_ms(); + for (;;) + { retval = mem_ap_read_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_DSCR, &dscr); if (retval != ERROR_OK) goto out; - } while ((dscr & DSCR_CORE_HALTED) == 0); + if ((dscr & DSCR_CORE_HALTED) != 0) + { + break; + } + if (timeval_ms() > then + 1000) + { + LOG_ERROR("Timeout waiting for halt"); + return ERROR_FAIL; + } + } target->debug_reason = DBG_REASON_DBGRQ; @@ -776,12 +797,21 @@ static int cortex_a8_resume(struct target *target, int current, if (retval != ERROR_OK) return retval; - do { + long long then = timeval_ms(); + for (;;) + { retval = mem_ap_read_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_DSCR, &dscr); if (retval != ERROR_OK) return retval; - } while ((dscr & DSCR_CORE_RESTARTED) == 0); + if ((dscr & DSCR_CORE_RESTARTED) != 0) + break; + if (timeval_ms() > then + 1000) + { + LOG_ERROR("Timeout waiting for resume"); + return ERROR_FAIL; + } + } target->debug_reason = DBG_REASON_NOTHALTED; target->state = TARGET_RUNNING; commit 37cfbe491777a32a4e04b17620bd5f327a6aed92 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jun 21 13:58:52 2010 +0200 cortex a8: add error propagation for mem_ap_read/write_atomic_u32 Error propagation avoids e.g. infinite loops waiting for target to halt, etc. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 933b42e..1577c26 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -88,7 +88,12 @@ static int cortex_a8_init_debug_access(struct target *target) /* The debugport might be uninitialised so try twice */ retval = mem_ap_write_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_LOCKACCESS, 0xC5ACCE55); if (retval != ERROR_OK) - mem_ap_write_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_LOCKACCESS, 0xC5ACCE55); + { + /* try again */ + retval = mem_ap_write_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_LOCKACCESS, 0xC5ACCE55); + } + if (retval != ERROR_OK) + return retval; /* Clear Sticky Power Down status Bit in PRSR to enable access to the registers in the Core Power Domain */ retval = mem_ap_read_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_PRSR, &dummy); @@ -363,6 +368,8 @@ static int cortex_a8_dpm_prepare(struct arm_dpm *dpm) retval = mem_ap_read_atomic_u32(swjdp, a8->armv7a_common.debug_base + CPUDBG_DSCR, &dscr); + if (retval != ERROR_OK) + return retval; } while ((dscr & DSCR_INSTR_COMP) == 0); /* this "should never happen" ... */ @@ -646,20 +653,26 @@ static int cortex_a8_halt(struct target *target) */ retval = mem_ap_write_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_DRCR, 0x1); + if (retval != ERROR_OK) + goto out; /* * enter halting debug mode */ - mem_ap_read_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_DSCR, &dscr); + retval = mem_ap_read_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_DSCR, &dscr); + if (retval != ERROR_OK) + goto out; + retval = mem_ap_write_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_DSCR, dscr | DSCR_HALT_DBG_MODE); - if (retval != ERROR_OK) goto out; do { - mem_ap_read_atomic_u32(swjdp, + retval = mem_ap_read_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_DSCR, &dscr); + if (retval != ERROR_OK) + goto out; } while ((dscr & DSCR_CORE_HALTED) == 0); target->debug_reason = DBG_REASON_DBGRQ; @@ -675,6 +688,7 @@ static int cortex_a8_resume(struct target *target, int current, struct armv7a_common *armv7a = target_to_armv7a(target); struct arm *armv4_5 = &armv7a->armv4_5_common; struct adiv5_dap *swjdp = &armv7a->dap; + int retval; // struct breakpoint *breakpoint = NULL; uint32_t resume_pc, dscr; @@ -758,11 +772,15 @@ static int cortex_a8_resume(struct target *target, int current, * REVISIT: for single stepping, we probably want to * disable IRQs by default, with optional override... */ - mem_ap_write_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_DRCR, 0x2); + retval = mem_ap_write_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_DRCR, 0x2); + if (retval != ERROR_OK) + return retval; do { - mem_ap_read_atomic_u32(swjdp, + retval = mem_ap_read_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_DSCR, &dscr); + if (retval != ERROR_OK) + return retval; } while ((dscr & DSCR_CORE_RESTARTED) == 0); target->debug_reason = DBG_REASON_NOTHALTED; @@ -804,8 +822,10 @@ static int cortex_a8_debug_entry(struct target *target) LOG_DEBUG("dscr = 0x%08" PRIx32, cortex_a8->cpudbg_dscr); /* REVISIT surely we should not re-read DSCR !! */ - mem_ap_read_atomic_u32(swjdp, + retval = mem_ap_read_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_DSCR, &dscr); + if (retval != ERROR_OK) + return retval; /* REVISIT see A8 TRM 12.11.4 steps 2..3 -- make sure that any * imprecise data aborts get discarded by issuing a Data @@ -816,6 +836,8 @@ static int cortex_a8_debug_entry(struct target *target) dscr |= DSCR_ITR_EN; retval = mem_ap_write_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_DSCR, dscr); + if (retval != ERROR_OK) + return retval; /* Examine debug reason */ arm_dpm_report_dscr(&armv7a->dpm, cortex_a8->cpudbg_dscr); @@ -827,6 +849,8 @@ static int cortex_a8_debug_entry(struct target *target) retval = mem_ap_read_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_WFAR, &wfar); + if (retval != ERROR_OK) + return retval; arm_dpm_report_wfar(&armv7a->dpm, wfar); } commit 19925e4d7f4ea3059c05e4ededa2e4f16eca67bf Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jun 21 13:41:53 2010 +0200 arm_adi_v5: error propagation fixes Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index aae60fc..b4f49e7 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -603,43 +603,47 @@ int mem_ap_read_buf_u32(struct adiv5_dap *dap, uint8_t *buffer, */ /* Scan out first read */ - adi_jtag_dp_scan(dap, JTAG_DP_APACC, AP_REG_DRW, + retval = adi_jtag_dp_scan(dap, JTAG_DP_APACC, AP_REG_DRW, DPAP_READ, 0, NULL, NULL); + if (retval != ERROR_OK) + return retval; for (readcount = 0; readcount < blocksize - 1; readcount++) { /* Scan out next read; scan in posted value for the * previous one. Assumes read is acked "OK/FAULT", * and CTRL_STAT says that meant "OK". */ - adi_jtag_dp_scan(dap, JTAG_DP_APACC, AP_REG_DRW, + retval = adi_jtag_dp_scan(dap, JTAG_DP_APACC, AP_REG_DRW, DPAP_READ, 0, buffer + 4 * readcount, &dap->ack); + if (retval != ERROR_OK) + return retval; } /* Scan in last posted value; RDBUFF has no other effect, * assuming ack is OK/FAULT and CTRL_STAT says "OK". */ - adi_jtag_dp_scan(dap, JTAG_DP_DPACC, DP_RDBUFF, + retval = adi_jtag_dp_scan(dap, JTAG_DP_DPACC, DP_RDBUFF, DPAP_READ, 0, buffer + 4 * readcount, &dap->ack); - if (dap_run(dap) == ERROR_OK) - { - wcount = wcount - blocksize; - address += 4 * blocksize; - buffer += 4 * blocksize; - } - else - { - errorcount++; - } + if (retval != ERROR_OK) + return retval; - if (errorcount > 1) + retval = dap_run(dap); + if (retval != ERROR_OK) { - LOG_WARNING("Block read error address 0x%" PRIx32 - ", count 0x%x", address, count); - /* REVISIT return the *actual* fault code */ - return ERROR_JTAG_DEVICE_ERROR; + errorcount++; + if (errorcount <= 1) + { + /* try again */ + continue; + } + LOG_WARNING("Block read error address 0x%" PRIx32, address); + return retval; } + wcount = wcount - blocksize; + address += 4 * blocksize; + buffer += 4 * blocksize; } /* if we have an unaligned access - reorder data */ ----------------------------------------------------------------------- Summary of changes: .gitignore | 3 + src/target/arm_adi_v5.c | 40 +++++---- src/target/cortex_a8.c | 104 ++++++++++++++++++---- tcl/{target/omap3530.cfg => board/am3517evm.cfg} | 53 ++++++++--- 4 files changed, 149 insertions(+), 51 deletions(-) copy tcl/{target/omap3530.cfg => board/am3517evm.cfg} (73%) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-21 16:56: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 branch, master has been updated via f747b16e4e14f25f19e391b4811db9fa70be919a (commit) via 9b5572857a3e42e0984b0daa3c478561337a0451 (commit) via bc7fa896e69d5a325776da4e5b423940cb1124dd (commit) via 190986eb8c6967cebafe0b415733c72305489f76 (commit) via ff1c09fbeabc568c7cd6e29b4681e15e5d0d184c (commit) via decd417064b63c8eda69ad523a63fefd22036d16 (commit) via d26b5236bac524ca33799f2c10f40f65755bdd08 (commit) via 3f59fcf77e5eb1d8c504a337b05bb1a5797e656f (commit) via b978dcbbee628ed30286b90cecf7085eb2cb7a82 (commit) via 3cfbf705597732c7b6a5b11a556c818529ea725b (commit) via ec073e89435785375dece2fb7c4664002c22859c (commit) from 2fbb0b5972b04e10090e39137817e9f359fb6105 (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 f747b16e4e14f25f19e391b4811db9fa70be919a Author: Antonio Borneo <bor...@gm...> Date: Sun Jun 20 18:40:02 2010 +0800 nand/mx2: review scope of symbols Add "static" qualifier to private variable. Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nand/mx2.c b/src/flash/nand/mx2.c index 83e1cb1..147546d 100644 --- a/src/flash/nand/mx2.c +++ b/src/flash/nand/mx2.c @@ -61,7 +61,7 @@ static const char sram_buffer_bounds_err_msg[] = "trying to access out of SRAM buffer bound (addr=0x%" PRIx32 ")"; static const char get_status_register_err_msg[] = "can't get NAND status"; static uint32_t in_sram_address; -unsigned char sign_of_sequental_byte_read; +static unsigned char sign_of_sequental_byte_read; static int initialize_nf_controller(struct nand_device *nand); static int get_next_byte_from_sram_buffer(struct target * target, uint8_t * value); commit 9b5572857a3e42e0984b0daa3c478561337a0451 Author: Antonio Borneo <bor...@gm...> Date: Sun Jun 20 17:44:24 2010 +0800 nor/str7x: review scope of symbols Add "static" qualifier to private function. Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/str7x.c b/src/flash/nor/str7x.c index 4c450af..069e90c 100644 --- a/src/flash/nor/str7x.c +++ b/src/flash/nor/str7x.c @@ -394,7 +394,7 @@ static int str7x_protect(struct flash_bank *bank, int set, int first, int last) return ERROR_OK; } -int str7x_write_block(struct flash_bank *bank, uint8_t *buffer, +static int str7x_write_block(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct str7x_flash_bank *str7x_info = bank->driver_priv; commit bc7fa896e69d5a325776da4e5b423940cb1124dd Author: Antonio Borneo <bor...@gm...> Date: Sun Jun 20 17:40:28 2010 +0800 openocd.c: review scope of symbols Add "static" qualifier to private data. Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/openocd.c b/src/openocd.c index 81c2dcd..623bd0c 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -210,7 +210,7 @@ static int openocd_register_commands(struct command_context *cmd_ctx) struct command_context *global_cmd_ctx; /* NB! this fn can be invoked outside this file for non PC hosted builds */ -struct command_context *setup_command_handler(Jim_Interp *interp) +static struct command_context *setup_command_handler(Jim_Interp *interp) { log_init(); LOG_DEBUG("log_init: complete"); commit 190986eb8c6967cebafe0b415733c72305489f76 Author: Antonio Borneo <bor...@gm...> Date: Sun Jun 20 17:38:19 2010 +0800 nor/virtual: review scope of symbols Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/virtual.c b/src/flash/nor/virtual.c index eb1885e..e91dfc7 100644 --- a/src/flash/nor/virtual.c +++ b/src/flash/nor/virtual.c @@ -195,7 +195,7 @@ static int virtual_info(struct flash_bank *bank, char *buf, int buf_size) return ERROR_OK; } -int virtual_blank_check(struct flash_bank *bank) +static int virtual_blank_check(struct flash_bank *bank) { struct flash_bank *master_bank = virtual_get_master_bank(bank); int retval; @@ -211,7 +211,7 @@ int virtual_blank_check(struct flash_bank *bank) return ERROR_OK; } -int virtual_flash_read(struct flash_bank *bank, +static int virtual_flash_read(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct flash_bank *master_bank = virtual_get_master_bank(bank); commit ff1c09fbeabc568c7cd6e29b4681e15e5d0d184c Author: Antonio Borneo <bor...@gm...> Date: Sun Jun 20 13:05:56 2010 +0800 target/avrt: review unused symbols Remove unused functions: - mcu_write_dr_u16 - mcu_write_dr_u8 - mcu_write_ir_u16 - mcu_write_ir_u32 Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/avrt.c b/src/target/avrt.c index 3861199..1ddf24d 100644 --- a/src/target/avrt.c +++ b/src/target/avrt.c @@ -46,10 +46,6 @@ static int avr_soft_reset_halt(struct target *target); static int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti); static int mcu_write_dr(struct jtag_tap *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_len, int rti); static int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti); -int mcu_write_dr_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int dr_len, int rti); -int mcu_write_ir_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int ir_len, int rti); -int mcu_write_dr_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int dr_len, int rti); -int mcu_write_ir_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int ir_len, int rti); static int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int dr_len, int rti); struct target_type avr_target = @@ -225,58 +221,6 @@ static int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, return ERROR_OK; } -int mcu_write_dr_u8(struct jtag_tap *tap, uint8_t *dr_in, uint8_t dr_out, int dr_len, int rti) -{ - if (dr_len > 8) - { - LOG_ERROR("dr_len overflow, maxium is 8"); - return ERROR_FAIL; - } - - mcu_write_dr(tap, dr_in, &dr_out, dr_len, rti); - - return ERROR_OK; -} - -int mcu_write_ir_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int ir_len, int rti) -{ - if (ir_len > 16) - { - LOG_ERROR("ir_len overflow, maxium is 16"); - return ERROR_FAIL; - } - - mcu_write_ir(tap, (uint8_t*)ir_in, (uint8_t*)&ir_out, ir_len, rti); - - return ERROR_OK; -} - -int mcu_write_dr_u16(struct jtag_tap *tap, uint16_t *dr_in, uint16_t dr_out, int dr_len, int rti) -{ - if (dr_len > 16) - { - LOG_ERROR("dr_len overflow, maxium is 16"); - return ERROR_FAIL; - } - - mcu_write_dr(tap, (uint8_t*)dr_in, (uint8_t*)&dr_out, dr_len, rti); - - return ERROR_OK; -} - -int mcu_write_ir_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int ir_len, int rti) -{ - if (ir_len > 32) - { - LOG_ERROR("ir_len overflow, maxium is 32"); - return ERROR_FAIL; - } - - mcu_write_ir(tap, (uint8_t*)ir_in, (uint8_t*)&ir_out, ir_len, rti); - - return ERROR_OK; -} - static int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *dr_in, uint32_t dr_out, int dr_len, int rti) { commit decd417064b63c8eda69ad523a63fefd22036d16 Author: Antonio Borneo <bor...@gm...> Date: Sun Jun 20 12:52:07 2010 +0800 target/avr: review scope of symbols Add "static" qualifier to private functions. Move duplicated global declarations from "target/avrt.c" and "nor/avrf.c" to "target/avrt.h". Remove unused declarations form "nor/avrf.c". Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/avrf.c b/src/flash/nor/avrf.c index 8472d83..4dc7c23 100644 --- a/src/flash/nor/avrf.c +++ b/src/flash/nor/avrf.c @@ -59,19 +59,6 @@ static struct avrf_type avft_chips_info[] = {"at90can128", 0x9781, 256, 512, 8, 512}, }; -int avr_jtag_sendinstr(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out); -int avr_jtag_senddat(struct jtag_tap *tap, uint32_t *dr_in, uint32_t dr_out, int len); - -int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti); -int mcu_write_dr(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int dr_len, int rti); -int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti); -int mcu_write_dr_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int dr_len, int rti); -int mcu_write_ir_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int ir_len, int rti); -int mcu_write_dr_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int dr_len, int rti); -int mcu_write_ir_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int ir_len, int rti); -int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int dr_len, int rti); -int mcu_execute_queue(void); - /* avr program functions */ static int avr_jtag_reset(struct avr_common *avr, uint32_t reset) { diff --git a/src/target/avrt.c b/src/target/avrt.c index 17f7c24..3861199 100644 --- a/src/target/avrt.c +++ b/src/target/avrt.c @@ -29,32 +29,28 @@ #define AVR_JTAG_INS_LEN 4 /* forward declarations */ -int avr_target_create(struct target *target, Jim_Interp *interp); -int avr_init_target(struct command_context *cmd_ctx, struct target *target); +static int avr_target_create(struct target *target, Jim_Interp *interp); +static int avr_init_target(struct command_context *cmd_ctx, struct target *target); -int avr_arch_state(struct target *target); -int avr_poll(struct target *target); -int avr_halt(struct target *target); -int avr_resume(struct target *target, int current, uint32_t address, int handle_breakpoints, int debug_execution); -int avr_step(struct target *target, int current, uint32_t address, int handle_breakpoints); +static int avr_arch_state(struct target *target); +static int avr_poll(struct target *target); +static int avr_halt(struct target *target); +static int avr_resume(struct target *target, int current, uint32_t address, int handle_breakpoints, int debug_execution); +static int avr_step(struct target *target, int current, uint32_t address, int handle_breakpoints); -int avr_assert_reset(struct target *target); -int avr_deassert_reset(struct target *target); -int avr_soft_reset_halt(struct target *target); +static int avr_assert_reset(struct target *target); +static int avr_deassert_reset(struct target *target); +static int avr_soft_reset_halt(struct target *target); /* IR and DR functions */ -int avr_jtag_sendinstr(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out); -int avr_jtag_senddat(struct jtag_tap *tap, uint32_t *dr_in, uint32_t dr_out, int len); - -int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti); -int mcu_write_dr(struct jtag_tap *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_len, int rti); -int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti); +static int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti); +static int mcu_write_dr(struct jtag_tap *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_len, int rti); +static int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti); int mcu_write_dr_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int dr_len, int rti); int mcu_write_ir_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int ir_len, int rti); int mcu_write_dr_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int dr_len, int rti); int mcu_write_ir_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int ir_len, int rti); -int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int dr_len, int rti); -int mcu_execute_queue(void); +static int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int dr_len, int rti); struct target_type avr_target = { @@ -92,7 +88,7 @@ struct target_type avr_target = .init_target = avr_init_target, }; -int avr_target_create(struct target *target, Jim_Interp *interp) +static int avr_target_create(struct target *target, Jim_Interp *interp) { struct avr_common *avr = calloc(1, sizeof(struct avr_common)); @@ -102,19 +98,19 @@ int avr_target_create(struct target *target, Jim_Interp *interp) return ERROR_OK; } -int avr_init_target(struct command_context *cmd_ctx, struct target *target) +static int avr_init_target(struct command_context *cmd_ctx, struct target *target) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } -int avr_arch_state(struct target *target) +static int avr_arch_state(struct target *target) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } -int avr_poll(struct target *target) +static int avr_poll(struct target *target) { if ((target->state == TARGET_RUNNING) || (target->state == TARGET_DEBUG_RUNNING)) { @@ -125,25 +121,26 @@ int avr_poll(struct target *target) return ERROR_OK; } -int avr_halt(struct target *target) +static int avr_halt(struct target *target) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } -int avr_resume(struct target *target, int current, uint32_t address, int handle_breakpoints, int debug_execution) +static int avr_resume(struct target *target, int current, uint32_t address, + int handle_breakpoints, int debug_execution) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } -int avr_step(struct target *target, int current, uint32_t address, int handle_breakpoints) +static int avr_step(struct target *target, int current, uint32_t address, int handle_breakpoints) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } -int avr_assert_reset(struct target *target) +static int avr_assert_reset(struct target *target) { target->state = TARGET_RESET; @@ -151,7 +148,7 @@ int avr_assert_reset(struct target *target) return ERROR_OK; } -int avr_deassert_reset(struct target *target) +static int avr_deassert_reset(struct target *target) { target->state = TARGET_RUNNING; @@ -159,13 +156,14 @@ int avr_deassert_reset(struct target *target) return ERROR_OK; } -int avr_soft_reset_halt(struct target *target) +static int avr_soft_reset_halt(struct target *target) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } -int avr_jtag_senddat(struct jtag_tap *tap, uint32_t* dr_in, uint32_t dr_out, int len) +int avr_jtag_senddat(struct jtag_tap *tap, uint32_t* dr_in, uint32_t dr_out, + int len) { return mcu_write_dr_u32(tap, dr_in, dr_out, len, 1); } @@ -176,7 +174,8 @@ int avr_jtag_sendinstr(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out) } /* IR and DR functions */ -int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti) +static int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, + int ir_len, int rti) { if (NULL == tap) { @@ -196,7 +195,8 @@ int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_l return ERROR_OK; } -int mcu_write_dr(struct jtag_tap *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_len, int rti) +static int mcu_write_dr(struct jtag_tap *tap, uint8_t *dr_in, uint8_t *dr_out, + int dr_len, int rti) { if (NULL == tap) { @@ -211,7 +211,8 @@ int mcu_write_dr(struct jtag_tap *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_l return ERROR_OK; } -int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti) +static int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, + uint8_t ir_out, int ir_len, int rti) { if (ir_len > 8) { @@ -276,7 +277,8 @@ int mcu_write_ir_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int return ERROR_OK; } -int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *dr_in, uint32_t dr_out, int dr_len, int rti) +static int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *dr_in, + uint32_t dr_out, int dr_len, int rti) { if (dr_len > 32) { diff --git a/src/target/avrt.h b/src/target/avrt.h index 221296a..221f924 100644 --- a/src/target/avrt.h +++ b/src/target/avrt.h @@ -32,4 +32,9 @@ struct avr_common struct mcu_jtag jtag_info; }; +int mcu_execute_queue(void); +int avr_jtag_sendinstr(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out); +int avr_jtag_senddat(struct jtag_tap *tap, uint32_t *dr_in, uint32_t dr_out, + int len); + #endif /* AVRT_H */ commit d26b5236bac524ca33799f2c10f40f65755bdd08 Author: Antonio Borneo <bor...@gm...> Date: Sun Jun 20 12:20:01 2010 +0800 target/feroceon: review scope of symbols Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/feroceon.c b/src/target/feroceon.c index efd3040..ea22ca0 100644 --- a/src/target/feroceon.c +++ b/src/target/feroceon.c @@ -59,7 +59,7 @@ #include "arm_opcodes.h" -int feroceon_assert_reset(struct target *target) +static int feroceon_assert_reset(struct target *target) { struct arm *armv4_5 = target->arch_info; struct arm7_9_common *arm7_9 = armv4_5->arch_info; @@ -72,7 +72,7 @@ int feroceon_assert_reset(struct target *target) return arm7_9_assert_reset(target); } -int feroceon_dummy_clock_out(struct arm_jtag *jtag_info, uint32_t instr) +static int feroceon_dummy_clock_out(struct arm_jtag *jtag_info, uint32_t instr) { struct scan_field fields[3]; uint8_t out_buf[4]; @@ -107,7 +107,8 @@ int feroceon_dummy_clock_out(struct arm_jtag *jtag_info, uint32_t instr) return ERROR_OK; } -void feroceon_change_to_arm(struct target *target, uint32_t *r0, uint32_t *pc) +static void feroceon_change_to_arm(struct target *target, uint32_t *r0, + uint32_t *pc) { struct arm *armv4_5 = target->arch_info; struct arm7_9_common *arm7_9 = armv4_5->arch_info; @@ -153,7 +154,8 @@ void feroceon_change_to_arm(struct target *target, uint32_t *r0, uint32_t *pc) *pc -= (12 + 4); } -void feroceon_read_core_regs(struct target *target, uint32_t mask, uint32_t* core_regs[16]) +static void feroceon_read_core_regs(struct target *target, + uint32_t mask, uint32_t* core_regs[16]) { int i; struct arm *armv4_5 = target->arch_info; @@ -172,7 +174,8 @@ void feroceon_read_core_regs(struct target *target, uint32_t mask, uint32_t* cor arm9tdmi_clock_out(jtag_info, ARMV4_5_NOP, 0, NULL, 0); } -void feroceon_read_core_regs_target_buffer(struct target *target, uint32_t mask, void* buffer, int size) +static void feroceon_read_core_regs_target_buffer(struct target *target, + uint32_t mask, void* buffer, int size) { int i; struct arm *armv4_5 = target->arch_info; @@ -209,7 +212,7 @@ void feroceon_read_core_regs_target_buffer(struct target *target, uint32_t mask, arm9tdmi_clock_out(jtag_info, ARMV4_5_NOP, 0, NULL, 0); } -void feroceon_read_xpsr(struct target *target, uint32_t *xpsr, int spsr) +static void feroceon_read_xpsr(struct target *target, uint32_t *xpsr, int spsr) { struct arm *armv4_5 = target->arch_info; struct arm7_9_common *arm7_9 = armv4_5->arch_info; @@ -232,7 +235,7 @@ void feroceon_read_xpsr(struct target *target, uint32_t *xpsr, int spsr) arm9tdmi_clock_out(jtag_info, ARMV4_5_NOP, 0, NULL, 0); } -void feroceon_write_xpsr(struct target *target, uint32_t xpsr, int spsr) +static void feroceon_write_xpsr(struct target *target, uint32_t xpsr, int spsr) { struct arm *armv4_5 = target->arch_info; struct arm7_9_common *arm7_9 = armv4_5->arch_info; @@ -273,7 +276,8 @@ void feroceon_write_xpsr(struct target *target, uint32_t xpsr, int spsr) arm9tdmi_clock_out(jtag_info, ARMV4_5_NOP, 0, NULL, 0); } -void feroceon_write_xpsr_im8(struct target *target, uint8_t xpsr_im, int rot, int spsr) +static void feroceon_write_xpsr_im8(struct target *target, + uint8_t xpsr_im, int rot, int spsr) { struct arm *armv4_5 = target->arch_info; struct arm7_9_common *arm7_9 = armv4_5->arch_info; @@ -290,7 +294,8 @@ void feroceon_write_xpsr_im8(struct target *target, uint8_t xpsr_im, int rot, in arm9tdmi_clock_out(jtag_info, ARMV4_5_NOP, 0, NULL, 0); } -void feroceon_write_core_regs(struct target *target, uint32_t mask, uint32_t core_regs[16]) +static void feroceon_write_core_regs(struct target *target, + uint32_t mask, uint32_t core_regs[16]) { int i; struct arm *armv4_5 = target->arch_info; @@ -310,7 +315,7 @@ void feroceon_write_core_regs(struct target *target, uint32_t mask, uint32_t cor arm9tdmi_clock_out(jtag_info, ARMV4_5_NOP, 0, NULL, 0); } -void feroceon_branch_resume(struct target *target) +static void feroceon_branch_resume(struct target *target) { struct arm *armv4_5 = target->arch_info; struct arm7_9_common *arm7_9 = armv4_5->arch_info; @@ -325,7 +330,7 @@ void feroceon_branch_resume(struct target *target) arm7_9->need_bypass_before_restart = 1; } -void feroceon_branch_resume_thumb(struct target *target) +static void feroceon_branch_resume_thumb(struct target *target) { LOG_DEBUG("-"); @@ -360,7 +365,8 @@ void feroceon_branch_resume_thumb(struct target *target) arm7_9->need_bypass_before_restart = 1; } -int feroceon_read_cp15(struct target *target, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value) +static int feroceon_read_cp15(struct target *target, uint32_t op1, + uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value) { struct arm *armv4_5 = target->arch_info; struct arm7_9_common *arm7_9 = armv4_5->arch_info; @@ -382,7 +388,8 @@ int feroceon_read_cp15(struct target *target, uint32_t op1, uint32_t op2, uint32 return jtag_execute_queue(); } -int feroceon_write_cp15(struct target *target, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t value) +static int feroceon_write_cp15(struct target *target, uint32_t op1, + uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t value) { struct arm *armv4_5 = target->arch_info; struct arm7_9_common *arm7_9 = armv4_5->arch_info; @@ -401,7 +408,7 @@ int feroceon_write_cp15(struct target *target, uint32_t op1, uint32_t op2, uint3 return arm7_9_execute_sys_speed(target); } -void feroceon_set_dbgrq(struct target *target) +static void feroceon_set_dbgrq(struct target *target) { struct arm *armv4_5 = target->arch_info; struct arm7_9_common *arm7_9 = armv4_5->arch_info; @@ -411,7 +418,7 @@ void feroceon_set_dbgrq(struct target *target) embeddedice_store_reg(dbg_ctrl); } -void feroceon_enable_single_step(struct target *target, uint32_t next_pc) +static void feroceon_enable_single_step(struct target *target, uint32_t next_pc) { struct arm *armv4_5 = target->arch_info; struct arm7_9_common *arm7_9 = armv4_5->arch_info; @@ -424,7 +431,7 @@ void feroceon_enable_single_step(struct target *target, uint32_t next_pc) embeddedice_write_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_MASK], 0xf7); } -void feroceon_disable_single_step(struct target *target) +static void feroceon_disable_single_step(struct target *target) { struct arm *armv4_5 = target->arch_info; struct arm7_9_common *arm7_9 = armv4_5->arch_info; @@ -436,7 +443,7 @@ void feroceon_disable_single_step(struct target *target) embeddedice_store_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_VALUE]); } -int feroceon_examine_debug_reason(struct target *target) +static int feroceon_examine_debug_reason(struct target *target) { /* the MOE is not implemented */ if (target->debug_reason != DBG_REASON_SINGLESTEP) @@ -447,7 +454,8 @@ int feroceon_examine_debug_reason(struct target *target) return ERROR_OK; } -int feroceon_bulk_write_memory(struct target *target, uint32_t address, uint32_t count, uint8_t *buffer) +static int feroceon_bulk_write_memory(struct target *target, + uint32_t address, uint32_t count, uint8_t *buffer) { int retval; struct arm *armv4_5 = target->arch_info; @@ -576,13 +584,14 @@ int feroceon_bulk_write_memory(struct target *target, uint32_t address, uint32_t return retval; } -int feroceon_init_target(struct command_context *cmd_ctx, struct target *target) +static int feroceon_init_target(struct command_context *cmd_ctx, + struct target *target) { arm9tdmi_init_target(cmd_ctx, target); return ERROR_OK; } -void feroceon_common_setup(struct target *target) +static void feroceon_common_setup(struct target *target) { struct arm *armv4_5 = target->arch_info; struct arm7_9_common *arm7_9 = armv4_5->arch_info; @@ -615,7 +624,7 @@ void feroceon_common_setup(struct target *target) arm7_9->wp1_used_default = -1; } -int feroceon_target_create(struct target *target, Jim_Interp *interp) +static int feroceon_target_create(struct target *target, Jim_Interp *interp) { struct arm926ejs_common *arm926ejs = calloc(1,sizeof(struct arm926ejs_common)); @@ -629,7 +638,7 @@ int feroceon_target_create(struct target *target, Jim_Interp *interp) return ERROR_OK; } -int dragonite_target_create(struct target *target, Jim_Interp *interp) +static int dragonite_target_create(struct target *target, Jim_Interp *interp) { struct arm966e_common *arm966e = calloc(1,sizeof(struct arm966e_common)); @@ -639,7 +648,7 @@ int dragonite_target_create(struct target *target, Jim_Interp *interp) return ERROR_OK; } -int feroceon_examine(struct target *target) +static int feroceon_examine(struct target *target) { struct arm *armv4_5; struct arm7_9_common *arm7_9; commit 3f59fcf77e5eb1d8c504a337b05bb1a5797e656f Author: Antonio Borneo <bor...@gm...> Date: Sun Jun 20 00:22:12 2010 +0800 target/mips_m4k: review scope of symbols Add "static" qualifier to private functions. Remove private prototypes from include file. Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c index e258b71..21ff0ba 100644 --- a/src/target/mips_m4k.c +++ b/src/target/mips_m4k.c @@ -32,7 +32,14 @@ #include "target_type.h" #include "register.h" -int mips_m4k_examine_debug_reason(struct target *target) +static void mips_m4k_enable_breakpoints(struct target *target); +static void mips_m4k_enable_watchpoints(struct target *target); +static int mips_m4k_set_breakpoint(struct target *target, + struct breakpoint *breakpoint); +static int mips_m4k_unset_breakpoint(struct target *target, + struct breakpoint *breakpoint); + +static int mips_m4k_examine_debug_reason(struct target *target) { uint32_t break_status; int retval; @@ -66,7 +73,7 @@ int mips_m4k_examine_debug_reason(struct target *target) return ERROR_OK; } -int mips_m4k_debug_entry(struct target *target) +static int mips_m4k_debug_entry(struct target *target) { struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; @@ -104,7 +111,7 @@ int mips_m4k_debug_entry(struct target *target) return ERROR_OK; } -int mips_m4k_poll(struct target *target) +static int mips_m4k_poll(struct target *target) { int retval; struct mips32_common *mips32 = target_to_mips32(target); @@ -162,7 +169,7 @@ int mips_m4k_poll(struct target *target) return ERROR_OK; } -int mips_m4k_halt(struct target *target) +static int mips_m4k_halt(struct target *target) { struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; @@ -207,7 +214,7 @@ int mips_m4k_halt(struct target *target) return ERROR_OK; } -int mips_m4k_assert_reset(struct target *target) +static int mips_m4k_assert_reset(struct target *target) { struct mips_m4k_common *mips_m4k = target_to_m4k(target); struct mips_ejtag *ejtag_info = &mips_m4k->mips32.ejtag_info; @@ -286,7 +293,7 @@ int mips_m4k_assert_reset(struct target *target) return ERROR_OK; } -int mips_m4k_deassert_reset(struct target *target) +static int mips_m4k_deassert_reset(struct target *target) { LOG_DEBUG("target->state: %s", target_state_name(target)); @@ -297,13 +304,13 @@ int mips_m4k_deassert_reset(struct target *target) return ERROR_OK; } -int mips_m4k_soft_reset_halt(struct target *target) +static int mips_m4k_soft_reset_halt(struct target *target) { /* TODO */ return ERROR_OK; } -int mips_m4k_single_step_core(struct target *target) +static int mips_m4k_single_step_core(struct target *target) { struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; @@ -322,7 +329,8 @@ int mips_m4k_single_step_core(struct target *target) return ERROR_OK; } -int mips_m4k_resume(struct target *target, int current, uint32_t address, int handle_breakpoints, int debug_execution) +static int mips_m4k_resume(struct target *target, int current, + uint32_t address, int handle_breakpoints, int debug_execution) { struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; @@ -397,7 +405,8 @@ int mips_m4k_resume(struct target *target, int current, uint32_t address, int ha return ERROR_OK; } -int mips_m4k_step(struct target *target, int current, uint32_t address, int handle_breakpoints) +static int mips_m4k_step(struct target *target, int current, + uint32_t address, int handle_breakpoints) { /* get pointers to arch-specific information */ struct mips32_common *mips32 = target_to_mips32(target); @@ -452,7 +461,7 @@ int mips_m4k_step(struct target *target, int current, uint32_t address, int hand return ERROR_OK; } -void mips_m4k_enable_breakpoints(struct target *target) +static void mips_m4k_enable_breakpoints(struct target *target) { struct breakpoint *breakpoint = target->breakpoints; @@ -465,7 +474,8 @@ void mips_m4k_enable_breakpoints(struct target *target) } } -int mips_m4k_set_breakpoint(struct target *target, struct breakpoint *breakpoint) +static int mips_m4k_set_breakpoint(struct target *target, + struct breakpoint *breakpoint) { struct mips32_common *mips32 = target_to_mips32(target); struct mips32_comparator * comparator_list = mips32->inst_break_list; @@ -557,7 +567,8 @@ int mips_m4k_set_breakpoint(struct target *target, struct breakpoint *breakpoint return ERROR_OK; } -int mips_m4k_unset_breakpoint(struct target *target, struct breakpoint *breakpoint) +static int mips_m4k_unset_breakpoint(struct target *target, + struct breakpoint *breakpoint) { /* get pointers to arch-specific information */ struct mips32_common *mips32 = target_to_mips32(target); @@ -636,7 +647,7 @@ int mips_m4k_unset_breakpoint(struct target *target, struct breakpoint *breakpoi return ERROR_OK; } -int mips_m4k_add_breakpoint(struct target *target, struct breakpoint *breakpoint) +static int mips_m4k_add_breakpoint(struct target *target, struct breakpoint *breakpoint) { struct mips32_common *mips32 = target_to_mips32(target); @@ -656,7 +667,8 @@ int mips_m4k_add_breakpoint(struct target *target, struct breakpoint *breakpoint return ERROR_OK; } -int mips_m4k_remove_breakpoint(struct target *target, struct breakpoint *breakpoint) +static int mips_m4k_remove_breakpoint(struct target *target, + struct breakpoint *breakpoint) { /* get pointers to arch-specific information */ struct mips32_common *mips32 = target_to_mips32(target); @@ -678,7 +690,8 @@ int mips_m4k_remove_breakpoint(struct target *target, struct breakpoint *breakpo return ERROR_OK; } -int mips_m4k_set_watchpoint(struct target *target, struct watchpoint *watchpoint) +static int mips_m4k_set_watchpoint(struct target *target, + struct watchpoint *watchpoint) { struct mips32_common *mips32 = target_to_mips32(target); struct mips32_comparator *comparator_list = mips32->data_break_list; @@ -745,7 +758,8 @@ int mips_m4k_set_watchpoint(struct target *target, struct watchpoint *watchpoint return ERROR_OK; } -int mips_m4k_unset_watchpoint(struct target *target, struct watchpoint *watchpoint) +static int mips_m4k_unset_watchpoint(struct target *target, + struct watchpoint *watchpoint) { /* get pointers to arch-specific information */ struct mips32_common *mips32 = target_to_mips32(target); @@ -771,7 +785,7 @@ int mips_m4k_unset_watchpoint(struct target *target, struct watchpoint *watchpoi return ERROR_OK; } -int mips_m4k_add_watchpoint(struct target *target, struct watchpoint *watchpoint) +static int mips_m4k_add_watchpoint(struct target *target, struct watchpoint *watchpoint) { struct mips32_common *mips32 = target_to_mips32(target); @@ -787,7 +801,8 @@ int mips_m4k_add_watchpoint(struct target *target, struct watchpoint *watchpoint return ERROR_OK; } -int mips_m4k_remove_watchpoint(struct target *target, struct watchpoint *watchpoint) +static int mips_m4k_remove_watchpoint(struct target *target, + struct watchpoint *watchpoint) { /* get pointers to arch-specific information */ struct mips32_common *mips32 = target_to_mips32(target); @@ -808,7 +823,7 @@ int mips_m4k_remove_watchpoint(struct target *target, struct watchpoint *watchpo return ERROR_OK; } -void mips_m4k_enable_watchpoints(struct target *target) +static void mips_m4k_enable_watchpoints(struct target *target) { struct watchpoint *watchpoint = target->watchpoints; @@ -821,7 +836,8 @@ void mips_m4k_enable_watchpoints(struct target *target) } } -int mips_m4k_read_memory(struct target *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer) +static int mips_m4k_read_memory(struct target *target, uint32_t address, + uint32_t size, uint32_t count, uint8_t *buffer) { struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; @@ -853,8 +869,8 @@ int mips_m4k_read_memory(struct target *target, uint32_t address, uint32_t size, return ERROR_OK; } -int mips_m4k_write_memory(struct target *target, uint32_t address, uint32_t size, - uint32_t count, uint8_t *buffer) +static int mips_m4k_write_memory(struct target *target, uint32_t address, + uint32_t size, uint32_t count, uint8_t *buffer) { struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; @@ -882,15 +898,16 @@ int mips_m4k_write_memory(struct target *target, uint32_t address, uint32_t size return mips32_dmaacc_write_mem(ejtag_info, address, size, count, (void *)buffer); } -int mips_m4k_init_target(struct command_context *cmd_ctx, struct target *target) +static int mips_m4k_init_target(struct command_context *cmd_ctx, + struct target *target) { mips32_build_reg_cache(target); return ERROR_OK; } -int mips_m4k_init_arch_info(struct target *target, struct mips_m4k_common *mips_m4k, - struct jtag_tap *tap) +static int mips_m4k_init_arch_info(struct target *target, + struct mips_m4k_common *mips_m4k, struct jtag_tap *tap) { struct mips32_common *mips32 = &mips_m4k->mips32; @@ -903,7 +920,7 @@ int mips_m4k_init_arch_info(struct target *target, struct mips_m4k_common *mips_ return ERROR_OK; } -int mips_m4k_target_create(struct target *target, Jim_Interp *interp) +static int mips_m4k_target_create(struct target *target, Jim_Interp *interp) { struct mips_m4k_common *mips_m4k = calloc(1, sizeof(struct mips_m4k_common)); @@ -912,7 +929,7 @@ int mips_m4k_target_create(struct target *target, Jim_Interp *interp) return ERROR_OK; } -int mips_m4k_examine(struct target *target) +static int mips_m4k_examine(struct target *target) { int retval; struct mips_m4k_common *mips_m4k = target_to_m4k(target); @@ -944,7 +961,7 @@ int mips_m4k_examine(struct target *target) return ERROR_OK; } -int mips_m4k_bulk_write_memory(struct target *target, uint32_t address, +static int mips_m4k_bulk_write_memory(struct target *target, uint32_t address, uint32_t count, uint8_t *buffer) { struct mips32_common *mips32 = target_to_mips32(target); diff --git a/src/target/mips_m4k.h b/src/target/mips_m4k.h index 5eb2029..bb37ee2 100644 --- a/src/target/mips_m4k.h +++ b/src/target/mips_m4k.h @@ -43,19 +43,4 @@ target_to_m4k(struct target *target) struct mips_m4k_common, mips32); } -int mips_m4k_bulk_write_memory(struct target *target, - uint32_t address, uint32_t count, uint8_t *buffer); - -void mips_m4k_enable_breakpoints(struct target *target); -int mips_m4k_set_breakpoint(struct target *target, struct breakpoint *bp); -int mips_m4k_unset_breakpoint(struct target *target, struct breakpoint *bp); -int mips_m4k_add_breakpoint(struct target *target, struct breakpoint *bp); -int mips_m4k_remove_breakpoint(struct target *target, struct breakpoint *bp); - -void mips_m4k_enable_watchpoints(struct target *target); -int mips_m4k_set_watchpoint(struct target *target, struct watchpoint *wp); -int mips_m4k_unset_watchpoint(struct target *target, struct watchpoint *wp); -int mips_m4k_add_watchpoint(struct target *target, struct watchpoint *wp); -int mips_m4k_remove_watchpoint(struct target *target, struct watchpoint *wp); - #endif /*MIPS_M4K_H*/ commit b978dcbbee628ed30286b90cecf7085eb2cb7a82 Author: Antonio Borneo <bor...@gm...> Date: Sat Jun 19 23:46:46 2010 +0800 helper/jim-eventloop.h: review unused definitions Remove unused typedef and define Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/helper/jim-eventloop.h b/src/helper/jim-eventloop.h index 77ee8fe..95c31d6 100644 --- a/src/helper/jim-eventloop.h +++ b/src/helper/jim-eventloop.h @@ -53,7 +53,6 @@ #define __JIM_EVENTLOOP_H__ typedef int Jim_FileProc(Jim_Interp *interp, void *clientData, int mask); -typedef int Jim_SignalProc(Jim_Interp *interp, void *clientData, void *msg); typedef void Jim_TimeProc(Jim_Interp *interp, void *clientData); typedef void Jim_EventFinalizerProc(Jim_Interp *interp, void *clientData); @@ -63,8 +62,6 @@ typedef void Jim_EventFinalizerProc(Jim_Interp *interp, void *clientData); #define JIM_EVENT_EXCEPTION 4 #define JIM_EVENT_FEOF 8 -#define JIM_API(x) x - int Jim_EventLoopOnLoad(Jim_Interp *interp); /* --- POSIX version of Jim_ProcessEvents, for now the only available --- */ @@ -73,16 +70,6 @@ int Jim_EventLoopOnLoad(Jim_Interp *interp); #define JIM_ALL_EVENTS (JIM_FILE_EVENTS | JIM_TIME_EVENTS) #define JIM_DONT_WAIT 4 -int JIM_API(Jim_ProcessEvents) (Jim_Interp *interp, int flags); - -#undef JIM_API - -#ifndef __JIM_EVENTLOOP_CORE__ - -#define JIM_GET_API(name) \ - Jim_GetApi(interp, "Jim_" #name, ((void *)&Jim_ ## name)) - -#undef JIM_GET_API -#endif /* __JIM_EVENTLOOP_CORE__ */ +int Jim_ProcessEvents(Jim_Interp *interp, int flags); #endif /* __JIM_EVENTLOOP_H__ */ commit 3cfbf705597732c7b6a5b11a556c818529ea725b Author: Antonio Borneo <bor...@gm...> Date: Sat Jun 19 23:37:33 2010 +0800 helper/jim-eventloop: review unused symbols Remove unused functions: - Jim_CreateSignalHandler - Jim_DeleteSignalHandler Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/helper/jim-eventloop.c b/src/helper/jim-eventloop.c index 23115fe..fe2d685 100644 --- a/src/helper/jim-eventloop.c +++ b/src/helper/jim-eventloop.c @@ -131,16 +131,6 @@ static void Jim_DeleteFileHandler(Jim_Interp *interp, void *handle) } } -// The same for signals. -void Jim_CreateSignalHandler(Jim_Interp *interp, int signum, - Jim_FileProc *proc, void *clientData, - Jim_EventFinalizerProc *finalizerProc) -{ -} -void Jim_DeleteSignalHandler(Jim_Interp *interp, int signum) -{ -} - /* That's another part of this extension that needs to be ported * to WIN32. */ static void JimGetTime(long *seconds, long *milliseconds) commit ec073e89435785375dece2fb7c4664002c22859c Author: Antonio Borneo <bor...@gm...> Date: Sat Jun 19 23:34:05 2010 +0800 helper/jim-eventloop: review scope of symbols Add "static" qualifier to private functions. Remove private prototypes from include file. Remove empty definition of JIM_STATIC. Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/helper/jim-eventloop.c b/src/helper/jim-eventloop.c index fae46e8..23115fe 100644 --- a/src/helper/jim-eventloop.c +++ b/src/helper/jim-eventloop.c @@ -90,7 +90,7 @@ typedef struct Jim_EventLoop { Jim_TimeEvent *timeEventHead; } Jim_EventLoop; -void Jim_CreateFileHandler(Jim_Interp *interp, void *handle, int mask, +static void Jim_CreateFileHandler(Jim_Interp *interp, void *handle, int mask, Jim_FileProc *proc, void *clientData, Jim_EventFinalizerProc *finalizerProc) { @@ -109,7 +109,7 @@ void Jim_CreateFileHandler(Jim_Interp *interp, void *handle, int mask, // fprintf(stderr,"raus\n"); } -void Jim_DeleteFileHandler(Jim_Interp *interp, void *handle) +static void Jim_DeleteFileHandler(Jim_Interp *interp, void *handle) { Jim_FileEvent *fe, *prev = NULL; Jim_EventLoop *eventLoop = Jim_GetAssocData(interp, "eventloop"); @@ -152,7 +152,7 @@ static void JimGetTime(long *seconds, long *milliseconds) *milliseconds = tv.tv_usec/1000; } -jim_wide Jim_CreateTimeHandler(Jim_Interp *interp, jim_wide milliseconds, +static jim_wide Jim_CreateTimeHandler(Jim_Interp *interp, jim_wide milliseconds, Jim_TimeProc *proc, void *clientData, Jim_EventFinalizerProc *finalizerProc) { @@ -181,7 +181,7 @@ jim_wide Jim_CreateTimeHandler(Jim_Interp *interp, jim_wide milliseconds, return id; } -jim_wide Jim_DeleteTimeHandler(Jim_Interp *interp, jim_wide id) +static jim_wide Jim_DeleteTimeHandler(Jim_Interp *interp, jim_wide id) { Jim_TimeEvent *te, *prev = NULL; Jim_EventLoop *eventLoop = Jim_GetAssocData(interp, "eventloop"); @@ -391,7 +391,7 @@ int Jim_ProcessEvents(Jim_Interp *interp, int flags) } /* ---------------------------------------------------------------------- */ -void JimELAssocDataDeleProc(Jim_Interp *interp, void *data) +static void JimELAssocDataDeleProc(Jim_Interp *interp, void *data) { void *next; Jim_FileEvent *fe; @@ -446,14 +446,14 @@ static int JimELVwaitCommand(Jim_Interp *interp, int argc, return JIM_OK; } -void JimAfterTimeHandler(Jim_Interp *interp, void *clientData) +static void JimAfterTimeHandler(Jim_Interp *interp, void *clientData) { Jim_Obj *objPtr = clientData; Jim_EvalObjBackground(interp, objPtr); } -void JimAfterTimeEventFinalizer(Jim_Interp *interp, void *clientData) +static void JimAfterTimeEventFinalizer(Jim_Interp *interp, void *clientData) { Jim_Obj *objPtr = clientData; diff --git a/src/helper/jim-eventloop.h b/src/helper/jim-eventloop.h index ddb6fc9..77ee8fe 100644 --- a/src/helper/jim-eventloop.h +++ b/src/helper/jim-eventloop.h @@ -64,9 +64,8 @@ typedef void Jim_EventFinalizerProc(Jim_Interp *interp, void *clientData); #define JIM_EVENT_FEOF 8 #define JIM_API(x) x -#define JIM_STATIC -JIM_STATIC int Jim_EventLoopOnLoad(Jim_Interp *interp); +int Jim_EventLoopOnLoad(Jim_Interp *interp); /* --- POSIX version of Jim_ProcessEvents, for now the only available --- */ #define JIM_FILE_EVENTS 1 @@ -74,20 +73,8 @@ JIM_STATIC int Jim_EventLoopOnLoad(Jim_Interp *interp); #define JIM_ALL_EVENTS (JIM_FILE_EVENTS | JIM_TIME_EVENTS) #define JIM_DONT_WAIT 4 -JIM_STATIC void JIM_API(Jim_CreateFileHandler) (Jim_Interp *interp, - void *handle, int mask, - Jim_FileProc *proc, void *clientData, - Jim_EventFinalizerProc *finalizerProc); -JIM_STATIC void JIM_API(Jim_DeleteFileHandler) (Jim_Interp *interp, - void *handle); -JIM_STATIC jim_wide JIM_API(Jim_CreateTimeHandler) (Jim_Interp *interp, - jim_wide milliseconds, - Jim_TimeProc *proc, void *clientData, - Jim_EventFinalizerProc *finalizerProc); -JIM_STATIC jim_wide JIM_API(Jim_DeleteTimeHandler) (Jim_Interp *interp, jim_wide id); -JIM_STATIC int JIM_API(Jim_ProcessEvents) (Jim_Interp *interp, int flags); +int JIM_API(Jim_ProcessEvents) (Jim_Interp *interp, int flags); -#undef JIM_STATIC #undef JIM_API #ifndef __JIM_EVENTLOOP_CORE__ ----------------------------------------------------------------------- Summary of changes: src/flash/nand/mx2.c | 2 +- src/flash/nor/avrf.c | 13 ----- src/flash/nor/str7x.c | 2 +- src/flash/nor/virtual.c | 4 +- src/helper/jim-eventloop.c | 24 +++------ src/helper/jim-eventloop.h | 30 +---------- src/openocd.c | 2 +- src/target/avrt.c | 124 ++++++++++++------------------------------- src/target/avrt.h | 5 ++ src/target/feroceon.c | 55 +++++++++++-------- src/target/mips_m4k.c | 75 ++++++++++++++++---------- src/target/mips_m4k.h | 15 ----- 12 files changed, 132 insertions(+), 219 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-21 15:03:31
|
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 2fbb0b5972b04e10090e39137817e9f359fb6105 (commit) via dcba0709580cd8b0d2869894d2f7e22195b7e3d7 (commit) from 7013b960feeb0d4ab3aeae40d5ac17dda6d79a3a (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 2fbb0b5972b04e10090e39137817e9f359fb6105 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jun 21 13:32:16 2010 +0200 jtag: retire jtag_get_error() This fn is an implementation detail of jtag_execute_queue() that is not to be exposed externally. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/jtag/core.c b/src/jtag/core.c index 65ca824..782f10f 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -52,9 +52,9 @@ static void jtag_add_scan_check(struct jtag_tap *active, * when an error occurs during processing that should be reported during * jtag_execute_queue(). * - * Tts value may be checked with jtag_get_error() and cleared with - * jtag_error_clear(). This value is returned (and cleared) by - * jtag_execute_queue(). + * The value is set and cleared, but never read by normal application code. + * + * This value is returned (and cleared) by jtag_execute_queue(). */ static int jtag_error = ERROR_OK; @@ -131,10 +131,7 @@ void jtag_set_error(int error) return; jtag_error = error; } -int jtag_get_error(void) -{ - return jtag_error; -} + int jtag_error_clear(void) { int temp = jtag_error; diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h index cdc02ab..97ceb01 100644 --- a/src/jtag/jtag.h +++ b/src/jtag/jtag.h @@ -661,8 +661,6 @@ void jtag_sleep(uint32_t us); * called with a non-zero error code. */ void jtag_set_error(int error); -/// @returns The current value of jtag_error -int jtag_get_error(void); /** * Resets jtag_error to ERROR_OK, returning its previous value. * @returns The previous value of @c jtag_error. commit dcba0709580cd8b0d2869894d2f7e22195b7e3d7 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jun 21 13:25:06 2010 +0200 jtag: do not use jtag_get_error() normal code should not call jtag_get_error(), but rather check the return code from jtag_execute_queue(). Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/adi_v5_jtag.c b/src/target/adi_v5_jtag.c index 44f624f..0a374be 100644 --- a/src/target/adi_v5_jtag.c +++ b/src/target/adi_v5_jtag.c @@ -120,7 +120,7 @@ int adi_jtag_dp_scan(struct adiv5_dap *dap, jtag_add_runtest(dap->memaccess_tck, TAP_IDLE); - return jtag_get_error(); + return ERROR_OK; } /** @@ -343,14 +343,11 @@ static int jtag_idcode_q_read(struct adiv5_dap *dap, fields[0].in_value = (void *) data; jtag_add_dr_scan(jtag_info->tap, 1, fields, TAP_IDLE); - retval = jtag_get_error(); - if (retval != ERROR_OK) - return retval; jtag_add_callback(arm_le_to_h_u32, (jtag_callback_data_t) data); - return retval; + return ERROR_OK; } static int jtag_dp_q_read(struct adiv5_dap *dap, unsigned reg, diff --git a/src/xsvf/xsvf.c b/src/xsvf/xsvf.c index 51d0e7b..f4d09ff 100644 --- a/src/xsvf/xsvf.c +++ b/src/xsvf/xsvf.c @@ -331,7 +331,7 @@ COMMAND_HANDLER(handle_xsvf_command) else jtag_add_pathmove(pathlen, path); - result = jtag_get_error(); + result = jtag_execute_queue(); if (result != ERROR_OK) { LOG_ERROR("XSVF: pathmove error %d", result); ----------------------------------------------------------------------- Summary of changes: src/jtag/core.c | 11 ++++------- src/jtag/jtag.h | 2 -- src/target/adi_v5_jtag.c | 7 ++----- src/xsvf/xsvf.c | 2 +- 4 files changed, 7 insertions(+), 15 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-21 10:49:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 7013b960feeb0d4ab3aeae40d5ac17dda6d79a3a (commit) via 8d1dcb9bcde55ff29c1967d86c5f8985620df923 (commit) from acee9d1c65bd97bbd5aa2b633e2455e87edbe836 (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 7013b960feeb0d4ab3aeae40d5ac17dda6d79a3a Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jun 21 09:02:53 2010 +0200 adi_v5_jtag: add missing error handling Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/adi_v5_jtag.c b/src/target/adi_v5_jtag.c index b368708..44f624f 100644 --- a/src/target/adi_v5_jtag.c +++ b/src/target/adi_v5_jtag.c @@ -259,7 +259,11 @@ static int jtagdp_transaction_endcheck(struct adiv5_dap *dap) LOG_DEBUG("jtag-dp: CTRL/STAT error, 0x%" PRIx32, ctrlstat); /* Check power to debug regions */ if ((ctrlstat & 0xf0000000) != 0xf0000000) - ahbap_debugport_init(dap); + { + retval = ahbap_debugport_init(dap); + if (retval != ERROR_OK) + return retval; + } else { uint32_t mem_ap_csw, mem_ap_tar; commit 8d1dcb9bcde55ff29c1967d86c5f8985620df923 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jun 21 09:02:02 2010 +0200 cortex a8: add missing error handling cortex examine was missing error handling. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index cfec48b..933b42e 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -1523,8 +1523,14 @@ static int cortex_a8_examine_first(struct target *target) /* We do one extra read to ensure DAP is configured, * we call ahbap_debugport_init(swjdp) instead */ - ahbap_debugport_init(swjdp); - mem_ap_read_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_CPUID, &cpuid); + retval = ahbap_debugport_init(swjdp); + if (retval != ERROR_OK) + return retval; + + retval = mem_ap_read_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_CPUID, &cpuid); + if (retval != ERROR_OK) + return retval; + if ((retval = mem_ap_read_atomic_u32(swjdp, armv7a->debug_base + CPUDBG_CPUID, &cpuid)) != ERROR_OK) { @@ -1559,7 +1565,9 @@ static int cortex_a8_examine_first(struct target *target) LOG_DEBUG("didr = 0x%08" PRIx32, didr); armv7a->armv4_5_common.core_type = ARM_MODE_MON; - cortex_a8_dpm_setup(cortex_a8, didr); + retval = cortex_a8_dpm_setup(cortex_a8, didr); + if (retval != ERROR_OK) + return retval; /* Setup Breakpoint Register Pairs */ cortex_a8->brp_num = ((didr >> 24) & 0x0F) + 1; ----------------------------------------------------------------------- Summary of changes: src/target/adi_v5_jtag.c | 6 +++++- src/target/cortex_a8.c | 14 +++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-19 11:37:52
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via acee9d1c65bd97bbd5aa2b633e2455e87edbe836 (commit) from 2a25c968bf4ffec39ee76da0a164e46bd4215134 (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 acee9d1c65bd97bbd5aa2b633e2455e87edbe836 Author: Andreas Fritiofson <and...@gm...> Date: Sat Jun 19 11:12:12 2010 +0200 arm-jtag-ew: -Wshadow fix declaration of âindexâ shadows a global declaration in /usr/include/string.h Signed-off-by: Andreas Fritiofson <and...@gm...> diff --git a/src/jtag/drivers/arm-jtag-ew.c b/src/jtag/drivers/arm-jtag-ew.c index 7a6c178..72c756e 100644 --- a/src/jtag/drivers/arm-jtag-ew.c +++ b/src/jtag/drivers/arm-jtag-ew.c @@ -568,29 +568,29 @@ static void armjtagew_tap_ensure_space(int scans, int bits) static void armjtagew_tap_append_step(int tms, int tdi) { last_tms = tms; - int index = tap_length / 8; + int index_local = tap_length / 8; - if (index < ARMJTAGEW_TAP_BUFFER_SIZE) + if (index_local < ARMJTAGEW_TAP_BUFFER_SIZE) { int bit_index = tap_length % 8; uint8_t bit = 1 << bit_index; if (tms) { - tms_buffer[index] |= bit; + tms_buffer[index_local] |= bit; } else { - tms_buffer[index] &= ~bit; + tms_buffer[index_local] &= ~bit; } if (tdi) { - tdi_buffer[index] |= bit; + tdi_buffer[index_local] |= bit; } else { - tdi_buffer[index] &= ~bit; + tdi_buffer[index_local] &= ~bit; } tap_length++; ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/arm-jtag-ew.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-19 09:27:52
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 2a25c968bf4ffec39ee76da0a164e46bd4215134 (commit) from b8f8d756a255936ccfb60ac3dda076e4e06108a6 (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 2a25c968bf4ffec39ee76da0a164e46bd4215134 Author: Ãyvind Harboe <oyv...@zy...> Date: Fri Jun 18 15:35:52 2010 +0200 cortex a8: fix segfault for unexamined targets print error message instead of segfaulting for unexamined targets. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index 4ee36ff..92469eb 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -232,6 +232,7 @@ struct dap_ops { static inline int dap_queue_idcode_read(struct adiv5_dap *dap, uint8_t *ack, uint32_t *data) { + assert(dap->ops != NULL); return dap->ops->queue_idcode_read(dap, ack, data); } @@ -250,6 +251,7 @@ static inline int dap_queue_idcode_read(struct adiv5_dap *dap, static inline int dap_queue_dp_read(struct adiv5_dap *dap, unsigned reg, uint32_t *data) { + assert(dap->ops != NULL); return dap->ops->queue_dp_read(dap, reg, data); } @@ -267,6 +269,7 @@ static inline int dap_queue_dp_read(struct adiv5_dap *dap, static inline int dap_queue_dp_write(struct adiv5_dap *dap, unsigned reg, uint32_t data) { + assert(dap->ops != NULL); return dap->ops->queue_dp_write(dap, reg, data); } @@ -283,6 +286,7 @@ static inline int dap_queue_dp_write(struct adiv5_dap *dap, static inline int dap_queue_ap_read(struct adiv5_dap *dap, unsigned reg, uint32_t *data) { + assert(dap->ops != NULL); return dap->ops->queue_ap_read(dap, reg, data); } @@ -298,6 +302,7 @@ static inline int dap_queue_ap_read(struct adiv5_dap *dap, static inline int dap_queue_ap_write(struct adiv5_dap *dap, unsigned reg, uint32_t data) { + assert(dap->ops != NULL); return dap->ops->queue_ap_write(dap, reg, data); } @@ -314,6 +319,7 @@ static inline int dap_queue_ap_write(struct adiv5_dap *dap, */ static inline int dap_queue_ap_abort(struct adiv5_dap *dap, uint8_t *ack) { + assert(dap->ops != NULL); return dap->ops->queue_ap_abort(dap, ack); } @@ -329,6 +335,7 @@ static inline int dap_queue_ap_abort(struct adiv5_dap *dap, uint8_t *ack) */ static inline int dap_run(struct adiv5_dap *dap) { + assert(dap->ops != NULL); return dap->ops->run(dap); } diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 0b12abe..cfec48b 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -1839,10 +1839,13 @@ COMMAND_HANDLER(cortex_a8_handle_cache_info_command) COMMAND_HANDLER(cortex_a8_handle_dbginit_command) { struct target *target = get_current_target(CMD_CTX); + if (!target_was_examined(target)) + { + LOG_ERROR("target not examined yet"); + return ERROR_FAIL; + } - cortex_a8_init_debug_access(target); - - return ERROR_OK; + return cortex_a8_init_debug_access(target); } static const struct command_registration cortex_a8_exec_command_handlers[] = { ----------------------------------------------------------------------- Summary of changes: src/target/arm_adi_v5.h | 7 +++++++ src/target/cortex_a8.c | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-18 10:03:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via b8f8d756a255936ccfb60ac3dda076e4e06108a6 (commit) via 2319caff7d9ddf27311a9d592f6d143d71cd5602 (commit) from 3f9d377ce788365844f9225064cb9b0f0b4542ef (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 b8f8d756a255936ccfb60ac3dda076e4e06108a6 Author: Antonio Borneo <bor...@gm...> Date: Fri Jun 18 14:30:26 2010 +0800 target/dsp563xx: review unused symbols Remove unused functions: - dsp563xx_jtag_senddat - dsp563xx_write_ir_u16 - dsp563xx_write_dr_u16 - dsp563xx_write_ir_u32 Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/dsp563xx.c b/src/target/dsp563xx.c index 48e559e..a454c76 100644 --- a/src/target/dsp563xx.c +++ b/src/target/dsp563xx.c @@ -51,8 +51,6 @@ static int dsp563xx_write_ir_u8(struct jtag_tap *tap, uint8_t * ir_in, uint8_t i /* IR and DR functions */ static int dsp563xx_jtag_sendinstr(struct jtag_tap *tap, uint8_t * ir_in, uint8_t ir_out); -int dsp563xx_jtag_senddat(struct jtag_tap *tap, uint32_t * dr_in, uint32_t dr_out, - int len); #define ASM_REG_R_R0 0x607000 #define ASM_REG_R_R1 0x617000 @@ -819,12 +817,6 @@ static int dsp563xx_write_memory_p(struct target *target, uint32_t address, uint return ERROR_OK; } -int dsp563xx_jtag_senddat(struct jtag_tap *tap, uint32_t * dr_in, uint32_t dr_out, - int len) -{ - return dsp563xx_write_dr_u32(tap, dr_in, dr_out, len, 1); -} - static int dsp563xx_jtag_sendinstr(struct jtag_tap *tap, uint8_t * ir_in, uint8_t ir_out) { return dsp563xx_write_ir_u8(tap, ir_in, ir_out, DSP563XX_JTAG_INS_LEN, 1); @@ -896,48 +888,6 @@ int dsp563xx_write_dr_u8(struct jtag_tap *tap, uint8_t * dr_in, uint8_t dr_out, return ERROR_OK; } -int dsp563xx_write_ir_u16(struct jtag_tap *tap, uint16_t * ir_in, uint16_t ir_out, - int ir_len, int rti) -{ - if (ir_len > 16) - { - LOG_ERROR("ir_len overflow, maxium is 16"); - return ERROR_FAIL; - } - - dsp563xx_write_ir(tap, (uint8_t *) ir_in, (uint8_t *) & ir_out, ir_len, rti); - - return ERROR_OK; -} - -int dsp563xx_write_dr_u16(struct jtag_tap *tap, uint16_t * dr_in, uint16_t dr_out, - int dr_len, int rti) -{ - if (dr_len > 16) - { - LOG_ERROR("dr_len overflow, maxium is 16"); - return ERROR_FAIL; - } - - dsp563xx_write_dr(tap, (uint8_t *) dr_in, (uint8_t *) & dr_out, dr_len, rti); - - return ERROR_OK; -} - -int dsp563xx_write_ir_u32(struct jtag_tap *tap, uint32_t * ir_in, uint32_t ir_out, - int ir_len, int rti) -{ - if (ir_len > 32) - { - LOG_ERROR("ir_len overflow, maxium is 32"); - return ERROR_FAIL; - } - - dsp563xx_write_ir(tap, (uint8_t *) ir_in, (uint8_t *) & ir_out, ir_len, rti); - - return ERROR_OK; -} - int dsp563xx_write_dr_u32(struct jtag_tap *tap, uint32_t * dr_in, uint32_t dr_out, int dr_len, int rti) { diff --git a/src/target/dsp563xx.h b/src/target/dsp563xx.h index 3258faa..f8070fa 100644 --- a/src/target/dsp563xx.h +++ b/src/target/dsp563xx.h @@ -68,12 +68,6 @@ static inline struct dsp563xx_common *target_to_dsp563xx(struct target *target) int dsp563xx_write_dr_u8(struct jtag_tap *tap, uint8_t * ir_in, uint8_t ir_out, int dr_len, int rti); -int dsp563xx_write_ir_u16(struct jtag_tap *tap, uint16_t * ir_in, uint16_t ir_out, - int ir_len, int rti); -int dsp563xx_write_dr_u16(struct jtag_tap *tap, uint16_t * ir_in, uint16_t ir_out, - int dr_len, int rti); -int dsp563xx_write_ir_u32(struct jtag_tap *tap, uint32_t * ir_in, uint32_t ir_out, - int ir_len, int rti); int dsp563xx_write_dr_u32(struct jtag_tap *tap, uint32_t * ir_in, uint32_t ir_out, int dr_len, int rti); commit 2319caff7d9ddf27311a9d592f6d143d71cd5602 Author: Antonio Borneo <bor...@gm...> Date: Fri Jun 18 14:28:01 2010 +0800 target/dsp563xx: review scope of symbols Add "static" qualifier to private functions. Remove private prototypes from include file. Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/dsp563xx.c b/src/target/dsp563xx.c index b42e7b3..48e559e 100644 --- a/src/target/dsp563xx.c +++ b/src/target/dsp563xx.c @@ -46,31 +46,14 @@ #define JTAG_INSTR_BYPASS 0x0F /* forward declarations */ -int dsp563xx_target_create(struct target *target, Jim_Interp * interp); -int dsp563xx_init_target(struct command_context *cmd_ctx, struct target *target); - -int dsp563xx_arch_state(struct target *target); -int dsp563xx_poll(struct target *target); -int dsp563xx_halt(struct target *target); -int dsp563xx_resume(struct target *target, int current, uint32_t address, - int handle_breakpoints, int debug_execution); -int dsp563xx_step(struct target *target, int current, uint32_t address, - int handle_breakpoints); - -int dsp563xx_assert_reset(struct target *target); -int dsp563xx_deassert_reset(struct target *target); -int dsp563xx_soft_reset_halt(struct target *target); +static int dsp563xx_write_ir_u8(struct jtag_tap *tap, uint8_t * ir_in, uint8_t ir_out, + int ir_len, int rti); /* IR and DR functions */ -int dsp563xx_jtag_sendinstr(struct jtag_tap *tap, uint8_t * ir_in, uint8_t ir_out); +static int dsp563xx_jtag_sendinstr(struct jtag_tap *tap, uint8_t * ir_in, uint8_t ir_out); int dsp563xx_jtag_senddat(struct jtag_tap *tap, uint32_t * dr_in, uint32_t dr_out, int len); -int dsp563xx_read_memory_p(struct target *target, uint32_t address, uint32_t size, - uint32_t count, uint8_t * buffer); -int dsp563xx_write_memory_p(struct target *target, uint32_t address, uint32_t size, - uint32_t count, uint8_t * buffer); - #define ASM_REG_R_R0 0x607000 #define ASM_REG_R_R1 0x617000 #define ASM_REG_R_R2 0x627000 @@ -269,7 +252,7 @@ static int dsp563xx_get_gdb_reg_list(struct target *target, struct reg **reg_lis } -int dsp563xx_read_core_reg(struct target *target, int num) +static int dsp563xx_read_core_reg(struct target *target, int num) { uint32_t reg_value; struct dsp563xx_core_reg *dsp563xx_core_reg; @@ -287,7 +270,7 @@ int dsp563xx_read_core_reg(struct target *target, int num) return ERROR_OK; } -int dsp563xx_write_core_reg(struct target *target, int num) +static int dsp563xx_write_core_reg(struct target *target, int num) { uint32_t reg_value; struct dsp563xx_core_reg *dsp563xx_core_reg; @@ -305,7 +288,7 @@ int dsp563xx_write_core_reg(struct target *target, int num) return ERROR_OK; } -int dsp563xx_target_create(struct target *target, Jim_Interp * interp) +static int dsp563xx_target_create(struct target *target, Jim_Interp * interp) { struct dsp563xx_common *dsp563xx = calloc(1, sizeof(struct dsp563xx_common)); @@ -317,7 +300,7 @@ int dsp563xx_target_create(struct target *target, Jim_Interp * interp) return ERROR_OK; } -int dsp563xx_get_core_reg(struct reg *reg) +static int dsp563xx_get_core_reg(struct reg *reg) { int retval = 0; @@ -337,7 +320,7 @@ int dsp563xx_get_core_reg(struct reg *reg) return retval; } -int dsp563xx_set_core_reg(struct reg *reg, uint8_t * buf) +static int dsp563xx_set_core_reg(struct reg *reg, uint8_t * buf) { LOG_DEBUG("%s", __FUNCTION__); @@ -357,7 +340,7 @@ int dsp563xx_set_core_reg(struct reg *reg, uint8_t * buf) return ERROR_OK; } -int dsp563xx_save_context(struct target *target) +static int dsp563xx_save_context(struct target *target) { int i; uint32_t data = 0; @@ -388,7 +371,7 @@ int dsp563xx_save_context(struct target *target) return ERROR_OK; } -int dsp563xx_restore_context(struct target *target) +static int dsp563xx_restore_context(struct target *target) { int i; struct dsp563xx_common *dsp563xx = target_to_dsp563xx(target); @@ -416,7 +399,7 @@ static const struct reg_arch_type dsp563xx_reg_type = { .set = dsp563xx_set_core_reg, }; -int dsp563xx_init_target(struct command_context *cmd_ctx, struct target *target) +static int dsp563xx_init_target(struct command_context *cmd_ctx, struct target *target) { /* get pointers to arch-specific information */ struct dsp563xx_common *dsp563xx = target_to_dsp563xx(target); @@ -459,13 +442,13 @@ int dsp563xx_init_target(struct command_context *cmd_ctx, struct target *target) return ERROR_OK; } -int dsp563xx_arch_state(struct target *target) +static int dsp563xx_arch_state(struct target *target) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } -int dsp563xx_jtag_status(struct target *target, uint8_t * status) +static int dsp563xx_jtag_status(struct target *target, uint8_t * status) { uint8_t ir_in; @@ -479,7 +462,7 @@ int dsp563xx_jtag_status(struct target *target, uint8_t * status) return ERROR_OK; } -int dsp563xx_jtag_debug_request(struct target *target) +static int dsp563xx_jtag_debug_request(struct target *target) { uint8_t ir_in = 0; uint32_t retry = 0; @@ -506,7 +489,7 @@ int dsp563xx_jtag_debug_request(struct target *target) return ERROR_OK; } -int dsp563xx_poll(struct target *target) +static int dsp563xx_poll(struct target *target) { uint8_t jtag_status; uint32_t once_status; @@ -537,7 +520,7 @@ int dsp563xx_poll(struct target *target) return ERROR_OK; } -int dsp563xx_halt(struct target *target) +static int dsp563xx_halt(struct target *target) { uint8_t jtag_status; uint32_t once_status; @@ -582,7 +565,7 @@ int dsp563xx_halt(struct target *target) #define DSP563XX_ASM_CMD_JUMP 0x0AF080 -int dsp563xx_resume(struct target *target, int current, uint32_t address, +static int dsp563xx_resume(struct target *target, int current, uint32_t address, int handle_breakpoints, int debug_execution) { struct dsp563xx_common *dsp563xx = target_to_dsp563xx(target); @@ -616,7 +599,7 @@ int dsp563xx_resume(struct target *target, int current, uint32_t address, return ERROR_OK; } -int dsp563xx_step(struct target *target, int current, uint32_t address, +static int dsp563xx_step(struct target *target, int current, uint32_t address, int handle_breakpoints) { uint32_t once_status; @@ -708,7 +691,7 @@ int dsp563xx_step(struct target *target, int current, uint32_t address, return ERROR_OK; } -int dsp563xx_assert_reset(struct target *target) +static int dsp563xx_assert_reset(struct target *target) { target->state = TARGET_RESET; @@ -716,7 +699,7 @@ int dsp563xx_assert_reset(struct target *target) return ERROR_OK; } -int dsp563xx_deassert_reset(struct target *target) +static int dsp563xx_deassert_reset(struct target *target) { target->state = TARGET_RUNNING; @@ -724,7 +707,7 @@ int dsp563xx_deassert_reset(struct target *target) return ERROR_OK; } -int dsp563xx_soft_reset_halt(struct target *target) +static int dsp563xx_soft_reset_halt(struct target *target) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; @@ -752,7 +735,7 @@ int dsp563xx_soft_reset_halt(struct target *target) * 076190 movem r0,p:(r1) * */ -int dsp563xx_read_memory_p(struct target *target, uint32_t address, +static int dsp563xx_read_memory_p(struct target *target, uint32_t address, uint32_t size, uint32_t count, uint8_t * buffer) { uint32_t i, x; @@ -793,7 +776,7 @@ int dsp563xx_read_memory_p(struct target *target, uint32_t address, return ERROR_OK; } -int dsp563xx_write_memory_p(struct target *target, uint32_t address, uint32_t size, +static int dsp563xx_write_memory_p(struct target *target, uint32_t address, uint32_t size, uint32_t count, uint8_t * buffer) { uint32_t i, x; @@ -842,13 +825,13 @@ int dsp563xx_jtag_senddat(struct jtag_tap *tap, uint32_t * dr_in, uint32_t dr_ou return dsp563xx_write_dr_u32(tap, dr_in, dr_out, len, 1); } -int dsp563xx_jtag_sendinstr(struct jtag_tap *tap, uint8_t * ir_in, uint8_t ir_out) +static int dsp563xx_jtag_sendinstr(struct jtag_tap *tap, uint8_t * ir_in, uint8_t ir_out) { return dsp563xx_write_ir_u8(tap, ir_in, ir_out, DSP563XX_JTAG_INS_LEN, 1); } /* IR and DR functions */ -int dsp563xx_write_ir(struct jtag_tap *tap, uint8_t * ir_in, uint8_t * ir_out, +static int dsp563xx_write_ir(struct jtag_tap *tap, uint8_t * ir_in, uint8_t * ir_out, int ir_len, int rti) { if (NULL == tap) @@ -869,7 +852,7 @@ int dsp563xx_write_ir(struct jtag_tap *tap, uint8_t * ir_in, uint8_t * ir_out, return ERROR_OK; } -int dsp563xx_write_dr(struct jtag_tap *tap, uint8_t * dr_in, uint8_t * dr_out, +static int dsp563xx_write_dr(struct jtag_tap *tap, uint8_t * dr_in, uint8_t * dr_out, int dr_len, int rti) { if (NULL == tap) @@ -885,7 +868,7 @@ int dsp563xx_write_dr(struct jtag_tap *tap, uint8_t * dr_in, uint8_t * dr_out, return ERROR_OK; } -int dsp563xx_write_ir_u8(struct jtag_tap *tap, uint8_t * ir_in, uint8_t ir_out, +static int dsp563xx_write_ir_u8(struct jtag_tap *tap, uint8_t * ir_in, uint8_t ir_out, int ir_len, int rti) { if (ir_len > 8) diff --git a/src/target/dsp563xx.h b/src/target/dsp563xx.h index 73050b6..3258faa 100644 --- a/src/target/dsp563xx.h +++ b/src/target/dsp563xx.h @@ -66,12 +66,6 @@ static inline struct dsp563xx_common *target_to_dsp563xx(struct target *target) return target->arch_info; } -int dsp563xx_write_ir(struct jtag_tap *tap, uint8_t * ir_in, uint8_t * ir_out, - int ir_len, int rti); -int dsp563xx_write_dr(struct jtag_tap *tap, uint8_t * dr_in, uint8_t * dr_out, - int dr_len, int rti); -int dsp563xx_write_ir_u8(struct jtag_tap *tap, uint8_t * ir_in, uint8_t ir_out, - int ir_len, int rti); int dsp563xx_write_dr_u8(struct jtag_tap *tap, uint8_t * ir_in, uint8_t ir_out, int dr_len, int rti); int dsp563xx_write_ir_u16(struct jtag_tap *tap, uint16_t * ir_in, uint16_t ir_out, ----------------------------------------------------------------------- Summary of changes: src/target/dsp563xx.c | 121 +++++++++++-------------------------------------- src/target/dsp563xx.h | 12 ----- 2 files changed, 27 insertions(+), 106 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-18 09:53: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 3f9d377ce788365844f9225064cb9b0f0b4542ef (commit) from 127f9da4fe0a3e2eaa86c5cd32bb45b6a7083171 (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 3f9d377ce788365844f9225064cb9b0f0b4542ef Author: Andreas Fritiofson <and...@gm...> Date: Fri Jun 18 01:33:22 2010 +0200 reverse order of Jim stack trace output The stack traces makes much more sense this way. Signed-off-by: Andreas Fritiofson <and...@gm...> diff --git a/src/helper/jim.c b/src/helper/jim.c index 7fdf52c..071e557 100644 --- a/src/helper/jim.c +++ b/src/helper/jim.c @@ -12291,7 +12291,7 @@ void Jim_PrintErrorMessage(Jim_Interp *interp) Jim_fprintf(interp,interp->cookie_stderr, "%s" JIM_NL, Jim_GetString(interp->result, NULL)); Jim_ListLength(interp, interp->stackTrace, &len); - for (i = len-3; i >= 0; i-= 3) { + for (i = 0; i < len; i += 3) { Jim_Obj *objPtr=NULL; const char *proc, *file, *line; ----------------------------------------------------------------------- Summary of changes: src/helper/jim.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-18 08:05: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 127f9da4fe0a3e2eaa86c5cd32bb45b6a7083171 (commit) from c3ee63be77476af770134b39d31758eb6a0ef69f (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 127f9da4fe0a3e2eaa86c5cd32bb45b6a7083171 Author: Andreas Fritiofson <and...@gm...> Date: Fri Jun 18 00:48:47 2010 +0200 don't add confusing source info to Jim When an interactive command fails, the Jim stack trace prints references to the line in "command.c" where the interpreter was invoked. Since that location has no relation to the actual command that failed, the information serves only to add confusion. By not adding the useless source info to Jim the noise can be reduced, while still printing a useful trace for nested commands. Signed-off-by: Andreas Fritiofson <and...@gm...> Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/helper/command.c b/src/helper/command.c index be262f2..ea768b2 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -362,7 +362,7 @@ static int register_command_handler(struct command_context *cmd_ctx, if (NULL == override_name) return JIM_ERR; - retval = Jim_Eval_Named(interp, override_name, __THIS__FILE__ , __LINE__); + retval = Jim_Eval_Named(interp, override_name, 0, 0); free((void *)override_name); return retval; @@ -651,7 +651,7 @@ int command_run_line(struct command_context *context, char *line) retcode = Jim_SetAssocData(interp, "retval", NULL, &retval); if (retcode == JIM_OK) { - retcode = Jim_Eval_Named(interp, line, __THIS__FILE__, __LINE__); + retcode = Jim_Eval_Named(interp, line, 0, 0); Jim_DeleteAssocData(interp, "retval"); } ----------------------------------------------------------------------- Summary of changes: src/helper/command.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-18 07:53:56
|
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 c3ee63be77476af770134b39d31758eb6a0ef69f (commit) via cebd817cee515fda9d697c5c8d23992254805346 (commit) from ada8f5963d0263d9e839c371641fdb4dd611f436 (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 c3ee63be77476af770134b39d31758eb6a0ef69f Author: Antonio Borneo <bor...@gm...> Date: Fri Jun 18 11:43:09 2010 +0800 helper/jim: review unused symbols Remove unused functions: - Jim_IdentityHashFunction - StringAppendObj - JimReferencesHTDoubleHashFunction Signed-off-by: Antonio Borneo <bor...@gm...> Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/helper/jim.c b/src/helper/jim.c index 91f1ea5..7fdf52c 100644 --- a/src/helper/jim.c +++ b/src/helper/jim.c @@ -656,12 +656,6 @@ static unsigned int Jim_IntHashFunction(unsigned int key) return key; } -/* Identity hash function for integer keys */ -unsigned int Jim_IdentityHashFunction(unsigned int key) -{ - return key; -} - /* Generic hash function (we are using to multiply by 9 and add the byte * as Tcl) */ static unsigned int Jim_GenHashFunction(const unsigned char *buf, int len) @@ -2040,16 +2034,6 @@ static void StringAppendString(Jim_Obj *objPtr, const char *str, int len) objPtr->length += len; } -/* Low-level wrapper to append an object. */ -void StringAppendObj(Jim_Obj *objPtr, Jim_Obj *appendObjPtr) -{ - int len; - const char *str; - - str = Jim_GetString(appendObjPtr, &len); - StringAppendString(objPtr, str, len); -} - /* Higher level API to append strings to objects. */ void Jim_AppendString(Jim_Interp *interp, Jim_Obj *objPtr, const char *str, int len) @@ -4029,14 +4013,6 @@ static unsigned int JimReferencesHTHashFunction(const void *key) return Jim_IntHashFunction(intValue); } -unsigned int JimReferencesHTDoubleHashFunction(const void *key) -{ - /* Only the least significant bits are used. */ - const jim_wide *widePtr = key; - unsigned int intValue = (unsigned int) *widePtr; - return intValue; /* identity function. */ -} - static const void *JimReferencesHTKeyDup(void *privdata, const void *key) { void *copy = Jim_Alloc(sizeof(jim_wide)); commit cebd817cee515fda9d697c5c8d23992254805346 Author: Antonio Borneo <bor...@gm...> Date: Fri Jun 18 11:39:43 2010 +0800 helper/jim: review scope of symbols Add "static" qualifier to private functions. Function Jim_InterpolateTokens() is private, but has not been changed to "static". This function is called only once, so compiler inlines it. After inline, there is a warning for variable uninitialized. Signed-off-by: Antonio Borneo <bor...@gm...> Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/helper/jim.c b/src/helper/jim.c index e9a6ec5..91f1ea5 100644 --- a/src/helper/jim.c +++ b/src/helper/jim.c @@ -370,7 +370,7 @@ static int JimStringMatch(const char *pattern, int patternLen, return 0; } -int JimStringCompare(const char *s1, int l1, const char *s2, int l2, +static int JimStringCompare(const char *s1, int l1, const char *s2, int l2, int nocase) { unsigned char *u1 = (unsigned char*) s1, *u2 = (unsigned char*) s2; @@ -397,7 +397,7 @@ int JimStringCompare(const char *s1, int l1, const char *s2, int l2, /* Search 's1' inside 's2', starting to search from char 'index' of 's2'. * The index of the first occurrence of s1 in s2 is returned. * If s1 is not found inside s2, -1 is returned. */ -int JimStringFirst(const char *s1, int l1, const char *s2, int l2, int index_t) +static int JimStringFirst(const char *s1, int l1, const char *s2, int l2, int index_t) { int i; @@ -412,13 +412,13 @@ int JimStringFirst(const char *s1, int l1, const char *s2, int l2, int index_t) return -1; } -int Jim_WideToString(char *buf, jim_wide wideValue) +static int Jim_WideToString(char *buf, jim_wide wideValue) { const char *fmt = "%" JIM_WIDE_MODIFIER; return sprintf(buf, fmt, wideValue); } -int Jim_StringToWide(const char *str, jim_wide *widePtr, int base) +static int Jim_StringToWide(const char *str, jim_wide *widePtr, int base) { char *endptr; @@ -439,7 +439,7 @@ int Jim_StringToWide(const char *str, jim_wide *widePtr, int base) return JIM_OK; } -int Jim_StringToIndex(const char *str, int *intPtr) +static int Jim_StringToIndex(const char *str, int *intPtr) { char *endptr; @@ -472,7 +472,7 @@ static int JimFormatReference(char *buf, Jim_Reference *refPtr, jim_wide id) return JIM_REFERENCE_SPACE; } -int Jim_DoubleToString(char *buf, double doubleValue) +static int Jim_DoubleToString(char *buf, double doubleValue) { char *s; int len; @@ -496,7 +496,7 @@ int Jim_DoubleToString(char *buf, double doubleValue) return len; } -int Jim_StringToDouble(const char *str, double *doublePtr) +static int Jim_StringToDouble(const char *str, double *doublePtr) { char *endptr; @@ -586,7 +586,7 @@ void Jim_Free(void *ptr) { free(ptr); } -void *Jim_Realloc(void *ptr, int size) +static void *Jim_Realloc(void *ptr, int size) { /* We allocate zero length arrayes, etc. to use a single orthogonal codepath */ if (size == 0) @@ -606,7 +606,7 @@ char *Jim_StrDup(const char *s) return copy; } -char *Jim_StrDupLen(const char *s, int l) +static char *Jim_StrDupLen(const char *s, int l) { char *copy = Jim_Alloc(l + 1); @@ -645,7 +645,7 @@ static int JimInsertHashEntry(Jim_HashTable *ht, const void *key); /* -------------------------- hash functions -------------------------------- */ /* Thomas Wang's 32 bit Mix Function */ -unsigned int Jim_IntHashFunction(unsigned int key) +static unsigned int Jim_IntHashFunction(unsigned int key) { key += ~(key << 15); key ^= (key >> 10); @@ -664,7 +664,7 @@ unsigned int Jim_IdentityHashFunction(unsigned int key) /* Generic hash function (we are using to multiply by 9 and add the byte * as Tcl) */ -unsigned int Jim_GenHashFunction(const unsigned char *buf, int len) +static unsigned int Jim_GenHashFunction(const unsigned char *buf, int len) { unsigned int h = 0; while (len--) @@ -1168,7 +1168,7 @@ static char *JimParserGetToken(struct JimParserCtx *pc, /* Initialize a parser context. * 'prg' is a pointer to the program text, linenr is the line * number of the first line contained in the program. */ -void JimParserInit(struct JimParserCtx *pc, const char *prg, +static void JimParserInit(struct JimParserCtx *pc, const char *prg, int len, int linenr) { pc->prg = prg; @@ -1706,7 +1706,7 @@ int Jim_ScriptIsComplete(const char *s, int len, char *stateCharPtr) static int JimParseListSep(struct JimParserCtx *pc); static int JimParseListStr(struct JimParserCtx *pc); -int JimParseList(struct JimParserCtx *pc) +static int JimParseList(struct JimParserCtx *pc) { if (pc->len == 0) { pc->tstart = pc->tend = pc->p; @@ -2019,7 +2019,7 @@ Jim_Obj *Jim_NewStringObjNoAlloc(Jim_Interp *interp, char *s, int len) /* Low-level string append. Use it only against objects * of type "string". */ -void StringAppendString(Jim_Obj *objPtr, const char *str, int len) +static void StringAppendString(Jim_Obj *objPtr, const char *str, int len) { int needlen; @@ -2132,7 +2132,7 @@ int Jim_StringMatchObj(Jim_Obj *patternObjPtr, Jim_Obj *objPtr, return JimStringMatch(pattern, patternLen, string, stringLen, nocase); } -int Jim_StringCompareObj(Jim_Obj *firstObjPtr, +static int Jim_StringCompareObj(Jim_Obj *firstObjPtr, Jim_Obj *secondObjPtr, int nocase) { const char *s1, *s2; @@ -2579,7 +2579,7 @@ int Jim_CompareStringImmediate(Jim_Interp *interp, Jim_Obj *objPtr, } } -int qsortCompareStringPointers(const void *a, const void *b) +static int qsortCompareStringPointers(const void *a, const void *b) { char * const *sa = (char * const *)a; char * const *sb = (char * const *)b; @@ -3132,7 +3132,7 @@ int SetScriptFromAny(Jim_Interp *interp, struct Jim_Obj *objPtr) return JIM_OK; } -ScriptObj *Jim_GetScript(Jim_Interp *interp, Jim_Obj *objPtr) +static ScriptObj *Jim_GetScript(Jim_Interp *interp, Jim_Obj *objPtr) { if (objPtr->typePtr != &scriptObjType) { SetScriptFromAny(interp, objPtr); @@ -3899,7 +3899,7 @@ void DupDictSubstInternalRep(Jim_Interp *interp, Jim_Obj *srcPtr, * object that is *guaranteed* to be in the form VARNAME(INDEX). * The 'index' part is [subst]ituted, and is used to lookup a key inside * the [dict]ionary contained in variable VARNAME. */ -Jim_Obj *Jim_ExpandDictSugar(Jim_Interp *interp, Jim_Obj *objPtr) +static Jim_Obj *Jim_ExpandDictSugar(Jim_Interp *interp, Jim_Obj *objPtr) { Jim_Obj *varObjPtr, *keyObjPtr, *dictObjPtr, *resObjPtr; Jim_Obj *substKeyObjPtr = NULL; @@ -4021,7 +4021,7 @@ static void JimReferencesHTValDestructor(void *interp, void *val) Jim_Free(val); } -unsigned int JimReferencesHTHashFunction(const void *key) +static unsigned int JimReferencesHTHashFunction(const void *key) { /* Only the least significant bits are used. */ const jim_wide *widePtr = key; @@ -4037,7 +4037,7 @@ unsigned int JimReferencesHTDoubleHashFunction(const void *key) return intValue; /* identity function. */ } -const void *JimReferencesHTKeyDup(void *privdata, const void *key) +static const void *JimReferencesHTKeyDup(void *privdata, const void *key) { void *copy = Jim_Alloc(sizeof(jim_wide)); JIM_NOTUSED(privdata); @@ -4046,7 +4046,7 @@ const void *JimReferencesHTKeyDup(void *privdata, const void *key) return copy; } -int JimReferencesHTKeyCompare(void *privdata, const void *key1, +static int JimReferencesHTKeyCompare(void *privdata, const void *key1, const void *key2) { JIM_NOTUSED(privdata); @@ -4054,7 +4054,7 @@ int JimReferencesHTKeyCompare(void *privdata, const void *key1, return memcmp(key1, key2, sizeof(jim_wide)) == 0; } -void JimReferencesHTKeyDestructor(void *privdata, const void *key) +static void JimReferencesHTKeyDestructor(void *privdata, const void *key) { JIM_NOTUSED(privdata); @@ -4106,7 +4106,7 @@ static int isrefchar(int c) return 0; } -int SetReferenceFromAny(Jim_Interp *interp, Jim_Obj *objPtr) +static int SetReferenceFromAny(Jim_Interp *interp, Jim_Obj *objPtr) { jim_wide wideValue; int i, len; @@ -5106,7 +5106,7 @@ testbrace: /* Returns the malloc-ed representation of a string * using backslash to quote special chars. */ -char *BackslashQuoteString(const char *s, int len, int *qlenPtr) +static char *BackslashQuoteString(const char *s, int len, int *qlenPtr) { char *q = Jim_Alloc(len*2 + 1), *p; @@ -5357,7 +5357,7 @@ void ListAppendElement(Jim_Obj *listPtr, Jim_Obj *objPtr) * * NOTE: this function can be called only against objects * with internal type of List. */ -void ListInsertElements(Jim_Obj *listPtr, int index_t, int elemc, +static void ListInsertElements(Jim_Obj *listPtr, int index_t, int elemc, Jim_Obj *const *elemVec) { int currentLen = listPtr->internalRep.listValue.len; @@ -5384,7 +5384,7 @@ void ListInsertElements(Jim_Obj *listPtr, int index_t, int elemc, /* Appends every element of appendListPtr into listPtr. * Both have to be of the list type. */ -void ListAppendList(Jim_Obj *listPtr, Jim_Obj *appendListPtr) +static void ListAppendList(Jim_Obj *listPtr, Jim_Obj *appendListPtr) { int i, oldLen = listPtr->internalRep.listValue.len; int appendLen = appendListPtr->internalRep.listValue.len; @@ -5590,7 +5590,8 @@ Jim_Obj *Jim_ConcatObj(Jim_Interp *interp, int objc, Jim_Obj *const *objv) /* Returns a list composed of the elements in the specified range. * first and start are directly accepted as Jim_Objects and * processed for the end?-index? case. */ -Jim_Obj *Jim_ListRange(Jim_Interp *interp, Jim_Obj *listObjPtr, Jim_Obj *firstObjPtr, Jim_Obj *lastObjPtr) +static Jim_Obj *Jim_ListRange(Jim_Interp *interp, Jim_Obj *listObjPtr, + Jim_Obj *firstObjPtr, Jim_Obj *lastObjPtr) { int first, last; int len, rangeLen; @@ -5618,7 +5619,7 @@ static int SetDictFromAny(Jim_Interp *interp, struct Jim_Obj *objPtr); * * Keys and Values are Jim objects. */ -unsigned int JimObjectHTHashFunction(const void *key) +static unsigned int JimObjectHTHashFunction(const void *key) { const char *str; Jim_Obj *objPtr = (Jim_Obj*) key; @@ -5629,7 +5630,7 @@ unsigned int JimObjectHTHashFunction(const void *key) return h; } -int JimObjectHTKeyCompare(void *privdata, const void *key1, const void *key2) +static int JimObjectHTKeyCompare(void *privdata, const void *key1, const void *key2) { JIM_NOTUSED(privdata); @@ -5867,7 +5868,7 @@ static void DictAddElement(Jim_Interp *interp, Jim_Obj *objPtr, /* Add an element, higher-level interface for DictAddElement(). * If valueObjPtr == NULL, the key is removed if it exists. */ -int Jim_DictAddElement(Jim_Interp *interp, Jim_Obj *objPtr, +static int Jim_DictAddElement(Jim_Interp *interp, Jim_Obj *objPtr, Jim_Obj *keyObjPtr, Jim_Obj *valueObjPtr) { if (Jim_IsShared(objPtr)) @@ -6282,7 +6283,7 @@ static struct Jim_ExprOperator Jim_ExprOperators[] = { #define JIM_EXPR_OPERATORS_NUM \ (sizeof(Jim_ExprOperators)/sizeof(struct Jim_ExprOperator)) -int JimParseExpression(struct JimParserCtx *pc) +static int JimParseExpression(struct JimParserCtx *pc) { /* Discard spaces and quoted newline */ while (*(pc->p) == ' ' || @@ -6430,7 +6431,7 @@ int JimParseExprOperator(struct JimParserCtx *pc) return JIM_OK; } -struct Jim_ExprOperator *JimExprOperatorInfo(const char *opname) +static struct Jim_ExprOperator *JimExprOperatorInfo(const char *opname) { int i; for (i = 0; i < (signed)JIM_EXPR_OPERATORS_NUM; i++) @@ -6440,7 +6441,7 @@ struct Jim_ExprOperator *JimExprOperatorInfo(const char *opname) return NULL; } -struct Jim_ExprOperator *JimExprOperatorInfoByOpcode(int opcode) +static struct Jim_ExprOperator *JimExprOperatorInfoByOpcode(int opcode) { int i; for (i = 0; i < (signed)JIM_EXPR_OPERATORS_NUM; i++) @@ -6840,7 +6841,7 @@ err: /* we jump here on syntax/compile errors. */ return JIM_ERR; } -ExprByteCode *Jim_GetExpression(Jim_Interp *interp, Jim_Obj *objPtr) +static ExprByteCode *Jim_GetExpression(Jim_Interp *interp, Jim_Obj *objPtr) { if (objPtr->typePtr != &exprObjType) { if (SetExprFromAny(interp, objPtr) != JIM_OK) @@ -7917,7 +7918,7 @@ const char *dlerror(void) } #endif /* WIN32 */ -int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName) +static int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName) { Jim_Obj *libPathObjPtr; int prefixc, i; @@ -7992,7 +7993,7 @@ err: return JIM_ERR; } #else /* JIM_DYNLIB */ -int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName) +static int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName) { JIM_NOTUSED(interp); JIM_NOTUSED(pathName); @@ -8532,7 +8533,7 @@ err: * (and increments argc by reference accordingly), performing * expansion of the list object if 'expand' is non-zero, or * just adding objPtr to argv if 'expand' is zero. */ -void Jim_ExpandArgument(Jim_Interp *interp, Jim_Obj ***argv, +static void Jim_ExpandArgument(Jim_Interp *interp, Jim_Obj ***argv, int *argcPtr, int expand, Jim_Obj *objPtr) { if (!expand) { @@ -9086,7 +9087,7 @@ static Jim_ObjType substObjType = { /* This method takes the string representation of an object * as a Tcl string where to perform [subst]itution, and generates * the pre-parsed internal representation. */ -int SetSubstFromAny(Jim_Interp *interp, struct Jim_Obj *objPtr, int flags) +static int SetSubstFromAny(Jim_Interp *interp, struct Jim_Obj *objPtr, int flags) { int scriptTextLen; const char *scriptText = Jim_GetString(objPtr, &scriptTextLen); @@ -9120,7 +9121,7 @@ int SetSubstFromAny(Jim_Interp *interp, struct Jim_Obj *objPtr, int flags) return JIM_OK; } -ScriptObj *Jim_GetSubst(Jim_Interp *interp, Jim_Obj *objPtr, int flags) +static ScriptObj *Jim_GetSubst(Jim_Interp *interp, Jim_Obj *objPtr, int flags) { struct ScriptObj *script = Jim_GetIntRepPtr(objPtr); ----------------------------------------------------------------------- Summary of changes: src/helper/jim.c | 103 +++++++++++++++++++++--------------------------------- 1 files changed, 40 insertions(+), 63 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-17 21:11:16
|
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 ada8f5963d0263d9e839c371641fdb4dd611f436 (commit) via 3eaab9b55b92a4b52e0a31b9c06da8a904a1dddb (commit) via 647fe050db9ea709f7624c7330c1315251eb9114 (commit) via b1cd202f9ad8c95a70548d946ca3073553a340cf (commit) from f2f798fdd3a4c6d221569ba278945385c2f47504 (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 ada8f5963d0263d9e839c371641fdb4dd611f436 Author: Freddie Chopin <fre...@op...> Date: Thu Jun 17 20:30:23 2010 +0200 mingw32: -Wshadow fixes in arm-jtag-ew.c (error: declaration of âstatâ shadows a global declaration; /usr/local/lib/gcc/i686-w64-mingw32/4.4.2/../../../../i686-w64-mingw32/include/sys/stat.h:279: error: shadowed declaration is here) Signed-off-by: Freddie Chopin <fre...@op...> diff --git a/src/jtag/drivers/arm-jtag-ew.c b/src/jtag/drivers/arm-jtag-ew.c index 9d8b8b1..7a6c178 100644 --- a/src/jtag/drivers/arm-jtag-ew.c +++ b/src/jtag/drivers/arm-jtag-ew.c @@ -659,11 +659,11 @@ static int armjtagew_tap_execute(void) if (result == 0) { - int stat; + int stat_local; - stat = (int)buf_get_u32(usb_in_buffer + byte_length, 0, 32); - if (stat) { - LOG_ERROR("armjtagew_tap_execute, emulator returned error code %d for a CMD_TAP_SHIFT command", stat); + stat_local = (int)buf_get_u32(usb_in_buffer + byte_length, 0, 32); + if (stat_local) { + LOG_ERROR("armjtagew_tap_execute, emulator returned error code %d for a CMD_TAP_SHIFT command", stat_local); return ERROR_JTAG_QUEUE_FAILED; } commit 3eaab9b55b92a4b52e0a31b9c06da8a904a1dddb Author: Freddie Chopin <fre...@op...> Date: Thu Jun 17 20:26:48 2010 +0200 mingw32: -Wshadow fixes in rlink.c (error: declaration of âbyteâ shadows a global declaration; /usr/local/lib/gcc/i686-w64-mingw32/4.4.2/../../../../i686-w64-mingw32/include/rpcndr.h:50: error: shadowed declaration is here) Signed-off-by: Freddie Chopin <fre...@op...> diff --git a/src/jtag/drivers/rlink.c b/src/jtag/drivers/rlink.c index 2905bf2..dde117b 100644 --- a/src/jtag/drivers/rlink.c +++ b/src/jtag/drivers/rlink.c @@ -824,21 +824,21 @@ int tap_state_queue_run(void) { int i; int bits; - uint8_t byte; + uint8_t byte_param; int retval; retval = 0; if (!tap_state_queue.length) return(retval); bits = 1; - byte = 0; + byte_param = 0; for (i = tap_state_queue.length; i--;) { - byte <<= 1; + byte_param <<= 1; if (tap_state_queue.buffer & 1) { - byte |= 1; + byte_param |= 1; } if ((bits >= 8) || !i) { - byte <<= (8 - bits); + byte_param <<= (8 - bits); /* make sure there's room for stop, byte op, and one byte */ if (dtc_queue.cmd_index >= (sizeof(dtc_queue.cmd_buffer) - (1 + 1 + 1))) { @@ -860,9 +860,9 @@ tap_state_queue_run(void) { #endif dtc_queue.cmd_buffer[dtc_queue.cmd_index++] = - byte; + byte_param; - byte = 0; + byte_param = 0; bits = 1; } else { bits++; commit 647fe050db9ea709f7624c7330c1315251eb9114 Author: Freddie Chopin <fre...@op...> Date: Thu Jun 17 20:24:46 2010 +0200 rlink: -Wshadows fixes (error: declaration of âpHDevâ shadows a global declaration; ../../../../src/jtag/drivers/rlink.c:102: error: shadowed declaration is here) Signed-off-by: Freddie Chopin <fre...@op...> diff --git a/src/jtag/drivers/rlink.c b/src/jtag/drivers/rlink.c index 0060baf..2905bf2 100644 --- a/src/jtag/drivers/rlink.c +++ b/src/jtag/drivers/rlink.c @@ -110,7 +110,7 @@ static usb_dev_handle *pHDev; static int ep1_generic_commandl( - usb_dev_handle *pHDev, + usb_dev_handle *pHDev_param, size_t length, ... ) { @@ -138,7 +138,7 @@ ep1_generic_commandl( ); usb_ret = usb_bulk_write( - pHDev, + pHDev_param, USB_EP1OUT_ADDR, (char *)usb_buffer, sizeof(usb_buffer), USB_TIMEOUT_MS @@ -219,7 +219,7 @@ ep1_memory_read( static ssize_t ep1_memory_write( - usb_dev_handle *pHDev, + usb_dev_handle *pHDev_param, uint16_t addr, size_t length, uint8_t const *buffer @@ -256,7 +256,7 @@ ep1_memory_write( ); usb_ret = usb_bulk_write( - pHDev, USB_EP1OUT_ADDR, + pHDev_param, USB_EP1OUT_ADDR, (char *)usb_buffer, sizeof(usb_buffer), USB_TIMEOUT_MS ); @@ -324,7 +324,7 @@ static uint8_t dtc_entry_download; static int dtc_load_from_buffer( - usb_dev_handle *pHDev, + usb_dev_handle *pHDev_param, const uint8_t *buffer, size_t length ) { @@ -341,7 +341,7 @@ dtc_load_from_buffer( /* Stop the DTC before loading anything. */ usb_err = ep1_generic_commandl( - pHDev, 1, + pHDev_param, 1, EP1_CMD_DTC_STOP ); if (usb_err < 0) return(usb_err); @@ -375,7 +375,7 @@ dtc_load_from_buffer( case DTCLOAD_LOAD: /* Send the DTC program to ST7 RAM. */ usb_err = ep1_memory_write( - pHDev, + pHDev_param, DTC_LOAD_BUFFER, header->length + 1, buffer ); @@ -383,7 +383,7 @@ dtc_load_from_buffer( /* Load it into the DTC. */ usb_err = ep1_generic_commandl( - pHDev, 3, + pHDev_param, 3, EP1_CMD_DTC_LOAD, (DTC_LOAD_BUFFER >> 8), DTC_LOAD_BUFFER @@ -394,7 +394,7 @@ dtc_load_from_buffer( case DTCLOAD_RUN: usb_err = ep1_generic_commandl( - pHDev, 3, + pHDev_param, 3, EP1_CMD_DTC_CALL, buffer[0], EP1_CMD_DTC_WAIT @@ -409,7 +409,7 @@ dtc_load_from_buffer( case DTCLOAD_LUT: usb_err = ep1_memory_write( - pHDev, + pHDev_param, ST7_USB_BUF_EP0OUT + lut_start, header->length + 1, buffer ); @@ -494,7 +494,7 @@ dtc_start_download(void) { static int dtc_run_download( - usb_dev_handle *pHDev, + usb_dev_handle *pHDev_param, uint8_t *command_buffer, int command_buffer_size, uint8_t *reply_buffer, @@ -507,7 +507,7 @@ dtc_run_download( LOG_DEBUG(": %d/%d\n", command_buffer_size, reply_buffer_size); usb_err = usb_bulk_write( - pHDev, + pHDev_param, USB_EP2OUT_ADDR, (char *)command_buffer, USB_EP2BANK_SIZE, USB_TIMEOUT_MS @@ -518,7 +518,7 @@ dtc_run_download( /* Wait for DTC to finish running command buffer */ for (i = 10;;) { usb_err = ep1_generic_commandl( - pHDev, 4, + pHDev_param, 4, EP1_CMD_MEMORY_READ, DTC_STATUS_POLL_BYTE >> 8, @@ -528,7 +528,7 @@ dtc_run_download( if (usb_err < 0) return(usb_err); usb_err = usb_bulk_read( - pHDev, + pHDev_param, USB_EP1IN_ADDR, (char *)ep2_buffer, 1, USB_TIMEOUT_MS @@ -549,7 +549,7 @@ dtc_run_download( if (!reply_buffer) reply_buffer_size = 0; if (reply_buffer_size) { usb_err = usb_bulk_read( - pHDev, + pHDev_param, USB_EP2IN_ADDR, (char *)ep2_buffer, sizeof(ep2_buffer), USB_TIMEOUT_MS commit b1cd202f9ad8c95a70548d946ca3073553a340cf Author: Freddie Chopin <fre...@op...> Date: Thu Jun 17 20:06:28 2010 +0200 mingw32: -Wshadow fixes in jim.c (error: declaration of âbooleanâ shadows a global declaration; /usr/local/lib/gcc/i686-w64-mingw32/4.4.2/../../../../i686-w64-mingw32/include/rpcndr.h:52: error: shadowed declaration is here) Signed-off-by: Freddie Chopin <fre...@op...> diff --git a/src/helper/jim.c b/src/helper/jim.c index 8538954..e9a6ec5 100644 --- a/src/helper/jim.c +++ b/src/helper/jim.c @@ -9942,12 +9942,12 @@ noopt: /* The general purpose implementation of while starts here */ while (1) { - int boolean, retval; + int local_boolean, retval; if ((retval = Jim_GetBoolFromExpr(interp, argv[1], - &boolean)) != JIM_OK) + &local_boolean)) != JIM_OK) return retval; - if (!boolean) break; + if (!local_boolean) break; if ((retval = Jim_EvalObj(interp, argv[2])) != JIM_OK) { switch (retval) { case JIM_BREAK: @@ -10146,13 +10146,13 @@ evalstart: if ((retval = Jim_EvalObj(interp, argv[1])) != JIM_OK) return retval; while (1) { - int boolean; + int local_boolean; testcond: /* Test the condition */ - if ((retval = Jim_GetBoolFromExpr(interp, argv[2], &boolean)) + if ((retval = Jim_GetBoolFromExpr(interp, argv[2], &local_boolean)) != JIM_OK) return retval; - if (!boolean) break; + if (!local_boolean) break; /* Eval body */ if ((retval = Jim_EvalObj(interp, argv[4])) != JIM_OK) { switch (retval) { @@ -10297,13 +10297,13 @@ static int Jim_LmapCoreCommand(Jim_Interp *interp, int argc, static int Jim_IfCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - int boolean, retval, current = 1, falsebody = 0; + int local_boolean, retval, current = 1, falsebody = 0; if (argc >= 3) { while (1) { /* Far not enough arguments given! */ if (current >= argc) goto err; if ((retval = Jim_GetBoolFromExpr(interp, - argv[current++], &boolean)) + argv[current++], &local_boolean)) != JIM_OK) return retval; /* There lacks something, isn't it? */ @@ -10312,7 +10312,7 @@ static int Jim_IfCoreCommand(Jim_Interp *interp, int argc, "then")) current++; /* Tsk tsk, no then-clause? */ if (current >= argc) goto err; - if (boolean) + if (local_boolean) return Jim_EvalObj(interp, argv[current]); /* Ok: no else-clause follows */ if (++current >= argc) { ----------------------------------------------------------------------- Summary of changes: src/helper/jim.c | 18 ++++++++-------- src/jtag/drivers/arm-jtag-ew.c | 8 +++--- src/jtag/drivers/rlink.c | 44 ++++++++++++++++++++-------------------- 3 files changed, 35 insertions(+), 35 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-17 18:14:49
|
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 f2f798fdd3a4c6d221569ba278945385c2f47504 (commit) via d4e4da0fa177c640196e5bc3476ed03c3a70be00 (commit) from 8a2808681e932b6644f572717885c8f8f360e9fa (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 f2f798fdd3a4c6d221569ba278945385c2f47504 Author: Antonio Borneo <bor...@gm...> Date: Thu Jun 17 23:13:08 2010 +0800 jlink: fix -Wshadow warning Signed-off-by: Antonio Borneo <bor...@gm...> Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c index 34fce38..52f12b4 100644 --- a/src/jtag/drivers/jlink.c +++ b/src/jtag/drivers/jlink.c @@ -712,9 +712,9 @@ static void jlink_tap_ensure_space(int scans, int bits) static void jlink_tap_append_step(int tms, int tdi) { - int index = tap_length / 8; + int index_var = tap_length / 8; - if (index >= JLINK_TAP_BUFFER_SIZE) + if (index_var >= JLINK_TAP_BUFFER_SIZE) { LOG_ERROR("jlink_tap_append_step: overflow"); *(uint32_t *)0xFFFFFFFF = 0; @@ -727,18 +727,18 @@ static void jlink_tap_append_step(int tms, int tdi) // we do not pad TMS, so be sure to initialize all bits if (0 == bit_index) { - tms_buffer[index] = tdi_buffer[index] = 0; + tms_buffer[index_var] = tdi_buffer[index_var] = 0; } if (tms) - tms_buffer[index] |= bit; + tms_buffer[index_var] |= bit; else - tms_buffer[index] &= ~bit; + tms_buffer[index_var] &= ~bit; if (tdi) - tdi_buffer[index] |= bit; + tdi_buffer[index_var] |= bit; else - tdi_buffer[index] &= ~bit; + tdi_buffer[index_var] &= ~bit; tap_length++; } commit d4e4da0fa177c640196e5bc3476ed03c3a70be00 Author: Antonio Borneo <bor...@gm...> Date: Thu Jun 17 23:12:48 2010 +0800 vsllink: fix -Wshadow warning Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/jtag/drivers/vsllink.c b/src/jtag/drivers/vsllink.c index 450ce06..7533a09 100644 --- a/src/jtag/drivers/vsllink.c +++ b/src/jtag/drivers/vsllink.c @@ -699,20 +699,20 @@ static void vsllink_tap_ensure_pending(int scans) static void vsllink_tap_append_step(int tms, int tdi) { - int index = tap_length / 8; + int index_var = tap_length / 8; int bit_index = tap_length % 8; uint8_t bit = 1 << bit_index; if (tms) - tms_buffer[index] |= bit; + tms_buffer[index_var] |= bit; else - tms_buffer[index] &= ~bit; + tms_buffer[index_var] &= ~bit; if (tdi) - tdi_buffer[index] |= bit; + tdi_buffer[index_var] |= bit; else - tdi_buffer[index] &= ~bit; + tdi_buffer[index_var] &= ~bit; tap_length++; ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/jlink.c | 14 +++++++------- src/jtag/drivers/vsllink.c | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-06-17 15:41:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 8a2808681e932b6644f572717885c8f8f360e9fa (commit) from 80eb7e2a789939263662cf37e564d0afcdb0e188 (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 8a2808681e932b6644f572717885c8f8f360e9fa Author: Oyvind Harboe <oyv...@zy...> Date: Thu Jun 17 15:30:25 2010 +0200 gdb-server: fix -Wshadow warning This warning was only reproducable with Cygwin. Cygwin now builds without warnings for the basic case. Signed-off-by: Oyvind Harboe <oyv...@zy...> diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index a1ff7c8..e97839d 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1,3 +1,4 @@ + /*************************************************************************** * Copyright (C) 2005 by Dominic Rath * * Dom...@gm... * @@ -760,22 +761,22 @@ static void gdb_frontend_halted(struct target *target, struct connection *connec if (gdb_connection->frontend_state == TARGET_RUNNING) { char sig_reply[4]; - int signal; + int signal_var; /* stop forwarding log packets! */ log_remove_callback(gdb_log_callback, connection); if (gdb_connection->ctrl_c) { - signal = 0x2; + signal_var = 0x2; gdb_connection->ctrl_c = 0; } else { - signal = gdb_last_signal(target); + signal_var = gdb_last_signal(target); } - snprintf(sig_reply, 4, "T%2.2x", signal); + snprintf(sig_reply, 4, "T%2.2x", signal_var); gdb_put_packet(connection, sig_reply, 3); gdb_connection->frontend_state = TARGET_HALTED; } @@ -945,11 +946,11 @@ static int gdb_last_signal_packet(struct connection *connection, struct target *target, char* packet, int packet_size) { char sig_reply[4]; - int signal; + int signal_var; - signal = gdb_last_signal(target); + signal_var = gdb_last_signal(target); - snprintf(sig_reply, 4, "S%2.2x", signal); + snprintf(sig_reply, 4, "S%2.2x", signal_var); gdb_put_packet(connection, sig_reply, 3); return ERROR_OK; ----------------------------------------------------------------------- Summary of changes: src/server/gdb_server.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) hooks/post-receive -- Main OpenOCD repository |