Commit Graph

883 Commits

Author SHA1 Message Date
David Brownell
a0b1e05b53 printf format warning fixes
Observed on a Cygwin build.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-10 11:32:39 -07:00
David Brownell
bc13c12be9 add documentation about reset customization
We added two overridable procedures; document them, and the
two jtag arp_* operations they necessarily expose.

Update the comment about the jtag_init_reset() routine; it's
been obsolete for as long as it's had SRST support.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-09 12:52:42 -07:00
David Brownell
5b352c9e79 minor JTAG init messaging tweaks
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-08 23:51:50 -07:00
David Brownell
a8234af06c prevent abort via polling during jtag_reset
Observed:

  openocd: core.c:318: jtag_checks: Assertion `jtag_trst == 0' failed.

The issue was that nothing disabled background polling during calls
from the TCL shell to "jtag_reset 1 1".  Fix by moving the existing
poll-disable mechanism to the JTAG layer where it belongs, and then
augmenting it to always pay attention to TRST and SRST.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-08 11:14:00 -07:00
David Brownell
40c9668b70 Stop ignoring most scan chain validation errors
Among other things this causes startup errors to kick in the
fallback "reset harder" logic during server startup.  Comments
are also updated a bit, explaining what the various error paths
signify (in at least my observation).

There's one class of validation error that we can still plausibly
ignore:  when wrong IDCODE values are observed.

This change seems to have helped make an OMAP5912 behave much
more reliably.  There's still some post-reset flakiness, but
it's unrelated to scan verification.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-08 09:16:01 -07:00
dbrownell
cdc33b3808 Force sane SRST and TRST initialization
At least some FT2232 based adapters don't necessarily come up
in the expected state, with SRST and TRST disabled.  Since
other adapters could suffer the same problem, let's avoid
needing to patch every driver and just force *all* adapters
to initialize those values properly at server startup.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2824 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-10-07 19:02:21 +00:00
dbrownell
246ff4f601 Better fix for TAPs violating the JTAG spec for IR-Capture.
Instead of just assuming all IDCODE-deprived TAPs violate the
JTAG spec (they don't!), just require TAPs with such problems
to be declared with proper ircapture/irmask values.  Example,
with mask and value of zero.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2823 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-10-07 18:51:11 +00:00
dbrownell
7035b37e71 Remove much #ifdeffery around _DEBUG_JTAG_IO_ usage.
Have DEBUG_JTAG_IO() always trigger necessary warnings.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2822 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-10-07 17:30:51 +00:00
dbrownell
b83d79a42f Updates for "reset_config":
- revert to previous default: don't talk JTAG during SRST
 - add "srst_nogates" flag, the converse of "srst_gates_jtag"
 - with no args, display the current configuration

And update the User's Guide text with bullet lists to be a bit more clear.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2818 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-10-07 15:31:33 +00:00
oharboe
53dea2f952 Do not check ir capture if there is no IDCODE
git-svn-id: svn://svn.berlios.de/openocd/trunk@2812 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-10-07 11:03:01 +00:00
oharboe
e4cc19521b 1.55 snapshot
git-svn-id: svn://svn.berlios.de/openocd/trunk@2810 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-10-07 06:53:44 +00:00
oharboe
39b57471bf Introduced jtag_init and "jtag arp_init" to allow target scripts more control over how OpenOCD starts up and initializes the target.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2805 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-10-06 08:10:57 +00:00
dbrownell
7a57c31619 Improve jtag_validate_ircapture() diagnostics.
Bugfix the error message so it shows the disliked value, and add
a debug message showing each TAP's IR capture value, all N bits.

This just changes diagnostics ... it still ignores the parameters
given to us at TAP declaration time.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2801 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-10-05 08:23:33 +00:00
dbrownell
7c7467b34f Add a new JTAG "setup" event; use for better DaVinci ICEpick support.
The model is that this fires after scanchain verification, when it's
safe to call "jtag tapenable $TAPNAME".  So it will fire as part of
non-error paths of "init" and "reset" command processing.  However it
will *NOT* trigger during "jtag_reset" processing, which skips all
scan chain verification, or after verification errors.

ALSO:
 - switch DaVinci chips to use this new mechanism
 - log TAP activation/deactivation, since their IDCODEs aren't verified
 - unify "enum jtag_event" scripted event notifications
 - remove duplicative JTAG_TAP_EVENT_POST_RESET


git-svn-id: svn://svn.berlios.de/openocd/trunk@2800 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-10-05 08:20:28 +00:00
dbrownell
e4de4251fe Streamline Capture-IR validation code
- Don't issue needless JTAG resets ... only do them after
   errors. Normal exit now leaves every TAP in BYPASS.
   
 - Fix an unlikely memory leak on one fault path.

 - Remove the oddball limitation that invalid capture LSBs 
   trigger errors only for TAPs that support IDCODE.

Re the JTAG reset:  there are too many of them, and they can
(and do!) change system state.  So the needless ones should
get removed.  This one was especially pointless.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2777 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-29 19:28:08 +00:00
dbrownell
4297209ac9 Make "-expected-id 0" suppress warnings; not unlike it used to do.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2775 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-29 18:26:18 +00:00
oharboe
035b6ba84b reentry assert
git-svn-id: svn://svn.berlios.de/openocd/trunk@2770 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-29 14:23:42 +00:00
oharboe
c5949a03a7 added t/nsrst_assert_width commands
git-svn-id: svn://svn.berlios.de/openocd/trunk@2768 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-29 06:07:50 +00:00
oharboe
e3a0647558 if srst pulls trst, then set state to TAP_RESET.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2767 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-28 12:22:20 +00:00
dbrownell
817ea3f4e4 Update FT2232 driver so that it reliably enters TAP_RESET.
When the OpenOCD server starts up it records its state as TAP_RESET,
even though it could be anything.  Then when it starts to examine
the scan chain, it calls jtag_add_tlr() which sees it doesn't have
any work to do, and so it does nothing.  This can make the next
operations fail because they start from the wrong TAP state...

Instead of caring about the current recorded state, always enter
TAP_RESET by forcing five clocks with TMS high.

(NOTE:  it seems most other JTAG adapter drivers have this same bug.)


git-svn-id: svn://svn.berlios.de/openocd/trunk@2763 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-27 16:55:52 +00:00
dbrownell
2329ae9306 Diagnostics tweaks for jtag_examine_chain() failure paths.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2760 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-26 22:01:24 +00:00
dbrownell
f64e924ba9 Updates to the initial scanchain validation code:
- minor bug fixes
  - code cleanup
  - update comments
  - improve diagnostics
  - etc


git-svn-id: svn://svn.berlios.de/openocd/trunk@2759 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-26 19:18:42 +00:00
dbrownell
2e210ee48f Streamline Capture-IR handling and integrity test.
Change the handling of the "-ircapture" and "-irmask" parameters
to be slightly more sensible, given that the JTAG spec describes
what is required, and that we already require that conformance in
one place.  IR scan returns some bitstring with LSBs "01".

 - First, provide and use default values that satisfy the IEEE spec.
   Existing TAP configs will override the defaults, but those parms
   are no longer required.

 - Second, warn if any TAP gets set up to violate the JTAG spec.
   It's likely a bug, but maybe not; else this should be an error.
   Improve the related diagnostics to say which TAP is affected.

And associated minor fixes/cleanups to comments and diagnostics.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2758 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-26 19:08:34 +00:00
dbrownell
86a7d813a1 Remove annoying end-of-line whitespace from most src/*
files; omitted src/httpd


git-svn-id: svn://svn.berlios.de/openocd/trunk@2742 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-21 18:40:55 +00:00
dbrownell
d20103cd93 Update the jtag-examine_chain() logic to verify that there's no
garbage after the expected data (from the TAPs' BYPASS or IDCODE
registers).

NOTE that there was previously some code that looked like it was
trying to do this ... which didn't work, because it was looping
over the list of expected TAPs, and never checked *after* that
list completed!  That could hide some *nasty* reset issues...

Also replace a now-obsolete scanchain length test with one that
behaves correctly; and update reporting of unexpected IDCODEs.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2739 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-21 00:04:35 +00:00
dbrownell
0c4b119d3f Debug message updates:
- Shrink messaging during resets, primarily by getting rid of
   "nothing happened" noise that hides *useful* information.

 - Improve: the "no IDCODE" message by identifying which tap only
   supports BYPASS; and the TAP event strings.

Related minor code updates:

 - Remove two needless tests when examining the chain:  we know
   we have a TAP, and that all TAPs have names.

 - Clean up two loops, turning "while"s into "for"s which better
   show what's actually being done.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2736 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-20 07:55:11 +00:00
dbrownell
75581ffea6 Minor regression bugfix for the jtag_tap_handle_event() case
for disabling TAPs.  We don't actually know how to make any
JRCs which do that yet; but when we do, this will matter.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2735 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-20 07:46:22 +00:00
dbrownell
3e87fc20ab Style cleanup for the updated ft2232_add_pathmove().
Indentation, whitespace, line lengths.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2731 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-19 06:54:01 +00:00
dbrownell
2d3bcddf04 Minor behavior fixes for the two JTAG reset events (C/internal,
and Tcl/external):

 - Reorder so *both* paths (TCK/TMS or TRST) can enable TAPs with
   ICEpick ... first C code flags TAPs that got disabled, then call
   any Tcl code that might want to re-enable them.

 - Always call the C/internal handlers when JTAG operations can be
   issued; previously that wasn't done when TRST was used. 

Plus some small cleanups (whitespace, strings, better messaging
during debug and on some errors) to reset-related code.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2730 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-19 06:49:40 +00:00
oharboe
631b2ab244 remove unused externs
git-svn-id: svn://svn.berlios.de/openocd/trunk@2727 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-18 07:09:44 +00:00
dbrownell
e961bd14d9 Address codereview comment from Steve Grubb <sgrubb@redhat.com>:
avoid a duplicate test.

Plus other cleanup in the same code: be "static", sane line lengths
for source and diagnostics, and fix misleading variable names.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2725 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-17 19:20:18 +00:00
oharboe
84f51bf50c michal smulski <michal.smulski@ooma.com> fix regression in jtag_add_pathmove() which broke arm11 in r1825. Other uses of jtag_add_pathmove are svn + xsvf + xscale...
git-svn-id: svn://svn.berlios.de/openocd/trunk@2722 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-17 12:25:53 +00:00
oharboe
016e7ebbfa srst_gates_jtag option. at91sam9260 needs retesting, and possibly srst_gates_jtag added to reset_config. Could i.MX27 be a case where srst does not pull trst, but really srst gates jtag clock?
git-svn-id: svn://svn.berlios.de/openocd/trunk@2720 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-17 11:23:41 +00:00
oharboe
4f7761828c tap post reset event added. Allows omap3530 to send 100 runtest idle tickle's after a TAP_RESET.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2696 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-11 18:34:15 +00:00
oharboe
983f5a1ae9 - Fix bug-in-waiting when adding more than one TAP event type
- Infinite loop bugfix when running tap configure a second time


git-svn-id: svn://svn.berlios.de/openocd/trunk@2681 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-09 07:09:14 +00:00
oharboe
dce1cdc9fb David Brownell <david-b@pacbell.net> Fix segv in jtag_examine_chain(): exit loop on no-tap. Keep
"next iteration" step with the rest of the loop overhead.

Cleanup:  remove spurious whitespace, and an overlong line;
only assign "tap->hasidcode" once.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2631 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-26 19:06:56 +00:00
oharboe
0de530067f added missing check on jtag_execute
git-svn-id: svn://svn.berlios.de/openocd/trunk@2630 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-26 10:13:51 +00:00
oharboe
9a9ebfb924 reduce arm11 output noise
git-svn-id: svn://svn.berlios.de/openocd/trunk@2628 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-26 08:32:03 +00:00
oharboe
24f011ebb4 David Brownell <david-b@pacbell.net> More jtag_add_reset() cleanup:
Unify the handling of the req_srst parameter, and rip out a
large NOP branch and its associated FIXME.  (There didn't seem
to be anything that needs fixing; but that was unclear since
the constraints were scattered all over the place not unified.)

git-svn-id: svn://svn.berlios.de/openocd/trunk@2623 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 19:59:55 +00:00
oharboe
86b49612a6 David Brownell <david-b@pacbell.net> More jtag_add_reset() cleanup:
Unify the handling of the req_tlr_or_trst parameter.  Basically,
JTAG TMS+TCK ops ("TLR") is always used ... unless TRST is a safe
option in this system configuration.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2622 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 19:58:06 +00:00
oharboe
6f359fba68 David Brownell <david-b@pacbell.net> Some jtag_add_reset() cleanup:
- Track whether TRST and/or SRST actually change:

    * If they're not changing, don't ask the JTAG adapter to do anything!
      (JTAG TCK/TMS ops might still be used to enter TAP_RESET though.)
    * Don't change their recorded values until after the adapter says it
      did so ... so fault paths can't leave corrupt state.
    * Detect and report jtag_execute_queue() failure mode
    * Only emit messages saying what really changed; this includes adding
      an omitted "deasserted TRST" message.
    * Only apply delays after deasserting SRST/TRST if we *DID* deassert!

 - Messages say "TLR" not "RESET", to be less confusing; there are many
   kinds of reset.  (Though "TLR" isn't quite ideal either, since it's
   the name of the TAP state being entered by TMS+TCK or TRST; it's at
   least non-ambiguous in context.)

So the main effect is to do only the work this routine was told to do;
and to have debug messaging make more sense.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2621 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 19:55:32 +00:00
oharboe
bf5f21e39a Steve Grubb <sgrubb@redhat.com> fix various and sundry leaks
git-svn-id: svn://svn.berlios.de/openocd/trunk@2606 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-24 07:53:46 +00:00
oharboe
332c8d78d8 Jonas Horberg <jhorberg@sauer-danfoss.com>
The trunk is currently broken for interfaces without
the speed_div function (interface specific clock speed
value to kHz conversion). Example: parport.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2605 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-24 07:26:05 +00:00
ntfreak
ef30f22fd3 - remove enable-ft2232-highspeed configure option, high speed ftdi support is now detected during the configure stage
- warning now issued if high speed ftdi device found and openocd was built using an old driver

git-svn-id: svn://svn.berlios.de/openocd/trunk@2599 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-20 07:54:49 +00:00
ntfreak
c2f593bdc1 Jonas Horberg [jhorberg@sauer-danfoss.com]:
Fix small typo in ftd2xx type detection

git-svn-id: svn://svn.berlios.de/openocd/trunk@2597 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-19 08:39:06 +00:00
ntfreak
a634b5d52e Jonas Horberg [jhorberg@sauer-danfoss.com]
https://lists.berlios.de/pipermail/openocd-development/2009-August/009939.html

1. It can only be built with the FTD2XX driver. libftdi supports FT2232H/FT4232H 
since version 0.16 

2. A speed value of 0 is used as a RTCK request indicator. This clashes with the 
valid clock division value 0 that provide the highest fixed clock frequency. 

3. The ft2232_speed_div function return the maximum selectable frequency (30MHz) 
when RTCK is activated. It should return 0. 

4. The ft2232_khz function return ERROR_OK when RTCK is requested even for 
devices lacking RTCK support. It should return ERROR_FAIL so the upper driver layers 
can detect this and try to fallback to a fixed frequency. 

5. FT2232H/FT4232H have a backward compatibility function that divide the clock 
by 5 to get the same frequency range as FT2232D. There is no code that disable 
this functionality. I can not find anything about if this is enabled or disabled by default. 
I think it is safest to actively disable it. 


git-svn-id: svn://svn.berlios.de/openocd/trunk@2591 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-18 14:41:58 +00:00
ntfreak
bb5086b83e Jonas Horberg [jhorberg@sauer-danfoss.com]
Change jtag_rclk behaviour so it can be called before the interface init function

git-svn-id: svn://svn.berlios.de/openocd/trunk@2590 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-18 12:14:01 +00:00
ntfreak
720c39ba2f David Brownell <david-b@pacbell.net>:
Warn about anyone using "jtag_speed" commands; that command is obsolete, and will someday be removed.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2578 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-07 09:37:59 +00:00
ntfreak
d40fd9e0f4 Gary Carlson [gcarlson@carlson-minot.com]:
- revert patch from rev1507 as it was causing reset issues with arm9 cores

git-svn-id: svn://svn.berlios.de/openocd/trunk@2574 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-06 23:34:34 +00:00
oharboe
c7565cc381 Ferdinand Postema <ferdinand@postema.eu> fix cygwin warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@2559 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-23 07:04:21 +00:00
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
oharboe
2ff59c9aaf print errno when parport fails to open.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2529 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 12:30:06 +00:00
oharboe
197a195191 1.54 snapshot
git-svn-id: svn://svn.berlios.de/openocd/trunk@2523 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-14 10:38:26 +00:00
ntfreak
ebd46e23b3 Gary Carlson <gcarlson@carlson-minot.com>
Spencer Oliver <spen@spen-soft.co.uk>

- fix jlink win32/linux/darwin startup issues
- see https://lists.berlios.de/pipermail/openocd-development/2009-July/009438.html

git-svn-id: svn://svn.berlios.de/openocd/trunk@2513 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-13 06:36:51 +00:00
duane
5627e841e3 Simple warning fix
git-svn-id: svn://svn.berlios.de/openocd/trunk@2507 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-11 02:01:22 +00:00
oharboe
f4a9db660b fix return value for "reset" and "runtest" command. Found by code inspection.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2488 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-07 10:47:23 +00:00
ntfreak
cd1b2c15ab - change sleep to usleep - fixes issue under win32 build
git-svn-id: svn://svn.berlios.de/openocd/trunk@2483 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 15:41:55 +00:00
oharboe
a4081acc51 revert svn 1679 - fixes cp15 read/write timeout. Single stepping still broken.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2477 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 12:03:55 +00:00
zwelch
d6a686c852 Ferdinand Postema <ferdinand@postema.eu>:
Updates to private TAP state tables in amtjtagaccel interface driver.

The first change is the neccesary one to correct a long-standing bug that
caused the IDCODE to be shifted by one bit too many.  This was caused by
an incorrect path from state RESET to state DRSHIFT.

The value of those 2 bytes were 0x8a and 0x04. This means that the
bitstream to do this transition is 0b 00100 01010 (send LSB first). This
will bring you from the reset state to the shift state; however, you
enter the shift-state twice, which explains why the ID-CODE that will be
read next will be shifted 1 bit.  The fix changes these to 0x05 and 0x00.
This will send the bitstream 0b 00101 (send LSB first).  This will bring
the TAP controller from the RESET state to the DRSHIFT state directly,
without entering the DRSHIFT state twice.

After checking the whole table, two other transitions were found that
could be optimized (5 bits in stead of 10 bits).

Summary off all changes:
  From   To       Old values  Old Bitstream  New values  New Bitstream  Remarks
  ----   -------  ----------  -------------  ----------  -------------  -------
  RESET  DRSHIFT  0x8a 0x04   0b00100 01010  0x05 0x00   0b00101        1,2
  IDLE   DRSHIFT  0x85 0x08   0b01000 00101  0x04 0x00   0b00100        2
  IDLE   IRSHIFT  0x8b 0x08   0b01000 01011  0x06 0x00   0b00110        2

[1] Fixes the IDCODE bug
[2] Optimization


git-svn-id: svn://svn.berlios.de/openocd/trunk@2472 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 10:34:49 +00:00
zwelch
a604b570da Gary Carlson <gcarlson@carlson-minot.com>:
Fix intermittent J-Link interface startup failures:
- Use usb_reset to ensure selected dongle is in known good state.
- Assert emulator reset durning status check to prevent supurious failures.
- Eliminate status check loop; not needed due to other fixes.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2471 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 10:34:33 +00:00
zwelch
a239d6b334 Fix FTD2XX build for CygWin.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2454 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-02 11:16:57 +00:00
oharboe
12c13acdf8 zy1000 1.53 snapshot
git-svn-id: svn://svn.berlios.de/openocd/trunk@2451 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-02 09:11:18 +00:00
zwelch
f130f95d45 Marcel Jost <marcel.jost@bfh.ch>:
This patch adds support for the Luminary Micro LM3S9B90 target and
LM3S9B92 Evaluation Kit.  These kits include a new ft2232 adapter, the
Luminary In-Circuit Debug Interface (ICDI) Board, so this is added as a
new ft2232 layout called "luminary_icdi".


git-svn-id: svn://svn.berlios.de/openocd/trunk@2429 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-30 09:09:30 +00:00
zwelch
0894ae214a David Brownell <david-b@pacbell.net>:
Add "jtag names" command, mirroring "target names" but returning
TAP names instead of target names.  This starts letting TAPs be
manipulated in scripts ... much like what works now for targets.

It's a bit limited just yet, since "jtag cget $TAPNAME" doesn't
expose all TAP attributes.  "$TARGETNAME cget" is more functional.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2428 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-30 09:03:59 +00:00
zwelch
0c9d86b273 Fix doxygen warning in jtag.h caused by a changed parameter name.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2424 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-30 05:34:21 +00:00
zwelch
44b06db783 Fix @file documentation blocks in new interfaces source files.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2422 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-30 05:33:57 +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
c2cecc74b0 Move JTAG interface list to new files.
- Adds new source files to encapsulate static/dynamic module handling.
- Further work should implement the jtag_interface_modules_load routine,
  to populate the jtag_interfaces list from shared libraries in a path.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2413 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-29 00:00:50 +00:00
oharboe
92db0c58b0 zy1000 rev C work
git-svn-id: svn://svn.berlios.de/openocd/trunk@2405 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-26 12:57:56 +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
6d1d58a1fc - Fixes '[<>]' whitespace
- Replace ')\([<>]\)(' with ') \1 ('.
- 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@2375 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:45:47 +00:00
zwelch
fb1a9b2cb2 - Fixes '[|]' whitespace
- Replace ')\([|]\)(' with ') \1 ('.
- 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@2374 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:45:15 +00:00
zwelch
8959de9f67 - Fixes '+' whitespace
- Replace ')\(+\)(' with ') \1 ('.
- 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@2373 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:44:17 +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
aea6815462 - 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@2370 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:41:13 +00:00
zwelch
0e2c2fe1d1 - 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@2369 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:40:42 +00:00
zwelch
6319ea33f7 - Fixes '<=' whitespace
- Replace '\(\w\)\(<=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2368 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:40:33 +00:00
zwelch
4ce93ac479 - Fixes '>=' whitespace
- Replace ')\(>=\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(>=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2367 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:40:10 +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
d61714f4d5 - Fixes '[+]=' whitespace
- Replace '\(\w\)\([+]=\)(' with '\1 \2 ('.
- Replace '\(\w\)\([+]=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2364 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:39:18 +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
9af5e445b7 - Replace 'switch(' with 'switch ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2359 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:36:56 +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
zwelch
580a05a07f Remove editor preferences from source files.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2294 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-19 23:56:52 +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
oharboe
01823f5e0b less warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@2288 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 13:40:38 +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
f876d5e9c7 Transform 'u16' to 'uint16_t'
- Replace '\([^_]\)u16' with '\1uint16_t'.
- Replace '^u16' with 'uint16_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2277 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:07:59 +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
oharboe
8d8937f1a6 dummy driver now works under eCos
git-svn-id: svn://svn.berlios.de/openocd/trunk@2268 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-17 10:51:34 +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
e2cacd4368 Set svn:eol-style native on ZY1000 minidriver header file.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2261 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-17 01:59:59 +00:00
zwelch
c928fe0fa0 David Brownell <david-b@pacbell.net>:
Fix a bug preventing ICEpick "enable that TAP" code from working:
the "runtest" command wrongly finished with a JTAG reset, discarding
the work the TAP enable handler just finished!  Instead, JTAG should
stay in RUN/IDLE state.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2252 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-16 12:17:26 +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
491083a248 David Brownell <david-b@pacbell.net>:
Tighten error handling on TAP enable/disable paths a bit:

 - Don't enable/disable unless it's necessary.  Those event
   handlers could have nasty side effects...

 - Don't *succeed* enables/disables if there was no code which
   could have implemented that action.  This prevents bugs like
   wrongly acting as if the scan chain changed.

 - Minor whitespace cleanup in enable/disable command code.

The big problem is still the lack of code to verify scan chains
were actually updated as requested; this adds a comment on that.
I suspect the best we can do near term will be to verify IDCODE.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2250 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-16 12:17:12 +00:00
zwelch
0de478618a David Brownell <david-b@pacbell.net>:
Fix bug in a warning.  It warned about "huge IRlength" for an
older JRC with a two bit instruction register ... wrong!


git-svn-id: svn://svn.berlios.de/openocd/trunk@2249 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-16 00:23:32 +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
cdd8f23b9b David Brownell <david-b@pacbell.net>:
Currently the "debug_level 3" command tracing ignores commands
that could return values to TCL scripts (by plugging in to a
slightly lower level of the interpreter stack).

Fix that by abstracting the tracing command and starting to
make some of those previously-untraced commands use this new
mechanism.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2224 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 22:06:02 +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
a351c57261 Fix unitialized use of cur_speed in handle_jtag_khz_command:
- Use the default KHz speed setting, in case interface is not initialized.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2218 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 01:41:07 +00:00
zwelch
f5e4511701 Improve vsllink command argument handling:
- Bug fix: Always clear high bit of USB bulk out endpoint.
- Use parse_ulong helpers to ensure numeric strings are parsed properly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2217 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 01:41:00 +00:00
zwelch
a9d5119825 Improve handle_runtest_command:
- Use parse_uint helper to ensure argument is parsed properly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2216 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 01:40:54 +00:00
zwelch
ea95cdb8e2 Improve VID/PID command argument handling in FTDI driver:
- Bug fix: Return a syntax error when less than two arguments are given.
- Bug fix: Use parse_u16 helper to ensure vales are parsed properly.
- Simplify loop termination logic by ensuring argc is always even.
- Move loop induction variable declaration to where it is used.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2215 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 01:40:48 +00:00
zwelch
70d853b9fa Improve handle_irscan_command:
- Use parse_u32 helper to ensure scan values are parsed properly.
- Clear the fields buffer to ensure partial cleanup occur correctly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2214 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 01:40:42 +00:00
zwelch
82403fe644 Improve JTAG reset, speed, and khz handlers to use parse_uint helper.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2213 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 01:40:35 +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
d5339d2eb4 Simplify and improve gw16012_handle_parport_command:
- Show the port number to the user when asking for it or setting it.
- Print an error if the parport_port has already been set.
- Use parse_u16 helper to ensure the parport_port string parses correctly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2211 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 01:40:23 +00:00
zwelch
f218f36df5 Simplify and improve amt_jtagaccel_handle_parport_port_command:
- Show the port number to the user when asking for it or setting it.
- Print an error if the amt_jtagaccel_port has already been set.
- Use parse_u16 helper to ensure amt_jtagaccel_port string parses correctly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2210 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 01:40:17 +00:00
zwelch
ae28b96ab9 Simplify and improve parport_handle_parport_port_command:
- Show the port number to the user when asking for it or setting it.
- Print an error if the parport_port has already been set.
- Use parse_u16 helper to ensure the parport_port string parses correctly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2209 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-12 01:40:03 +00:00
zwelch
4c31d5d179 Move jtag_get_flush_queue_count near jtag_execute_queue (fix its docs).
git-svn-id: svn://svn.berlios.de/openocd/trunk@2189 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 07:08:45 +00:00
zwelch
128ff94226 Improve grouping of JTAG KHz and verification accessors in header file.
Add some quick Doxygen comments for these routines.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2188 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 07:08:34 +00:00
zwelch
28fa603eff Group JTAG reset configuration and accessor APIs together in header file.
Remove unused reset_line_mode enumerated type.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2187 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 07:08:28 +00:00
zwelch
5208481fb3 Move jtag_error helper declarations to the end of the header.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2186 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-11 07:08:21 +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
oharboe
ba0f4a254c added pathmove command
git-svn-id: svn://svn.berlios.de/openocd/trunk@2180 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-10 07:19:14 +00:00
zwelch
82aa9af1ad 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.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2177 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 14:18:28 +00:00
zwelch
0bc53e73cc 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.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2176 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 14:18:23 +00:00
zwelch
b8034bd9ee Rename jtag_driver.c as driver.c to remove duplicate name component.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2175 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 12:47:49 +00:00
zwelch
00228aa839 Fix make maintainer-clean for out-of-tree builds.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2172 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 10:28:16 +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
ae52de5ad5 Expose jtag_unregister_event_callback with related API declarations.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2167 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:41:23 +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
2a8e37173a Remove superfluous extern for non-existant global variable.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2160 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:40:23 +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
92a102c2d5 Move extern of nvp_jtag_tap_event from jtag.h to tcl.c.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2156 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:39:44 +00:00
zwelch
d19643f774 Remove superfluous extern of jtag_event_strings from jtag.h.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2155 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 08:39:37 +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
zwelch
03b2b345ed Merge documentation for jtag_add_statemove from source into header block.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2148 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 02:48:28 +00:00
zwelch
cf08b00376 Move Doxygen documentation for IR/DR scan routines to header file.
- Move plain IR scan declaration closer to the other IR scan declarations.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2147 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 02:48:18 +00:00
zwelch
3cd428ffdb - Replace 'jtag_tap_by_abs_position' with 'jtag_tap_by_position'.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2146 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 02:24:05 +00:00
zwelch
f7216ffa33 Remove non-existant jtag_tap_by_position API declaration.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2145 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 02:24:00 +00:00
zwelch
2410d4b2b9 Use unsigned type for jtag_tap_count and jtag_tap_by_abs_position.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2144 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 02:23:53 +00:00
zwelch
0c3e5b5069 Cleanup jtag_tap_by_abs_position:
- Remove unused orig_n local variable.
- Merge variable declaration with first use.
- Update code to use current style guidelines.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2143 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 02:23:44 +00:00
zwelch
009034f56c Simplify jtag_tap_by_jim_object:
- Merge declarations of temporary variables with first use.
- Restructure logic to simplify conditional logic.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2142 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 02:23:35 +00:00
zwelch
9f185eef7d Simplify and fix bug in jtag_tap_by_string:
- Bug fix: Use unsigned type and strtoul when parsing for position number.
- Simplify logic by returning directly when a tap is found by name.
- Reduce scope: declare temporary variables with first use.
- Bring code up to current style guidelines.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2141 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 02:23:27 +00:00
zwelch
1c74d0e3a4 Allow jtag_tap_add to be called from other JTAG code modules.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2140 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 02:23:16 +00:00
zwelch
d706eb206e Cleanup jtag_tap_count_enabled.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2139 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 02:23:03 +00:00
zwelch
ff85ad7c12 Change jtag_add_pathmove to set jtag_error rather than call exit():
- Add new error codes to encode the possible failure conditions.
- Add documentation to describe the routine's possible error codes.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2138 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 01:16:35 +00:00
zwelch
731d2d0cb6 Reduce scope or eliminate temporary variables in jtag_add_statemove:
- Change types of tms_bits and tms_count to unsigned, eliminates a cast.
- Use moves[] only if needed; a single move can use goal_state directly.
- Declare loop induction variable inside its control statement.
- Remove retval in favor of direct returns.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2137 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 01:16:19 +00:00
zwelch
b3121aac76 Move documentation in jtag_add_statemove body to Doxygen block.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2136 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 01:16:13 +00:00
oharboe
3245a0cd5f update zy1000 to latest minidriver work
git-svn-id: svn://svn.berlios.de/openocd/trunk@2132 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 14:13:32 +00:00
zwelch
51d158c410 Factor interface list to its own command:
- Add handle_interface_list_command, used by handle_interface_command.
- Display output of new list to command console.
- Change first index of displayed drivers to 1; it's only cosmetic.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2129 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 13:12:17 +00:00
zwelch
7bcd2e6854 Cleanup and simplify handle_interface_command:
- Reduce indent: invert logic of strcmp test.
- Reduce scope: declare variables upon first use in loops.
- Reduce unsaid: compare end of table with NULL.
- Remove superfluous braces around blocks with one statment.
- Improve language that introduces the list of built-in drivers.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2128 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 13:12:12 +00:00
zwelch
8290a05c2b Simplify jtag_add_sleep:
- Add todo for removing keep_alive: is this a layering violation?
- Use jtag_set_error instead of accessing jtag_error directly.
- Remove superfluous retval temporary variable and empty return.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2127 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:58:28 +00:00
zwelch
8c21ca7e81 Simplify jtag_add_reset:
- Use jtag_set_error instead of accessing jtag_error directly.
- Remove superfluous retval temporary variable.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2126 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:58:13 +00:00
zwelch
6f4de887f7 Simplify jtag_add_clocks:
- Use jtag_set_error instead of accessing jtag_error directly.
- Improve error language and whitespace.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2125 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:57:51 +00:00
zwelch
d76c63431f Simplify jtag_add_runtest:
- Use jtag_set_error instead of accessing jtag_error directly.
- Eliminate superfluous comment and temporary variable.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2124 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:57:39 +00:00
zwelch
521d8d5bfa Simplify jtag_add_pathmove:
- Use jtag_set_error instead of accessing jtag_error directly.
- Eliminate superfluous retval temporary variable.
- Reduce scope of loop induction variable.
- Wrap to fit within 80 columns.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2123 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:57:18 +00:00
zwelch
8a89899860 Simplify jtag_add_tlr:
- Use jtag_set_error instead of accessing jtag_error directly.
- Eliminate superfluous temporary variable.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2122 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:57:10 +00:00
zwelch
d3d0f662ef Simplify jtag_add_plain_dr_scan:
- Use jtag_set_error instead of accessing jtag_error directly.
- Wrap function arguments to fit everything in 80 columns.
- Move retval variable to location of first use.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2121 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:56:49 +00:00
zwelch
1497e6699a Simplify jtag_add_dr_scan:
- Use jtag_set_error instead of accessing jtag_error directly.
- Wrap function arguments to fit everything in 80 columns.
- Move retval variable to location of first use.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2120 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:56:36 +00:00
zwelch
e3b1937aaf Simplify jtag_add_plain_ir_scan:
- Use jtag_set_error instead of accessing jtag_error directly.
- Wrap function arguments to fit everything in 80 columns.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2119 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:56:25 +00:00
zwelch
9bdbe70ceb Simplify jtag_add_ir_scan_noverify:
- Use jtag_set_error instead of accessing jtag_error directly.
- Wrap and rename function arguments to fit everything in 80 columns.
- Move retval variable to location of first use.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2118 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:56:18 +00:00
zwelch
4cff9dc0c1 Simplify jtag_execute_queue:
- Add static inline jtag_error_clear helper to return and clear jtag_error.
- Use new helper to shrink body of function to two lines.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2117 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:56:07 +00:00
zwelch
f418fcbff0 Simplify jtag_execute_queue_noclear:
- Replace jtag_error logic with equivalent call to jtag_set_error.
- Remove superfluous comment and temporary return variable.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2116 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:55:54 +00:00
zwelch
791701165c Cleanup handle_runtest_command:
- Make command argument require exactly one argument; do not allow extras.
- Remove superfluous whitespace at end of function.
- Wrap function arguments to fit in 80 columns.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2115 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:55:44 +00:00
zwelch
5c9221ce61 Clean up handle_jtag_reset_command:
- Make command require exactly two arguments; do not allow more than two.
- Move temporary variable declarations closer to point of first use.
- Remove superfluous braces around single statments.
- Wrap to 80 column width.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2114 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:55:36 +00:00
zwelch
c75ef1cd37 Extend handle_jtag_n{s,t}rst_delay_command routines:
- Add support to display the reset delays too, like the other commands.
- Always show the values, so users can see if they are being redundant.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2113 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:55:24 +00:00
zwelch
ae0ba6f355 Add accessors to retrieve values of jtag_n{s,t}rst_delay variables.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2112 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:55:13 +00:00
zwelch
d7c4e1ec93 Update JTAG reset delay command handlers:
- Fixes for error handling:
  - Return a syntax error instead of calling exit(-1).
  - Return error when more than one argument is provided too.
- Remove useless braces and indent after the if/return statements.
- Wrap function arguments to fit in 80 columns.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2111 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:54:52 +00:00
zwelch
47a1185d5d Cleanup the handle_jtag_khz_command routine:
- Separate retval assignments from logical tests.
- Simplify logical tests.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2110 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:54:41 +00:00
zwelch
620ecedf42 Simplify logic in handle_jtag_speed_command.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2109 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 10:54:06 +00:00
zwelch
1419a72892 Move minidummy source file, as was supposed to happen in last commit.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2103 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 01:14:04 +00:00
zwelch
f84c78a2e1 Finish off the dummy minidriver integration:
- Try to disambiguates minidriver options from "standard" driver options.
  - Make minidummy symbols more explict about being a minidriver.
  - Move minidummy.c into minidummy directory to put it with its header.

In configure.in:
- Improve configuration option to allow new minidriver implementations:
  - Change option from --enable-minidummy to --enable-minidriver-dummy.
  - Move it to the end of the list of options.
  - Provides a clear pattern for future minidrivers.
- Update handling of HAVE_JTAG_MINIDRIVER_H:
  - Check for external jtag_minidriver.h only with --enable-ecosboard.
  - Otherwise, define it when --enable-minidriver-dummy is provided.
- Add check to ensure only one minidriver is enabled.
- When a minidriver is enabled, warn user that standard drivers are not built.
- Use proper AC_DEFINE semantics with MINIDRIVER_DUMMY.

In src/jtag/Makefile.am:
- Restructure handling of minidummy source files.
- Include minidummy driver header in the distribution.

In src/jtag/jtag.c:
- Restructure preprocessor logic to include:
  - only one minidriver, or
  - all configured standard drivers.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2102 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-08 00:42:15 +00:00
oharboe
c28efd0a0e retire endstate command
git-svn-id: svn://svn.berlios.de/openocd/trunk@2095 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 19:10:51 +00:00
zwelch
b90d7d12f1 Set svn:eol-style properties on new minidummy driver files.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2094 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 18:39:11 +00:00
zwelch
3363851781 Fix regressions in previous series of cleanp, caused by r2092.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2093 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 18:38:13 +00:00
oharboe
14d6605cc9 minidriver build test driver "minidriver"
git-svn-id: svn://svn.berlios.de/openocd/trunk@2092 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 13:55:29 +00:00
zwelch
7dd8754575 Factoring of jtag_examine_chain for maintainability:
- Improve variable type: change device_count to unsigned.
- Improves jtag_tap_count_enabled() API too (now returns unsigned).


git-svn-id: svn://svn.berlios.de/openocd/trunk@2091 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:24:27 +00:00
zwelch
b550f70100 Factoring of jtag_examine_chain for maintainability:
- Limit scope: move tap and bit_count variables to point of first use.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2090 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:24:20 +00:00
zwelch
63c4848d11 Factoring of jtag_examine_chain for maintainability:
- Factor TAP ID matching into new helper function.
- Simplifies the main jtag_examine_chain loop logic considerably.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2089 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:24:12 +00:00
zwelch
f106382055 Factoring of jtag_examine_chain for maintainability:
- Minor whitespace and style cleanups in body of jtag_examine_chain.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2088 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:24:03 +00:00
zwelch
9eefd4d7e5 Factoring of jtag_examine_chain for maintainability:
- Add helper to check for the terminating ID during jtag_examine_chain.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2087 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:23:50 +00:00
zwelch
d8421f2766 Factoring of jtag_examine_chain for maintainability:
- Factor end-of-chain verfication into new helper routine.
- Change 'unexpected' local variable name to 'triggered' and type to bool.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2086 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:23:40 +00:00
zwelch
feb865f9ee Factoring of jtag_examine_chain for maintainability:
- Factor output of accepted/incorrect/expected TAP IDs into static helper.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2085 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:23:30 +00:00
zwelch
c318068839 Factoring of jtag_examine_chain for maintainability:
- Factor initial chain examination check into new static helper.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2084 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:23:13 +00:00
zwelch
90dbfcea7d Factoring of jtag_examine_chain for maintainability:
- Factor JTAG chain examination into static helper function.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2083 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:23:03 +00:00
zwelch
861f52ff16 Factoring of jtag_examine_chain for maintainability:
- Reduce indent: invert logical test of expected_id count.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2082 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:22:53 +00:00
zwelch
15ae1ac678 Factoring of jtag_examine_chain for maintainability:
- Reduce indent: invert logic test for unexpected TAP (no IDs).


git-svn-id: svn://svn.berlios.de/openocd/trunk@2081 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:22:42 +00:00
zwelch
32350a5006 Factoring of jtag_examine_chain for maintainability:
- Reduce indent: invert logic test for tap in jtag_examine_chain.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2080 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:22:34 +00:00
zwelch
401d6472cc Factoring of jtag_examine_chain for maintainability:
- Move definition of maximum JTAG chain size closer to its only uses.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2079 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:22:25 +00:00
zwelch
0b08845e3f Factoring of jtag_examine_chain for maintainability:
- Move JTAG EXTRACT macros out from the middle of jtag_examine_chain.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2078 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 05:22:09 +00:00
zwelch
43e1ed244f Clean up handle_endstate_command():
- Merge declaration of state with first use.
- Unindent and remove unnecessary 'else' block.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2077 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-07 03:48:21 +00:00
zwelch
0eb5c7509d Eliminate MixedCaps symbol from public JTAG TAP API:
- Purely mechanical transformations to the source files.
- Rename 'jtag_NextEnabledTap' as 'jtag_tap_next_enabled.'


git-svn-id: svn://svn.berlios.de/openocd/trunk@2069 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 00:43:43 +00:00
zwelch
0d39db1109 Eliminate MixedCaps symbol from public JTAG TAP API:
- Purely mechanical transformations to the source files.
- Rename 'jtag_NumEnabledTaps' as 'jtag_tap_count_enabled.'


git-svn-id: svn://svn.berlios.de/openocd/trunk@2068 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 00:43:32 +00:00
zwelch
92cf94295e Eliminate MixedCaps symbol from public JTAG TAP API:
- Purely mechanical transformations to the source files.
- Rename 'jtag_NumTotalTaps' as 'jtag_tap_count.'


git-svn-id: svn://svn.berlios.de/openocd/trunk@2067 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 00:43:23 +00:00
zwelch
7db5839608 Eliminate MixedCaps symbol from public JTAG TAP API:
- Purely mechanical transformations to the source files.
- Rename 'jtag_TapByJimObj' as 'jtag_tap_by_jim_obj.'


git-svn-id: svn://svn.berlios.de/openocd/trunk@2066 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 00:43:12 +00:00
zwelch
689e9664b0 Eliminate MixedCaps symbol from public JTAG TAP API:
- Purely mechanical transformations to the source files.
- Rename 'jtag_TapByString' as 'jtag_tap_by_string.'


git-svn-id: svn://svn.berlios.de/openocd/trunk@2065 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 00:42:52 +00:00
zwelch
473dc89c24 Eliminate MixedCaps symbol from public JTAG TAP API:
- Purely mechanical transformations to the source files.
- Rename 'jtag_TapByAbsPosition' as 'jtag_tap_by_abs_position.'


git-svn-id: svn://svn.berlios.de/openocd/trunk@2064 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 00:42:39 +00:00
zwelch
05eb8d8c13 Eliminate MixedCaps symbol from public JTAG TAP API:
- Purely mechanical transformations to the source files.
- Rename 'jtag_TapByPosition' as 'jtag_tap_by_position.'


git-svn-id: svn://svn.berlios.de/openocd/trunk@2063 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 00:42:32 +00:00
zwelch
dd89964ae0 Eliminate MixedCaps symbol from public JTAG TAP API:
- Purely mechanical transformations to the source files.
- Rename 'jtag_AllTaps' as 'jtag_all_taps.'


git-svn-id: svn://svn.berlios.de/openocd/trunk@2062 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 00:42:25 +00:00
zwelch
eaf37cf9e8 Eliminate MixedCaps symbol from public JTAG TAP API:
- Purely mechanical transformations to the source files.
- Rename 'jtag_all_taps' as '__jtag_all_taps.'
- Frees original symbol name to rename the accessor function.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2061 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 00:42:17 +00:00
zwelch
499f30f693 Add accessors for jtag_verify; use them in jim command handler.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2060 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 00:06:34 +00:00
zwelch
99fd479503 Add accessors for reset delays; use them in jim command handlers.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2059 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 00:04:12 +00:00
zwelch
d530313866 Add accessors for speed_khz; use them in jim command handler.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2058 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05 00:02:00 +00:00
zwelch
8580c70172 Add jtag_get_flush_queue_count accessor to help future factoring.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2057 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 23:52:58 +00:00
zwelch
a847326216 Clean up the JTAG TAP creation handler:
- Factor jtag_tap_init() helper out of the end of jim_newtap_cmd.
- Factor jtag_tap_free() helper out of the error case in jim_newtap_cmd.
- Invert test to improve indentation at the end of jim_newtap_cmd.
- Improve whitespace in the newly factored functions.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2056 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 23:49:52 +00:00
zwelch
d3d02f4789 Clean up the core JTAG TAP APIs:
- Move jtag_tap_name to same location as other TAP functions; export it.
- Factor new jtag_tap_add() from jim_newtap_cmd(); appends TAP to global list.
- Move static chain position counter to global; use in jtag_NumTotalTaps().
- Use jtag_AllTaps for reading tap list, instead of accessing global directly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2055 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 23:26:58 +00:00
zwelch
82a5f6ff3e Change hasKHz to use bool type.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2054 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 22:43:34 +00:00
zwelch
c0f9fbcca5 Add missing static keywords in JTAG source file.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2053 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 22:41:21 +00:00
oharboe
d861002612 Rename jtag_add_end_state to jtag_set_end_state since "add" implies that
this fn has something to do with the queue, which it does not as such.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2050 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 13:18:07 +00:00
oharboe
f133158175 Introduce jtag_get_end_state() fn to clarify code a bit.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2049 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 13:14:07 +00:00
oharboe
310a9eabff tiny bit of encapsulation of global end state. No longer expose it as a global variable.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2048 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 13:05:57 +00:00
oharboe
9e8dce64fc do not modify global end state from jtag_add_xxx()
git-svn-id: svn://svn.berlios.de/openocd/trunk@2047 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 12:52:54 +00:00
oharboe
89e9d86a56 remove unused code.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2046 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 12:42:21 +00:00
oharboe
f86f2ab3f8 use assert() to catch TAP_INVALID passed to jtag_add_xxx() fn's.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2043 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 11:42:34 +00:00
oharboe
6468859389 remove TAP_INVALID as argument to jtag_add_xxx() fn's
git-svn-id: svn://svn.berlios.de/openocd/trunk@2042 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 11:33:36 +00:00
oharboe
bb1a1ddb54 jtag_add_end_state() now returns the value of the global variable and does not modify the global variable if passed TAP_INVALID. This patch has no effect on the current code and is just to prepare upcoming patches.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2041 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 07:05:22 +00:00
oharboe
9ab49135c6 JTAG_TRST_ASSERTED event cleanup. More clear where and when it is invoked and some duplicate(harmless) invocations avoided.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2040 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 06:56:22 +00:00
zwelch
e7d6306b23 David Brownell <david-b@pacbell.net>:
Remove pernicious whitespace from ft2232 driver; as usual,
end-of-line noise, but here also much line-internal stuff.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2038 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 01:17:27 +00:00
zwelch
ec2bc2259c David Brownell <david-b@pacbell.net>:
Minor cleanup of FT2232:
  - make Olimex glue warn about Olimex issues instead of JTAGkey issues;
  - make some data static+const;
  - don't export some internal symbols.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2037 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 01:16:43 +00:00
zwelch
4123f08263 David Brownell <david-b@pacbell.net>:
Remove pernicious whitespace from src/jtag/*c files; mostly
the end-of-line flavor for now, although there's more.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2036 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 00:56:41 +00:00
oharboe
976f13d27b use assert() for obscure check on illegal arguments upon trst being asserted while commands are queued
git-svn-id: svn://svn.berlios.de/openocd/trunk@2033 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 16:36:01 +00:00
oharboe
0c57bc8be2 remove unused code path.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2032 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 12:12:21 +00:00
oharboe
c68684c2e6 catchup with jtag refactoring.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2031 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 07:55:56 +00:00
zwelch
80d66c9fcb Move JTAG command handling implementation into its own source file.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2030 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 07:06:37 +00:00
zwelch
a3e84343e2 Finish JTAG header file modularization; command factoring follows.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2029 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 06:29:09 +00:00
oharboe
4a6adee17e added missing extern to jtag_command_queue definition.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2028 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 06:27:57 +00:00
zwelch
4bc3af0374 Move JTAG command APIs into new jtag/commands.h header file.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2027 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 06:08:07 +00:00
zwelch
9a5acdc161 Improve in-source documentation that was causing Doxygen warnings.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2025 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 04:37:51 +00:00
zwelch
36432c9ba6 Enable or add doxygen comments to the public JTAG API.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2019 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 01:51:04 +00:00
zwelch
41018ff44b Update documentationf or jtag_interface structure members.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2018 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 01:39:04 +00:00
zwelch
0d5da4bccb Remove vestigal tap_transition type from public jtag API.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2017 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 01:29:01 +00:00
zwelch
67caf323f7 Remove interface.h from public JTAG header, include it where required.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2016 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 01:26:01 +00:00
zwelch
c275cfd3da Expose tap_state_by_name TAP helper available in public API.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2015 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 01:23:48 +00:00
zwelch
4ecf2c7dd8 Move the JTAG cable interface API implementation
- Cloned the src/jtag/jtag.c file to src/jtag/interface.c.
- For each for of those files, deleted the contents of the other.
- Add new source file to automake input.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2012 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 00:45:21 +00:00
zwelch
f7d011a955 Add missed accessor for checking the current TMS table.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2011 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 00:33:22 +00:00
zwelch
f0b1b206cd Split and simplify handle_tms_sequence_command for further factoring.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2010 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 00:24:21 +00:00
zwelch
2c69be13ea Make tap_state_by_name available in new JTAG interface API header.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2009 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03 00:17:42 +00:00