Commit Graph

263 Commits

Author SHA1 Message Date
David Brownell
82f2492138 ADIv5: more messaging cleanup, docs
When the TAR cache was explicitly invalidated, don't bother
printing it; the actual hardware status is more informative.

Provide some doxygen for the MEM-AP setup routine.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-31 14:16:53 -08:00
David Brownell
e11ce3e6b0 Subject: ADIv5: fix more diagnostics
If the MEM-AP cache is invalid, don't display it; just report that
invalidity as an error.  (This bug has been observed with "mdw 0 32"
after just a "reset halt".  Some code is being wrongly bypassed...)

If it's valid, display that cache at DEBUG level, not ERROR.  Also,
don't assume it's an AHB-AP; it could be another flavor of MEM-AP.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-31 00:26:21 -08:00
David Brownell
695666d294 ADIv5 error checking for Tcl commands
Reject invalid AP numbers (256+) as Tcl operation parameters.
Shrink one of the overlong lines.

Add my copyright to the ADIv5 code (multiple contributions).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-30 22:46:00 -08:00
David Brownell
46b6d5bfe6 ARM ADIv5: fix diagnostics for block writes
They were reporting "read" errors, not "write" errors.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-30 18:08:19 -08:00
David Brownell
3d3128a8f5 ADIv5: cleanup, rename swjdp_transaction_endcheck()
Make messages reference "DAP" if they're actually transport-agnostic, or
"JTAG-DP" when they're JTAG-specific.  Saying SWJ-DP is often wrong (on
most Cortex-A8 chips) and is confusing even if correct (since we don't
yet support SWD).

Rename a JTAG-specific routine to jtagdp_transaction_endcheck() to highlight
that it's JTAG-specific, and that identify DAP clients undesirably depending
on JTAG.  (They will all need to change for SWD support.)

Shrink a few overlong lines of code.  Copy a comment from code removed
in a previous patch (for the ARMv7-M "dap baseaddr" command).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-29 14:31:19 -08:00
David Brownell
d44f1aaeff ARM ADIv5: messaging tweaks
Add space missing after the invalid ACK value.  On init, say
which AP is being used, and don't assume it's an AHP-AP.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-27 13:40:05 -08:00
David Brownell
183765707f ADIv5 improved diagnostic
Don't just complain about an invalid ACK; say what the
value was, to help troubleshooting.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-15 13:02:45 -08:00
David Brownell
8e1b5c3138 ARM ADIv5: add comments
Add doxygen and other comments for what's more or less the lowest
level JDAG-DP primitive, to access JTAG_DP_{A,D}PACC registers.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-14 12:58:39 -08:00
David Brownell
17921f51ab ARMv7: help/usage updates
Provide helptext which was sometimes missing; update some of it
to be more accurate.

Usage syntax messages have the same EBNF as the User's Guide;
there should be no angle brackets in either place.

Don't use "&function"; functions are like arrays, their address
is their name.  Shrink some overlong lines, remove some empties.

Add a couple comments about things that should change:  those
extra TCK cycles for MEM-AP reads are in the wrong place (that
might explain some problems we've seen); the DAP command tables
should be shared, not copied.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-07 16:18:01 -08:00
David Brownell
fccb812f82 ARM: add #defines for JTAG ack codes
JTAG has only two possible JTAG ack codes for APACC and DPACC
register reads/writes.  Define them, and remove empty "else"
clause in the code which now uses those codes.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-05 13:03:27 -08:00
David Brownell
adf2a9a267 ARM: add comments re DAP assumptions
I think some of these assumptions are not well-founded.
Related, that swjdp_transaction_endcheck() is a bit iffy.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-05 12:55:46 -08:00
David Brownell
4ed5b45097 ARM: ADIv5 JTAG symbol cleanup
Rename DAP_IR_* as JTAG_DP_* since those symbols are specifically
for JTAG-DP (or SWJ-DP in JTAG mode), and won't work with SWD.
Define the JTAG ABORT and IDCODE instructions for completeness;
add a comment about where to (someday) use ABORT.

Fix messaging which assumes everything is an SWJ-DP; say "JTAG-DP"
instead, it's at least more appropriate for all JTAG transports.

Shrink the affected lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-02 15:53:33 -08:00
David Brownell
858226aae2 ARM: dap info fix + tweaks
Fix: don't print the BASE address except if it's a MEM-AP;
that's an unlikely error, but there's no point getting it wrong.
Tweaks: comments, capitalization.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-02 15:53:18 -08:00
David Brownell
6105f2bc4a ARM: ADIv5 export cleanup
Make some private functions "static".  Remove their public declarations,
and what is now an obviously unused function.  Shrinks this object's size
(about 5% on x86_64) while making the code's scope easier to understand.
Shrink the affected lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-02 15:53:06 -08:00
David Brownell
e60c164cdb ARM: ADIv5 symbol and comment cleanup
Instead of magic numbers, use their AP_REG_* constants.  Rename
the ROM address symbol as BASE to match ARM's documentation.

Comment various other symbols in the header; add some missing ones.
Remove an unused struct.  Add some doxygen for stuff including the
DAP structure and initialization.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-02 15:53:03 -08:00
Zachary T Welch
6512e5e36b change #include "time_support.h" to <helper/time_support.h>
Changes from the flat namespace to heirarchical one.  Instead of writing:

	#include "time_support.h"

the following form should be used.

	#include <helper/time_support.h>

The exception is from .c files in the same directory.
2009-12-03 04:22:52 -08:00
David Brownell
21378f58b6 ARM: comment tweaks in ADIv5
"OptimoDE DESS" is ARM's semicustom DSPish stuff.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-25 16:14:45 -08:00
Zachary T Welch
2861877b32 command_handler: change 'cmd_ctx' to CMD_CTX
Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
2009-11-17 11:40:06 -08:00
Zachary T Welch
23402315ce command_handler: change 'args' to CMD_ARGV
This patch converts all instances of 'args' in COMMAND_HANDLER routines
to use CMD_ARGV macro.
2009-11-17 11:38:07 -08:00
Zachary T Welch
7bf1a86e47 command_handler: change to 'argc' to CMD_ARGC
This patch converts all instances of 'argc' in COMMAND_HANDLER routines
to use CMD_ARGC.
2009-11-17 11:38:06 -08:00
Zachary T Welch
98723c4ecd command_context_t -> struct command_context
Remove misleading typedef and redundant suffix from struct command_context.
2009-11-13 13:25:47 -08:00
Zachary T Welch
056fcdb540 arm_jtag_t -> struct arm_jtag
Remove misleading typedef and redundant suffix from struct arm_jtag.
2009-11-13 11:58:10 -08:00
Zachary T Welch
f96d6054e6 swjdp_common_t -> struct swjdp_common
Remove misleading typedef and redundant suffix from struct swjdp_common.
2009-11-13 11:58:09 -08:00
Zachary T Welch
d0809ac060 scan_field_t -> struct scan_field
Remove useless structure typedef.
2009-11-13 11:58:04 -08:00
Zachary T Welch
d02fee197f arm_adi,armv7[am]: use COMMAND_HELPER for helpers
Rewrites the dap_* command helpers to use the COMMAND_HELPER paradigm.
Uses CALL_COMMAND_HELPER to hide inherited calling conventions.
2009-11-13 10:51:46 -08:00
Zachary T Welch
a8886cdfee Improve arm_adi_v5 command argument parsing. 2009-11-05 18:03:19 -08:00
David Brownell
ddade10d4a ARM ADIv5: "dap info" gets more readable
Make the "dap info" output more comprehensible:

 - Don't show CIDs unless they're incorrect (only four bits matter)
 - For CoreSight parts, interpret the part type
 - Interpret the part number
 - Show all five PID bytes together
 - Other minor cleanups

Also some whitespace fixes, and shrink a few overlong source lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-26 16:02:45 -07: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
zwelch
1af6b72fc1 Magnus Lundin <lundin@mlu.mine.nu>, Oyvind Harboe <oyvind.harboe@zylin.com>, David Brownell <david-b@pacbell.net>:
Move the dap command handler implementations to arm_adi_v5.c,
leaving just thin wrappers in armv7m.c.  There should be no
change in functionality here.  (From Magnus.)

Minor style cleanup:  whitespace, line length, etc.  Update spec
references to use docs which are currently available.  (From Dave.)


git-svn-id: svn://svn.berlios.de/openocd/trunk@2544 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-16 00:08:36 +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
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
128a733428 - Fixes '&&' whitespace
- Replace ')\(&&\)(' with ') \1 ('.
- Replace '\(\w\)\(&&\)(' with '\1 \2 ('.
- Replace '\(\w\)\(&&\)\(\w\)' with '\1 \2 \3'.


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


git-svn-id: svn://svn.berlios.de/openocd/trunk@2363 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:38:12 +00:00
duane
05f0e6e9d5 C99 printf() -Werror fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@2307 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-21 03:15:42 +00:00
oharboe
333642fcff fix jtag_add_callback() args. The first argument is nothing special, it's just another generic argument.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2290 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-19 08:18:36 +00:00
zwelch
db7e77237c Transform 'u32' to 'uint32_t' in src/target/arm*
- Replace '\([^_]\)u32' with '\1uint32_t'.
- Replace '^u32' with 'uint32_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2278 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:08:52 +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
86173cdbdd Transform 'u8' to 'uint8_t' in src/target
- Replace '\([^_]\)u8' with '\1uint8_t'.
- Replace '^u8' with 'uint8_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2274 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:04:08 +00:00
ntfreak
f7d3fdb195 - add support for different TAR autotincrement sizes as per ARM ADI spec.
- set TAR size to 12 bits for Cortex-M3.
- Original patch submitted by Magnus Lundin [lundin@mlu.mine.nu].


git-svn-id: svn://svn.berlios.de/openocd/trunk@2051 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 13:45:50 +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
f499341558 no longer use jtag_add_xxx() to set end state to TAP_IDLE. Same must be done for TAP_DRPAUSE
git-svn-id: svn://svn.berlios.de/openocd/trunk@2044 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 12:06:31 +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
ntfreak
7dc29156fe - change signature for adi_jtag_dp_scan and adi_jtag_dp_scan_u32 to use swjdp_common_t *swjdp instead of arm_jtag_t *jtag_info
- change SWJDP_IR/DR_APACC to DAP_IR/DR_APACC to conform with ARM_ADI docs.
- add swjdp->memaccess_tck field and code for extra tck clocks before accessing memory bus
- Set default memaccess value to 8 for Cortex-M3.
- Add dap memaccess command.
- document all armv7 dap cmds.
- Original patch submitted by Magnus Lundin [lundin@mlu.mine.nu].

git-svn-id: svn://svn.berlios.de/openocd/trunk@2005 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-02 21:06:12 +00:00
oharboe
a79945b7a9 switch to jtag_add_callback() - USB performance fix
git-svn-id: svn://svn.berlios.de/openocd/trunk@1724 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 07:26:59 +00:00
zwelch
68b05c5575 Audit and eliminate redundant #include directives in arm target files.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1714 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 04:46:21 +00:00
oharboe
57bc9f37c9 in_handler in_check_mask and in_check_value now removed from field. Last big patch in the series of JTAG API cleanup.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1672 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-08 09:48:00 +00:00
oharboe
75f98d1649 added comments w.r.t. potential performance problems
git-svn-id: svn://svn.berlios.de/openocd/trunk@1663 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-08 06:14:08 +00:00
oharboe
15f15cdddb ouch - typo in last commit
git-svn-id: svn://svn.berlios.de/openocd/trunk@1656 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-07 22:59:51 +00:00
oharboe
8f41f7c7d5 fix copy & paste error when retiring in_handler
git-svn-id: svn://svn.berlios.de/openocd/trunk@1653 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-07 22:45:17 +00:00
oharboe
146b6462a3 remove in_handler usage
git-svn-id: svn://svn.berlios.de/openocd/trunk@1637 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-07 12:33:26 +00:00
zwelch
92bae0b1df Fix pointer cast alignment warnings in arm_adi_v5.c
git-svn-id: svn://svn.berlios.de/openocd/trunk@1627 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-07 00:58:38 +00:00
oharboe
e86dee3200 remove unecessary setting of deprecated fields to NULL
git-svn-id: svn://svn.berlios.de/openocd/trunk@1611 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-06 07:21:46 +00:00
oharboe
4d88c124b1 retire out_mask - not used anywhere
git-svn-id: svn://svn.berlios.de/openocd/trunk@1608 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-06 06:20:52 +00:00
oharboe
b6f268c113 mark usage of in_handler that can be converted into user code
git-svn-id: svn://svn.berlios.de/openocd/trunk@1607 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-05 19:30:13 +00:00
mlu
9f9c56d6bc More error logging for DAP errors
git-svn-id: svn://svn.berlios.de/openocd/trunk@1569 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-29 18:17:51 +00:00
mlu
573d9a0368 Added arm_adi_v5.c/h, to replace cortex_swjdp.c/h. Better conformance to ARM Debug Interface rev 5 documentation and remoed code specific to the Cortex-M3 targets.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1535 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-27 08:21:35 +00:00