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
(54) |
Sep
(47) |
Oct
(15) |
Nov
(61) |
Dec
|
|
From: <zw...@ma...> - 2009-06-11 13:43:03
|
Author: zwelch
Date: 2009-06-11 13:43:00 +0200 (Thu, 11 Jun 2009)
New Revision: 2195
Modified:
trunk/src/target/target.c
Log:
Factor target_timer_callbacks_check_time into pieces:
- Add target_timer_callback_periodic_restart and target_call_timer_callback.
- Clean up and simplify logic that determines whether to call each callback.
- Move variable declarations to location of first use.
Modified: trunk/src/target/target.c
===================================================================
--- trunk/src/target/target.c 2009-06-11 11:42:54 UTC (rev 2194)
+++ trunk/src/target/target.c 2009-06-11 11:43:00 UTC (rev 2195)
@@ -821,46 +821,56 @@
return ERROR_OK;
}
+static int target_timer_callback_periodic_restart(
+ target_timer_callback_t *cb, struct timeval *now)
+{
+ int time_ms = cb->time_ms;
+ cb->when.tv_usec = now->tv_usec + (time_ms % 1000) * 1000;
+ time_ms -= (time_ms % 1000);
+ cb->when.tv_sec = now->tv_sec + time_ms / 1000;
+ if (cb->when.tv_usec > 1000000)
+ {
+ cb->when.tv_usec = cb->when.tv_usec - 1000000;
+ cb->when.tv_sec += 1;
+ }
+ return ERROR_OK;
+}
+
+static int target_call_timer_callback(target_timer_callback_t *cb,
+ struct timeval *now)
+{
+ cb->callback(cb->priv);
+
+ if (cb->periodic)
+ return target_timer_callback_periodic_restart(cb, now);
+
+ return target_unregister_timer_callback(cb->callback, cb->priv);
+}
+
static int target_call_timer_callbacks_check_time(int checktime)
{
- target_timer_callback_t *callback = target_timer_callbacks;
- target_timer_callback_t *next_callback;
- struct timeval now;
-
keep_alive();
+ struct timeval now;
gettimeofday(&now, NULL);
+ target_timer_callback_t *callback = target_timer_callbacks;
while (callback)
{
- next_callback = callback->next;
+ // cleaning up may unregister and free this callback
+ target_timer_callback_t *next_callback = callback->next;
- if ((!checktime&&callback->periodic)||
- (((now.tv_sec >= callback->when.tv_sec) && (now.tv_usec >= callback->when.tv_usec))
- || (now.tv_sec > callback->when.tv_sec)))
+ bool call_it = callback->callback &&
+ ((!checktime && callback->periodic) ||
+ now.tv_sec > callback->when.tv_sec ||
+ (now.tv_sec == callback->when.tv_sec &&
+ now.tv_usec >= callback->when.tv_usec));
+
+ if (call_it)
{
- if(callback->callback != NULL)
- {
- callback->callback(callback->priv);
- if (callback->periodic)
- {
- int time_ms = callback->time_ms;
- callback->when.tv_usec = now.tv_usec + (time_ms % 1000) * 1000;
- time_ms -= (time_ms % 1000);
- callback->when.tv_sec = now.tv_sec + time_ms / 1000;
- if (callback->when.tv_usec > 1000000)
- {
- callback->when.tv_usec = callback->when.tv_usec - 1000000;
- callback->when.tv_sec += 1;
- }
- }
- else
- {
- int retval;
- if((retval = target_unregister_timer_callback(callback->callback, callback->priv)) != ERROR_OK)
- return retval;
- }
- }
+ int retval = target_call_timer_callback(callback, &now);
+ if (retval != ERROR_OK)
+ return retval;
}
callback = next_callback;
|
|
From: <zw...@ma...> - 2009-06-11 13:42:57
|
Author: zwelch
Date: 2009-06-11 13:42:54 +0200 (Thu, 11 Jun 2009)
New Revision: 2194
Modified:
trunk/src/target/target.c
Log:
Simplify and clean handle_virt2phys_command:
- Add a doxygen block to simplify logic.
- Move declarations to point of first use.
Modified: trunk/src/target/target.c
===================================================================
--- trunk/src/target/target.c 2009-06-11 11:42:47 UTC (rev 2193)
+++ trunk/src/target/target.c 2009-06-11 11:42:54 UTC (rev 2194)
@@ -2575,30 +2575,27 @@
return ERROR_OK;
}
-static int handle_virt2phys_command(command_context_t *cmd_ctx, char *cmd, char **args, int argc)
-{
- int retval;
- target_t *target = get_current_target(cmd_ctx);
- u32 va;
- u32 pa;
+/**
+ * Translate a virtual address to a physical address.
+ *
+ * The low-level target implementation must have logged a detailed error
+ * which is forwarded to telnet/GDB session.
+ */
+static int handle_virt2phys_command(command_context_t *cmd_ctx,
+ char *cmd, char **args, int argc)
+{
if (argc != 1)
- {
return ERROR_COMMAND_SYNTAX_ERROR;
- }
- va = strtoul(args[0], NULL, 0);
- retval = target->type->virt2phys(target, va, &pa);
+ target_t *target = get_current_target(cmd_ctx);
+ u32 va = strtoul(args[0], NULL, 0);
+ u32 pa;
+
+ int retval = target->type->virt2phys(target, va, &pa);
if (retval == ERROR_OK)
- {
command_print(cmd_ctx, "Physical address 0x%08x", pa);
- }
- else
- {
- /* lower levels will have logged a detailed error which is
- * forwarded to telnet/GDB session.
- */
- }
+
return retval;
}
|
|
From: <zw...@ma...> - 2009-06-11 13:42:51
|
Author: zwelch
Date: 2009-06-11 13:42:47 +0200 (Thu, 11 Jun 2009)
New Revision: 2193
Modified:
trunk/src/target/target.c
Log:
Simplify and fix target handle_rwp_command routine:
- Return syntax error unless exactly one argument is passed.
- Move variable declaration to point of first use.
Modified: trunk/src/target/target.c
===================================================================
--- trunk/src/target/target.c 2009-06-11 11:42:40 UTC (rev 2192)
+++ trunk/src/target/target.c 2009-06-11 11:42:47 UTC (rev 2193)
@@ -2566,11 +2566,12 @@
static int handle_rwp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
+ if (argc != 1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
target_t *target = get_current_target(cmd_ctx);
+ watchpoint_remove(target, strtoul(args[0], NULL, 0));
- if (argc > 0)
- watchpoint_remove(target, strtoul(args[0], NULL, 0));
-
return ERROR_OK;
}
|
|
From: <zw...@ma...> - 2009-06-11 13:42:45
|
Author: zwelch
Date: 2009-06-11 13:42:40 +0200 (Thu, 11 Jun 2009)
New Revision: 2192
Modified:
trunk/src/target/target.c
Log:
Simplify and fix handle_reset_command:
- Return syntax error if more than one argument is given.
- Move variables to location of first use.
Modified: trunk/src/target/target.c
===================================================================
--- trunk/src/target/target.c 2009-06-11 11:42:33 UTC (rev 2191)
+++ trunk/src/target/target.c 2009-06-11 11:42:40 UTC (rev 2192)
@@ -1912,11 +1912,13 @@
static int handle_reset_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
- const Jim_Nvp *n;
+ if (argc > 1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
enum target_reset_mode reset_mode = RESET_RUN;
-
- if (argc >= 1)
+ if (argc == 1)
{
+ const Jim_Nvp *n;
n = Jim_Nvp_name2value_simple( nvp_reset_modes, args[0] );
if( (n->name == NULL) || (n->value == RESET_UNKNOWN) ){
return ERROR_COMMAND_SYNTAX_ERROR;
|
|
From: <zw...@ma...> - 2009-06-11 13:42:37
|
Author: zwelch
Date: 2009-06-11 13:42:33 +0200 (Thu, 11 Jun 2009)
New Revision: 2191
Modified:
trunk/src/target/target.c
Log:
Simplify handle_resume_command:
- Eliminate redundant calls to target_resume with addr temp variable.
- Place variables at location of first use.
- Fix minor whitespace issues.
Modified: trunk/src/target/target.c
===================================================================
--- trunk/src/target/target.c 2009-06-11 11:42:26 UTC (rev 2190)
+++ trunk/src/target/target.c 2009-06-11 11:42:33 UTC (rev 2191)
@@ -1931,21 +1931,20 @@
static int handle_resume_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
- int retval;
+ if (argc > 1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
target_t *target = get_current_target(cmd_ctx);
+ target_handle_event(target, TARGET_EVENT_OLD_pre_resume);
- target_handle_event( target, TARGET_EVENT_OLD_pre_resume );
+ /* with no args, resume from current pc, addr = 0,
+ * with one arguments, addr = args[0],
+ * handle breakpoints, not debugging */
+ u32 addr = 0;
+ if (argc == 1)
+ addr = strtoul(args[0], NULL, 0);
- if (argc == 0)
- retval = target_resume(target, 1, 0, 1, 0); /* current pc, addr = 0, handle breakpoints, not debugging */
- else if (argc == 1)
- retval = target_resume(target, 0, strtoul(args[0], NULL, 0), 1, 0); /* addr = args[0], handle breakpoints, not debugging */
- else
- {
- retval = ERROR_COMMAND_SYNTAX_ERROR;
- }
-
- return retval;
+ return target_resume(target, 0, addr, 1, 0);
}
static int handle_step_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
|
From: <zw...@ma...> - 2009-06-11 13:42:31
|
Author: zwelch
Date: 2009-06-11 13:42:26 +0200 (Thu, 11 Jun 2009)
New Revision: 2190
Modified:
trunk/src/target/target.c
Log:
Simplify and fix handle_step_command:
- Bug fix: return syntax error when more than one argument is given.
- Eliminate redundant calls to step callback with addr temp variable.
- Place variables at location of first use.
Modified: trunk/src/target/target.c
===================================================================
--- trunk/src/target/target.c 2009-06-11 07:08:45 UTC (rev 2189)
+++ trunk/src/target/target.c 2009-06-11 11:42:26 UTC (rev 2190)
@@ -1950,17 +1950,20 @@
static int handle_step_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
- target_t *target = get_current_target(cmd_ctx);
+ if (argc > 1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
LOG_DEBUG("-");
- if (argc == 0)
- return target->type->step(target, 1, 0, 1); /* current pc, addr = 0, handle breakpoints */
-
+ /* with no args, step from current pc, addr = 0,
+ * with one argument addr = args[0],
+ * handle breakpoints, debugging */
+ u32 addr = 0;
if (argc == 1)
- return target->type->step(target, 0, strtoul(args[0], NULL, 0), 1); /* addr = args[0], handle breakpoints */
+ addr = strtoul(args[0], NULL, 0);
- return ERROR_OK;
+ target_t *target = get_current_target(cmd_ctx);
+ return target->type->step(target, 0, addr, 1);
}
static void handle_md_output(struct command_context_s *cmd_ctx,
|
|
From: <zw...@ma...> - 2009-06-11 09:08:48
|
Author: zwelch Date: 2009-06-11 09:08:45 +0200 (Thu, 11 Jun 2009) New Revision: 2189 Modified: trunk/src/jtag/jtag.h Log: Move jtag_get_flush_queue_count near jtag_execute_queue (fix its docs). Modified: trunk/src/jtag/jtag.h =================================================================== --- trunk/src/jtag/jtag.h 2009-06-11 07:08:34 UTC (rev 2188) +++ trunk/src/jtag/jtag.h 2009-06-11 07:08:45 UTC (rev 2189) @@ -621,9 +621,13 @@ */ extern int jtag_execute_queue(void); -/* same as jtag_execute_queue() but does not clear the error flag */ +/// same as jtag_execute_queue() but does not clear the error flag extern void jtag_execute_queue_noclear(void); +/// @returns the number of times the scan queue has been flushed +int jtag_get_flush_queue_count(void); + + /* can be implemented by hw+sw */ extern int jtag_power_dropout(int* dropout); extern int jtag_srst_asserted(int* srst_asserted); @@ -686,9 +690,6 @@ tap_state_t end_state); -/// @returns the number of times the scan queue has been flushed -int jtag_get_flush_queue_count(void); - /** * Set the current JTAG core execution error, unless one was set * by a previous call previously. Driver or application code must |
|
From: <zw...@ma...> - 2009-06-11 09:08:40
|
Author: zwelch
Date: 2009-06-11 09:08:34 +0200 (Thu, 11 Jun 2009)
New Revision: 2188
Modified:
trunk/src/jtag/jtag.h
Log:
Improve grouping of JTAG KHz and verification accessors in header file.
Add some quick Doxygen comments for these routines.
Modified: trunk/src/jtag/jtag.h
===================================================================
--- trunk/src/jtag/jtag.h 2009-06-11 07:08:28 UTC (rev 2187)
+++ trunk/src/jtag/jtag.h 2009-06-11 07:08:34 UTC (rev 2188)
@@ -250,6 +250,15 @@
*/
int jtag_set_speed(int speed);
+
+/// Attempt to configure the interface for the specified KHz.
+int jtag_config_khz(unsigned khz);
+/// Set the clock speed of the JTAG interface in KHz.
+void jtag_set_speed_khz(unsigned speed);
+/// Retreives the clock speed of the JTAG interface in KHz.
+unsigned jtag_get_speed_khz(void);
+
+
enum reset_types {
RESET_NONE = 0x0,
RESET_HAS_TRST = 0x1,
@@ -275,7 +284,15 @@
/// @returns The current state of SRST.
int jtag_get_srst(void);
+/// Enable or disable data scan verification checking.
+void jtag_set_verify(bool enable);
+/// @returns True if data scan verification will be performed.
+bool jtag_will_verify(void);
+/// Enable or disable verification of IR scan checking.
+void jtag_set_verify_capture_ir(bool enable);
+/// @returns True if IR scan verification will be performed.
+bool jtag_will_verify_capture_ir(void);
/**
* Initialize interface upon startup. Return a successful no-op upon
@@ -672,16 +689,6 @@
/// @returns the number of times the scan queue has been flushed
int jtag_get_flush_queue_count(void);
-int jtag_config_khz(unsigned khz);
-void jtag_set_speed_khz(unsigned speed);
-unsigned jtag_get_speed_khz(void);
-
-void jtag_set_verify(bool enable);
-bool jtag_will_verify(void);
-
-void jtag_set_verify_capture_ir(bool enable);
-bool jtag_will_verify_capture_ir(void);
-
/**
* Set the current JTAG core execution error, unless one was set
* by a previous call previously. Driver or application code must
|
|
From: <zw...@ma...> - 2009-06-11 09:08:31
|
Author: zwelch
Date: 2009-06-11 09:08:28 +0200 (Thu, 11 Jun 2009)
New Revision: 2187
Modified:
trunk/src/jtag/jtag.h
Log:
Group JTAG reset configuration and accessor APIs together in header file.
Remove unused reset_line_mode enumerated type.
Modified: trunk/src/jtag/jtag.h
===================================================================
--- trunk/src/jtag/jtag.h 2009-06-11 07:08:21 UTC (rev 2186)
+++ trunk/src/jtag/jtag.h 2009-06-11 07:08:28 UTC (rev 2187)
@@ -185,11 +185,6 @@
extern unsigned jtag_tap_count(void);
-enum reset_line_mode {
- LINE_OPEN_DRAIN = 0x0,
- LINE_PUSH_PULL = 0x1,
-};
-
/*
* There are three cases when JTAG_TRST_ASSERTED callback is invoked. The
* event is invoked *after* TRST is asserted(or queued rather). It is illegal
@@ -217,11 +212,6 @@
jtag_tap_event_action_t* next;
};
-/// @returns The current state of TRST.
-int jtag_get_trst(void);
-/// @returns The current state of SRST.
-int jtag_get_srst(void);
-
/**
* Defines the function signature requide for JTAG event callback
* functions, which are added with jtag_register_event_callback()
@@ -274,6 +264,19 @@
enum reset_types jtag_get_reset_config(void);
void jtag_set_reset_config(enum reset_types type);
+void jtag_set_nsrst_delay(unsigned delay);
+unsigned jtag_get_nsrst_delay(void);
+
+void jtag_set_ntrst_delay(unsigned delay);
+unsigned jtag_get_ntrst_delay(void);
+
+/// @returns The current state of TRST.
+int jtag_get_trst(void);
+/// @returns The current state of SRST.
+int jtag_get_srst(void);
+
+
+
/**
* Initialize interface upon startup. Return a successful no-op upon
* subsequent invocations.
@@ -669,12 +672,6 @@
/// @returns the number of times the scan queue has been flushed
int jtag_get_flush_queue_count(void);
-void jtag_set_nsrst_delay(unsigned delay);
-unsigned jtag_get_nsrst_delay(void);
-
-void jtag_set_ntrst_delay(unsigned delay);
-unsigned jtag_get_ntrst_delay(void);
-
int jtag_config_khz(unsigned khz);
void jtag_set_speed_khz(unsigned speed);
unsigned jtag_get_speed_khz(void);
|
|
From: <zw...@ma...> - 2009-06-11 09:08:24
|
Author: zwelch Date: 2009-06-11 09:08:21 +0200 (Thu, 11 Jun 2009) New Revision: 2186 Modified: trunk/src/jtag/jtag.h Log: Move jtag_error helper declarations to the end of the header. Modified: trunk/src/jtag/jtag.h =================================================================== --- trunk/src/jtag/jtag.h 2009-06-11 07:08:14 UTC (rev 2185) +++ trunk/src/jtag/jtag.h 2009-06-11 07:08:21 UTC (rev 2186) @@ -604,21 +604,6 @@ /* same as jtag_execute_queue() but does not clear the error flag */ extern void jtag_execute_queue_noclear(void); -/** - * Set the current JTAG core execution error, unless one was set - * by a previous call previously. Driver or application code must - * use jtag_error_clear to reset jtag_error once this routine has been - * 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. - */ -int jtag_error_clear(void); - /* can be implemented by hw+sw */ extern int jtag_power_dropout(int* dropout); extern int jtag_srst_asserted(int* srst_asserted); @@ -700,4 +685,19 @@ void jtag_set_verify_capture_ir(bool enable); bool jtag_will_verify_capture_ir(void); +/** + * Set the current JTAG core execution error, unless one was set + * by a previous call previously. Driver or application code must + * use jtag_error_clear to reset jtag_error once this routine has been + * 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. + */ +int jtag_error_clear(void); + #endif /* JTAG_H */ |
|
From: <zw...@ma...> - 2009-06-11 09:08:18
|
Author: zwelch
Date: 2009-06-11 09:08:14 +0200 (Thu, 11 Jun 2009)
New Revision: 2185
Modified:
trunk/src/jtag/core.c
trunk/src/jtag/jtag.h
Log:
Out-of-line jtag_tap_next_enabled and simplify its logic.
Modified: trunk/src/jtag/core.c
===================================================================
--- trunk/src/jtag/core.c 2009-06-11 07:08:03 UTC (rev 2184)
+++ trunk/src/jtag/core.c 2009-06-11 07:08:14 UTC (rev 2185)
@@ -202,6 +202,18 @@
return t;
}
+jtag_tap_t* jtag_tap_next_enabled(jtag_tap_t* p)
+{
+ p = p ? p->next_tap : jtag_all_taps();
+ while (p)
+ {
+ if (p->enabled)
+ return p;
+ p = p->next_tap;
+ }
+ return NULL;
+}
+
const char *jtag_tap_name(const jtag_tap_t *tap)
{
return (tap == NULL) ? "(unknown)" : tap->dotted_name;
Modified: trunk/src/jtag/jtag.h
===================================================================
--- trunk/src/jtag/jtag.h 2009-06-11 07:08:03 UTC (rev 2184)
+++ trunk/src/jtag/jtag.h 2009-06-11 07:08:14 UTC (rev 2185)
@@ -180,37 +180,11 @@
extern jtag_tap_t* jtag_tap_by_string(const char* dotted_name);
extern jtag_tap_t* jtag_tap_by_jim_obj(Jim_Interp* interp, Jim_Obj* obj);
extern jtag_tap_t* jtag_tap_by_position(unsigned abs_position);
+extern jtag_tap_t* jtag_tap_next_enabled(jtag_tap_t* p);
extern unsigned jtag_tap_count_enabled(void);
extern unsigned jtag_tap_count(void);
-static __inline__ jtag_tap_t* jtag_tap_next_enabled(jtag_tap_t* p)
-{
- if (p == NULL)
- {
- /* start at the head of list */
- p = jtag_all_taps();
- }
- else
- {
- /* start *after* this one */
- p = p->next_tap;
- }
- while (p)
- {
- if (p->enabled)
- {
- break;
- }
- else
- {
- p = p->next_tap;
- }
- }
- return p;
-}
-
-
enum reset_line_mode {
LINE_OPEN_DRAIN = 0x0,
LINE_PUSH_PULL = 0x1,
|
|
From: <zw...@ma...> - 2009-06-11 09:08:10
|
Author: zwelch
Date: 2009-06-11 09:08:03 +0200 (Thu, 11 Jun 2009)
New Revision: 2184
Modified:
trunk/src/jtag/core.c
trunk/src/jtag/jtag.h
Log:
Move jtag_add_statemove decl/body nearer jtag_add_pathmove.
Modified: trunk/src/jtag/core.c
===================================================================
--- trunk/src/jtag/core.c 2009-06-11 06:19:37 UTC (rev 2183)
+++ trunk/src/jtag/core.c 2009-06-11 07:08:03 UTC (rev 2184)
@@ -476,6 +476,50 @@
cmd_queue_cur_state = path[num_states - 1];
}
+int jtag_add_statemove(tap_state_t goal_state)
+{
+ tap_state_t cur_state = cmd_queue_cur_state;
+
+ LOG_DEBUG( "cur_state=%s goal_state=%s",
+ tap_state_name(cur_state),
+ tap_state_name(goal_state) );
+
+
+ if (goal_state==cur_state )
+ ; /* nothing to do */
+ else if( goal_state==TAP_RESET )
+ {
+ jtag_add_tlr();
+ }
+ else if( tap_is_state_stable(cur_state) && tap_is_state_stable(goal_state) )
+ {
+ unsigned tms_bits = tap_get_tms_path(cur_state, goal_state);
+ unsigned tms_count = tap_get_tms_path_len(cur_state, goal_state);
+ tap_state_t moves[8];
+ assert(tms_count < DIM(moves));
+
+ for (unsigned i = 0; i < tms_count; i++, tms_bits >>= 1)
+ {
+ bool bit = tms_bits & 1;
+
+ cur_state = tap_state_transition(cur_state, bit);
+ moves[i] = cur_state;
+ }
+
+ jtag_add_pathmove(tms_count, moves);
+ }
+ else if( tap_state_transition(cur_state, true) == goal_state
+ || tap_state_transition(cur_state, false) == goal_state )
+ {
+ jtag_add_pathmove(1, &goal_state);
+ }
+
+ else
+ return ERROR_FAIL;
+
+ return ERROR_OK;
+}
+
void jtag_add_runtest(int num_cycles, tap_state_t state)
{
jtag_prelude(state);
@@ -1249,50 +1293,6 @@
return jtag->srst_asserted(srst_asserted);
}
-int jtag_add_statemove(tap_state_t goal_state)
-{
- tap_state_t cur_state = cmd_queue_cur_state;
-
- LOG_DEBUG( "cur_state=%s goal_state=%s",
- tap_state_name(cur_state),
- tap_state_name(goal_state) );
-
-
- if (goal_state==cur_state )
- ; /* nothing to do */
- else if( goal_state==TAP_RESET )
- {
- jtag_add_tlr();
- }
- else if( tap_is_state_stable(cur_state) && tap_is_state_stable(goal_state) )
- {
- unsigned tms_bits = tap_get_tms_path(cur_state, goal_state);
- unsigned tms_count = tap_get_tms_path_len(cur_state, goal_state);
- tap_state_t moves[8];
- assert(tms_count < DIM(moves));
-
- for (unsigned i = 0; i < tms_count; i++, tms_bits >>= 1)
- {
- bool bit = tms_bits & 1;
-
- cur_state = tap_state_transition(cur_state, bit);
- moves[i] = cur_state;
- }
-
- jtag_add_pathmove(tms_count, moves);
- }
- else if( tap_state_transition(cur_state, true) == goal_state
- || tap_state_transition(cur_state, false) == goal_state )
- {
- jtag_add_pathmove(1, &goal_state);
- }
-
- else
- return ERROR_FAIL;
-
- return ERROR_OK;
-}
-
enum reset_types jtag_get_reset_config(void)
{
return jtag_reset_config;
Modified: trunk/src/jtag/jtag.h
===================================================================
--- trunk/src/jtag/jtag.h 2009-06-11 06:19:37 UTC (rev 2183)
+++ trunk/src/jtag/jtag.h 2009-06-11 07:08:03 UTC (rev 2184)
@@ -508,6 +508,39 @@
extern void jtag_add_pathmove(int num_states, const tap_state_t* path);
/**
+ * jtag_add_statemove() moves from the current state to @a goal_state.
+ *
+ * @param goal_state The final TAP state.
+ * @return ERROR_OK on success, or an error code on failure.
+ *
+ * Moves from the current state to the goal \a state.
+ *
+ * This needs to be handled according to the xsvf spec, see the XSTATE
+ * command description. From the XSVF spec, pertaining to XSTATE:
+ *
+ * For special states known as stable states (Test-Logic-Reset,
+ * Run-Test/Idle, Pause-DR, Pause- IR), an XSVF interpreter follows
+ * predefined TAP state paths when the starting state is a stable state
+ * and when the XSTATE specifies a new stable state. See the STATE
+ * command in the [Ref 5] for the TAP state paths between stable
+ * states.
+ *
+ * For non-stable states, XSTATE should specify a state that is only one
+ * TAP state transition distance from the current TAP state to avoid
+ * undefined TAP state paths. A sequence of multiple XSTATE commands can
+ * be issued to transition the TAP through a specific state path.
+ *
+ * @note Unless @c tms_bits holds a path that agrees with [Ref 5] in the
+ * above spec, then this code is not fully conformant to the xsvf spec.
+ * This puts a burden on tap_get_tms_path() function from the xsvf spec.
+ * If in doubt, you should confirm that that burden is being met.
+ *
+ * Otherwise, @a goal_state must be immediately reachable in one clock
+ * cycle, and does not need to be a stable state.
+ */
+extern int jtag_add_statemove(tap_state_t goal_state);
+
+/**
* Goes to TAP_IDLE (if we're not already there), cycle
* precisely num_cycles in the TAP_IDLE state, after which move
* to @a endstate (unless it is also TAP_IDLE).
@@ -674,39 +707,6 @@
tap_state_t end_state);
-/**
- * jtag_add_statemove() moves from the current state to @a goal_state.
- *
- * @param goal_state The final TAP state.
- * @return ERROR_OK on success, or an error code on failure.
- *
- * Moves from the current state to the goal \a state.
- *
- * This needs to be handled according to the xsvf spec, see the XSTATE
- * command description. From the XSVF spec, pertaining to XSTATE:
- *
- * For special states known as stable states (Test-Logic-Reset,
- * Run-Test/Idle, Pause-DR, Pause- IR), an XSVF interpreter follows
- * predefined TAP state paths when the starting state is a stable state
- * and when the XSTATE specifies a new stable state. See the STATE
- * command in the [Ref 5] for the TAP state paths between stable
- * states.
- *
- * For non-stable states, XSTATE should specify a state that is only one
- * TAP state transition distance from the current TAP state to avoid
- * undefined TAP state paths. A sequence of multiple XSTATE commands can
- * be issued to transition the TAP through a specific state path.
- *
- * @note Unless @c tms_bits holds a path that agrees with [Ref 5] in the
- * above spec, then this code is not fully conformant to the xsvf spec.
- * This puts a burden on tap_get_tms_path() function from the xsvf spec.
- * If in doubt, you should confirm that that burden is being met.
- *
- * Otherwise, @a goal_state must be immediately reachable in one clock
- * cycle, and does not need to be a stable state.
- */
-extern int jtag_add_statemove(tap_state_t goal_state);
-
/// @returns the number of times the scan queue has been flushed
int jtag_get_flush_queue_count(void);
|
|
From: oharboe at B. <oh...@ma...> - 2009-06-11 08:19:41
|
Author: oharboe
Date: 2009-06-11 08:19:37 +0200 (Thu, 11 Jun 2009)
New Revision: 2183
Modified:
trunk/src/target/target.c
Log:
disable polling continuous polling during reset
Modified: trunk/src/target/target.c
===================================================================
--- trunk/src/target/target.c 2009-06-10 22:22:49 UTC (rev 2182)
+++ trunk/src/target/target.c 2009-06-11 06:19:37 UTC (rev 2183)
@@ -434,9 +434,18 @@
return ERROR_FAIL;
}
+ /* disable polling during reset to make reset event scripts
+ * more predictable, i.e. dr/irscan & pathmove in events will
+ * not have JTAG operations injected into the middle of a sequence.
+ */
+ int save_poll = target_continous_poll;
+ target_continous_poll = 0;
+
sprintf( buf, "ocd_process_reset %s", n->name );
retval = Jim_Eval( interp, buf );
+ target_continous_poll = save_poll;
+
if(retval != JIM_OK) {
Jim_PrintErrorMessage(interp);
return ERROR_FAIL;
|
|
From: ntfreak at B. <nt...@ma...> - 2009-06-11 00:22:50
|
Author: ntfreak
Date: 2009-06-11 00:22:49 +0200 (Thu, 11 Jun 2009)
New Revision: 2182
Modified:
trunk/doc/openocd.texi
Log:
- update openocd online doc url's
Modified: trunk/doc/openocd.texi
===================================================================
--- trunk/doc/openocd.texi 2009-06-10 21:30:48 UTC (rev 2181)
+++ trunk/doc/openocd.texi 2009-06-10 22:22:49 UTC (rev 2182)
@@ -143,11 +143,11 @@
available. A version for more recent code may be available.
Its HTML form is published irregularly at:
-@uref{http://openocd.berlios.de/doc/}
+@uref{http://openocd.berlios.de/doc/html/index.html}
PDF form is likewise published at:
-@uref{http://openocd.berlios.de/doc/pdf/}
+@uref{http://openocd.berlios.de/doc/pdf/openocd.pdf}
@section OpenOCD User's Forum
|
|
From: ntfreak at B. <nt...@ma...> - 2009-06-10 23:30:49
|
Author: ntfreak
Date: 2009-06-10 23:30:48 +0200 (Wed, 10 Jun 2009)
New Revision: 2181
Modified:
trunk/doc/openocd.texi
Log:
- fix texi/pdf issue created in svn r2039
Modified: trunk/doc/openocd.texi
===================================================================
--- trunk/doc/openocd.texi 2009-06-10 07:19:14 UTC (rev 2180)
+++ trunk/doc/openocd.texi 2009-06-10 21:30:48 UTC (rev 2181)
@@ -4002,7 +4002,7 @@
Remove data watchpoint on @var{address}
@end deffn
-@deffn Command {wp} [address len [(@option{r}|@option{w}|@option{a}) [value [mask]]]
+@deffn Command {wp} [address len [(@option{r}|@option{w}|@option{a}) [value [mask]]]]
With no parameters, lists all active watchpoints.
Else sets a data watchpoint on data from @var{address} for @var{length} bytes.
The watch point is an "access" watchpoint unless
|
|
From: oharboe at B. <oh...@ma...> - 2009-06-10 09:19:19
|
Author: oharboe
Date: 2009-06-10 09:19:14 +0200 (Wed, 10 Jun 2009)
New Revision: 2180
Modified:
trunk/src/jtag/tcl.c
Log:
added pathmove command
Modified: trunk/src/jtag/tcl.c
===================================================================
--- trunk/src/jtag/tcl.c 2009-06-10 04:08:32 UTC (rev 2179)
+++ trunk/src/jtag/tcl.c 2009-06-10 07:19:14 UTC (rev 2180)
@@ -189,6 +189,7 @@
static int handle_runtest_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
static int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
+static int Jim_Command_pathmove(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
static int Jim_Command_flush_count(Jim_Interp *interp, int argc, Jim_Obj *const *args);
static int handle_verify_ircapture_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
@@ -658,6 +659,7 @@
COMMAND_EXEC, "execute IR scan <device> <instr> [dev2] [instr2] ...");
register_jim(cmd_ctx, "drscan", Jim_Command_drscan, "execute DR scan <device> <num_bits> <value> <num_bits1> <value2> ...");
register_jim(cmd_ctx, "flush_count", Jim_Command_flush_count, "returns number of times the JTAG queue has been flushed");
+ register_jim(cmd_ctx, "pathmove", Jim_Command_pathmove, "move JTAG to state1 then to state2, state3, etc. <state1>,<state2>,<stat3>...");
register_command(cmd_ctx, NULL, "verify_ircapture", handle_verify_ircapture_command,
COMMAND_ANY, "verify value captured during Capture-IR <enable|disable>");
@@ -1308,6 +1310,48 @@
}
+static int Jim_Command_pathmove(Jim_Interp *interp, int argc, Jim_Obj *const *args)
+{
+ tap_state_t states[8];
+
+ if ((argc < 2) || ((size_t)argc > (sizeof(states)/sizeof(*states)+1)))
+ {
+ Jim_WrongNumArgs(interp, 1, args, "wrong arguments");
+ return JIM_ERR;
+ }
+
+ int i;
+ for (i=0; i<argc-1; i++)
+ {
+ const char *cp;
+ cp = Jim_GetString( args[i+1], NULL );
+ states[i] = tap_state_by_name(cp);
+ if( states[i] < 0 )
+ {
+ /* update the error message */
+ Jim_SetResult_sprintf(interp,"endstate: %s invalid", cp );
+ return JIM_ERR;
+ }
+ }
+
+ if ((jtag_add_statemove(states[0]) != ERROR_OK) || ( jtag_execute_queue()!= ERROR_OK))
+ {
+ Jim_SetResultString(interp, "pathmove: jtag execute failed",-1);
+ return JIM_ERR;
+ }
+
+ jtag_add_pathmove(argc-2, states+1);
+
+ if (jtag_execute_queue()!= ERROR_OK)
+ {
+ Jim_SetResultString(interp, "pathmove: failed",-1);
+ return JIM_ERR;
+ }
+
+ return JIM_OK;
+}
+
+
static int Jim_Command_flush_count(Jim_Interp *interp, int argc, Jim_Obj *const *args)
{
Jim_SetResult(interp, Jim_NewIntObj(interp, jtag_get_flush_queue_count()));
|
|
From: <zw...@ma...> - 2009-06-10 06:08:36
|
Author: zwelch
Date: 2009-06-10 06:08:32 +0200 (Wed, 10 Jun 2009)
New Revision: 2179
Modified:
trunk/tcl/board/csb337.cfg
Log:
David Brownell <da...@pa...>:
Tweak the csb337 code so that it doesn't enable alignment traps when
it completes the "reset init" sequence. It turns out that the current
CFI code reliably triggers such traps.
Modified: trunk/tcl/board/csb337.cfg
===================================================================
--- trunk/tcl/board/csb337.cfg 2009-06-10 04:06:25 UTC (rev 2178)
+++ trunk/tcl/board/csb337.cfg 2009-06-10 04:08:32 UTC (rev 2179)
@@ -108,9 +108,7 @@
# I(12) = 1
# - Reserved/ones
# 6:3 = 1
- # - Alignment traps enabled
- # A(1) = 1
- arm920t cp15 2 0xc000107a
+ arm920t cp15 2 0xc0001078
}
$_TARGETNAME configure -event reset-init {csb337_reset_init}
|
|
From: <zw...@ma...> - 2009-06-10 06:06:33
|
Author: zwelch
Date: 2009-06-10 06:06:25 +0200 (Wed, 10 Jun 2009)
New Revision: 2178
Modified:
trunk/doc/openocd.texi
trunk/src/target/target.c
Log:
Move the documentation for the "poll" command up with
other server configuration. Explain what it's about;
reference the related "$target_name curstate" method.
Update "poll" output to report whether background polling
is enabled or not.
Also fix a small typo; PC's have "complementary" tools.
Some have also "complimentary" ones; but not all.
Modified: trunk/doc/openocd.texi
===================================================================
--- trunk/doc/openocd.texi 2009-06-09 14:18:28 UTC (rev 2177)
+++ trunk/doc/openocd.texi 2009-06-10 04:06:25 UTC (rev 2178)
@@ -1302,6 +1302,67 @@
use @option{enable} see these errors reported.
@end deffn
+@anchor{Event Polling}
+@section Event Polling
+
+Hardware debuggers are parts of asynchronous systems,
+where significant events can happen at any time.
+The OpenOCD server needs to detect some of these events,
+so it can report them to through TCL command line
+or to GDB.
+
+Examples of such events include:
+
+@itemize
+@item One of the targets can stop running ... maybe it triggers
+a code breakpoint or data watchpoint, or halts itself.
+@item Messages may be sent over ``debug message'' channels ... many
+targets support such messages sent over JTAG,
+for receipt by the person debugging or tools.
+@item Loss of power ... some adapters can detect these events.
+@item Resets not issued through JTAG ... such reset sources
+can include button presses or other system hardware, sometimes
+including the target itself (perhaps through a watchdog).
+@item Debug instrumentation sometimes supports event triggering
+such as ``trace buffer full'' (so it can quickly be emptied)
+or other signals (to correlate with code behavior).
+@end itemize
+
+None of those events are signaled through standard JTAG signals.
+However, most conventions for JTAG connectors include voltage
+level and system reset (SRST) signal detection.
+Some connectors also include instrumentation signals, which
+can imply events when those signals are inputs.
+
+In general, OpenOCD needs to periodically check for those events,
+either by looking at the status of signals on the JTAG connector
+or by sending synchronous ``tell me your status'' JTAG requests
+to the various active targets.
+There is a command to manage and monitor that polling,
+which is normally done in the background.
+
+@deffn Command poll [@option{on}|@option{off}]
+Poll the current target for its current state.
+(Also, @pxref{target curstate}.)
+If that target is in debug mode, architecture
+specific information about the current state is printed.
+An optional parameter
+allows background polling to be enabled and disabled.
+
+You could use this from the TCL command shell, or
+from GDB using @command{monitor poll} command.
+@example
+> poll
+background polling: on
+target state: halted
+target halted in ARM state due to debug-request, \
+ current mode: Supervisor
+cpsr: 0x800000d3 pc: 0x11081bfc
+MMU: disabled, D-Cache: disabled, I-Cache: enabled
+>
+@end example
+@end deffn
+
@node Interface - Dongle Configuration
@chapter Interface - Dongle Configuration
JTAG Adapters/Interfaces/Dongles are normally configured
@@ -2492,12 +2553,14 @@
@end example
@end deffn
+@anchor{target curstate}
@deffn Command {$target_name curstate}
Displays the current target state:
@code{debug-running},
@code{halted},
@code{reset},
@code{running}, or @code{unknown}.
+(Also, @pxref{Event Polling}.)
@end deffn
@deffn Command {$target_name eventlist}
@@ -3769,23 +3832,6 @@
@end example
@end deffn
-@deffn Command poll [@option{on}|@option{off}]
-Poll the current target for its current state.
-If that target is in debug mode, architecture
-specific information about the current state is printed. An optional parameter
-allows continuous polling to be enabled and disabled.
-
-@example
-> poll
-target state: halted
-target halted in ARM state due to debug-request, \
- current mode: Supervisor
-cpsr: 0x800000d3 pc: 0x11081bfc
-MMU: disabled, D-Cache: disabled, I-Cache: enabled
->
-@end example
-@end deffn
-
@deffn Command halt [ms]
@deffnx Command wait_halt [ms]
The @command{halt} command first sends a halt request to the target,
@@ -3843,7 +3889,7 @@
These commands are available when
OpenOCD is built with @option{--enable-ioutil}.
They are mainly useful on embedded targets;
-PC type hosts have complimentary tools.
+PC type hosts have complementary tools.
@emph{Note:} there are several more such commands.
Modified: trunk/src/target/target.c
===================================================================
--- trunk/src/target/target.c 2009-06-09 14:18:28 UTC (rev 2177)
+++ trunk/src/target/target.c 2009-06-10 04:06:25 UTC (rev 2178)
@@ -1770,9 +1770,11 @@
if (argc == 0)
{
- if((retval = target_poll(target)) != ERROR_OK)
+ command_print(cmd_ctx, "background polling: %s",
+ target_continous_poll ? "on" : "off");
+ if ((retval = target_poll(target)) != ERROR_OK)
return retval;
- if((retval = target_arch_state(target)) != ERROR_OK)
+ if ((retval = target_arch_state(target)) != ERROR_OK)
return retval;
}
|
|
From: <zw...@ma...> - 2009-06-09 16:18:32
|
Author: zwelch Date: 2009-06-09 16:18:28 +0200 (Tue, 09 Jun 2009) New Revision: 2177 Modified: trunk/configure.in trunk/src/jtag/Makefile.am Log: Improve use of automake conditionals for FTDI-based JTAG drivers: - Remove once-used XXX_FTD2XX symbols; replace with XXX_DRIVER symbols. - Enabled when either libftdi or FTD2xx driver should be built. - Eliminates redundant DRIVERSFILE assignment in JTAG automake input. Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2009-06-09 14:18:23 UTC (rev 2176) +++ trunk/configure.in 2009-06-09 14:18:28 UTC (rev 2177) @@ -903,11 +903,11 @@ AM_CONDITIONAL(AT91RM9200, test $build_at91rm9200 = yes) AM_CONDITIONAL(BITBANG, test $build_bitbang = yes) AM_CONDITIONAL(FT2232_LIBFTDI, test $build_ft2232_libftdi = yes) -AM_CONDITIONAL(FT2232_FTD2XX, test $build_ft2232_ftd2xx = yes) +AM_CONDITIONAL(FT2232_DRIVER, test $build_ft2232_ftd2xx = yes -o $build_ft2232_libftdi = yes) AM_CONDITIONAL(AMTJTAGACCEL, test $build_amtjtagaccel = yes) AM_CONDITIONAL(GW16012, test $build_gw16012 = yes) AM_CONDITIONAL(PRESTO_LIBFTDI, test $build_presto_libftdi = yes) -AM_CONDITIONAL(PRESTO_FTD2XX, test $build_presto_ftd2xx = yes) +AM_CONDITIONAL(PRESTO_DRIVER, test $build_presto_ftd2xx = yes -o $build_presto_libftdi = yes) AM_CONDITIONAL(USBPROG, test $build_usbprog = yes) AM_CONDITIONAL(OOCD_TRACE, test $build_oocd_trace = yes) AM_CONDITIONAL(JLINK, test $build_jlink = yes) Modified: trunk/src/jtag/Makefile.am =================================================================== --- trunk/src/jtag/Makefile.am 2009-06-09 14:18:23 UTC (rev 2176) +++ trunk/src/jtag/Makefile.am 2009-06-09 14:18:28 UTC (rev 2177) @@ -32,13 +32,9 @@ if DUMMY DRIVERFILES += dummy.c endif -if FT2232_LIBFTDI +if FT2232_DRIVER DRIVERFILES += ft2232.c -else -if FT2232_FTD2XX -DRIVERFILES += ft2232.c endif -endif if AMTJTAGACCEL DRIVERFILES += amt_jtagaccel.c endif @@ -54,13 +50,9 @@ if BITQ DRIVERFILES += bitq.c endif -if PRESTO_LIBFTDI +if PRESTO_DRIVER DRIVERFILES += presto.c -else -if PRESTO_FTD2XX -DRIVERFILES += presto.c endif -endif if USBPROG DRIVERFILES += usbprog.c endif |
|
From: <zw...@ma...> - 2009-06-09 16:18:26
|
Author: zwelch Date: 2009-06-09 16:18:23 +0200 (Tue, 09 Jun 2009) New Revision: 2176 Modified: trunk/src/jtag/Makefile.am Log: Simplify JTAG automake input file: - Consolidate all individual driver variables into DRIVERFILES. - Eliminates all empty 'else' conditional clauses. - Move minidriver files to top of file. - Use MINIDRIVER conditional to build only driver(s) that will be linked. - Eliminate superfluous whitespace. Modified: trunk/src/jtag/Makefile.am =================================================================== --- trunk/src/jtag/Makefile.am 2009-06-09 12:47:49 UTC (rev 2175) +++ trunk/src/jtag/Makefile.am 2009-06-09 14:18:23 UTC (rev 2176) @@ -5,145 +5,87 @@ METASOURCES = AUTO noinst_LTLIBRARIES = libjtag.la -if BITBANG -BITBANGFILES = bitbang.c -else -BITBANGFILES = +DRIVERFILES = + +if MINIDRIVER + +if ECOSBOARD +DRIVERFILES += zy1000/zy1000.c +AM_CPPFLAGS += -I$(srcdir)/zy1000 endif +if MINIDRIVER_DUMMY +DRIVERFILES += minidummy/minidummy.c commands.c +AM_CPPFLAGS += -I$(srcdir)/minidummy +endif -if PARPORT -PARPORTFILES = parport.c else -PARPORTFILES = -endif +# Standard Driver: common files +DRIVERFILES += driver.c commands.c + +if BITBANG +DRIVERFILES += bitbang.c +endif +if PARPORT +DRIVERFILES += parport.c +endif if DUMMY -DUMMYFILES = dummy.c -else -DUMMYFILES = +DRIVERFILES += dummy.c endif - if FT2232_LIBFTDI -FT2232FILES = ft2232.c +DRIVERFILES += ft2232.c else if FT2232_FTD2XX -FT2232FILES = ft2232.c -else -FT2232FILES = +DRIVERFILES += ft2232.c endif endif - if AMTJTAGACCEL -AMTJTAGACCELFILES = amt_jtagaccel.c -else -AMTJTAGACCELFILES = +DRIVERFILES += amt_jtagaccel.c endif - if EP93XX -EP93XXFILES = ep93xx.c -else -EP93XXFILES = +DRIVERFILES += ep93xx.c endif - -if ECOSBOARD -ECOSBOARDFILES = zy1000/zy1000.c -AM_CPPFLAGS += -I$(srcdir)/zy1000 -else -ECOSBOARDFILES = -endif - -if MINIDRIVER_DUMMY -MINIDUMMYFILES = minidummy/minidummy.c commands.c -AM_CPPFLAGS += -I$(srcdir)/minidummy -else -MINIDUMMYFILES = -endif - -if MINIDRIVER -DRIVERFILES = $(MINIDUMMYFILES) -else -DRIVERFILES = driver.c commands.c -endif - if AT91RM9200 -AT91RM9200FILES = at91rm9200.c -else -AT91RM9200FILES = +DRIVERFILES += at91rm9200.c endif - if GW16012 -GW16012FILES = gw16012.c -else -GW16012FILES = +DRIVERFILES += gw16012.c endif - if BITQ -BITQFILES = bitq.c -else -BITQFILES = +DRIVERFILES += bitq.c endif - if PRESTO_LIBFTDI -PRESTOFILES = presto.c +DRIVERFILES += presto.c else if PRESTO_FTD2XX -PRESTOFILES = presto.c -else -PRESTOFILES = +DRIVERFILES += presto.c endif endif - if USBPROG -USBPROGFILES = usbprog.c -else -USBPROGFILES = +DRIVERFILES += usbprog.c endif - if JLINK -JLINKFILES = jlink.c -else -JLINKFILES = +DRIVERFILES += jlink.c endif - if RLINK -RLINKFILES = rlink/rlink.c rlink/rlink_speed_table.c -else -RLINKFILES = +DRIVERFILES += rlink/rlink.c rlink/rlink_speed_table.c endif - if VSLLINK -VSLLINKFILES = vsllink.c -else -VSLLINKFILES = +DRIVERFILES += vsllink.c endif - if ARMJTAGEW -ARMJTAGEWFILES = arm-jtag-ew.c -else -ARMJTAGEWFILES = +DRIVERFILES += arm-jtag-ew.c endif +endif +# endif // MINIDRIVER + + libjtag_la_SOURCES = \ core.c \ tcl.c \ interface.c \ - $(DRIVERFILES) \ - $(BITBANGFILES) \ - $(PARPORTFILES) \ - $(DUMMYFILES) \ - $(FT2232FILES) \ - $(AMTJTAGACCELFILES) \ - $(EP93XXFILES) \ - $(AT91RM9200FILES) \ - $(GW16012FILES) \ - $(BITQFILES) \ - $(PRESTOFILES) \ - $(USBPROGFILES) \ - $(ECOSBOARDFILES) \ - $(JLINKFILES) \ - $(RLINKFILES) \ - $(VSLLINKFILES) \ - $(ARMJTAGEWFILES) + $(DRIVERFILES) noinst_HEADERS = \ interface.h \ |
|
From: <zw...@ma...> - 2009-06-09 14:47:55
|
Author: zwelch Date: 2009-06-09 14:47:49 +0200 (Tue, 09 Jun 2009) New Revision: 2175 Added: trunk/src/jtag/driver.c Removed: trunk/src/jtag/jtag_driver.c Modified: trunk/src/jtag/Makefile.am Log: Rename jtag_driver.c as driver.c to remove duplicate name component. Modified: trunk/src/jtag/Makefile.am =================================================================== --- trunk/src/jtag/Makefile.am 2009-06-09 12:01:56 UTC (rev 2174) +++ trunk/src/jtag/Makefile.am 2009-06-09 12:47:49 UTC (rev 2175) @@ -62,7 +62,7 @@ if MINIDRIVER DRIVERFILES = $(MINIDUMMYFILES) else -DRIVERFILES = jtag_driver.c commands.c +DRIVERFILES = driver.c commands.c endif if AT91RM9200 Copied: trunk/src/jtag/driver.c (from rev 2174, trunk/src/jtag/jtag_driver.c) Deleted: trunk/src/jtag/jtag_driver.c =================================================================== --- trunk/src/jtag/jtag_driver.c 2009-06-09 12:01:56 UTC (rev 2174) +++ trunk/src/jtag/jtag_driver.c 2009-06-09 12:47:49 UTC (rev 2175) @@ -1,520 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by Dominic Rath * - * Dom...@gm... * - * * - * Copyright (C) 2007,2008 Øyvind Harboe * - * oyv...@zy... * - * * - * Copyright (C) 2009 SoftPLC Corporation * - * http://softplc.com * - * di...@so... * - * * - * Copyright (C) 2009 Zachary T Welch * - * zw...@su... * - * * - * 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 - -#include "interface.h" -#include "minidriver.h" -#include "command.h" - -struct jtag_callback_entry -{ - struct jtag_callback_entry *next; - - jtag_callback_t callback; - u8 *in; - jtag_callback_data_t data1; - jtag_callback_data_t data2; - jtag_callback_data_t data3; -}; - -static struct jtag_callback_entry *jtag_callback_queue_head = NULL; -static struct jtag_callback_entry *jtag_callback_queue_tail = NULL; - -static void jtag_callback_queue_reset(void) -{ - jtag_callback_queue_head = NULL; - jtag_callback_queue_tail = NULL; -} - -/** - * Copy a scan_field_t for insertion into the queue. - * - * This allocates a new copy of out_value using cmd_queue_alloc. - */ -static void cmd_queue_scan_field_clone(scan_field_t * dst, const scan_field_t * src) -{ - dst->tap = src->tap; - dst->num_bits = src->num_bits; - dst->out_value = buf_cpy(src->out_value, cmd_queue_alloc(CEIL(src->num_bits, 8)), src->num_bits); - dst->in_value = src->in_value; -} - - -/** - * see jtag_add_ir_scan() - * - */ -int interface_jtag_add_ir_scan(int in_num_fields, const scan_field_t *in_fields, tap_state_t state) -{ - size_t num_taps = jtag_tap_count_enabled(); - - jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t)); - scan_command_t * scan = cmd_queue_alloc(sizeof(scan_command_t)); - scan_field_t * out_fields = cmd_queue_alloc(num_taps * sizeof(scan_field_t)); - - jtag_queue_command(cmd); - - cmd->type = JTAG_SCAN; - cmd->cmd.scan = scan; - - scan->ir_scan = true; - scan->num_fields = num_taps; /* one field per device */ - scan->fields = out_fields; - scan->end_state = state; - - - scan_field_t * field = out_fields; /* keep track where we insert data */ - - /* loop over all enabled TAPs */ - - for (jtag_tap_t * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap)) - { - /* search the input field list for fields for the current TAP */ - - bool found = false; - - for (int j = 0; j < in_num_fields; j++) - { - if (tap != in_fields[j].tap) - continue; - - /* if TAP is listed in input fields, copy the value */ - - found = true; - - tap->bypass = 0; - - assert(in_fields[j].num_bits == tap->ir_length); /* input fields must have the same length as the TAP's IR */ - - cmd_queue_scan_field_clone(field, in_fields + j); - - break; - } - - if (!found) - { - /* if a TAP isn't listed in input fields, set it to BYPASS */ - - tap->bypass = 1; - - field->tap = tap; - field->num_bits = tap->ir_length; - field->out_value = buf_set_ones(cmd_queue_alloc(CEIL(tap->ir_length, 8)), tap->ir_length); - field->in_value = NULL; /* do not collect input for tap's in bypass */ - } - - /* update device information */ - buf_cpy(field->out_value, tap->cur_instr, tap->ir_length); - - field++; - } - - assert(field == out_fields + num_taps); /* paranoia: jtag_tap_count_enabled() and jtag_tap_next_enabled() not in sync */ - - return ERROR_OK; -} - -/** - * see jtag_add_plain_ir_scan() - * - */ -int interface_jtag_add_plain_ir_scan(int in_num_fields, const scan_field_t *in_fields, tap_state_t state) -{ - - jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t)); - scan_command_t * scan = cmd_queue_alloc(sizeof(scan_command_t)); - scan_field_t * out_fields = cmd_queue_alloc(in_num_fields * sizeof(scan_field_t)); - - jtag_queue_command(cmd); - - cmd->type = JTAG_SCAN; - cmd->cmd.scan = scan; - - scan->ir_scan = true; - scan->num_fields = in_num_fields; - scan->fields = out_fields; - scan->end_state = state; - - for (int i = 0; i < in_num_fields; i++) - cmd_queue_scan_field_clone(out_fields + i, in_fields + i); - - return ERROR_OK; -} - - - -/** - * see jtag_add_dr_scan() - * - */ -int interface_jtag_add_dr_scan(int in_num_fields, const scan_field_t *in_fields, tap_state_t state) -{ - /* count devices in bypass */ - - size_t bypass_devices = 0; - - for (jtag_tap_t * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap)) - { - if (tap->bypass) - bypass_devices++; - } - - jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t)); - scan_command_t * scan = cmd_queue_alloc(sizeof(scan_command_t)); - scan_field_t * out_fields = cmd_queue_alloc((in_num_fields + bypass_devices) * sizeof(scan_field_t)); - - jtag_queue_command(cmd); - - cmd->type = JTAG_SCAN; - cmd->cmd.scan = scan; - - scan->ir_scan = false; - scan->num_fields = in_num_fields + bypass_devices; - scan->fields = out_fields; - scan->end_state = state; - - - scan_field_t * field = out_fields; /* keep track where we insert data */ - - /* loop over all enabled TAPs */ - - for (jtag_tap_t * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap)) - { - /* if TAP is not bypassed insert matching input fields */ - - if (!tap->bypass) - { - scan_field_t * start_field = field; /* keep initial position for assert() */ - - for (int j = 0; j < in_num_fields; j++) - { - if (tap != in_fields[j].tap) - continue; - - cmd_queue_scan_field_clone(field, in_fields + j); - - field++; - } - - assert(field > start_field); /* must have at least one input field per not bypassed TAP */ - } - - /* if a TAP is bypassed, generated a dummy bit*/ - else - { - field->tap = tap; - field->num_bits = 1; - field->out_value = NULL; - field->in_value = NULL; - - field++; - } - } - - assert(field == out_fields + scan->num_fields); /* no superfluous input fields permitted */ - - return ERROR_OK; -} - - - -/** - * Generate a DR SCAN using the array of output values passed to the function - * - * This function assumes that the parameter target_tap specifies the one TAP - * that is not bypassed. All other TAPs must be bypassed and the function will - * generate a dummy 1bit field for them. - * - * For the target_tap a sequence of output-only fields will be generated where - * each field has the size num_bits and the field's values are taken from - * the array value. - * - * The bypass status of TAPs is set by jtag_add_ir_scan(). - * - */ -void interface_jtag_add_dr_out(jtag_tap_t *target_tap, - int in_num_fields, - const int *num_bits, - const u32 *value, - tap_state_t end_state) -{ - /* count devices in bypass */ - - size_t bypass_devices = 0; - - for (jtag_tap_t * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap)) - { - if (tap->bypass) - bypass_devices++; - } - - - jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t)); - scan_command_t * scan = cmd_queue_alloc(sizeof(scan_command_t)); - scan_field_t * out_fields = cmd_queue_alloc((in_num_fields + bypass_devices) * sizeof(scan_field_t)); - - jtag_queue_command(cmd); - - cmd->type = JTAG_SCAN; - cmd->cmd.scan = scan; - - scan->ir_scan = false; - scan->num_fields = in_num_fields + bypass_devices; - scan->fields = out_fields; - scan->end_state = end_state; - - - bool target_tap_match = false; - - scan_field_t * field = out_fields; /* keep track where we insert data */ - - /* loop over all enabled TAPs */ - - for (jtag_tap_t * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap)) - { - /* if TAP is not bypassed insert matching input fields */ - - if (!tap->bypass) - { - assert(tap == target_tap); /* target_tap must match the one not bypassed TAP */ - - target_tap_match = true; - - for (int j = 0; j < in_num_fields; j++) - { - u8 out_value[4]; - size_t scan_size = num_bits[j]; - buf_set_u32(out_value, 0, scan_size, value[j]); - - field->tap = tap; - field->num_bits = scan_size; - field->out_value = buf_cpy(out_value, cmd_queue_alloc(CEIL(scan_size, 8)), scan_size); - field->in_value = NULL; - - field++; - } - } - - /* if a TAP is bypassed, generated a dummy bit*/ - else - { - - field->tap = tap; - field->num_bits = 1; - field->out_value = NULL; - field->in_value = NULL; - - field++; - } - } - - assert(target_tap_match); /* target_tap should be enabled and not bypassed */ -} - -/** - * see jtag_add_plain_dr_scan() - * - */ -int interface_jtag_add_plain_dr_scan(int in_num_fields, const scan_field_t *in_fields, tap_state_t state) -{ - jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t)); - scan_command_t * scan = cmd_queue_alloc(sizeof(scan_command_t)); - scan_field_t * out_fields = cmd_queue_alloc(in_num_fields * sizeof(scan_field_t)); - - jtag_queue_command(cmd); - - cmd->type = JTAG_SCAN; - cmd->cmd.scan = scan; - - scan->ir_scan = false; - scan->num_fields = in_num_fields; - scan->fields = out_fields; - scan->end_state = state; - - for (int i = 0; i < in_num_fields; i++) - cmd_queue_scan_field_clone(out_fields + i, in_fields + i); - - return ERROR_OK; -} - -int interface_jtag_add_tlr(void) -{ - tap_state_t state = TAP_RESET; - - /* allocate memory for a new list member */ - jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t)); - - jtag_queue_command(cmd); - - cmd->type = JTAG_STATEMOVE; - - cmd->cmd.statemove = cmd_queue_alloc(sizeof(statemove_command_t)); - cmd->cmd.statemove->end_state = state; - - return ERROR_OK; -} - -int interface_jtag_add_pathmove(int num_states, const tap_state_t *path) -{ - /* allocate memory for a new list member */ - jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t)); - - jtag_queue_command(cmd); - - cmd->type = JTAG_PATHMOVE; - - cmd->cmd.pathmove = cmd_queue_alloc(sizeof(pathmove_command_t)); - cmd->cmd.pathmove->num_states = num_states; - cmd->cmd.pathmove->path = cmd_queue_alloc(sizeof(tap_state_t) * num_states); - - for (int i = 0; i < num_states; i++) - cmd->cmd.pathmove->path[i] = path[i]; - - return ERROR_OK; -} - -int interface_jtag_add_runtest(int num_cycles, tap_state_t state) -{ - /* allocate memory for a new list member */ - jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t)); - - jtag_queue_command(cmd); - - cmd->type = JTAG_RUNTEST; - - cmd->cmd.runtest = cmd_queue_alloc(sizeof(runtest_command_t)); - cmd->cmd.runtest->num_cycles = num_cycles; - cmd->cmd.runtest->end_state = state; - - return ERROR_OK; -} - -int interface_jtag_add_clocks( int num_cycles ) -{ - /* allocate memory for a new list member */ - jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t)); - - jtag_queue_command(cmd); - - cmd->type = JTAG_STABLECLOCKS; - - cmd->cmd.stableclocks = cmd_queue_alloc(sizeof(stableclocks_command_t)); - cmd->cmd.stableclocks->num_cycles = num_cycles; - - return ERROR_OK; -} - -int interface_jtag_add_reset(int req_trst, int req_srst) -{ - /* allocate memory for a new list member */ - jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t)); - - jtag_queue_command(cmd); - - cmd->type = JTAG_RESET; - - cmd->cmd.reset = cmd_queue_alloc(sizeof(reset_command_t)); - cmd->cmd.reset->trst = req_trst; - cmd->cmd.reset->srst = req_srst; - - return ERROR_OK; -} - -int interface_jtag_add_sleep(u32 us) -{ - /* allocate memory for a new list member */ - jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t)); - - jtag_queue_command(cmd); - - cmd->type = JTAG_SLEEP; - - cmd->cmd.sleep = cmd_queue_alloc(sizeof(sleep_command_t)); - cmd->cmd.sleep->us = us; - - return ERROR_OK; -} - -/* add callback to end of queue */ -void interface_jtag_add_callback4(jtag_callback_t callback, u8 *in, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3) -{ - struct jtag_callback_entry *entry=cmd_queue_alloc(sizeof(struct jtag_callback_entry)); - - entry->next=NULL; - entry->callback=callback; - entry->in=in; - entry->data1=data1; - entry->data2=data2; - entry->data3=data3; - - if (jtag_callback_queue_head==NULL) - { - jtag_callback_queue_head=entry; - jtag_callback_queue_tail=entry; - } else - { - jtag_callback_queue_tail->next=entry; - jtag_callback_queue_tail=entry; - } -} - -int interface_jtag_execute_queue(void) -{ - int retval = default_interface_jtag_execute_queue(); - if (retval == ERROR_OK) - { - struct jtag_callback_entry *entry; - for (entry=jtag_callback_queue_head; entry!=NULL; entry=entry->next) - { - retval=entry->callback(entry->in, entry->data1, entry->data2, entry->data3); - if (retval!=ERROR_OK) - break; - } - } - - jtag_command_queue_reset(); - jtag_callback_queue_reset(); - - return retval; -} - -static int jtag_convert_to_callback4(u8 *in, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3) -{ - ((jtag_callback1_t)data1)(in); - return ERROR_OK; -} - -void interface_jtag_add_callback(jtag_callback1_t callback, u8 *in) -{ - jtag_add_callback4(jtag_convert_to_callback4, in, (jtag_callback_data_t)callback, 0, 0); -} - |
|
From: <zw...@ma...> - 2009-06-09 14:02:02
|
Author: zwelch Date: 2009-06-09 14:01:56 +0200 (Tue, 09 Jun 2009) New Revision: 2174 Modified: trunk/Makefile.am trunk/configure.in Log: Add a rule to rebuild libtool if ltmain.sh changes (from libtool docs). Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2009-06-09 11:05:45 UTC (rev 2173) +++ trunk/Makefile.am 2009-06-09 12:01:56 UTC (rev 2174) @@ -15,6 +15,9 @@ Doxyfile.in \ tools/logger.pl +libtool: $(LIBTOOL_DEPS) + $(SHELL) ./config.status --recheck + docs: pdf html doxygen Doxyfile: $(srcdir)/Doxyfile.in Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2009-06-09 11:05:45 UTC (rev 2173) +++ trunk/configure.in 2009-06-09 12:01:56 UTC (rev 2174) @@ -24,6 +24,7 @@ m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:]) AC_DISABLE_SHARED AC_PROG_LIBTOOL +AC_SUBST(LIBTOOL_DEPS) dnl configure checks required for Jim files (these are obsolete w/ C99) |
|
From: oharboe at B. <oh...@ma...> - 2009-06-09 13:05:47
|
Author: oharboe Date: 2009-06-09 13:05:45 +0200 (Tue, 09 Jun 2009) New Revision: 2173 Modified: trunk/Makefile.am trunk/configure.in Log: reset to eol native for now. guess-rev.sh was broken by eol native, but it was a red herring that these two files were affected. Property changes on: trunk/Makefile.am ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/configure.in ___________________________________________________________________ Name: svn:eol-style + native |
|
From: <zw...@ma...> - 2009-06-09 12:28:33
|
Author: zwelch Date: 2009-06-09 12:28:16 +0200 (Tue, 09 Jun 2009) New Revision: 2172 Modified: trunk/Makefile.am trunk/doc/Makefile.am trunk/src/Makefile.am trunk/src/flash/Makefile.am trunk/src/helper/Makefile.am trunk/src/jtag/Makefile.am trunk/src/pld/Makefile.am trunk/src/server/Makefile.am trunk/src/svf/Makefile.am trunk/src/target/Makefile.am trunk/src/xsvf/Makefile.am Log: Fix make maintainer-clean for out-of-tree builds. Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2009-06-09 10:07:07 UTC (rev 2171) +++ trunk/Makefile.am 2009-06-09 10:28:16 UTC (rev 2172) @@ -58,15 +58,15 @@ DISTCLEANFILES = doxygen.log MAINTAINERCLEANFILES = \ - configure \ - Makefile.in \ - depcomp \ - config.guess \ - config.sub \ - config.h.in \ - config.h.in~ \ - compile \ - ltmain.sh \ - missing \ - aclocal.m4 \ - install-sh + $(srcdir)/configure \ + $(srcdir)/Makefile.in \ + $(srcdir)/depcomp \ + $(srcdir)/config.guess \ + $(srcdir)/config.sub \ + $(srcdir)/config.h.in \ + $(srcdir)/config.h.in~ \ + $(srcdir)/compile \ + $(srcdir)/ltmain.sh \ + $(srcdir)/missing \ + $(srcdir)/aclocal.m4 \ + $(srcdir)/install-sh Modified: trunk/doc/Makefile.am =================================================================== --- trunk/doc/Makefile.am 2009-06-09 10:07:07 UTC (rev 2171) +++ trunk/doc/Makefile.am 2009-06-09 10:28:16 UTC (rev 2172) @@ -11,4 +11,7 @@ cp -p $(srcdir)/manual/$$i/* $(distdir)/manual/$$i/; \ done -MAINTAINERCLEANFILES = Makefile.in mdate-sh texinfo.tex +MAINTAINERCLEANFILES = \ + $(srcdir)/Makefile.in \ + $(srcdir)/mdate-sh \ + $(srcdir)/texinfo.tex Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2009-06-09 10:07:07 UTC (rev 2171) +++ trunk/src/Makefile.am 2009-06-09 10:28:16 UTC (rev 2172) @@ -89,4 +89,4 @@ libopenocd_la_LIBADD += -lmicrohttpd endif -MAINTAINERCLEANFILES = Makefile.in +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in Modified: trunk/src/flash/Makefile.am =================================================================== --- trunk/src/flash/Makefile.am 2009-06-09 10:07:07 UTC (rev 2171) +++ trunk/src/flash/Makefile.am 2009-06-09 10:28:16 UTC (rev 2172) @@ -58,4 +58,4 @@ pic32mx.h \ avrf.h -MAINTAINERCLEANFILES = Makefile.in +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in Modified: trunk/src/helper/Makefile.am =================================================================== --- trunk/src/helper/Makefile.am 2009-06-09 10:07:07 UTC (rev 2171) +++ trunk/src/helper/Makefile.am 2009-06-09 10:28:16 UTC (rev 2172) @@ -60,4 +60,4 @@ # add startup_tcl.c to make clean list CLEANFILES = startup_tcl.c bin2char$(EXEEXT_FOR_BUILD) -MAINTAINERCLEANFILES = Makefile.in +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in Modified: trunk/src/jtag/Makefile.am =================================================================== --- trunk/src/jtag/Makefile.am 2009-06-09 10:07:07 UTC (rev 2171) +++ trunk/src/jtag/Makefile.am 2009-06-09 10:28:16 UTC (rev 2172) @@ -158,4 +158,4 @@ rlink/st7.h \ minidummy/jtag_minidriver.h -MAINTAINERCLEANFILES = Makefile.in +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in Modified: trunk/src/pld/Makefile.am =================================================================== --- trunk/src/pld/Makefile.am 2009-06-09 10:07:07 UTC (rev 2171) +++ trunk/src/pld/Makefile.am 2009-06-09 10:28:16 UTC (rev 2172) @@ -8,4 +8,4 @@ noinst_HEADERS = pld.h xilinx_bit.h virtex2.h libpld_la_SOURCES = pld.c xilinx_bit.c virtex2.c -MAINTAINERCLEANFILES = Makefile.in +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in Modified: trunk/src/server/Makefile.am =================================================================== --- trunk/src/server/Makefile.am 2009-06-09 10:07:07 UTC (rev 2171) +++ trunk/src/server/Makefile.am 2009-06-09 10:28:16 UTC (rev 2172) @@ -42,4 +42,4 @@ httpd/Stylizer.java \ httpd/Stylizer.class -MAINTAINERCLEANFILES = Makefile.in +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in Modified: trunk/src/svf/Makefile.am =================================================================== --- trunk/src/svf/Makefile.am 2009-06-09 10:07:07 UTC (rev 2171) +++ trunk/src/svf/Makefile.am 2009-06-09 10:28:16 UTC (rev 2172) @@ -8,4 +8,4 @@ noinst_HEADERS = svf.h libsvf_la_SOURCES = svf.c -MAINTAINERCLEANFILES = Makefile.in +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in Modified: trunk/src/target/Makefile.am =================================================================== --- trunk/src/target/Makefile.am 2009-06-09 10:07:07 UTC (rev 2171) +++ trunk/src/target/Makefile.am 2009-06-09 10:28:16 UTC (rev 2172) @@ -98,4 +98,4 @@ nobase_dist_pkglib_DATA += xscale/debug_handler.bin nobase_dist_pkglib_DATA += ecos/at91eb40a.elf -MAINTAINERCLEANFILES = Makefile.in +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in Modified: trunk/src/xsvf/Makefile.am =================================================================== --- trunk/src/xsvf/Makefile.am 2009-06-09 10:07:07 UTC (rev 2171) +++ trunk/src/xsvf/Makefile.am 2009-06-09 10:28:16 UTC (rev 2172) @@ -8,4 +8,4 @@ noinst_HEADERS = xsvf.h libxsvf_la_SOURCES = xsvf.c -MAINTAINERCLEANFILES = Makefile.in +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in |
|
From: <zw...@ma...> - 2009-06-09 12:07:12
|
Author: zwelch
Date: 2009-06-09 12:07:07 +0200 (Tue, 09 Jun 2009)
New Revision: 2171
Modified:
trunk/src/jtag/core.c
trunk/src/jtag/jtag.h
trunk/src/jtag/tcl.c
Log:
Encapsulate the core jtag interface pointer:
- Add new jtag_config_khz to increase encapsulation of jtag->khz call.
- Add new jtag_get_speed_readable to encapsulate of jtag->speed_div call.
- Make definition of jtag static in core.c, remove extern from tcl.c.
Modified: trunk/src/jtag/core.c
===================================================================
--- trunk/src/jtag/core.c 2009-06-09 08:59:54 UTC (rev 2170)
+++ trunk/src/jtag/core.c 2009-06-09 10:07:07 UTC (rev 2171)
@@ -103,7 +103,7 @@
static bool hasKHz = false;
static int jtag_speed = 0;
-struct jtag_interface_s *jtag = NULL;
+static struct jtag_interface_s *jtag = NULL;
/* configuration */
jtag_interface_t *jtag_interface = NULL;
@@ -1178,6 +1178,27 @@
{
return speed_khz;
}
+int jtag_config_khz(unsigned khz)
+{
+ LOG_DEBUG("handle jtag khz");
+ jtag_set_speed_khz(khz);
+
+ int cur_speed = 0;
+ if (jtag != NULL)
+ {
+ LOG_DEBUG("have interface set up");
+ int speed_div1;
+ int retval = jtag->khz(jtag_get_speed_khz(), &speed_div1);
+ if (ERROR_OK != retval)
+ {
+ jtag_set_speed_khz(0);
+ return retval;
+ }
+ cur_speed = speed_div1;
+ }
+ return jtag_set_speed(cur_speed);
+}
+
int jtag_get_speed(void)
{
return jtag_speed;
@@ -1192,6 +1213,12 @@
return jtag ? jtag->speed(speed) : ERROR_OK;
}
+int jtag_get_speed_readable(int *speed)
+{
+ return jtag ? jtag->speed_div(jtag_get_speed(), speed) : ERROR_OK;
+}
+
+
void jtag_set_verify(bool enable)
{
jtag_verify = enable;
Modified: trunk/src/jtag/jtag.h
===================================================================
--- trunk/src/jtag/jtag.h 2009-06-09 08:59:54 UTC (rev 2170)
+++ trunk/src/jtag/jtag.h 2009-06-09 10:07:07 UTC (rev 2171)
@@ -270,6 +270,14 @@
/// @returns The current JTAG speed setting.
int jtag_get_speed(void);
/**
+ * Given a @a speed setting, use the interface @c speed_div callback to
+ * adjust the setting.
+ * @param speed The speed setting to convert back to readable KHz.
+ * @returns ERROR_OK if the interface has not been initialized or on success;
+ * otherwise, the error code produced by the @c speed_div callback.
+ */
+int jtag_get_speed_readable(int *speed);
+/**
* Set the JTAG speed. This routine will call the underlying
* interface @c speed callback, if the interface has been initialized.
* @param speed The new speed setting.
@@ -708,6 +716,7 @@
void jtag_set_ntrst_delay(unsigned delay);
unsigned jtag_get_ntrst_delay(void);
+int jtag_config_khz(unsigned khz);
void jtag_set_speed_khz(unsigned speed);
unsigned jtag_get_speed_khz(void);
Modified: trunk/src/jtag/tcl.c
===================================================================
--- trunk/src/jtag/tcl.c 2009-06-09 08:59:54 UTC (rev 2170)
+++ trunk/src/jtag/tcl.c 2009-06-09 10:07:07 UTC (rev 2171)
@@ -170,7 +170,6 @@
NULL,
};
-extern struct jtag_interface_s *jtag;
extern jtag_interface_t *jtag_interface;
/* jtag commands */
@@ -1012,41 +1011,24 @@
return ERROR_COMMAND_SYNTAX_ERROR;
int retval = ERROR_OK;
- int cur_speed = 0;
if (argc == 1)
{
- LOG_DEBUG("handle jtag khz");
-
- jtag_set_speed_khz(strtoul(args[0], NULL, 0));
- if (jtag != NULL)
- {
- LOG_DEBUG("have interface set up");
- int speed_div1;
- retval = jtag->khz(jtag_get_speed_khz(), &speed_div1);
- if (ERROR_OK != retval)
- {
- jtag_set_speed_khz(0);
- return retval;
- }
- cur_speed = speed_div1;
- }
- retval = jtag_set_speed(cur_speed);
- }
-
- cur_speed = jtag_get_speed_khz();
- if (jtag != NULL)
- {
- retval = jtag->speed_div(jtag_get_speed(), &cur_speed);
+ retval = jtag_config_khz(strtoul(args[0], NULL, 0));
if (ERROR_OK != retval)
return retval;
}
+ int cur_speed;
+ retval = jtag_get_speed_readable(&cur_speed);
+ if (ERROR_OK != retval)
+ return retval;
+
if (cur_speed)
command_print(cmd_ctx, "%d kHz", cur_speed);
else
command_print(cmd_ctx, "RCLK - adaptive");
- return retval;
+ return retval;
}
static int handle_jtag_reset_command(struct command_context_s *cmd_ctx,
|