Commit Graph

41 Commits

Author SHA1 Message Date
oharboe
8b994145b8 Andreas Fritiofson <andreas.fritiofson@gmail.com> UTF8 fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@2549 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-17 19:54:25 +00:00
zwelch
f0fd28a66c David Brownell <david-b@pacbell.net>:
Warn when people (or scripts) use numeric identifiers for TAPs,
instead of dotted.name values.  We want this usage to go away,
so that for example adding more TAPs doesn't cause config scripts
to break because some sequence number changed.

It's been deprecated since late 2008, but putting a warning on
this should help us remove it (say, in June 2010) by helping to
phase out old (ab)usage in config scripts.

Other than in various config files, the only code expecting such
a number was the almost unused str9xpec driver.  This code was
changed to use the TAP it was passed, instead of making its own
dubious lookup and ignoring that TAP.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2415 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-29 20:03:59 +00:00
zwelch
c97caebccd Remove whitespace at end of lines, step 2.
- Replace '\s*$' with ''.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2380 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:50:08 +00:00
zwelch
c493543fc9 - Replace '){' with ') {'.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2378 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:49:06 +00:00
zwelch
dc575dc5bf Remove whitespace that occurs before ')'.
- Replace '[ \t]*[)]' with ')'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2377 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:47:42 +00:00
zwelch
f90d8fa45f Remove whitespace that occurs after '('.
- Replace '([ \t]*' with '('.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2376 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:46:23 +00:00
zwelch
84df52f9ea - Fixes '=' whitespace
- Replace ')\(=\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(=\)(' with '\1 \2 ('.
- Replace '\(\w\)\(=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2372 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:42:54 +00:00
zwelch
3813fda44a - Fixes '==' whitespace
- Replace ')\(==\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(==\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2371 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:42:03 +00:00
zwelch
128a733428 - Fixes '&&' whitespace
- Replace ')\(&&\)(' with ') \1 ('.
- Replace '\(\w\)\(&&\)(' with '\1 \2 ('.
- Replace '\(\w\)\(&&\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2366 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:39:47 +00:00
zwelch
53d605e12c - Fixes '!=' whitespace
- Replace ')\(!=\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(!=\)(' with '\1 \2 ('.
- Replace '\(\w\)\(!=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2363 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:38:12 +00:00
zwelch
95d2a23724 - Replace 'for(' with 'for ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2360 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:37:21 +00:00
zwelch
50c086ffb9 - Replace 'while(' with 'while ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2358 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:36:11 +00:00
zwelch
e43979e702 - Replace 'if(' with 'if ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2357 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:35:09 +00:00
duane
40d7e81c45 printf() warning fixes due to uint32_t change-over
git-svn-id: svn://svn.berlios.de/openocd/trunk@2293 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-19 23:15:58 +00:00
oharboe
333642fcff fix jtag_add_callback() args. The first argument is nothing special, it's just another generic argument.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2290 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-19 08:18:36 +00:00
zwelch
86e4324f1b Finish transforming 'u32' to 'uint32_t'.
- Replace '\([^_]\)u32' with '\1uint32_t'.
- Replace '^u32' with 'uint32_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2281 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:11:11 +00:00
zwelch
c18947b947 Transform 'u8' to 'uint8_t'
- Replace '\([^_]\)u8' with '\1uint8_t'.
- Replace '^u8' with 'uint8_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2276 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:07:12 +00:00
zwelch
d31e57a10d David Brownell <david-b@pacbell.net>:
Let jtag_call_event_callbacks() behave when the callback removes itself.
Oddly, this crashed on x86_32 but not x86_64.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2264 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-17 06:40:50 +00:00
zwelch
a0c10dd29b David Brownell <david-b@pacbell.net>:
Extend the internal JTAG event handlers to cover enable/disable,
and use those events to make sure that targets get "examined" if
they were disabled when the scan chain was first set up:

 - Remove "enum jtag_tap_event", merge with "enum jtag_event",
   so C code can now listen for TAP enable/disable events.

 - Report those events so they can trigger callbacks.

 - During startup, make target_examine() register a handler to
   catch ENABLE events for any then-disabled targets.

This fixes bugs like "can't halt target after enabling its TAP".

One class of unresolved bugs:  if the target has an ETM hooked
up to an ETB, nothing activates the ETB.  But starting up the
ETM without access to the ETB registers fails...


git-svn-id: svn://svn.berlios.de/openocd/trunk@2251 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-16 12:17:18 +00:00
zwelch
5f9b74d055 David Brownell <david-b@pacbell.net>:
Doc update:  say "jtag newtap ... -disable" records the
state after exiting the RESET state, matching the only
implementation we're working with so far (TI ICEpick-C).

Matching code updates.  Now we can be sure that the
"enabled" flag value is correct after JTAG resets.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2246 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-16 00:23:00 +00:00
zwelch
03803a9d79 David Brownell <david-b@pacbell.net>:
Fix a memory leak in jtag_tap_free():  unregister the event
callback too.

Also fix the associated conceptual bug in unregistering JTAG
event callbacks:  since the same callback procedure is used
many times with different callback data (a TAP handle), that
data must be considered when unregistering any callback.

This could fix some crashes after TAP registration errors,
by making sure the reset event handler doesn't scribble over
memory that's now used by something else.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2245 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-16 00:22:52 +00:00
zwelch
c7cfb3417b David Brownell <david-b@pacbell.net>:
Minor jtag cleanup:

 - remove hidden assumption about JTAG event numbering
 - move function declarations to a header
 - some end'o'line whitespace
 - use "calloc" not "malloc + memset"


git-svn-id: svn://svn.berlios.de/openocd/trunk@2244 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-16 00:22:40 +00:00
zwelch
8551803eb5 David Brownell <david-b@pacbell.net>:
Partial fix to the "long IR length" problems.

 - Current code could handle up to 32 bit IR lengths with
   full functionality, if it didn't just reject may of them
   out of hand.  So only reject clear errors, where the IR
   mask (or capture instruction) needs more than IrLen bits.

 - Longer IR lengths can only be handled in BYPASS mode
   for now.  Example:  TI's DSPs use 38-bit IR lengths.
   So we can't issue their IDCODE instructions...

A more complete fix would be able to issue longer instructions;
or minimally, would fail cleanly for the non-BYPASS case.

Note that this *could* make some currently broken scripts fail,
since the previous code accepted garbage values so long as
they didn't use more than 16 bits.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2222 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 21:43:53 +00:00
zwelch
5d657571cb Use parse_uint helper to replace strtoul call in jtag_tap_by_string.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2212 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 01:40:29 +00:00
zwelch
08382e0601 Out-of-line jtag_tap_next_enabled and simplify its logic.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2185 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 07:08:14 +00:00
zwelch
04cb121073 Move jtag_add_statemove decl/body nearer jtag_add_pathmove.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2184 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 07:08:03 +00:00
zwelch
e8febc2255 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.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2171 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 10:07:07 +00:00
zwelch
15974a0eeb 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.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2169 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:41:36 +00:00
zwelch
aabb31d571 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.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2168 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:41:29 +00:00
zwelch
a485ded4bf 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.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2166 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:41:14 +00:00
zwelch
a2d18e9111 Properly encapsulate core hasKHZ variable.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2165 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:41:08 +00:00
zwelch
55be316dbf 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.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2164 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:41:00 +00:00
zwelch
a70d77aec3 Add missing static keywords to a few variables in JTAG core module.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2163 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:40:54 +00:00
zwelch
f9596e96c9 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.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2162 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:40:46 +00:00
zwelch
6dc2c2ce97 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.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2161 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:40:31 +00:00
zwelch
cd7f89f6bc Add get and set accessors for jtag_speed:
- Setter calls the interface driver callback to improve core encapsulation.
- Use getter in standard JTAG interface drivers and ZY1000 minidriver.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2159 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:40:10 +00:00
zwelch
bcad121d2b Encapsulate the jtag_event_callback list; add helper functions if needed.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2158 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:40:02 +00:00
zwelch
175867ea32 Encapsulate the jtag_trst and jtag_srst variables:
- Add accessor functions to return their value.
- Use new SRST accessor in cortex_m3.c and mips_m4k.c


git-svn-id: svn://svn.berlios.de/openocd/trunk@2157 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:39:50 +00:00
zwelch
133a616572 Replace 'jtag.c' with 'core.c' in code comments.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2152 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 04:54:09 +00:00
zwelch
8e081cf401 Remove accidental duplicate of hasKHz; fixes pre-init speed setup.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2151 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 04:39:54 +00:00
zwelch
66707c94d7 Split main jtag.c file into two layers:
- src/jtag/core.c: contains the low-level JTAG TAP and scanning routines.
- src/jtag/tcl.c: contains high-level JTAG TCL commands that use the core.
- Remove static keywords from routines in core.c, extern from tcl.c:
  - jtag, jtag_interface global variables
  - jtag_{examine,validate}_chain and jtag_tap_{init,free} functions
- Added myself to the copyright header in both of these files.
- Used 'svn cp' to add files, so versioning was preserved for both.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2149 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 04:15:13 +00:00