You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
(16) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <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, |
From: oharboe at B. <oh...@ma...> - 2009-06-09 10:59:55
|
Author: oharboe Date: 2009-06-09 10:59:54 +0200 (Tue, 09 Jun 2009) New Revision: 2170 Modified: trunk/configure.in Log: dos2unix Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2009-06-09 08:41:36 UTC (rev 2169) +++ trunk/configure.in 2009-06-09 08:59:54 UTC (rev 2170) @@ -1,1028 +1,1028 @@ -AC_PREREQ(2.60) -AC_INIT([openocd], [0.2.0-in-development], - [OpenOCD Mailing List <ope...@li...>]) -AC_CONFIG_SRCDIR([src/openocd.c]) - -AM_INIT_AUTOMAKE([-Wall -Wno-portability]) -AM_MAINTAINER_MODE - -AM_CONFIG_HEADER(config.h) -AH_BOTTOM([ -#include "system.h" -#include "replacements.h" -]) - -AC_LANG_C -AC_PROG_CC -AC_PROG_CC_C99 -AM_PROG_CC_C_O -AC_PROG_RANLIB - -dnl disable checks for C++, Fortran and GNU Java Compiler -m4_defun([_LT_AC_LANG_CXX_CONFIG], [:]) -m4_defun([_LT_AC_LANG_F77_CONFIG], [:]) -m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:]) -AC_DISABLE_SHARED -AC_PROG_LIBTOOL - - -dnl configure checks required for Jim files (these are obsolete w/ C99) -AC_C_CONST -AC_TYPE_LONG_LONG_INT - - -AC_SEARCH_LIBS([ioperm], [ioperm]) -AC_SEARCH_LIBS([dlopen], [dl]) - -AC_CHECK_HEADERS(arpa/inet.h) -AC_CHECK_HEADERS(elf.h) -AC_CHECK_HEADERS(dirent.h) -AC_CHECK_HEADERS(fcntl.h) -AC_CHECK_HEADERS(ifaddrs.h) -AC_CHECK_HEADERS(malloc.h) -AC_CHECK_HEADERS(netdb.h) -AC_CHECK_HEADERS(netinet/in.h) -AC_CHECK_HEADERS(netinet/tcp.h) -AC_CHECK_HEADERS(pthread.h) -AC_CHECK_HEADERS(strings.h) -AC_CHECK_HEADERS(sys/ioctl.h) -AC_CHECK_HEADERS(sys/param.h) -AC_CHECK_HEADERS(sys/poll.h) -AC_CHECK_HEADERS(sys/select.h) -AC_CHECK_HEADERS(sys/socket.h) -AC_CHECK_HEADERS(sys/stat.h) -AC_CHECK_HEADERS(sys/time.h) -AC_CHECK_HEADERS(sys/types.h) -AC_CHECK_HEADERS(unistd.h) - -AC_CHECK_HEADERS([net/if.h], [], [], [dnl -#include <stdio.h> -#ifdef STDC_HEADERS -# include <stdlib.h> -# include <stddef.h> -#else -# ifdef HAVE_STDLIB_H -# include <stdlib.h> -# endif -#endif -#ifdef HAVE_SYS_SOCKET_H -# include <sys/socket.h> -#endif -]) - -AC_HEADER_ASSERT -AC_HEADER_STDBOOL -AC_HEADER_TIME - -AC_C_BIGENDIAN - -AC_CHECK_FUNCS(strndup) -AC_CHECK_FUNCS(strnlen) -AC_CHECK_FUNCS(gettimeofday) -AC_CHECK_FUNCS(usleep) -AC_CHECK_FUNCS(vasprintf) - -build_bitbang=no -build_bitq=no -is_cygwin=no -is_mingw=no -is_win32=no -is_darwin=no -build_release=yes - -AC_ARG_ENABLE(release, - AS_HELP_STRING([--enable-release], [Enable Release Build, default no]), - [build_release=$enableval], [build_release=no]) - -if test $cross_compiling = no; then - if test $build_release = no; then - # check we can find guess-rev.sh - AC_CHECK_FILE("$srcdir/guess-rev.sh", build_release=no, build_release=yes) - fi -fi - -# We are not *ALWAYS* being installed in the standard place. -# We may be installed in a "tool-build" specific location. -# Normally with other packages - as part of a tool distro. -# Thus - we should search that 'libdir' also. -# -# And - if we are being installed there - the odds are -# The libraries unique to what we are are there too. -# - -# Expand nd deal with NONE - just like configure will do later -OCDprefix=$prefix -OCDxprefix=$exec_prefix -test x"$OCDprefix" = xNONE && OCDprefix=$ac_default_prefix -# Let make expand exec_prefix. -test x"$OCDxprefix" = xNONE && OCDxprefix="$OCDprefix" - -# what matters is the "exec-prefix" -if test "$OCDxprefix" != "$ac_default_prefix" -then - # We are installing in a non-standard place - # Nonstandard --prefix and/or --exec-prefix - # We have an override of some sort. - # use build specific install library dir - - LDFLAGS="$LDFLAGS -L$OCDxprefix/lib" - # RPATH becomes an issue on Linux only - if test $host_os = linux-gnu || test $host_os = linux ; then - LDFLAGS="$LDFLAGS -Wl,-rpath,$OCDxprefix/lib" - fi - # The "INCDIR" is also usable - CFLAGS="$CFLAGS -I$includedir" -fi - -AC_ARG_WITH(ftd2xx, - AS_HELP_STRING([--with-ftd2xx=<PATH>],[This option has been removed.]), - [ -# Option Given. -cat << __EOF__ - -The option: --with-ftd2xx=<PATH> has been removed. -On Linux, the new option is: - - --with-ftd2xx-linux-tardir=/path/to/files - -Where <path> is the path the the directory where the "tar.gz" file -from FTDICHIP.COM was unpacked, for example: - - --with-ftd2xx-linux-tardir=${HOME}/libftd2xx0.4.16 - -On Cygwin/MingW32, the new option is: - - --with-ftd2xx-win32-zipdir=/path/to/files - -Where <path> is the path to the directory where the "zip" file from -FTDICHIP.COM was unpacked, for example: - - --with-ftd2xx-win32-zipdir=${HOME}/ftd2xx.cdm.files - -__EOF__ - - AC_MSG_ERROR([Sorry Cannot continue]) - ], [true]) - -#======================================== -# FTD2XXX support comes in 4 forms. -# (1) win32 - via a zip file -# (2) linux - via a tar file -# (3) linux/cygwin/mingw - via libftdi -# (4) darwin - installed under /usr/local -# -# In case (1) and (2) we need to know where the package was unpacked. - -AC_ARG_WITH(ftd2xx-win32-zipdir, - AS_HELP_STRING([--with-ftd2xx-win32-zipdir],[Where (CYGWIN/MINGW) the zip file from ftdichip.com was unpacked <default=search>]), - [ - # option present - if test -d $with_ftd2xx_win32_zipdir - then - with_ftd2xx_win32_zipdir=`cd $with_ftd2xx_win32_zipdir && pwd` - AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_win32_zipdir]) - else - AC_MSG_ERROR([Parameter to --with-ftd2xx-win32-zipdir is not a dir: $with_ftd2xx_win32_zipdir]) - fi - ], [true]) - -AC_ARG_WITH(ftd2xx-linux-tardir, - AS_HELP_STRING([--with-ftd2xx-linux-tardir], [Where (Linux/Unix) the tar file from ftdichip.com was unpacked <default=search>]), - [ - # Option present - if test $is_win32 = yes ; then - AC_MSG_ERROR([The option: --with-ftd2xx-linux-tardir is only usable on linux]) - fi - if test -d $with_ftd2xx_linux_tardir - then - with_ftd2xx_linux_tardir=`cd $with_ftd2xx_linux_tardir && pwd` - AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_linux_tardir]) - else - AC_MSG_ERROR([Parameter to --with-ftd2xx-linux-tardir is not a dir: $with_ftd2xx_linux_tardir]) - fi - ], [true]) - -AC_ARG_WITH(ftd2xx-lib, - AS_HELP_STRING([--with-ftd2xx-lib], - [Use static or shared ftd2xx libs on default static]), - [ - case "$withval" in - static) - with_ftd2xx_lib=$withval - ;; - shared) - with_ftd2xx_lib=$withval - ;; - *) - AC_MSG_ERROR([Option: --with-ftd2xx-lib=static or --with-ftd2xx-lib=shared not, $withval]) - ;; - esac - ], [ - # Default is static - it is simpler :-( - with_ftd2xx_lib=static - ]) - -AC_ARG_ENABLE(gccwarnings, - AS_HELP_STRING([--disable-gccwarnings], [Disable compiler warnings]), - [gcc_warnings=$enableval], [gcc_warnings=yes]) - -AC_ARG_ENABLE(wextra, - AS_HELP_STRING([--disable-wextra], [Disable extra compiler warnings]), - [gcc_wextra=$enableval], [gcc_wextra=$gcc_warnings]) - -AC_ARG_ENABLE(werror, - AS_HELP_STRING([--disable-werror], [Do not treat warnings as errors]), - [gcc_werror=$enableval], [gcc_werror=$gcc_warnings]) - -# set default verbose options, overridden by following options -debug_jtag_io=no -debug_usb_io=no -debug_usb_comms=no - -AC_ARG_ENABLE(verbose, - AS_HELP_STRING([--enable-verbose], - [Enable verbose JTAG I/O messages (for debugging).]), - [ - debug_jtag_io=$enableval - debug_usb_io=$enableval - debug_usb_comms=$enableval - ], []) - -AC_ARG_ENABLE(verbose_jtag_io, - AS_HELP_STRING([--enable-verbose-jtag-io], - [Enable verbose JTAG I/O messages (for debugging).]), - [debug_jtag_io=$enableval], []) -AC_ARG_ENABLE(verbose_usb_io, - AS_HELP_STRING([--enable-verbose-usb-io], - [Enable verbose USB I/O messages (for debugging)]), - [debug_usb_io=$enableval], []) -AC_ARG_ENABLE(verbose_usb_comms, - AS_HELP_STRING([--enable-verbose-usb-comms], - [Enable verbose USB communication messages (for debugging)]), - [debug_usb_comms=$enableval], []) - -AC_MSG_CHECKING([whether to enable verbose JTAG I/O messages]); -AC_MSG_RESULT($debug_jtag_io) -if test $debug_jtag_io = yes; then - AC_DEFINE([_DEBUG_JTAG_IO_],[1], [Print verbose JTAG I/O messages]) -fi - -AC_MSG_CHECKING([whether to enable verbose USB I/O messages]); -AC_MSG_RESULT($debug_usb_io) -if test $debug_usb_io = yes; then - AC_DEFINE([_DEBUG_USB_IO_],[1], [Print verbose USB I/O messages]) -fi - -AC_MSG_CHECKING([whether to enable verbose USB communication messages]); -AC_MSG_RESULT($debug_usb_comms) -if test $debug_usb_comms = yes; then - AC_DEFINE([_DEBUG_USB_COMMS_],[1], [Print verbose USB communication messages]) -fi - - -debug_malloc=no -AC_ARG_ENABLE(malloc_logging, - AS_HELP_STRING([--enable-malloc-logging], - [Include free space in logging messages (requires malloc.h).]), - [debug_malloc=$enableval], []) - -AC_MSG_CHECKING([whether to enable malloc free space logging]); -AC_MSG_RESULT($debug_malloc) -if test $debug_malloc = yes; then - AC_DEFINE([_DEBUG_FREE_SPACE_],[1], [Include malloc free space in logging]) -fi - - -AC_ARG_ENABLE(dummy, - AS_HELP_STRING([--enable-dummy], [Enable building the dummy port driver]), - [build_dummy=$enableval], [build_dummy=no]) - -AC_ARG_ENABLE(parport, - AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]), - [build_parport=$enableval], [build_parport=no]) - -AC_ARG_ENABLE(parport_ppdev, - AS_HELP_STRING([--disable-parport-ppdev], - [Disable use of ppdev (/dev/parportN) for parport (for x86 only)]), - [parport_use_ppdev=$enableval], [parport_use_ppdev=]) - -AC_ARG_ENABLE(parport_giveio, - AS_HELP_STRING([--enable-parport-giveio], - [Enable use of giveio for parport (for CygWin only)]), - [parport_use_giveio=$enableval], [parport_use_giveio=]) - -AC_ARG_ENABLE(ft2232_libftdi, - AS_HELP_STRING([--enable-ft2232_libftdi], [Enable building support for FT2232 based devices using the libftdi driver, opensource alternate of FTD2XX]), - [build_ft2232_libftdi=$enableval], [build_ft2232_libftdi=no]) - -AC_ARG_ENABLE(ft2232_ftd2xx, - AS_HELP_STRING([--enable-ft2232_ftd2xx], [Enable building support for FT2232 based devices using the FTD2XX driver from ftdichip.com]), - [build_ft2232_ftd2xx=$enableval], [build_ft2232_ftd2xx=no]) - -AC_ARG_ENABLE(ftd2xx_highspeed, - AS_HELP_STRING([--enable-ftd2xx-highspeed], [Enable building support for FT2232H and FT4232H-based devices (requires >=libftd2xx-0.4.16)]), - [want_ftd2xx_highspeed=$enableval], [want_ftd2xx_highspeed=maybe]) - -AC_ARG_ENABLE(amtjtagaccel, - AS_HELP_STRING([--enable-amtjtagaccel], [Enable building the Amontec JTAG-Accelerator driver]), - [build_amtjtagaccel=$enableval], [build_amtjtagaccel=no]) - -AC_ARG_ENABLE(ecosboard, - AS_HELP_STRING([--enable-ecosboard], [Enable building support for eCosBoard based JTAG debugger]), - [build_ecosboard=$enableval], [build_ecosboard=no]) - -AC_ARG_ENABLE(ioutil, - AS_HELP_STRING([--enable-ioutil], [Enable ioutil functions - useful for standalone OpenOCD implementations]), - [build_ioutil=$enableval], [build_ioutil=no]) - -AC_ARG_ENABLE(httpd, - AS_HELP_STRING([--enable-httpd], [Enable builtin httpd server - useful for standalone OpenOCD implementations]), - [build_httpd=$enableval], [build_httpd=no]) - -case "${host_cpu}" in - arm*) - AC_ARG_ENABLE(ep93xx, - AS_HELP_STRING([--enable-ep93xx], [Enable building support for EP93xx based SBCs]), - [build_ep93xx=$enableval], [build_ep93xx=no]) - - AC_ARG_ENABLE(at91rm9200, - AS_HELP_STRING([--enable-at91rm9200], [Enable building support for AT91RM9200 based SBCs]), - [build_at91rm9200=$enableval], [build_at91rm9200=no]) - ;; - - *) - build_ep93xx=no - build_at91rm9200=no - ;; -esac - -AC_ARG_ENABLE(gw16012, - AS_HELP_STRING([--enable-gw16012], [Enable building support for the Gateworks GW16012 JTAG Programmer]), - [build_gw16012=$enableval], [build_gw16012=no]) - -AC_ARG_ENABLE(presto_libftdi, - AS_HELP_STRING([--enable-presto_libftdi], [Enable building support for ASIX Presto Programmer using the libftdi driver]), - [build_presto_libftdi=$enableval], [build_presto_libftdi=no]) - -AC_ARG_ENABLE(presto_ftd2xx, - AS_HELP_STRING([--enable-presto_ftd2xx], [Enable building support for ASIX Presto Programmer using the FTD2XX driver]), - [build_presto_ftd2xx=$enableval], [build_presto_ftd2xx=no]) - -AC_ARG_ENABLE(usbprog, - AS_HELP_STRING([--enable-usbprog], [Enable building support for the usbprog JTAG Programmer]), - [build_usbprog=$enableval], [build_usbprog=no]) - -AC_ARG_ENABLE(oocd_trace, - AS_HELP_STRING([--enable-oocd_trace], [Enable building support for the OpenOCD+trace ETM capture device]), - [build_oocd_trace=$enableval], [build_oocd_trace=no]) - -AC_ARG_ENABLE(jlink, - AS_HELP_STRING([--enable-jlink], [Enable building support for the Segger J-Link JTAG Programmer]), - [build_jlink=$enableval], [build_jlink=no]) - -AC_ARG_ENABLE(vsllink, - AS_HELP_STRING([--enable-vsllink], [Enable building support for the Versaloon-Link JTAG Programmer]), - [build_vsllink=$enableval], [build_vsllink=no]) - -AC_ARG_ENABLE(rlink, - AS_HELP_STRING([--enable-rlink], [Enable building support for the Raisonance RLink JTAG Programmer]), - [build_rlink=$enableval], [build_rlink=no]) - -AC_ARG_ENABLE(arm-jtag-ew, - AS_HELP_STRING([--enable-arm-jtag-ew], [Enable building support for the Olimex ARM-JTAG-EW Programmer]), - [build_armjtagew=$enableval], [build_armjtagew=no]) - -AC_ARG_ENABLE(minidriver_dummy, - AS_HELP_STRING([--enable-minidriver-dummy], [Enable the dummy minidriver.]), - [build_minidriver_dummy=$enableval], [build_minidriver_dummy=no]) - - -build_minidriver=no -AC_MSG_CHECKING([whether to enable ZY1000 minidriver]) -if test $build_ecosboard = yes; then - if test $build_minidriver = yes; then - AC_MSG_ERROR([Multiple minidriver options have been enabled.]) - fi - AC_DEFINE(HAVE_JTAG_MINIDRIVER_H, 1, - [Define to 1 if you have the <jtag_minidriver.h> header file.]) - build_minidriver=yes -fi -AC_MSG_RESULT($build_ecosboard) - - -AC_MSG_CHECKING([whether to enable dummy minidriver]) -if test $build_minidriver_dummy = yes; then - if test $build_minidriver = yes; then - AC_MSG_ERROR([Multiple minidriver options have been enabled.]) - fi - build_minidriver=yes - AC_DEFINE(BUILD_MINIDRIVER_DUMMY, 1, [Use the dummy minidriver.]) - AC_DEFINE(HAVE_JTAG_MINIDRIVER_H, 1, - [Define to 1 if you have the <jtag_minidriver.h> header file.]) -fi -AC_MSG_RESULT($build_minidriver_dummy) - -AC_MSG_CHECKING([whether standard drivers can be built]) -if test "$build_minidriver" = yes; then - AC_MSG_RESULT([no]) - AC_MSG_WARN([Using the minidriver disables all other drivers.]) - sleep 2 -else - AC_MSG_RESULT([yes]) -fi - -case "${host_cpu}" in - i?86|x86*) - ;; - *) - if test x$parport_use_ppdev = xno; then - AC_MSG_WARN([--disable-parport-ppdev is not supported by the host CPU]) - fi - parport_use_ppdev=yes - ;; -esac - -case $host in - *-cygwin*) - is_win32=yes - - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[return __MINGW32__;]), - [is_mingw=yes],[is_mingw=no]) - if test $is_mingw = yes; then - AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.]) - if test x$parport_use_giveio = xno; then - AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts]) - fi - parport_use_giveio=yes - is_cygwin=no - else - is_cygwin=yes - AC_DEFINE(IS_CYGWIN, 1, [1 if building for Cygwin.]) - fi - - AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.]) - AC_DEFINE(IS_DARWIN, 0, [0 if not building for Darwin.]) - ;; - *-mingw*) - is_mingw=yes - is_win32=yes - - if test x$parport_use_giveio = xno; then - AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts]) - fi - parport_use_giveio=yes - - AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.]) - AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.]) - AC_DEFINE(IS_DARWIN, 0, [0 if not building for Darwin.]) - ;; - *darwin*) - is_darwin=yes - - if test x$parport_use_giveio = xyes; then - AC_MSG_WARN([--enable-parport-giveio cannot be used by Darwin hosts]) - fi - parport_use_giveio=no - - AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.]) - AC_DEFINE(IS_WIN32, 0, [0 if not building for Win32.]) - AC_DEFINE(IS_DARWIN, 1, [1 if building for Darwin.]) - ;; - *) - if test x$parport_use_giveio = xyes; then - AC_MSG_WARN([--enable-parport-giveio cannot be used by ]$host[ hosts]) - fi - parport_use_giveio=no - AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.]) - AC_DEFINE(IS_WIN32, 0, [0 if not building for Win32.]) - AC_DEFINE(IS_DARWIN, 0, [0 if not building for Darwin.]) - ;; -esac - -if test $build_parport = yes; then - build_bitbang=yes - AC_DEFINE(BUILD_PARPORT, 1, [1 if you want parport.]) -else - AC_DEFINE(BUILD_PARPORT, 0, [0 if you don't want parport.]) -fi - -if test $build_dummy = yes; then - build_bitbang=yes - AC_DEFINE(BUILD_DUMMY, 1, [1 if you want dummy driver.]) -else - AC_DEFINE(BUILD_DUMMY, 0, [0 if you don't want dummy driver.]) -fi - -if test $build_ep93xx = yes; then - build_bitbang=yes - AC_DEFINE(BUILD_EP93XX, 1, [1 if you want ep93xx.]) -else - AC_DEFINE(BUILD_EP93XX, 0, [0 if you don't want ep93xx.]) -fi - -if test $build_ecosboard = yes; then - AC_DEFINE(BUILD_ECOSBOARD, 1, [1 if you want eCosBoard.]) -else - AC_DEFINE(BUILD_ECOSBOARD, 0, [0 if you don't want eCosBoard.]) -fi - -if test $build_ioutil = yes; then - AC_DEFINE(BUILD_IOUTIL, 1, [1 if you want ioutils.]) -else - AC_DEFINE(BUILD_IOUTIL, 0, [0 if you don't want ioutils.]) -fi - -if test $build_httpd = yes; then - AC_DEFINE(BUILD_HTTPD, 1, [1 if you want httpd.]) -else - AC_DEFINE(BUILD_HTTPD, 0, [0 if you don't want httpd.]) -fi - -if test $build_at91rm9200 = yes; then - build_bitbang=yes - AC_DEFINE(BUILD_AT91RM9200, 1, [1 if you want at91rm9200.]) -else - AC_DEFINE(BUILD_AT91RM9200, 0, [0 if you don't want at91rm9200.]) -fi - -if test x$parport_use_ppdev = xyes; then - AC_DEFINE(PARPORT_USE_PPDEV, 1, [1 if you want parport to use ppdev.]) -else - AC_DEFINE(PARPORT_USE_PPDEV, 0, [0 if you don't want parport to use ppdev.]) -fi - -if test x$parport_use_giveio = xyes; then - AC_DEFINE(PARPORT_USE_GIVEIO, 1, [1 if you want parport to use giveio.]) -else - AC_DEFINE(PARPORT_USE_GIVEIO, 0, [0 if you don't want parport to use giveio.]) -fi - -if test $build_bitbang = yes; then - AC_DEFINE(BUILD_BITBANG, 1, [1 if you want a bitbang interface.]) -else - AC_DEFINE(BUILD_BITBANG, 0, [0 if you don't want a bitbang interface.]) -fi - -if test $build_ft2232_libftdi = yes; then - AC_DEFINE(BUILD_FT2232_LIBFTDI, 1, [1 if you want libftdi ft2232.]) -else - AC_DEFINE(BUILD_FT2232_LIBFTDI, 0, [0 if you don't want libftdi ft2232.]) -fi - -if test $build_ft2232_ftd2xx = yes; then - AC_DEFINE(BUILD_FT2232_FTD2XX, 1, [1 if you want ftd2xx ft2232.]) -else - AC_DEFINE(BUILD_FT2232_FTD2XX, 0, [0 if you don't want ftd2xx ft2232.]) -fi - -if test $build_amtjtagaccel = yes; then - AC_DEFINE(BUILD_AMTJTAGACCEL, 1, [1 if you want the Amontec JTAG-Accelerator driver.]) -else - AC_DEFINE(BUILD_AMTJTAGACCEL, 0, [0 if you don't want the Amontec JTAG-Accelerator driver.]) -fi - -if test $build_gw16012 = yes; then - AC_DEFINE(BUILD_GW16012, 1, [1 if you want the Gateworks GW16012 driver.]) -else - AC_DEFINE(BUILD_GW16012, 0, [0 if you don't want the Gateworks GW16012 driver.]) -fi - -if test $build_presto_libftdi = yes; then - build_bitq=yes - AC_DEFINE(BUILD_PRESTO_LIBFTDI, 1, [1 if you want the ASIX PRESTO driver using libftdi.]) -else - AC_DEFINE(BUILD_PRESTO_LIBFTDI, 0, [0 if you don't want the ASIX PRESTO driver using libftdi.]) -fi - -if test $build_presto_ftd2xx = yes; then - build_bitq=yes - AC_DEFINE(BUILD_PRESTO_FTD2XX, 1, [1 if you want the ASIX PRESTO driver using FTD2XX.]) -else - AC_DEFINE(BUILD_PRESTO_FTD2XX, 0, [0 if you don't want the ASIX PRESTO driver using FTD2XX.]) -fi - -if test $build_bitq = yes; then - AC_DEFINE(BUILD_BITQ, 1, [1 if you want a bitq interface.]) -else - AC_DEFINE(BUILD_BITQ, 0, [0 if you don't want a bitq interface.]) -fi - -if test $build_usbprog = yes; then - AC_DEFINE(BUILD_USBPROG, 1, [1 if you want the usbprog JTAG driver.]) -else - AC_DEFINE(BUILD_USBPROG, 0, [0 if you don't want the usbprog JTAG driver.]) -fi - -if test $build_oocd_trace = yes; then - AC_DEFINE(BUILD_OOCD_TRACE, 1, [1 if you want the OpenOCD+trace ETM capture driver.]) -else - AC_DEFINE(BUILD_OOCD_TRACE, 0, [0 if you don't want the OpenOCD+trace ETM capture driver.]) -fi - -if test $build_jlink = yes; then - AC_DEFINE(BUILD_JLINK, 1, [1 if you want the J-Link JTAG driver.]) -else - AC_DEFINE(BUILD_JLINK, 0, [0 if you don't want the J-Link JTAG driver.]) -fi - -if test $build_vsllink = yes; then - AC_DEFINE(BUILD_VSLLINK, 1, [1 if you want the Versaloon-Link JTAG driver.]) -else - AC_DEFINE(BUILD_VSLLINK, 0, [0 if you don't want the Versaloon-Link JTAG driver.]) -fi - -if test $build_rlink = yes; then - AC_DEFINE(BUILD_RLINK, 1, [1 if you want the RLink JTAG driver.]) -else - AC_DEFINE(BUILD_RLINK, 0, [0 if you don't want the RLink JTAG driver.]) -fi - -if test $build_armjtagew = yes; then - AC_DEFINE(BUILD_ARMJTAGEW, 1, [1 if you want the ARM-JTAG-EW JTAG driver.]) -else - AC_DEFINE(BUILD_ARMJTAGEW, 0, [0 if you don't want the ARM-JTAG-EW JTAG driver.]) -fi - -#-- Deal with MingW/Cygwin FTD2XX issues - -if test $is_win32 = yes; then -if test "${with_ftd2xx_linux_tardir+set}" = set -then - AC_MSG_ERROR([The option: with_ftd2xx_linux_tardir is for LINUX only.]) -fi - -if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes ; then - AC_MSG_CHECKING([for ftd2xx.lib exists (win32)]) - - # if we are given a zipdir... - if test "${with_ftd2xx_win32_zipdir+set}" = set - then - # Set the CFLAGS for "ftd2xx.h" - f=$with_ftd2xx_win32_zipdir/ftd2xx.h - if test ! -f $f ; then - AC_MSG_ERROR([File: $f cannot be found]) - fi - CFLAGS="$CFLAGS -I$with_ftd2xx_win32_zipdir" - - # And calculate the LDFLAGS for the machine - case "$host_cpu" in - i?86|x86_*) - LDFLAGS="$LDFLAGS -L$with_ftd2xx_win32_zipdir/i386" - LIBS="$LIBS -lftd2xx" - f=$with_ftd2xx_win32_zipdir/i386/ftd2xx.lib - ;; - amd64) - LDFLAGS="$LDFLAGS -L$with_ftd2xx_win32_zipdir/amd64" - LIBS="$LIBS -lftd2xx" - f=$with_ftd2xx_win32_zipdir/amd64/ftd2xx.lib - ;; - *) - AC_MSG_ERROR([Unknown Win32 host cpu: $host_cpu]) - ;; - esac - if test ! -f $f ; then - AC_MSG_ERROR([Library: $f not found]) - fi - else - LIBS="$LIBS -lftd2xx" - AC_MSG_WARN([ASSUMPTION: The (win32) FTDICHIP.COM files: ftd2xx.h and ftd2xx.lib are in a proper place]) - fi -fi -fi # win32 - -if test $is_darwin = yes ; then -if test "${with_ftd2xx_win32_zipdir+set}" = set -then - AC_MSG_ERROR([The option: --with-ftd2xx-win32-zipdir is for win32 only]) -fi -if test "${with_ftd2xx_linux_tardir+set}" = set -then - AC_MSG_ERROR([The option: with_ftd2xx_linux_tardir is for LINUX only.]) -fi - -if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes ; then - AC_MSG_CHECKING([for libftd2xx.a (darwin)]) - - if test ! -f /usr/local/include/ftd2xx.h ; then - AC_MSG_ERROR([ftd2xx library from FTDICHIP.com seems to be missing, cannot find: /usr/local/include/ftd2xx.h]) - fi - - CFLAGS="$CFLAGS -I/usr/local/include" - LDFLAGS="$LDFLAGS -L/usr/local/lib" - LIBS="$LIBS -lftd2xx" - AC_MSG_RESULT([-L/usr/local/lib -lftd2xx]) -fi -fi # darwin - -if test $is_win32 = no && test $is_darwin = no ; then - -if test "${with_ftd2xx_win32_zipdir+set}" = set -then - AC_MSG_ERROR([The option: --with-ftd2xx-win32-zipdir is for win32 only]) -fi - -if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes ; then - # Must be linux - if test $host_os != linux-gnu && test $host_os != linux ; then - AC_MSG_ERROR([The (linux) ftd2xx library from FTDICHIP.com is linux only. Try --enable-ft2232-libftdi instead]) - fi - # Are we given a TAR directory? - if test "${with_ftd2xx_linux_tardir+set}" = set - then - AC_MSG_CHECKING([uninstalled ftd2xx distribution]) - # The .H file is simple.. - FTD2XX_H=$with_ftd2xx_linux_tardir/ftd2xx.h - if test ! -f "${FTD2XX_H}"; then - AC_MSG_ERROR([Option: --with-ftd2xx-linux-tardir appears wrong, cannot find: ${FTD2XX_H}]) - fi - CFLAGS="$CFLAGS -I$with_ftd2xx_linux_tardir" - FTD2XX_LDFLAGS="-L$with_ftd2xx_linux_tardir" - FTD2XX_LIB="-lftd2xx" - if test $with_ftd2xx_lib != shared; then - # Test #1 - Future proof - if/when ftdichip fixes their distro. - # Try it with the simple ".a" suffix. - FTD2XX_LIB="$with_ftd2xx_linux_tardir/static_lib/libftd2xx.a" - if test -f "${FTD2XX_LIB}"; then - FTD2XX_LDFLAGS="${FTD2XX_LDFLAGS}/static_lib" - else - # Test Number2. - # Grr.. perhaps it exists as a version number? - FTD2XX_LIB="$with_ftd2xx_linux_tardir/static_lib/libftd2xx.a.*.*.*" - count=`ls ${FTD2XX_LIB} | wc -l` - if test $count -gt 1 ; then - AC_MSG_ERROR([Multiple libftd2xx.a files found in: $with_ftd2xx_linux_tardir/static_lib sorry cannot handle this yet]) - fi - if test $count -ne 1 ; then - AC_MSG_ERROR([Not found: $f, option: --with-ftd2xx-linux-tardir appears to be wrong]) - fi - # Because the "-l" rules do not understand version numbers... - # we will just stuff the absolute path onto the LIBS variable - FTD2XX_LIB="`ls ${FTD2XX_LIB}` -lpthread" - FTD2XX_LDFLAGS="" - fi - fi - LDFLAGS="${LDFLAGS} ${FTD2XX_LDFLAGS}" - LIBS="${LIBS} ${FTD2XX_LIB}" - AC_MSG_RESULT([${FTD2XX_LDFLAGS} ${FTD2XX_LIB}]) - else - AC_CHECK_HEADER([ftd2xx.h],[],[ - AC_MSG_ERROR([You seem to be missing the FTD2xx driver header file.]) - ]) - AC_SEARCH_LIBS([FT_GetLibraryVersion],[ftd2xx],,[ - AC_MSG_ERROR([You appear to be missing the FTD2xx driver library.]) - ],[]) - fi -fi -fi # linux - -if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes; then - -# Before we go any further - make sure we can *BUILD* and *RUN* -# a simple app with the "ftd2xx.lib" file - in what ever form we where given -# We should be able to compile, link and run this test program now -AC_MSG_CHECKING([whether ftd2xx library works]) - -# -# Save the LDFLAGS for later.. -LDFLAGS_SAVE=$LDFLAGS -CFLAGS_SAVE=$CFLAGS -_LDFLAGS=`eval echo $LDFLAGS` -_CFLAGS=`eval echo $CFLAGS` -LDFLAGS=$_LDFLAGS -CFLAGS=$_CFLAGS - -AC_RUN_IFELSE([ -#include "confdefs.h" -#if IS_WIN32 -#include "windows.h" -#endif -#include <stdio.h> -#include <ftd2xx.h> - -int -main( int argc, char **argv ) -{ - DWORD x; - FT_GetLibraryVersion( &x ); - return 0; -} - ], [ - AC_MSG_RESULT([Success!]) - ], [ - AC_MSG_ERROR([Cannot build & run test program using ftd2xx.lib]) - ] ) - -AC_MSG_CHECKING([whether to build ftd2xx device support]) -AC_MSG_RESULT([$want_ftd2xx_highspeed]) -if test $want_ftd2xx_highspeed != no; then - AC_MSG_CHECKING([for ftd2xx highspeed device support]) - AC_COMPILE_IFELSE([ -#include "confdefs.h" -#if IS_WIN32 -#include "windows.h" -#endif -#include <stdio.h> -#include <ftd2xx.h> -DWORD x = FT_DEVICE_4232H; - ], [ - AC_DEFINE(BUILD_FTD2XX_HIGHSPEED, [1], - [Support FT2232H/FT4232HS with FTD2XX.]) - build_ftd2xx_highspeed=yes - ], [ - build_ftd2xx_highspeed=no - ]) - AC_MSG_RESULT([$build_ftd2xx_highspeed]) - - if test $want_ftd2xx_highspeed = yes -a $build_ftd2xx_highspeed = no; then - AC_MSG_ERROR([You need a newer FTD2XX driver (version 0.4.16 or later).]) - fi -fi - -LDFLAGS=$LDFLAGS_SAVE -CFLAGS=$CFLAGS_SAVE -fi - -if test $build_ft2232_libftdi = yes ; then - # We assume: the package is preinstalled in the proper place - # these present as 2 libraries.. - LIBS="$LIBS -lftdi -lusb" - # - # Try to build a small program. - AC_MSG_CHECKING([Build & Link with libftdi...]) - - LDFLAGS_SAVE=$LDFLAGS - CFLAGS_SAVE=$CFLAGS - _LDFLAGS=`eval echo $LDFLAGS` - _CFLAGS=`eval echo $CFLAGS` - LDFLAGS=$_LDFLAGS - CFLAGS=$_CFLAGS - - AC_RUN_IFELSE([ -#include <stdio.h> -#include <ftdi.h> - -int -main( int argc, char **argv ) -{ - struct ftdi_context *p; - p = ftdi_new(); - if( p != NULL ){ - return 0; - } else { - fprintf( stderr, "calling ftdi_new() failed\n"); - return 1; - } -} - ], [ - AC_MSG_RESULT([Success]) - ], [ - AC_MSG_ERROR([Cannot build & run test program using libftdi]) - ]) - # Restore the 'unexpanded ldflags' - LDFLAGS=$LDFLAGS_SAVE - CFLAGS=$CFLAGS_SAVE -fi - -# check for usb.h when a driver will require it -if test $build_jlink = yes -o $build_vsllink = yes -o $build_usbprog = yes -o \ - $build_rlink = yes -o $build_armjtagew = yes -then - AC_CHECK_HEADERS([usb.h],[], - [AC_MSG_ERROR([usb.h is required to build some OpenOCD driver(s)])]) -fi - -AM_CONDITIONAL(RELEASE, test $build_release = yes) -AM_CONDITIONAL(PARPORT, test $build_parport = yes) -AM_CONDITIONAL(DUMMY, test $build_dummy = yes) -AM_CONDITIONAL(GIVEIO, test x$parport_use_giveio = xyes) -AM_CONDITIONAL(EP93XX, test $build_ep93xx = yes) -AM_CONDITIONAL(ECOSBOARD, test $build_ecosboard = yes) -AM_CONDITIONAL(IOUTIL, test $build_ioutil = yes) -AM_CONDITIONAL(HTTPD, test $build_httpd = yes) -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(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(USBPROG, test $build_usbprog = yes) -AM_CONDITIONAL(OOCD_TRACE, test $build_oocd_trace = yes) -AM_CONDITIONAL(JLINK, test $build_jlink = yes) -AM_CONDITIONAL(VSLLINK, test $build_vsllink = yes) -AM_CONDITIONAL(RLINK, test $build_rlink = yes) -AM_CONDITIONAL(ARMJTAGEW, test $build_armjtagew = yes) -AM_CONDITIONAL(IS_CYGWIN, test $is_cygwin = yes) -AM_CONDITIONAL(IS_MINGW, test $is_mingw = yes) -AM_CONDITIONAL(IS_WIN32, test $is_win32 = yes) -AM_CONDITIONAL(IS_DARWIN, test $is_darwin = yes) -AM_CONDITIONAL(BITQ, test $build_bitq = yes) - -AM_CONDITIONAL(MINIDRIVER, test $build_minidriver = yes) -AM_CONDITIONAL(MINIDRIVER_DUMMY, test $build_minidriver_dummy = yes) - -# Look for environ alternatives. Possibility #1: is environ in unistd.h or stdlib.h? -AC_MSG_CHECKING([for environ in unistd.h and stdlib.h]) -AC_COMPILE_IFELSE([ -#define _GNU_SOURCE -#include <unistd.h> -#include <stdlib.h> -int main(int argc, char **argv) { char **ep = environ; } - ], [ - AC_MSG_RESULT([yes]) - has_environ=yes - ], [ - AC_MSG_RESULT([no]) - - # Possibility #2: can environ be found in an available library? - AC_MSG_CHECKING([for extern environ]) - AC_LINK_IFELSE([ -extern char **environ; -int main(int argc, char **argv) { char **ep = environ; } - ], [ - AC_DEFINE(NEED_ENVIRON_EXTERN, [1], [Must declare 'environ' to use it.]) - has_environ=yes - ], [ - has_environ=no - ]) - AC_MSG_RESULT([${has_environ}]) - ]) - -if test "${has_environ}" != "yes" ; then - AC_MSG_FAILURE([Could not find 'environ' in unistd.h or available libraries.]) -fi - -AC_DEFINE([_GNU_SOURCE],[1],[Use GNU C library extensions (e.g. stdndup).]) - -# set default gcc warnings -GCC_WARNINGS="-Wall -Wstrict-prototypes -Wformat-security" -if test "${gcc_wextra}" = yes; then - GCC_WARNINGS="${GCC_WARNINGS} -Wextra -Wno-unused-parameter" - GCC_WARNINGS="${GCC_WARNINGS} -Wbad-function-cast" - GCC_WARNINGS="${GCC_WARNINGS} -Wcast-align" - GCC_WARNINGS="${GCC_WARNINGS} -Wredundant-decls" -fi -if test "${gcc_werror}" = yes; then - GCC_WARNINGS="${GCC_WARNINGS} -Werror" -fi - -# overide default gcc cflags -if test $gcc_warnings = yes; then - CFLAGS="$CFLAGS $GCC_WARNINGS" -fi - -# Setup for compiling build tools -AC_MSG_CHECKING([for a C compiler for build tools]) -if test $cross_compiling = yes; then - AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc) - CFLAGS_FOR_BUILD="-g -O2 $GCC_WARNINGS" -else - CC_FOR_BUILD=$CC - CFLAGS_FOR_BUILD=$CFLAGS -fi - -AC_MSG_RESULT([$CC_FOR_BUILD]) -AC_SUBST(CC_FOR_BUILD) -AC_SUBST(CFLAGS_FOR_BUILD) - -AC_MSG_CHECKING([for suffix of executable build tools]) -if test $cross_compiling = yes; then - cat >conftest.c <<\_______EOF -int main () -{ - exit (0); -} -_______EOF - for i in .exe ""; do - compile="$CC_FOR_BUILD conftest.c -o conftest$i" - if AC_TRY_EVAL(compile); then - if (./conftest) 2>&AC_FD_CC; then - EXEEXT_FOR_BUILD=$i - break - fi - fi - done - rm -f conftest* - if test "${EXEEXT_FOR_BUILD+set}" != set; then - AC_MSG_ERROR([Cannot determine suffix of executable build tools]) - fi -else - EXEEXT_FOR_BUILD=$EXEEXT -fi -AC_MSG_RESULT([$EXEEXT_FOR_BUILD]) -AC_SUBST(EXEEXT_FOR_BUILD) - -AC_OUTPUT(dnl - Makefile dnl - src/Makefile dnl - src/helper/Makefile dnl - src/jtag/Makefile dnl - src/xsvf/Makefile dnl - src/svf/Makefile dnl - src/target/Makefile dnl - src/server/Makefile dnl - src/flash/Makefile dnl - src/pld/Makefile dnl - doc/Makefile dnl - ) +AC_PREREQ(2.60) +AC_INIT([openocd], [0.2.0-in-development], + [OpenOCD Mailing List <ope...@li...>]) +AC_CONFIG_SRCDIR([src/openocd.c]) + +AM_INIT_AUTOMAKE([-Wall -Wno-portability]) +AM_MAINTAINER_MODE + +AM_CONFIG_HEADER(config.h) +AH_BOTTOM([ +#include "system.h" +#include "replacements.h" +]) + +AC_LANG_C +AC_PROG_CC +AC_PROG_CC_C99 +AM_PROG_CC_C_O +AC_PROG_RANLIB + +dnl disable checks for C++, Fortran and GNU Java Compiler +m4_defun([_LT_AC_LANG_CXX_CONFIG], [:]) +m4_defun([_LT_AC_LANG_F77_CONFIG], [:]) +m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:]) +AC_DISABLE_SHARED +AC_PROG_LIBTOOL + + +dnl configure checks required for Jim files (these are obsolete w/ C99) +AC_C_CONST +AC_TYPE_LONG_LONG_INT + + +AC_SEARCH_LIBS([ioperm], [ioperm]) +AC_SEARCH_LIBS([dlopen], [dl]) + +AC_CHECK_HEADERS(arpa/inet.h) +AC_CHECK_HEADERS(elf.h) +AC_CHECK_HEADERS(dirent.h) +AC_CHECK_HEADERS(fcntl.h) +AC_CHECK_HEADERS(ifaddrs.h) +AC_CHECK_HEADERS(malloc.h) +AC_CHECK_HEADERS(netdb.h) +AC_CHECK_HEADERS(netinet/in.h) +AC_CHECK_HEADERS(netinet/tcp.h) +AC_CHECK_HEADERS(pthread.h) +AC_CHECK_HEADERS(strings.h) +AC_CHECK_HEADERS(sys/ioctl.h) +AC_CHECK_HEADERS(sys/param.h) +AC_CHECK_HEADERS(sys/poll.h) +AC_CHECK_HEADERS(sys/select.h) +AC_CHECK_HEADERS(sys/socket.h) +AC_CHECK_HEADERS(sys/stat.h) +AC_CHECK_HEADERS(sys/time.h) +AC_CHECK_HEADERS(sys/types.h) +AC_CHECK_HEADERS(unistd.h) + +AC_CHECK_HEADERS([net/if.h], [], [], [dnl +#include <stdio.h> +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# ifdef HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#ifdef HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#endif +]) + +AC_HEADER_ASSERT +AC_HEADER_STDBOOL +AC_HEADER_TIME + +AC_C_BIGENDIAN + +AC_CHECK_FUNCS(strndup) +AC_CHECK_FUNCS(strnlen) +AC_CHECK_FUNCS(gettimeofday) +AC_CHECK_FUNCS(usleep) +AC_CHECK_FUNCS(vasprintf) + +build_bitbang=no +build_bitq=no +is_cygwin=no +is_mingw=no +is_win32=no +is_darwin=no +build_release=yes + +AC_ARG_ENABLE(release, + AS_HELP_STRING([--enable-release], [Enable Release Build, default no]), + [build_release=$enableval], [build_release=no]) + +if test $cross_compiling = no; then + if test $build_release = no; then + # check we can find guess-rev.sh + AC_CHECK_FILE("$srcdir/guess-rev.sh", build_release=no, build_release=yes) + fi +fi + +# We are not *ALWAYS* being installed in the standard place. +# We may be installed in a "tool-build" specific location. +# Normally with other packages - as part of a tool distro. +# Thus - we should search that 'libdir' also. +# +# And - if we are being installed there - the odds are +# The libraries unique to what we are are there too. +# + +# Expand nd deal with NONE - just like configure will do later +OCDprefix=$prefix +OCDxprefix=$exec_prefix +test x"$OCDprefix" = xNONE && OCDprefix=$ac_default_prefix +# Let make expand exec_prefix. +test x"$OCDxprefix" = xNONE && OCDxprefix="$OCDprefix" + +# what matters is the "exec-prefix" +if test "$OCDxprefix" != "$ac_default_prefix" +then + # We are installing in a non-standard place + # Nonstandard --prefix and/or --exec-prefix + # We have an override of some sort. + # use build specific install library dir + + LDFLAGS="$LDFLAGS -L$OCDxprefix/lib" + # RPATH becomes an issue on Linux only + if test $host_os = linux-gnu || test $host_os = linux ; then + LDFLAGS="$LDFLAGS -Wl,-rpath,$OCDxprefix/lib" + fi + # The "INCDIR" is also usable + CFLAGS="$CFLAGS -I$includedir" +fi + +AC_ARG_WITH(ftd2xx, + AS_HELP_STRING([--with-ftd2xx=<PATH>],[This option has been removed.]), + [ +# Option Given. +cat << __EOF__ + +The option: --with-ftd2xx=<PATH> has been removed. +On Linux, the new option is: + + --with-ftd2xx-linux-tardir=/path/to/files + +Where <path> is the path the the directory where the "tar.gz" file +from FTDICHIP.COM was unpacked, for example: + + --with-ftd2xx-linux-tardir=${HOME}/libftd2xx0.4.16 + +On Cygwin/MingW32, the new option is: + + --with-ftd2xx-win32-zipdir=/path/to/files + +Where <path> is the path to the directory where the "zip" file from +FTDICHIP.COM was unpacked, for example: + + --with-ftd2xx-win32-zipdir=${HOME}/ftd2xx.cdm.files + +__EOF__ + + AC_MSG_ERROR([Sorry Cannot continue]) + ], [true]) + +#======================================== +# FTD2XXX support comes in 4 forms. +# (1) win32 - via a zip file +# (2) linux - via a tar file +# (3) linux/cygwin/mingw - via libftdi +# (4) darwin - installed under /usr/local +# +# In case (1) and (2) we need to know where the package was unpacked. + +AC_ARG_WITH(ftd2xx-win32-zipdir, + AS_HELP_STRING([--with-ftd2xx-win32-zipdir],[Where (CYGWIN/MINGW) the zip file from ftdichip.com was unpacked <default=search>]), + [ + # option present + if test -d $with_ftd2xx_win32_zipdir + then + with_ftd2xx_win32_zipdir=`cd $with_ftd2xx_win32_zipdir && pwd` + AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_win32_zipdir]) + else + AC_MSG_ERROR([Parameter to --with-ftd2xx-win32-zipdir is not a dir: $with_ftd2xx_win32_zipdir]) + fi + ], [true]) + +AC_ARG_WITH(ftd2xx-linux-tardir, + AS_HELP_STRING([--with-ftd2xx-linux-tardir], [Where (Linux/Unix) the tar file from ftdichip.com was unpacked <default=search>]), + [ + # Option present + if test $is_win32 = yes ; then + AC_MSG_ERROR([The option: --with-ftd2xx-linux-tardir is only usable on linux]) + fi + if test -d $with_ftd2xx_linux_tardir + then + with_ftd2xx_linux_tardir=`cd $with_ftd2xx_linux_tardir && pwd` + AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_linux_tardir]) + else + AC_MSG_ERROR([Parameter to --with-ftd2xx-linux-tardir is not a dir: $with_ftd2xx_linux_tardir]) + fi + ], [true]) + +AC_ARG_WITH(ftd2xx-lib, + AS_HELP_STRING([--with-ftd2xx-lib], + [Use static or shared ftd2xx libs on default static]), + [ + case "$withval" in + static) + with_ftd2xx_lib=$withval + ;; + shared) + with_ftd2xx_lib=$withval + ;; + *) + AC_MSG_ERROR([Option: --with-ftd2xx-lib=static or --with-ftd2xx-lib=shared not, $withval]) + ;; + esac + ], [ + # Default is static - it is simpler :-( + with_ftd2xx_lib=static + ]) + +AC_ARG_ENABLE(gccwarnings, + AS_HELP_STRING([--disable-gccwarnings], [Disable compiler warnings]), + [gcc_warnings=$enableval], [gcc_warnings=yes]) + +AC_ARG_ENABLE(wextra, + AS_HELP_STRING([--disable-wextra], [Disable extra compiler warnings]), + [gcc_wextra=$enableval], [gcc_wextra=$gcc_warnings]) + +AC_ARG_ENABLE(werror, + AS_HELP_STRING([--disable-werror], [Do not treat warnings as errors]), + [gcc_werror=$enableval], [gcc_werror=$gcc_warnings]) + +# set default verbose options, overridden by following options +debug_jtag_io=no +debug_usb_io=no +debug_usb_comms=no + +AC_ARG_ENABLE(verbose, + AS_HELP_STRING([--enable-verbose], + [Enable verbose JTAG I/O messages (for debugging).]), + [ + debug_jtag_io=$enableval + debug_usb_io=$enableval + debug_usb_comms=$enableval + ], []) + +AC_ARG_ENABLE(verbose_jtag_io, + AS_HELP_STRING([--enable-verbose-jtag-io], + [Enable verbose JTAG I/O messages (for debugging).]), + [debug_jtag_io=$enableval], []) +AC_ARG_ENABLE(verbose_usb_io, + AS_HELP_STRING([--enable-verbose-usb-io], + [Enable verbose USB I/O messages (for debugging)]), + [debug_usb_io=$enableval], []) +AC_ARG_ENABLE(verbose_usb_comms, + AS_HELP_STRING([--enable-verbose-usb-comms], + [Enable verbose USB communication messages (for debugging)]), + [debug_usb_comms=$enableval], []) + +AC_MSG_CHECKING([whether to enable verbose JTAG I/O messages]); +AC_MSG_RESULT($debug_jtag_io) +if test $debug_jtag_io = yes; then + AC_DEFINE([_DEBUG_JTAG_IO_],[1], [Print verbose JTAG I/O messages]) +fi + +AC_MSG_CHECKING([whether to enable verbose USB I/O messages]); +AC_MSG_RESULT($debug_usb_io) +if test $debug_usb_io = yes; then + AC_DEFINE([_DEBUG_USB_IO_],[1], [Print verbose USB I/O messages]) +fi + +AC_MSG_CHECKING([whether to enable verbose USB communication messages]); +AC_MSG_RESULT($debug_usb_comms) +if test $debug_usb_comms = yes; then + AC_DEFINE([_DEBUG_USB_COMMS_],[1], [Print verbose USB communication messages]) +fi + + +debug_malloc=no +AC_ARG_ENABLE(malloc_logging, + AS_HELP_STRING([--enable-malloc-logging], + [Include free space in logging messages (requires malloc.h).]), + [debug_malloc=$enableval], []) + +AC_MSG_CHECKING([whether to enable malloc free space logging]); +AC_MSG_RESULT($debug_malloc) +if test $debug_malloc = yes; then + AC_DEFINE([_DEBUG_FREE_SPACE_],[1], [Include malloc free space in logging]) +fi + + +AC_ARG_ENABLE(dummy, + AS_HELP_STRING([--enable-dummy], [Enable building the dummy port driver]), + [build_dummy=$enableval], [build_dummy=no]) + +AC_ARG_ENABLE(parport, + AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]), + [build_parport=$enableval], [build_parport=no]) + +AC_ARG_ENABLE(parport_ppdev, + AS_HELP_STRING([--disable-parport-ppdev], + [Disable use of ppdev (/dev/parportN) for parport (for x86 only)]), + [parport_use_ppdev=$enableval], [parport_use_ppdev=]) + +AC_ARG_ENABLE(parport_giveio, + AS_HELP_STRING([--enable-parport-giveio], + [Enable use of giveio for parport (for CygWin only)]), + [parport_use_giveio=$enableval], [parport_use_giveio=]) + +AC_ARG_ENABLE(ft2232_libftdi, + AS_HELP_STRING([--enable-ft2232_libftdi], [Enable building support for FT2232 based devices using the libftdi driver, opensource alternate of FTD2XX]), + [build_ft2232_libftdi=$enableval], [build_ft2232_libftdi=no]) + +AC_ARG_ENABLE(ft2232_ftd2xx, + AS_HELP_STRING([--enable-ft2232_ftd2xx], [Enable building support for FT2232 based devices using the FTD2XX driver from ftdichip.com]), + [build_ft2232_ftd2xx=$enableval], [build_ft2232_ftd2xx=no]) + +AC_ARG_ENABLE(ftd2xx_highspeed, + AS_HELP_STRING([--enable-ftd2xx-highspeed], [Enable building support for FT2232H and FT4232H-based devices (requires >=libftd2xx-0.4.16)]), + [want_ftd2xx_highspeed=$enableval], [want_ftd2xx_highspeed=maybe]) + +AC_ARG_ENABLE(amtjtagaccel, + AS_HELP_STRING([--enable-amtjtagaccel], [Enable building the Amontec JTAG-Accelerator driver]), + [build_amtjtagaccel=$enableval], [build_amtjtagaccel=no]) + +AC_ARG_ENABLE(ecosboard, + AS_HELP_STRING([--enable-ecosboard], [Enable building support for eCosBoard based JTAG debugger]), + [build_ecosboard=$enableval], [build_ecosboard=no]) + +AC_ARG_ENABLE(ioutil, + AS_HELP_STRING([--enable-ioutil], [Enable ioutil functions - useful for standalone OpenOCD implementations]), + [build_ioutil=$enableval], [build_ioutil=no]) + +AC_ARG_ENABLE(httpd, + AS_HELP_STRING([--enable-httpd], [Enable builtin httpd server - useful for standalone OpenOCD implementations]), + [build_httpd=$enableval], [build_httpd=no]) + +case "${host_cpu}" in + arm*) + AC_ARG_ENABLE(ep93xx, + AS_HELP_STRING([--enable-ep93xx], [Enable building support for EP93xx based SBCs]), + [build_ep93xx=$enableval], [build_ep93xx=no]) + + AC_ARG_ENABLE(at91rm9200, + AS_HELP_STRING([--enable-at91rm9200], [Enable building support for AT91RM9200 based SBCs]), + [build_at91rm9200=$enableval], [build_at91rm9200=no]) + ;; + + *) + build_ep93xx=no + build_at91rm9200=no + ;; +esac + +AC_ARG_ENABLE(gw16012, + AS_HELP_STRING([--enable-gw16012], [Enable building support for the Gateworks GW16012 JTAG Programmer]), + [build_gw16012=$enableval], [build_gw16012=no]) + +AC_ARG_ENABLE(presto_libftdi, + AS_HELP_STRING([--enable-presto_libftdi], [Enable building support for ASIX Presto Programmer using the libftdi driver]), + [build_presto_libftdi=$enableval], [build_presto_libftdi=no]) + +AC_ARG_ENABLE(presto_ftd2xx, + AS_HELP_STRING([--enable-presto_ftd2xx], [Enable building support for ASIX Presto Programmer using the FTD2XX driver]), + [build_presto_ftd2xx=$enableval], [build_presto_ftd2xx=no]) + +AC_ARG_ENABLE(usbprog, + AS_HELP_STRING([--enable-usbprog], [Enable building support for the usbprog JTAG Programmer]), + [build_usbprog=$enableval], [build_usbprog=no]) + +AC_ARG_ENABLE(oocd_trace, + AS_HELP_STRING([--enable-oocd_trace], [Enable building support for the OpenOCD+trace ETM capture device]), + [build_oocd_trace=$enableval], [build_oocd_trace=no]) + +AC_ARG_ENABLE(jlink, + AS_HELP_STRING([--enable-jlink], [Enable building support for the Segger J-Link JTAG Programmer]), + [build_jlink=$enableval], [build_jlink=no]) + +AC_ARG_ENABLE(vsllink, + AS_HELP_STRING([--enable-vsllink], [Enable building support for the Versaloon-Link JTAG Programmer]), + [build_vsllink=$enableval], [build_vsllink=no]) + +AC_ARG_ENABLE(rlink, + AS_HELP_STRING([--enable-rlink], [Enable building support for the Raisonance RLink JTAG Programmer]), + [build_rlink=$enableval], [build_rlink=no]) + +AC_ARG_ENABLE(arm-jtag-ew, + AS_HELP_STRING([--enable-arm-jtag-ew], [Enable building support for the Olimex ARM-JTAG-EW Programmer]), + [build_armjtagew=$enableval], [build_armjtagew=no]) + +AC_ARG_ENABLE(minidriver_dummy, + AS_HELP_STRING([--enable-minidriver-dummy], [Enable the dummy minidriver.]), + [build_minidriver_dummy=$enableval], [build_minidriver_dummy=no]) + + +build_minidriver=no +AC_MSG_CHECKING([whether to enable ZY1000 minidriver]) +if test $build_ecosboard = yes; then + if test $build_minidriver = yes; then + AC_MSG_ERROR([Multiple minidriver options have been enabled.]) + fi + AC_DEFINE(HAVE_JTAG_MINIDRIVER_H, 1, + [Define to 1 if you have the <jtag_minidriver.h> header file.]) + build_minidriver=yes +fi +AC_MSG_RESULT($build_ecosboard) + + +AC_MSG_CHECKING([whether to enable dummy minidriver]) +if test $build_minidriver_dummy = yes; then + if test $build_minidriver = yes; then + AC_MSG_ERROR([Multiple minidriver options have been enabled.]) + fi + build_minidriver=yes + AC_DEFINE(BUILD_MINIDRIVER_DUMMY, 1, [Use the dummy minidriver.]) + AC_DEFINE(HAVE_JTAG_MINIDRIVER_H, 1, + [Define to 1 if you have the <jtag_minidriver.h> header file.]) +fi +AC_MSG_RESULT($build_minidriver_dummy) + +AC_MSG_CHECKING([whether standard drivers can be built]) +if test "$build_minidriver" = yes; then + AC_MSG_RESULT([no]) + AC_MSG_WARN([Using the minidriver disables all other drivers.]) + sleep 2 +else + AC_MSG_RESULT([yes]) +fi + +case "${host_cpu}" in + i?86|x86*) + ;; + *) + if test x$parport_use_ppdev = xno; then + AC_MSG_WARN([--disable-parport-ppdev is not supported by the host CPU]) + fi + parport_use_ppdev=yes + ;; +esac + +case $host in + *-cygwin*) + is_win32=yes + + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[return __MINGW32__;]), + [is_mingw=yes],[is_mingw=no]) + if test $is_mingw = yes; then + AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.]) + if test x$parport_use_giveio = xno; then + AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts]) + fi + parport_use_giveio=yes + is_cygwin=no + else + is_cygwin=yes + AC_DEFINE(IS_CYGWIN, 1, [1 if building for Cygwin.]) + fi + + AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.]) + AC_DEFINE(IS_DARWIN, 0, [0 if not building for Darwin.]) + ;; + *-mingw*) + is_mingw=yes + is_win32=yes + + if test x$parport_use_giveio = xno; then + AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts]) + fi + parport_use_giveio=yes + + AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.]) + AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.]) + AC_DEFINE(IS_DARWIN, 0, [0 if not building for Darwin.]) + ;; + *darwin*) + is_darwin=yes + + if test x$parport_use_giveio = xyes; then + AC_MSG_WARN([--enable-parport-giveio cannot be used by Darwin hosts]) + fi + parport_use_giveio=no + + AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.]) + AC_DEFINE(IS_WIN32, 0, [0 if not building for Win32.]) + AC_DEFINE(IS_DARWIN, 1, [1 if building for Darwin.]) + ;; + *) + if test x$parport_use_giveio = xyes; then + AC_MSG_WARN([--enable-parport-giveio cannot be used by ]$host[ hosts]) + fi + parport_use_giveio=no + AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.]) + AC_DEFINE(IS_WIN32, 0, [0 if not building for Win32.]) + AC_DEFINE(IS_DARWIN, 0, [0 if not building for Darwin.]) + ;; +esac + +if test $build_parport = yes; then + build_bitbang=yes + AC_DEFINE(BUILD_PARPORT, 1, [1 if you want parport.]) +else + AC_DEFINE(BUILD_PARPORT, 0, [0 if you don't want parport.]) +fi + +if test $build_dummy = yes; then + build_bitbang=yes + AC_DEFINE(BUILD_DUMMY, 1, [1 if you want dummy driver.]) +else + AC_DEFINE(BUILD_DUMMY, 0, [0 if you don't want dummy driver.]) +fi + +if test $build_ep93xx = yes; then + build_bitbang=yes + AC_DEFINE(BUILD_EP93XX, 1, [1 if you want ep93xx.]) +else + AC_DEFINE(BUILD_EP93XX, 0, [0 if you don't want ep93xx.]) +fi + +if test $build_ecosboard = yes; then + AC_DEFINE(BUILD_ECOSBOARD, 1, [1 if you want eCosBoard.]) +else + AC_DEFINE(BUILD_ECOSBOARD, 0, [0 if you don't want eCosBoard.]) +fi + +if test $build_ioutil = yes; then + AC_DEFINE(BUILD_IOUTIL, 1, [1 if you want ioutils.]) +else + AC_DEFINE(BUILD_IOUTIL, 0, [0 if you don't want ioutils.]) +fi + +if test $build_httpd = yes; then + AC_DEFINE(BUILD_HTTPD, 1, [1 if you want httpd.]) +else + AC_DEFINE(BUILD_HTTPD, 0, [0 if you don't want httpd.]) +fi + +if test $build_at91rm9200 = yes; then + build_bitbang=yes + AC_DEFINE(BUILD_AT91RM9200, 1, [1 if you want at91rm9200.]) +else + AC_DEFINE(BUILD_AT91RM9200, 0, [0 if you don't want at91rm9200.]) +fi + +if test x$parport_use_ppdev = xyes; then + AC_DEFINE(PARPORT_USE_PPDEV, 1, [1 if you want parport to use ppdev.]) +else + AC_DEFINE(PARPORT_USE_PPDEV, 0, [0 if you don't want parport to use ppdev.]) +fi + +if test x$parport_use_giveio = xyes; then + AC_DEFINE(PARPORT_USE_GIVEIO, 1, [1 if you want parport to use giveio.]) +else + AC_DEFINE(PARPORT_USE_GIVEIO, 0, [0 if you don't want parport to use giveio.]) +fi + +if test $build_bitbang = yes; then + AC_DEFINE(BUILD_BITBANG, 1, [1 if you want a bitbang interface.]) +else + AC_DEFINE(BUILD_BITBANG, 0, [0 if you don't want a bitbang interface.]) +fi + +if test $build_ft2232_libftdi = yes; then + AC_DEFINE(BUILD_FT2232_LIBFTDI, 1, [1 if you want libftdi ft2232.]) +else + AC_DEFINE(BUILD_FT2232_LIBFTDI, 0, [0 if you don't want libftdi ft2232.]) +fi + +if test $build_ft2232_ftd2xx = yes; then + AC_DEFINE(BUILD_FT2232_FTD2XX, 1, [1 if you want ftd2xx ft2232.]) +else + AC_DEFINE(BUILD_FT2232_FTD2XX, 0, [0 if you don't want ftd2xx ft2232.]) +fi + +if test $build_amtjtagaccel = yes; then + AC_DEFINE(BUILD_AMTJTAGACCEL, 1, [1 if you want the Amontec JTAG-Accelerator driver.]) +else + AC_DEFINE(BUILD_AMTJTAGACCEL, 0, [0 if you don't want the Amontec JTAG-Accelerator driver.]) +fi + +if test $build_gw16012 = yes; then + AC_DEFINE(BUILD_GW16012, 1, [1 if you want the Gateworks GW16012 driver.]) +else + AC_DEFINE(BUILD_GW16012, 0, [0 if you don't want the Gateworks GW16012 driver.]) +fi + +if test $build_presto_libftdi = yes; then + build_bitq=yes + AC_DEFINE(BUILD_PRESTO_LIBFTDI, 1, [1 if you want the ASIX PRESTO driver using libftdi.]) +else + AC_DEFINE(BUILD_PRESTO_LIBFTDI, 0, [0 if you don't want the ASIX PRESTO driver using libftdi.]) +fi + +if test $build_presto_ftd2xx = yes; then + build_bitq=yes + AC_DEFINE(BUILD_PRESTO_FTD2XX, 1, [1 if you want the ASIX PRESTO driver using FTD2XX.]) +else + AC_DEFINE(BUILD_PRESTO_FTD2XX, 0, [0 if you don't want the ASIX PRESTO driver using FTD2XX.]) +fi + +if test $build_bitq = yes; then + AC_DEFINE(BUILD_BITQ, 1, [1 if you want a bitq interface.]) +else + AC_DEFINE(BUILD_BITQ, 0, [0 if you don't want a bitq interface.]) +fi + +if test $build_usbprog = yes; then + AC_DEFINE(BUILD_USBPROG, 1, [1 if you want the usbprog JTAG driver.]) +else + AC_DEFINE(BUILD_USBPROG, 0, [0 if you don't want the usbprog JTAG driver.]) +fi + +if test $build_oocd_trace = yes; then + AC_DEFINE(BUILD_OOCD_TRACE, 1, [1 if you want the OpenOCD+trace ETM capture driver.]) +else + AC_DEFINE(BUILD_OOCD_TRACE, 0, [0 if you don't want the OpenOCD+trace ETM capture driver.]) +fi + +if test $build_jlink = yes; then + AC_DEFINE(BUILD_JLINK, 1, [1 if you want the J-Link JTAG driver.]) +else + AC_DEFINE(BUILD_JLINK, 0, [0 if you don't want the J-Link JTAG driver.]) +fi + +if test $build_vsllink = yes; then + AC_DEFINE(BUILD_VSLLINK, 1, [1 if you want the Versaloon-Link JTAG driver.]) +else + AC_DEFINE(BUILD_VSLLINK, 0, [0 if you don't want the Versaloon-Link JTAG driver.]) +fi + +if test $build_rlink = yes; then + AC_DEFINE(BUILD_RLINK, 1, [1 if you want the RLink JTAG driver.]) +else + AC_DEFINE(BUILD_RLINK, 0, [0 if you don't want the RLink JTAG driver.]) +fi + +if test $build_armjtagew = yes; then + AC_DEFINE(BUILD_ARMJTAGEW, 1, [1 if you want the ARM-JTAG-EW JTAG driver.]) +else + AC_DEFINE(BUILD_ARMJTAGEW, 0, [0 if you don't want the ARM-JTAG-EW JTAG driver.]) +fi + +#-- Deal with MingW/Cygwin FTD2XX issues + +if test $is_win32 = yes; then +if test "${with_ftd2xx_linux_tardir+set}" = set +then + AC_MSG_ERROR([The option: with_ftd2xx_linux_tardir is for LINUX only.]) +fi + +if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes ; then + AC_MSG_CHECKING([for ftd2xx.lib exists (win32)]) + + # if we are given a zipdir... + if test "${with_ftd2xx_win32_zipdir+set}" = set + then + # Set the CFLAGS for "ftd2xx.h" + f=$with_ftd2xx_win32_zipdir/ftd2xx.h + if test ! -f $f ; then + AC_MSG_ERROR([File: $f cannot be found]) + fi + CFLAGS="$CFLAGS -I$with_ftd2xx_win32_zipdir" + + # And calculate the LDFLAGS for the machine + case "$host_cpu" in + i?86|x86_*) + LDFLAGS="$LDFLAGS -L$with_ftd2xx_win32_zipdir/i386" + LIBS="$LIBS -lftd2xx" + f=$with_ftd2xx_win32_zipdir/i386/ftd2xx.lib + ;; + amd64) + LDFLAGS="$LDFLAGS -L$with_ftd2xx_win32_zipdir/amd64" + LIBS="$LIBS -lftd2xx" + f=$with_ftd2xx_win32_zipdir/amd64/ftd2xx.lib + ;; + *) + AC_MSG_ERROR([Unknown Win32 host cpu: $host_cpu]) + ;; + esac + if test ! -f $f ; then + AC_MSG_ERROR([Library: $f not found]) + fi + else + LIBS="$LIBS -lftd2xx" + AC_MSG_WARN([ASSUMPTION: The (win32) FTDICHIP.COM files: ftd2xx.h and ftd2xx.lib are in a proper place]) + fi +fi +fi # win32 + +if test $is_darwin = yes ; then +if test "${with_ftd2xx_win32_zipdir+set}" = set +then + AC_MSG_ERROR([The option: --with-ftd2xx-win32-zipdir is for win32 only]) +fi +if test "${with_ftd2xx_linux_tardir+set}" = set +then + AC_MSG_ERROR([The option: with_ftd2xx_linux_tardir is for LINUX only.]) +fi + +if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes ; then + AC_MSG_CHECKING([for libftd2xx.a (darwin)]) + + if test ! -f /usr/local/include/ftd2xx.h ; then + AC_MSG_ERROR([ftd2xx library from FTDICHIP.com seems to be missing, cannot find: /usr/local/include/ftd2xx.h]) + fi + + CFLAGS="$CFLAGS -I/usr/local/include" + LDFLAGS="$LDFLAGS -L/usr/local/lib" + LIBS="$LIBS -lftd2xx" + AC_MSG_RESULT([-L/usr/local/lib -lftd2xx]) +fi +fi # darwin + +if test $is_win32 = no && test $is_darwin = no ; then + +if test "${with_ftd2xx_win32_zipdir+set}" = set +then + AC_MSG_ERROR([The option: --with-ftd2xx-win32-zipdir is for win32 only]) +fi + +if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes ; then + # Must be linux + if test $host_os != linux-gnu && test $host_os != linux ; then + AC_MSG_ERROR([The (linux) ftd2xx library from FTDICHIP.com is linux only. Try --enable-ft2232-libftdi instead]) + fi + # Are we given a TAR directory? + if test "${with_ftd2xx_linux_tardir+set}" = set + then + AC_MSG_CHECKING([uninstalled ftd2xx distribution]) + # The .H file is simple.. + FTD2XX_H=$with_ftd2xx_linux_tardir/ftd2xx.h + if test ! -f "${FTD2XX_H}"; then + AC_MSG_ERROR([Option: --with-ftd2xx-linux-tardir appears wrong, cannot find: ${FTD2XX_H}]) + fi + CFLAGS="$CFLAGS -I$with_ftd2xx_linux_tardir" + FTD2XX_LDFLAGS="-L$with_ftd2xx_linux_tardir" + FTD2XX_LIB="-lftd2xx" + if test $with_ftd2xx_lib != shared; then + # Test #1 - Future proof - if/when ftdichip fixes their distro. + # Try it with the simple ".a" suffix. + FTD2XX_LIB="$with_ftd2xx_linux_tardir/static_lib/libftd2xx.a" + if test -f "${FTD2XX_LIB}"; then + FTD2XX_LDFLAGS="${FTD2XX_LDFLAGS}/static_lib" + else + # Test Number2. + # Grr.. perhaps it exists as a version number? + FTD2XX_LIB="$with_ftd2xx_linux_tardir/static_lib/libftd2xx.a.*.*.*" + count=`ls ${FTD2XX_LIB} | wc -l` + if test $count -gt 1 ; then + AC_MSG_ERROR([Multiple libftd2xx.a files found in: $with_ftd2xx_linux_tardir/static_lib sorry cannot handle this yet]) + fi + if test $count -ne 1 ; then + AC_MSG_ERROR([Not found: $f, option: --with-ftd2xx-linux-tardir appears to be wrong]) + fi + # Because the "-l" rules do not understand version numbers... + # we will just stuff the absolute path onto the LIBS variable + FTD2XX_LIB="`ls ${FTD2XX_LIB}` -lpthread" + FTD2XX_LDFLAGS="" + fi + fi + LDFLAGS="${LDFLAGS} ${FTD2XX_LDFLAGS}" + LIBS="${LIBS} ${FTD2XX_LIB}" + AC_MSG_RESULT([${FTD2XX_LDFLAGS} ${FTD2XX_LIB}]) + else + AC_CHECK_HEADER([ftd2xx.h],[],[ + AC_MSG_ERROR([You seem to be missing the FTD2xx driver header file.]) + ]) + AC_SEARCH_LIBS([FT_GetLibraryVersion],[ftd2xx],,[ + AC_MSG_ERROR([You appear to be missing the FTD2xx driver library.]) + ],[]) + fi +fi +fi # linux + +if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes; then + +# Before we go any further - make sure we can *BUILD* and *RUN* +# a simple app with the "ftd2xx.lib" file - in what ever form we where given +# We should be able to compile, link and run this test program now +AC_MSG_CHECKING([whether ftd2xx library works]) + +# +# Save the LDFLAGS for later.. +LDFLAGS_SAVE=$LDFLAGS +CFLAGS_SAVE=$CFLAGS +_LDFLAGS=`eval echo $LDFLAGS` +_CFLAGS=`eval echo $CFLAGS` +LDFLAGS=$_LDFLAGS +CFLAGS=$_CFLAGS + +AC_RUN_IFELSE([ +#include "confdefs.h" +#if IS_WIN32 +#include "windows.h" +#endif +#include <stdio.h> +#include <ftd2xx.h> + +int +main( int argc, char **argv ) +{ + DWORD x; + FT_GetLibraryVersion( &x ); + return 0; +} + ], [ + AC_MSG_RESULT([Success!]) + ], [ + AC_MSG_ERROR([Cannot build & run test program using ftd2xx.lib]) + ] ) + +AC_MSG_CHECKING([whether to build ftd2xx device support]) +AC_MSG_RESULT([$want_ftd2xx_highspeed]) +if test $want_ftd2xx_highspeed != no; then + AC_MSG_CHECKING([for ftd2xx highspeed device support]) + AC_COMPILE_IFELSE([ +#include "confdefs.h" +#if IS_WIN32 +#include "windows.h" +#endif +#include <stdio.h> +#include <ftd2xx.h> +DWORD x = FT_DEVICE_4232H; + ], [ + AC_DEFINE(BUILD_FTD2XX_HIGHSPEED, [1], + [Support FT2232H/FT4232HS with FTD2XX.]) + build_ftd2xx_highspeed=yes + ], [ + build_ftd2xx_highspeed=no + ]) + AC_MSG_RESULT([$build_ftd2xx_highspeed]) + + if test $want_ftd2xx_highspeed = yes -a $build_ftd2xx_highspeed = no; t... [truncated message content] |
From: <zw...@ma...> - 2009-06-09 10:41:40
|
Author: zwelch Date: 2009-06-09 10:41:36 +0200 (Tue, 09 Jun 2009) New Revision: 2169 Modified: trunk/src/jtag/core.c trunk/src/jtag/jtag.h Log: Continue encapsulation of JTAG event callback sub-API: - Move jtag_event_callbacks struct to core.c; it's an implementation detail. - Move jtag_*_event_callbacks next to the definition of the new function type. Modified: trunk/src/jtag/core.c =================================================================== --- trunk/src/jtag/core.c 2009-06-09 08:41:29 UTC (rev 2168) +++ trunk/src/jtag/core.c 2009-06-09 08:41:36 UTC (rev 2169) @@ -87,6 +87,13 @@ static int jtag_nsrst_delay = 0; /* default to no nSRST delay */ static int jtag_ntrst_delay = 0; /* default to no nTRST delay */ +typedef struct jtag_event_callback_s +{ + jtag_event_handler_t callback; + void* priv; + struct jtag_event_callback_s* next; +} jtag_event_callback_t; + /* callbacks to inform high-level handlers about JTAG state changes */ static jtag_event_callback_t *jtag_event_callbacks; Modified: trunk/src/jtag/jtag.h =================================================================== --- trunk/src/jtag/jtag.h 2009-06-09 08:41:29 UTC (rev 2168) +++ trunk/src/jtag/jtag.h 2009-06-09 08:41:36 UTC (rev 2169) @@ -261,13 +261,12 @@ */ typedef int (*jtag_event_handler_t)(enum jtag_event event, void* priv); -typedef struct jtag_event_callback_s -{ - jtag_event_handler_t callback; - void* priv; - struct jtag_event_callback_s* next; -} jtag_event_callback_t; +extern int jtag_register_event_callback(jtag_event_handler_t f, void *x); +extern int jtag_unregister_event_callback(jtag_event_handler_t f); +extern int jtag_call_event_callbacks(enum jtag_event event); + + /// @returns The current JTAG speed setting. int jtag_get_speed(void); /** @@ -621,9 +620,6 @@ extern void jtag_check_value_mask(scan_field_t *field, u8 *value, u8 *mask); extern void jtag_sleep(u32 us); -extern int jtag_call_event_callbacks(enum jtag_event event); -extern int jtag_register_event_callback(jtag_event_handler_t f, void *x); -extern int jtag_unregister_event_callback(jtag_event_handler_t f); /* * The JTAG subsystem defines a number of error codes, |
From: <zw...@ma...> - 2009-06-09 10:41:33
|
Author: zwelch Date: 2009-06-09 10:41:29 +0200 (Tue, 09 Jun 2009) New Revision: 2168 Modified: trunk/src/jtag/core.c trunk/src/jtag/jtag.h Log: Add jtag_event_handler_t: - Define the function signature used by the JTAG event callback mechanism. - Provide Doxygen block for new type, including TODO for its return value. Modified: trunk/src/jtag/core.c =================================================================== --- trunk/src/jtag/core.c 2009-06-09 08:41:23 UTC (rev 2167) +++ trunk/src/jtag/core.c 2009-06-09 08:41:29 UTC (rev 2168) @@ -201,7 +201,7 @@ } -int jtag_register_event_callback(int (*callback)(enum jtag_event event, void *priv), void *priv) +int jtag_register_event_callback(jtag_event_handler_t callback, void *priv) { jtag_event_callback_t **callbacks_p = &jtag_event_callbacks; @@ -225,7 +225,7 @@ return ERROR_OK; } -int jtag_unregister_event_callback(int (*callback)(enum jtag_event event, void *priv)) +int jtag_unregister_event_callback(jtag_event_handler_t callback) { jtag_event_callback_t **callbacks_p = &jtag_event_callbacks; Modified: trunk/src/jtag/jtag.h =================================================================== --- trunk/src/jtag/jtag.h 2009-06-09 08:41:23 UTC (rev 2167) +++ trunk/src/jtag/jtag.h 2009-06-09 08:41:29 UTC (rev 2168) @@ -248,9 +248,22 @@ /// @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() + * and removed jtag_unregister_event_callback(). + * @param event The event to handle. + * @param prive A pointer to data that was passed to + * jtag_register_event_callback(). + * @returns Must return ERROR_OK on success, or an error code on failure. + * + * @todo Change to return void or define a use for its return code. + */ +typedef int (*jtag_event_handler_t)(enum jtag_event event, void* priv); + typedef struct jtag_event_callback_s { - int (*callback)(enum jtag_event event, void* priv); + jtag_event_handler_t callback; void* priv; struct jtag_event_callback_s* next; } jtag_event_callback_t; @@ -609,8 +622,8 @@ extern void jtag_sleep(u32 us); extern int jtag_call_event_callbacks(enum jtag_event event); -extern int jtag_register_event_callback(int (* callback)(enum jtag_event event, void* priv), void* priv); -extern int jtag_unregister_event_callback(int (*callback)(enum jtag_event event, void *priv)); +extern int jtag_register_event_callback(jtag_event_handler_t f, void *x); +extern int jtag_unregister_event_callback(jtag_event_handler_t f); /* * The JTAG subsystem defines a number of error codes, |
From: <zw...@ma...> - 2009-06-09 10:41:27
|
Author: zwelch Date: 2009-06-09 10:41:23 +0200 (Tue, 09 Jun 2009) New Revision: 2167 Modified: trunk/src/jtag/jtag.h Log: Expose jtag_unregister_event_callback with related API declarations. Modified: trunk/src/jtag/jtag.h =================================================================== --- trunk/src/jtag/jtag.h 2009-06-09 08:41:14 UTC (rev 2166) +++ trunk/src/jtag/jtag.h 2009-06-09 08:41:23 UTC (rev 2167) @@ -610,6 +610,7 @@ extern void jtag_sleep(u32 us); extern int jtag_call_event_callbacks(enum jtag_event event); extern int jtag_register_event_callback(int (* callback)(enum jtag_event event, void* priv), void* priv); +extern int jtag_unregister_event_callback(int (*callback)(enum jtag_event event, void *priv)); /* * The JTAG subsystem defines a number of error codes, |
From: <zw...@ma...> - 2009-06-09 10:41:19
|
Author: zwelch Date: 2009-06-09 10:41:14 +0200 (Tue, 09 Jun 2009) New Revision: 2166 Modified: trunk/src/jtag/core.c trunk/src/jtag/jtag.h trunk/src/jtag/tcl.c Log: Improve encapsulation of JTAG event handling: - Move nvp_jtag_tap_event and jtag_tap_handle_event to tcl.c. - Change both to be static; remove declaration of function from jtag.h. Modified: trunk/src/jtag/core.c =================================================================== --- trunk/src/jtag/core.c 2009-06-09 08:41:08 UTC (rev 2165) +++ trunk/src/jtag/core.c 2009-06-09 08:41:14 UTC (rev 2166) @@ -63,13 +63,6 @@ "JTAG controller reset (RESET or TRST)" }; -const Jim_Nvp nvp_jtag_tap_event[] = { - { .value = JTAG_TAP_EVENT_ENABLE, .name = "tap-enable" }, - { .value = JTAG_TAP_EVENT_DISABLE, .name = "tap-disable" }, - - { .name = NULL, .value = -1 } -}; - static int jtag_trst = 0; static int jtag_srst = 0; @@ -1222,37 +1215,6 @@ return jtag->srst_asserted(srst_asserted); } -void jtag_tap_handle_event( jtag_tap_t * tap, enum jtag_tap_event e) -{ - jtag_tap_event_action_t * jteap; - int done; - - jteap = tap->event_action; - - done = 0; - while (jteap) { - if (jteap->event == e) { - done = 1; - LOG_DEBUG( "JTAG tap: %s event: %d (%s) action: %s\n", - tap->dotted_name, - e, - Jim_Nvp_value2name_simple(nvp_jtag_tap_event, e)->name, - Jim_GetString(jteap->body, NULL) ); - if (Jim_EvalObj(interp, jteap->body) != JIM_OK) { - Jim_PrintErrorMessage(interp); - } - } - - jteap = jteap->next; - } - - if (!done) { - LOG_DEBUG( "event %d %s - no action", - e, - Jim_Nvp_value2name_simple( nvp_jtag_tap_event, e)->name); - } -} - int jtag_add_statemove(tap_state_t goal_state) { tap_state_t cur_state = cmd_queue_cur_state; Modified: trunk/src/jtag/jtag.h =================================================================== --- trunk/src/jtag/jtag.h 2009-06-09 08:41:08 UTC (rev 2165) +++ trunk/src/jtag/jtag.h 2009-06-09 08:41:14 UTC (rev 2166) @@ -611,8 +611,6 @@ extern int jtag_call_event_callbacks(enum jtag_event event); extern int jtag_register_event_callback(int (* callback)(enum jtag_event event, void* priv), void* priv); -void jtag_tap_handle_event(jtag_tap_t* tap, enum jtag_tap_event e); - /* * The JTAG subsystem defines a number of error codes, * using codes between -100 and -199. Modified: trunk/src/jtag/tcl.c =================================================================== --- trunk/src/jtag/tcl.c 2009-06-09 08:41:08 UTC (rev 2165) +++ trunk/src/jtag/tcl.c 2009-06-09 08:41:14 UTC (rev 2166) @@ -39,8 +39,13 @@ #include <strings.h> #endif -extern const Jim_Nvp nvp_jtag_tap_event[]; +static const Jim_Nvp nvp_jtag_tap_event[] = { + { .value = JTAG_TAP_EVENT_ENABLE, .name = "tap-enable" }, + { .value = JTAG_TAP_EVENT_DISABLE, .name = "tap-disable" }, + { .name = NULL, .value = -1 } +}; + /* jtag interfaces (parport, FTDI-USB, TI-USB, ...) */ @@ -443,6 +448,38 @@ return JIM_ERR; } +static void jtag_tap_handle_event( jtag_tap_t * tap, enum jtag_tap_event e) +{ + jtag_tap_event_action_t * jteap; + int done; + + jteap = tap->event_action; + + done = 0; + while (jteap) { + if (jteap->event == e) { + done = 1; + LOG_DEBUG( "JTAG tap: %s event: %d (%s) action: %s\n", + tap->dotted_name, + e, + Jim_Nvp_value2name_simple(nvp_jtag_tap_event, e)->name, + Jim_GetString(jteap->body, NULL) ); + if (Jim_EvalObj(interp, jteap->body) != JIM_OK) { + Jim_PrintErrorMessage(interp); + } + } + + jteap = jteap->next; + } + + if (!done) { + LOG_DEBUG( "event %d %s - no action", + e, + Jim_Nvp_value2name_simple( nvp_jtag_tap_event, e)->name); + } +} + + static int jim_jtag_command( Jim_Interp *interp, int argc, Jim_Obj *const *argv ) { Jim_GetOptInfo goi; |
From: <zw...@ma...> - 2009-06-09 10:41:11
|
Author: zwelch Date: 2009-06-09 10:41:08 +0200 (Tue, 09 Jun 2009) New Revision: 2165 Modified: trunk/src/jtag/core.c trunk/src/jtag/tcl.c Log: Properly encapsulate core hasKHZ variable. Modified: trunk/src/jtag/core.c =================================================================== --- trunk/src/jtag/core.c 2009-06-09 08:41:00 UTC (rev 2164) +++ trunk/src/jtag/core.c 2009-06-09 08:41:08 UTC (rev 2165) @@ -100,13 +100,13 @@ /* speed in kHz*/ static int speed_khz = 0; /* flag if the kHz speed was defined */ -bool hasKHz = false; +static bool hasKHz = false; +static int jtag_speed = 0; struct jtag_interface_s *jtag = NULL; /* configuration */ jtag_interface_t *jtag_interface = NULL; -static int jtag_speed = 0; void jtag_set_error(int error) { @@ -1188,6 +1188,7 @@ jtag_speed = speed; /* this command can be called during CONFIG, * in which case jtag isn't initialized */ + hasKHz = !jtag; return jtag ? jtag->speed(speed) : ERROR_OK; } Modified: trunk/src/jtag/tcl.c =================================================================== --- trunk/src/jtag/tcl.c 2009-06-09 08:41:00 UTC (rev 2164) +++ trunk/src/jtag/tcl.c 2009-06-09 08:41:08 UTC (rev 2165) @@ -39,8 +39,6 @@ #include <strings.h> #endif -extern bool hasKHz; - extern const Jim_Nvp nvp_jtag_tap_event[]; /* jtag interfaces (parport, FTDI-USB, TI-USB, ...) @@ -994,11 +992,8 @@ return retval; } cur_speed = speed_div1; - - retval = jtag_set_speed(cur_speed); } - else - hasKHz = true; + retval = jtag_set_speed(cur_speed); } cur_speed = jtag_get_speed_khz(); |
From: <zw...@ma...> - 2009-06-09 10:41:05
|
Author: zwelch Date: 2009-06-09 10:41:00 +0200 (Tue, 09 Jun 2009) New Revision: 2164 Modified: trunk/src/jtag/core.c trunk/src/jtag/jtag.h trunk/src/jtag/tcl.c Log: Cleanup and encapsulate IR Capture verification: - Add accessors for setting the jtag_verify_capture_ir flag. - Use them in handle_verify_ircapture_cpmmand - Change variable type to bool; make it static. Modified: trunk/src/jtag/core.c =================================================================== --- trunk/src/jtag/core.c 2009-06-09 08:40:54 UTC (rev 2163) +++ trunk/src/jtag/core.c 2009-06-09 08:41:00 UTC (rev 2164) @@ -87,7 +87,7 @@ static tap_state_t cmd_queue_end_state = TAP_RESET; tap_state_t cmd_queue_cur_state = TAP_RESET; -int jtag_verify_capture_ir = 1; +static bool jtag_verify_capture_ir = true; static int jtag_verify = 1; /* how long the OpenOCD should wait before attempting JTAG communication after reset lines deasserted (in ms) */ @@ -1201,7 +1201,16 @@ return jtag_verify; } +void jtag_set_verify_capture_ir(bool enable) +{ + jtag_verify_capture_ir = enable; +} +bool jtag_will_verify_capture_ir() +{ + return jtag_verify_capture_ir; +} + int jtag_power_dropout(int *dropout) { return jtag->power_dropout(dropout); Modified: trunk/src/jtag/jtag.h =================================================================== --- trunk/src/jtag/jtag.h 2009-06-09 08:40:54 UTC (rev 2163) +++ trunk/src/jtag/jtag.h 2009-06-09 08:41:00 UTC (rev 2164) @@ -611,8 +611,6 @@ extern int jtag_call_event_callbacks(enum jtag_event event); extern int jtag_register_event_callback(int (* callback)(enum jtag_event event, void* priv), void* priv); -extern int jtag_verify_capture_ir; - void jtag_tap_handle_event(jtag_tap_t* tap, enum jtag_tap_event e); /* @@ -708,4 +706,7 @@ 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); + #endif /* JTAG_H */ Modified: trunk/src/jtag/tcl.c =================================================================== --- trunk/src/jtag/tcl.c 2009-06-09 08:40:54 UTC (rev 2163) +++ trunk/src/jtag/tcl.c 2009-06-09 08:41:00 UTC (rev 2164) @@ -1304,25 +1304,21 @@ static int handle_verify_ircapture_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { + if (argc > 1) + return ERROR_COMMAND_SYNTAX_ERROR; + if (argc == 1) { if (strcmp(args[0], "enable") == 0) - { - jtag_verify_capture_ir = 1; - } + jtag_set_verify_capture_ir(true); else if (strcmp(args[0], "disable") == 0) - { - jtag_verify_capture_ir = 0; - } else - { + jtag_set_verify_capture_ir(false); + else return ERROR_COMMAND_SYNTAX_ERROR; - } - } else if (argc != 0) - { - return ERROR_COMMAND_SYNTAX_ERROR; } - command_print(cmd_ctx, "verify Capture-IR is %s", (jtag_verify_capture_ir) ? "enabled": "disabled"); + const char *status = jtag_will_verify_capture_ir() ? "enabled": "disabled"; + command_print(cmd_ctx, "verify Capture-IR is %s", status); return ERROR_OK; } |
From: <zw...@ma...> - 2009-06-09 10:40:57
|
Author: zwelch Date: 2009-06-09 10:40:54 +0200 (Tue, 09 Jun 2009) New Revision: 2163 Modified: trunk/src/jtag/core.c Log: Add missing static keywords to a few variables in JTAG core module. Modified: trunk/src/jtag/core.c =================================================================== --- trunk/src/jtag/core.c 2009-06-09 08:40:46 UTC (rev 2162) +++ trunk/src/jtag/core.c 2009-06-09 08:40:54 UTC (rev 2163) @@ -58,7 +58,7 @@ */ static int jtag_error = ERROR_OK; -char* jtag_event_strings[] = +static char* jtag_event_strings[] = { "JTAG controller reset (RESET or TRST)" }; @@ -83,12 +83,12 @@ */ static unsigned jtag_num_taps = 0; -enum reset_types jtag_reset_config = RESET_NONE; -tap_state_t cmd_queue_end_state = TAP_RESET; +static enum reset_types jtag_reset_config = RESET_NONE; +static tap_state_t cmd_queue_end_state = TAP_RESET; tap_state_t cmd_queue_cur_state = TAP_RESET; int jtag_verify_capture_ir = 1; -int jtag_verify = 1; +static int jtag_verify = 1; /* how long the OpenOCD should wait before attempting JTAG communication after reset lines deasserted (in ms) */ static int jtag_nsrst_delay = 0; /* default to no nSRST delay */ @@ -106,7 +106,7 @@ /* configuration */ jtag_interface_t *jtag_interface = NULL; -int jtag_speed = 0; +static int jtag_speed = 0; void jtag_set_error(int error) { |
From: <zw...@ma...> - 2009-06-09 10:40:51
|
Author: zwelch Date: 2009-06-09 10:40:46 +0200 (Tue, 09 Jun 2009) New Revision: 2162 Modified: trunk/src/jtag/core.c trunk/src/jtag/jtag.h Log: Move the jtag_error helper routines out of header file: - Makes jtag_error static, add new get helper function for completeness. - Improve and add documentation and style for these helpers. Modified: trunk/src/jtag/core.c =================================================================== --- trunk/src/jtag/core.c 2009-06-09 08:40:31 UTC (rev 2161) +++ trunk/src/jtag/core.c 2009-06-09 08:40:46 UTC (rev 2162) @@ -46,10 +46,17 @@ static void jtag_add_scan_check(void (*jtag_add_scan)(int in_num_fields, const scan_field_t *in_fields, tap_state_t state), int in_num_fields, scan_field_t *in_fields, tap_state_t state); -/* note that this is not marked as static as it must be available from outside core.c for those - that implement the jtag_xxx() minidriver layer -*/ -int jtag_error=ERROR_OK; +/** + * The jtag_error variable is set when an error occurs while executing + * the queue. Application code may set this using jtag_set_error(), + * 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(). + */ +static int jtag_error = ERROR_OK; char* jtag_event_strings[] = { @@ -101,6 +108,24 @@ jtag_interface_t *jtag_interface = NULL; int jtag_speed = 0; +void jtag_set_error(int error) +{ + if ((error == ERROR_OK) || (jtag_error != ERROR_OK)) + return; + jtag_error = error; +} +int jtag_get_error(void) +{ + return jtag_error; +} +int jtag_error_clear(void) +{ + int temp = jtag_error; + jtag_error = ERROR_OK; + return temp; +} + + jtag_tap_t *jtag_all_taps(void) { return __jtag_all_taps; Modified: trunk/src/jtag/jtag.h =================================================================== --- trunk/src/jtag/jtag.h 2009-06-09 08:40:31 UTC (rev 2161) +++ trunk/src/jtag/jtag.h 2009-06-09 08:40:46 UTC (rev 2162) @@ -578,36 +578,19 @@ extern void jtag_execute_queue_noclear(void); /** - * The jtag_error variable is set when an error occurs while executing - * the queue. - * - * This flag can also be set from application code, if an error happens - * during processing that should be reported during jtag_execute_queue(). - * - * It is cleared by jtag_execute_queue(). + * 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. */ -extern int jtag_error; - -static __inline__ void jtag_set_error(int error) -{ - if ((error==ERROR_OK)||(jtag_error!=ERROR_OK)) - { - /* keep first error */ - return; - } - jtag_error=error; -} - +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. */ -static inline int jtag_error_clear(void) -{ - int temp = jtag_error; - jtag_error = ERROR_OK; - return temp; -} +int jtag_error_clear(void); /* can be implemented by hw+sw */ extern int jtag_power_dropout(int* dropout); |
From: <zw...@ma...> - 2009-06-09 10:40:43
|
Author: zwelch Date: 2009-06-09 10:40:31 +0200 (Tue, 09 Jun 2009) New Revision: 2161 Modified: trunk/src/jtag/amt_jtagaccel.c trunk/src/jtag/bitbang.c trunk/src/jtag/bitq.c trunk/src/jtag/core.c trunk/src/jtag/dummy.c trunk/src/jtag/ft2232.c trunk/src/jtag/jtag.h trunk/src/jtag/rlink/rlink.c trunk/src/jtag/tcl.c trunk/src/jtag/zy1000/zy1000.c trunk/src/target/arm7_9_common.c trunk/src/target/cortex_m3.c trunk/src/target/mips_m4k.c Log: Encapsulate jtag_reset_config using accessors: - Update handle_reset_config_command in tcl.c to use new helpers. - Replace direct accesses in JTAG interface and target drivers. Modified: trunk/src/jtag/amt_jtagaccel.c =================================================================== --- trunk/src/jtag/amt_jtagaccel.c 2009-06-09 08:40:23 UTC (rev 2160) +++ trunk/src/jtag/amt_jtagaccel.c 2009-06-09 08:40:31 UTC (rev 2161) @@ -500,6 +500,7 @@ amt_jtagaccel_speed(jtag_get_speed()); + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) aw_control_rst &= ~0x8; else Modified: trunk/src/jtag/bitbang.c =================================================================== --- trunk/src/jtag/bitbang.c 2009-06-09 08:40:23 UTC (rev 2160) +++ trunk/src/jtag/bitbang.c 2009-06-09 08:40:31 UTC (rev 2161) @@ -258,7 +258,7 @@ #ifdef _DEBUG_JTAG_IO_ LOG_DEBUG("reset trst: %i srst %i", cmd->cmd.reset->trst, cmd->cmd.reset->srst); #endif - if ((cmd->cmd.reset->trst == 1) || (cmd->cmd.reset->srst && (jtag_reset_config & RESET_SRST_PULLS_TRST))) + if ((cmd->cmd.reset->trst == 1) || (cmd->cmd.reset->srst && (jtag_get_reset_config() & RESET_SRST_PULLS_TRST))) { tap_set_state(TAP_RESET); } Modified: trunk/src/jtag/bitq.c =================================================================== --- trunk/src/jtag/bitq.c 2009-06-09 08:40:23 UTC (rev 2160) +++ trunk/src/jtag/bitq.c 2009-06-09 08:40:31 UTC (rev 2161) @@ -298,7 +298,7 @@ #ifdef _DEBUG_JTAG_IO_ LOG_DEBUG("reset trst: %i srst %i", cmd->cmd.reset->trst, cmd->cmd.reset->srst); #endif - if ( (cmd->cmd.reset->trst == 1) || ( cmd->cmd.reset->srst && (jtag_reset_config & RESET_SRST_PULLS_TRST) ) ) + if ( (cmd->cmd.reset->trst == 1) || ( cmd->cmd.reset->srst && (jtag_get_reset_config() & RESET_SRST_PULLS_TRST) ) ) { tap_set_state(TAP_RESET); } Modified: trunk/src/jtag/core.c =================================================================== --- trunk/src/jtag/core.c 2009-06-09 08:40:23 UTC (rev 2160) +++ trunk/src/jtag/core.c 2009-06-09 08:40:31 UTC (rev 2161) @@ -1262,6 +1262,15 @@ return ERROR_OK; } +enum reset_types jtag_get_reset_config(void) +{ + return jtag_reset_config; +} +void jtag_set_reset_config(enum reset_types type) +{ + jtag_reset_config = type; +} + int jtag_get_trst(void) { return jtag_trst; Modified: trunk/src/jtag/dummy.c =================================================================== --- trunk/src/jtag/dummy.c 2009-06-09 08:40:23 UTC (rev 2160) +++ trunk/src/jtag/dummy.c 2009-06-09 08:40:31 UTC (rev 2161) @@ -123,7 +123,7 @@ { dummy_clock = 0; - if (trst || (srst && (jtag_reset_config & RESET_SRST_PULLS_TRST))) + if (trst || (srst && (jtag_get_reset_config() & RESET_SRST_PULLS_TRST))) dummy_state = TAP_RESET; LOG_DEBUG("reset to: %s", tap_state_name(dummy_state) ); Modified: trunk/src/jtag/ft2232.c =================================================================== --- trunk/src/jtag/ft2232.c 2009-06-09 08:40:23 UTC (rev 2160) +++ trunk/src/jtag/ft2232.c 2009-06-09 08:40:31 UTC (rev 2161) @@ -1193,6 +1193,7 @@ static void usbjtag_reset(int trst, int srst) { + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (trst == 1) { if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) @@ -1232,6 +1233,7 @@ static void jtagkey_reset(int trst, int srst) { + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (trst == 1) { if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) @@ -1273,6 +1275,7 @@ static void olimex_jtag_reset(int trst, int srst) { + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (trst == 1) { if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) @@ -2155,6 +2158,7 @@ return ERROR_JTAG_INIT_FAILED; } + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) { low_direction &= ~nTRSTnOE; /* nTRST input */ @@ -2229,6 +2233,7 @@ high_output = 0x0; high_direction = 0x0c; + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) { LOG_ERROR("can't set nTRSTOE to push-pull on the Dicarlo jtag"); @@ -2307,6 +2312,7 @@ high_output = 0x0; high_direction = 0x0f; + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) { high_output |= nTRSTnOE; @@ -2373,6 +2379,7 @@ high_output = 0x0; high_direction = 0x0f; + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) { high_output |= nTRSTnOE; @@ -2944,6 +2951,7 @@ nTRST = 0x10; nSRST = 0x20; + enum reset_types jtag_reset_config = jtag_get_reset_config(); if ((jtag_reset_config & RESET_TRST_OPEN_DRAIN) != 0) { low_direction &= ~nTRST; /* nTRST high impedance */ } @@ -2991,6 +2999,7 @@ low_output &= ~nTRST; } else if (trst == 0) { + enum reset_types jtag_reset_config = jtag_get_reset_config(); if ((jtag_reset_config & RESET_TRST_OPEN_DRAIN) != 0) low_direction &= ~nTRST; else Modified: trunk/src/jtag/jtag.h =================================================================== --- trunk/src/jtag/jtag.h 2009-06-09 08:40:23 UTC (rev 2160) +++ trunk/src/jtag/jtag.h 2009-06-09 08:40:31 UTC (rev 2161) @@ -277,7 +277,8 @@ RESET_SRST_PUSH_PULL = 0x20, }; -extern enum reset_types jtag_reset_config; +enum reset_types jtag_get_reset_config(void); +void jtag_set_reset_config(enum reset_types type); /** * Initialize interface upon startup. Return a successful no-op upon Modified: trunk/src/jtag/rlink/rlink.c =================================================================== --- trunk/src/jtag/rlink/rlink.c 2009-06-09 08:40:23 UTC (rev 2160) +++ trunk/src/jtag/rlink/rlink.c 2009-06-09 08:40:31 UTC (rev 2161) @@ -1419,7 +1419,7 @@ #ifdef _DEBUG_JTAG_IO_ LOG_DEBUG("reset trst: %i srst %i", cmd->cmd.reset->trst, cmd->cmd.reset->srst); #endif - if ((cmd->cmd.reset->trst == 1) || (cmd->cmd.reset->srst && (jtag_reset_config & RESET_SRST_PULLS_TRST))) + if ((cmd->cmd.reset->trst == 1) || (cmd->cmd.reset->srst && (jtag_get_reset_config() & RESET_SRST_PULLS_TRST))) { tap_set_state(TAP_RESET); } Modified: trunk/src/jtag/tcl.c =================================================================== --- trunk/src/jtag/tcl.c 2009-06-09 08:40:23 UTC (rev 2160) +++ trunk/src/jtag/tcl.c 2009-06-09 08:40:31 UTC (rev 2161) @@ -921,8 +921,10 @@ } /* clear previous values of those bits, save new values */ - jtag_reset_config &= ~mask; - jtag_reset_config |= new_cfg; + enum reset_types old_cfg = jtag_get_reset_config(); + old_cfg &= ~mask; + new_cfg |= old_cfg; + jtag_set_reset_config(new_cfg); return ERROR_OK; } Modified: trunk/src/jtag/zy1000/zy1000.c =================================================================== --- trunk/src/jtag/zy1000/zy1000.c 2009-06-09 08:40:23 UTC (rev 2160) +++ trunk/src/jtag/zy1000/zy1000.c 2009-06-09 08:40:31 UTC (rev 2161) @@ -164,7 +164,7 @@ ZY1000_POKE(ZY1000_JTAG_BASE+0x10, 0x00000002); } - if (trst||(srst&&(jtag_reset_config & RESET_SRST_PULLS_TRST))) + if (trst||(srst&&(jtag_get_reset_config() & RESET_SRST_PULLS_TRST))) { waitIdle(); /* we're now in the RESET state until trst is deasserted */ Modified: trunk/src/target/arm7_9_common.c =================================================================== --- trunk/src/target/arm7_9_common.c 2009-06-09 08:40:23 UTC (rev 2160) +++ trunk/src/target/arm7_9_common.c 2009-06-09 08:40:31 UTC (rev 2161) @@ -905,6 +905,7 @@ { if (target->reset_halt) { + enum reset_types jtag_reset_config = jtag_get_reset_config(); if ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0) { check_pc = 1; @@ -975,6 +976,7 @@ LOG_DEBUG("target->state: %s", Jim_Nvp_value2name_simple( nvp_target_state,target->state)->name); + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (!(jtag_reset_config & RESET_HAS_SRST)) { LOG_ERROR("Can't assert SRST"); @@ -1047,6 +1049,7 @@ /* deassert reset lines */ jtag_add_reset(0, 0); + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (target->reset_halt&&(jtag_reset_config & RESET_SRST_PULLS_TRST)!=0) { LOG_WARNING("srst pulls trst - can not reset into halted mode. Issuing halt after reset."); Modified: trunk/src/target/cortex_m3.c =================================================================== --- trunk/src/target/cortex_m3.c 2009-06-09 08:40:23 UTC (rev 2160) +++ trunk/src/target/cortex_m3.c 2009-06-09 08:40:31 UTC (rev 2161) @@ -544,7 +544,7 @@ if (target->state == TARGET_RESET) { - if ((jtag_reset_config & RESET_SRST_PULLS_TRST) && jtag_get_srst()) + if ((jtag_get_reset_config() & RESET_SRST_PULLS_TRST) && jtag_get_srst()) { LOG_ERROR("can't request a halt while in reset if nSRST pulls nTRST"); return ERROR_TARGET_FAILURE; @@ -753,6 +753,7 @@ LOG_DEBUG("target->state: %s", Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name ); + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (!(jtag_reset_config & RESET_HAS_SRST)) { LOG_ERROR("Can't assert SRST"); Modified: trunk/src/target/mips_m4k.c =================================================================== --- trunk/src/target/mips_m4k.c 2009-06-09 08:40:23 UTC (rev 2160) +++ trunk/src/target/mips_m4k.c 2009-06-09 08:40:31 UTC (rev 2161) @@ -235,7 +235,7 @@ if (target->state == TARGET_RESET) { - if ((jtag_reset_config & RESET_SRST_PULLS_TRST) && jtag_get_srst()) + if ((jtag_get_reset_config() & RESET_SRST_PULLS_TRST) && jtag_get_srst()) { LOG_ERROR("can't request a halt while in reset if nSRST pulls nTRST"); return ERROR_TARGET_FAILURE; @@ -267,6 +267,7 @@ LOG_DEBUG("target->state: %s", Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name); + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (!(jtag_reset_config & RESET_HAS_SRST)) { LOG_ERROR("Can't assert SRST"); |
From: <zw...@ma...> - 2009-06-09 10:40:26
|
Author: zwelch Date: 2009-06-09 10:40:23 +0200 (Tue, 09 Jun 2009) New Revision: 2160 Modified: trunk/src/jtag/jtag.h Log: Remove superfluous extern for non-existant global variable. Modified: trunk/src/jtag/jtag.h =================================================================== --- trunk/src/jtag/jtag.h 2009-06-09 08:40:10 UTC (rev 2159) +++ trunk/src/jtag/jtag.h 2009-06-09 08:40:23 UTC (rev 2160) @@ -266,8 +266,6 @@ */ int jtag_set_speed(int speed); -extern int jtag_speed_post_reset; - enum reset_types { RESET_NONE = 0x0, RESET_HAS_TRST = 0x1, |