summaryrefslogtreecommitdiff
path: root/src/jtag
Commit message (Collapse)AuthorAgeFilesLines
* Introduced jtag_init and "jtag arp_init" to allow target scripts more ↵oharboe2009-10-063-13/+27
| | | | | | 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
* Improve jtag_validate_ircapture() diagnostics.dbrownell2009-10-051-8/+10
| | | | | | | | | | | 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
* Add a new JTAG "setup" event; use for better DaVinci ICEpick support.dbrownell2009-10-053-23/+43
| | | | | | | | | | | | | | | | | 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
* Streamline Capture-IR validation codedbrownell2009-09-291-26/+23
| | | | | | | | | | | | | | | | | - 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
* Make "-expected-id 0" suppress warnings; not unlike it used to do.dbrownell2009-09-291-3/+7
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2775 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* reentry assertoharboe2009-09-291-0/+7
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2770 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* added t/nsrst_assert_width commandsoharboe2009-09-293-0/+72
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2768 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* if srst pulls trst, then set state to TAP_RESET. oharboe2009-09-281-3/+11
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2767 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Update FT2232 driver so that it reliably enters TAP_RESET.dbrownell2009-09-271-2/+10
| | | | | | | | | | | | | | | | 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
* Diagnostics tweaks for jtag_examine_chain() failure paths.dbrownell2009-09-261-3/+4
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2760 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Updates to the initial scanchain validation code:dbrownell2009-09-261-12/+41
| | | | | | | | | | | - 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
* Streamline Capture-IR handling and integrity test.dbrownell2009-09-261-12/+22
| | | | | | | | | | | | | | | | | | | | 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
* Remove annoying end-of-line whitespace from most src/*dbrownell2009-09-212-17/+17
| | | | | | | files; omitted src/httpd git-svn-id: svn://svn.berlios.de/openocd/trunk@2742 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Update the jtag-examine_chain() logic to verify that there's nodbrownell2009-09-211-38/+39
| | | | | | | | | | | | | | | | 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
* Debug message updates:dbrownell2009-09-202-31/+7
| | | | | | | | | | | | | | | | | | | - 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
* Minor regression bugfix for the jtag_tap_handle_event() casedbrownell2009-09-201-3/+7
| | | | | | | | 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
* Style cleanup for the updated ft2232_add_pathmove().dbrownell2009-09-191-15/+18
| | | | | | | Indentation, whitespace, line lengths. git-svn-id: svn://svn.berlios.de/openocd/trunk@2731 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Minor behavior fixes for the two JTAG reset events (C/internal,dbrownell2009-09-191-14/+12
| | | | | | | | | | | | | | | | | 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
* remove unused externsoharboe2009-09-181-3/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2727 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Address codereview comment from Steve Grubb <sgrubb@redhat.com>:dbrownell2009-09-172-33/+26
| | | | | | | | | | 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
* michal smulski <michal.smulski@ooma.com> fix regression in ↵oharboe2009-09-171-18/+30
| | | | | | 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
* srst_gates_jtag option. at91sam9260 needs retesting, and possibly ↵oharboe2009-09-172-0/+9
| | | | | | 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
* tap post reset event added. Allows omap3530 to send 100 runtest idle ↵oharboe2009-09-113-2/+37
| | | | | | tickle's after a TAP_RESET. git-svn-id: svn://svn.berlios.de/openocd/trunk@2696 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - Fix bug-in-waiting when adding more than one TAP event typeoharboe2009-09-091-4/+10
| | | | | | | - 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
* David Brownell <david-b@pacbell.net> Fix segv in jtag_examine_chain(): exit ↵oharboe2009-08-261-6/+8
| | | | | | | | | | | 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
* added missing check on jtag_executeoharboe2009-08-261-1/+4
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2630 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* reduce arm11 output noiseoharboe2009-08-262-3/+7
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2628 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net> More jtag_add_reset() cleanup:oharboe2009-08-251-36/+23
| | | | | | | | | 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
* David Brownell <david-b@pacbell.net> More jtag_add_reset() cleanup:oharboe2009-08-251-17/+18
| | | | | | | | 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
* David Brownell <david-b@pacbell.net> Some jtag_add_reset() cleanup:oharboe2009-08-251-42/+62
| | | | | | | | | | | | | | | | | | | | | | | - 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
* Steve Grubb <sgrubb@redhat.com> fix various and sundry leaksoharboe2009-08-242-0/+19
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2606 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Jonas Horberg <jhorberg@sauer-danfoss.com> oharboe2009-08-241-3/+2
| | | | | | | | 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
* - remove enable-ft2232-highspeed configure option, high speed ftdi support ↵ntfreak2009-08-201-12/+19
| | | | | | | | 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
* Jonas Horberg [jhorberg@sauer-danfoss.com]:ntfreak2009-08-191-1/+1
| | | | | | Fix small typo in ftd2xx type detection git-svn-id: svn://svn.berlios.de/openocd/trunk@2597 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Jonas Horberg [jhorberg@sauer-danfoss.com]ntfreak2009-08-181-159/+148
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Jonas Horberg [jhorberg@sauer-danfoss.com]ntfreak2009-08-183-30/+131
| | | | | | 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
* David Brownell <david-b@pacbell.net>:ntfreak2009-08-071-0/+3
| | | | | | 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
* Gary Carlson [gcarlson@carlson-minot.com]:ntfreak2009-08-061-3/+1
| | | | | | - 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
* Ferdinand Postema <ferdinand@postema.eu> fix cygwin warningsoharboe2009-07-232-2/+2
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2559 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Andreas Fritiofson <andreas.fritiofson@gmail.com> UTF8 fixesoharboe2009-07-1713-15/+15
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2549 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* print errno when parport fails to open.oharboe2009-07-151-2/+3
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2529 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* 1.54 snapshotoharboe2009-07-141-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2523 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Gary Carlson <gcarlson@carlson-minot.com>ntfreak2009-07-131-43/+92
| | | | | | | | | 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
* Simple warning fixduane2009-07-111-2/+2
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2507 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* fix return value for "reset" and "runtest" command. Found by code inspection.oharboe2009-07-071-7/+3
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2488 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - change sleep to usleep - fixes issue under win32 buildntfreak2009-07-061-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2483 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* revert svn 1679 - fixes cp15 read/write timeout. Single stepping still broken.oharboe2009-07-061-25/+20
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2477 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Ferdinand Postema <ferdinand@postema.eu>:zwelch2009-07-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Gary Carlson <gcarlson@carlson-minot.com>:zwelch2009-07-061-15/+27
| | | | | | | | | | 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
* Fix FTD2XX build for CygWin.zwelch2009-07-021-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2454 b42882b7-edfa-0310-969c-e2dbd0fdcd60