Commit Graph

88 Commits

Author SHA1 Message Date
Andreas Fritiofson e6907e6d7e Don't cast return value of [cm]alloc
Change-Id: I0028a5b6757b1ba00031893d9a2a1725f915a0d5
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2069
Tested-by: jenkins
Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-30 03:53:45 +00:00
Andreas Fritiofson 13f6c889ab Remove unnecessary (void *)
When pointer casts are needed, cast directly to the correct type, instead
of going via void*.

Don't explicitly cast to void* if it would have been done implicitly.

Change-Id: I4093209200051c5eb62847d00a4b9c8567480068
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1669
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31 20:42:47 +00:00
Spencer Oliver 08d4411b59 update files to correct FSF address
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1426
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2013-06-05 19:52:42 +00:00
Spencer Oliver 374127301e build: cleanup src/target directory
Change-Id: Ia055b6d2b5f6449a38afd0539a8c66e7d7e0c059
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/430
Tested-by: jenkins
2012-02-06 11:00:36 +00:00
Øyvind Harboe bbd84417f6 arm11: disable broken optimization for setting current scan chain 2011-08-08 22:33:41 +02:00
Freddie Chopin f499bab698 Fix "unused variable" warnings (errors) detected with GCC 4.7.0 - dubious fixes 2011-06-04 09:46:48 +02:00
Øyvind Harboe 1143bbc0c8 arm11 error propagation fixes
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-07-20 08:42:52 +02:00
Øyvind Harboe e5d1befe43 arm11: fix gaffe in no-ack transfers
The code did not transfer the last word in no-ack transfers.

The strange thing is that this did not lead to any
observable errors.

This gaffe was introduced in commit 1f5883ea56

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-23 11:10:30 +02:00
Øyvind Harboe 4bd415d01b arm11_dbgtap: -Wshadow warning fixes
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-15 23:22:24 +02:00
Øyvind Harboe 36df240cea jtag: cut down on usage of unintended modification of global end state
jtag_get/set_end_state() is now deprecated.

There were lots of places in the code where the end state was
unintentionally modified.

The big Q is whether there were any places where the intention
was to modify the end state. 0.5 is a long way off, so we'll
get a fair amount of testing.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-18 08:43:19 +01:00
Øyvind Harboe 57d7743639 jtag: jtag_add_ir_scan() now takes a single field
In the code a single field was all that was ever used. Makes
jtag_add_ir_scan() simpler and leaves more complicated stuff
to jtag_add_plain_ir_scan().

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-08 08:12:25 +01:00
Øyvind Harboe e018c7c1d2 jtag: retire tap field
jtag_add_dr/ir_scan() now takes the tap as the first
argument, rather than for each of the fields passed
in.

The code never exercised the path where there was
more than one tap being scanned, who knows if it even
worked.

This simplifies the implementation and reduces clutter
in the calling code.

use jtag_add_ir/dr_plain_scan() for more fancy situations.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-08 08:12:25 +01:00
Øyvind Harboe 1f5883ea56 arm11: allow minidrivers to implement inner loop of memory writes
This allows minidrivers to e.g. hardware accelerate memory
writes.

Same trick as is used for arm7/9 dcc writes.

Added error propagation for memory transfer failures in
code rearrangement.

Also the JTAG end state is not updated until after
the memory write run is complete.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-02-22 10:15:51 +01:00
Øyvind Harboe 65cc81ddb6 arm11: fix another infinite loop bug
reset init would get stuck in an infinite loop when
e.g. khz was too high. Added timeout. This is a copy
of paste of a number of such bugfixes in the arm11
code.

Arm11 code reviewed for further such infinite loop bugs
and I couldn't find any more. Xing fingers it's the last
one...

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-02-10 22:54:06 +01:00
David Brownell b3e64566ab ARM11: avoid pointless status returns
For some routines that only returned ERROR_OK and where the
caller never checked ... don't bother.  Remove some noise,
and bugfix some comments.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-11 20:55:12 -08:00
David Brownell cfd79e96a6 ARM11: minor cleanup, mostly ITR comments
ITR register handling seemed to be giving me problems, so I updated
the comments to better say what the code is trying to do ... and to
note the preconditions (one of which seems to be an issue) as listed
in the ARM1136 TRM.

Also removed the unused "ARM11_TAP_DEFAULT" from the ITR scan code;
all the callers already specify an exit path, since this register
isn't usable with such vague semantics.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-11 15:24:08 -08:00
David Brownell a0edb8a328 ARM11: basic watchpoint support
Use the DPM watchpoint support; remove old incomplete stubs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-04 18:57:31 -08:00
David Brownell f4651c869f ARM11: tweak TAP ops and debugging
Tweak scanchain 7 debug messaging:

 - show register addresses in decimal, matching ARM docs;
 - remove some pointless noise

Avoid some needless roundtrips:

 - skip SCAN_N when SCREG already holds that number (speeds up
   polling and other common operations)
 - avoid zeroing vcr twice on resume

Show the IR opcode as a label ("RESTART") too; and in decimal,
matching ARM docs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-04 18:57:30 -08:00
David Brownell ea7a49cb9b ARM DPM: share debug reason logic
No point in both ARM11 and Cortex-A8 having private copies
of the logic sorting out e.g. DBG_REASON_WATCHPOINT.

Add and use a shared routine for this ... there's actually
a bunch more debug entry logic that could be shared, this
is just a start on that.  Note that this routine fixes a
bug observed in the ARM11 code, where some abort mode quirks
were displayed as being an unknown debug reason; and also
silences needless ARM11 chatter.

Likewise with private copies of DSCR ... add one to the DPM
struct.  Save it as part of setting DBG_REASON_* so later
patches can switch over to using that copy.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-03 16:08:04 -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 f0c3e7011f ARM11: store a clean copy of DSCR
Just store a clean copy of DSCR in the per-CPU struct, so we
trivially pass a pointer to a recent copy.  This replaces the
previous "last_dscr" and cleans up most of the related calling
conventions ... but it doesn't remove the other DSCR copy.
2009-12-02 23:08:43 -08:00
David Brownell 1d29440a9c ARM11: remove arm11->target
Don't need/want arm11->target; we have arm11->arm.target instead.
Also remove some unused watchpoint stuff.
2009-12-02 23:08:42 -08:00
David Brownell c2af99d471 ARM DPM: tweak initialization
Move the initial breakpoint/watchpoint disable calls to
arm_dpm_initialize(), and start using that routine.  This
split helps with arm11 support.
2009-12-02 23:08:42 -08:00
David Brownell 73ec6d9b89 ARM11: fix warning on cygwin
Previous version of JTAG_DEBUG() macro hid this bug.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-29 09:14:52 -08:00
David Brownell 5f0223423d ARM11: fix warning on amd64
Previous version of JTAG_DEBUG() macro hid this bug.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-28 11:55:00 -08:00
David Brownell 30f6142fc8 ARM11: fix dbgtap JTAG_DEBUG
There is no DEBUG() macro; don't call one!  Always at
least *parse* debug code, to help prevent such errors.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-28 11:28:17 -08:00
David Brownell caf827ee81 ARM11: implement provider for new DPM interface
This is a very thin layer over some of the current ARM11
debug TAP utilities.  The layer isn't yet hooked up.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-24 00:14:06 -08:00
David Brownell b8b1353dd7 ARM11: remove unused state and exports
For now there's no point in saving this stuff after examine()
checks it out as OK.  Ditto exporting symbols that aren't
used outside of the module which defines them.  In fact, those
two things needlessly complicate the code...

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-22 15:51:16 -08:00
Øyvind Harboe 5985dee35d arm11: do not use dynamic arrays
Allocate working memory dynamically, caught by checkstack.pl

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-22 19:57:57 +01:00
David Brownell fa618cc74d ARM11: remove needless string format #ifdeffery
We don't need to use size_t in these places; so it's easy
to be rid of the need for this #ifdef and its MS-derived
portability problems.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-22 10:27:29 -08:00
David Brownell 9a98e83b49 target: less implicit inclusion of "etm.h"
Don't include it in more headers than necessary; just
use it in the few files that actually need it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 10:19:33 -08:00
Zachary T Welch dc1685ca25 move ARRAY_SIZE macro to types.h
The ARRAY_SIZE macro was defined in several target files, so move it
to types.h.

This patch also removes two other identical macros: DIM (from jtag.h)
and asizeof (from arm11.h).
2009-11-16 09:58:11 -08:00
David Brownell 817bf74302 ARM11: revert etmr/etmw commands
These aren't desirable, given "standard" ETM support.
Also remove the now-unused arm11_find_target().

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13 16:56:11 -08:00
David Brownell a7f5cdf999 ARM11: switch to new "arm" base type
This will enable reusing many common ARM utilities, in
particular the ETM and ETB support.  The ARM11 support
can still be much simplified after this patch, though.

Note:  none of those common utilities kick in yet...

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13 16:22:36 -08:00
Zachary T Welch f3b3752a9e arm11_sc7_action_t -> struct arm11_sc7_action
Remove misleading typedef and redundant suffix from struct arm11_sc7_action.
2009-11-13 11:58:09 -08:00
Zachary T Welch 55926f576f arm11_common_t -> struct arm11_common
Remove misleading typedef and redundant suffix from struct arm11_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 42ef503d37 jtag_tap_t -> struct jtag_tap
Search and destroy the jtag_tap_t typedef.  This also cleans up a
layering violation, removing the declaration from types.h.
2009-11-13 11:58:04 -08:00
Michael Bruck 627bd19768 arm11: add etmr/etmw registers to access ETM via DBGTAP scan chain
First cut of these commands. Øyvind tinkered a bit with
the number parsing to bring it up to speed + rebased it.
Ready for testing.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-10 14:00:24 +01:00
Zachary T Welch da3196bf5e Add private header for ARM11 internals.
Reduces confusion about location of associated routines and
reduces clutter in the arm11 header.

Removes extra whitespace around the lines touched by these changes.
2009-11-08 15:47:04 -08:00
Øyvind Harboe 20c8f64f0a Fix warning. 2009-10-13 12:22:23 +02:00
Øyvind Harboe 85398ccdcf More error propagation fixes. 2009-10-12 15:25:00 +02:00
Øyvind Harboe 165e3a1468 Fix warning and improve error message upon burst transfer failure 2009-10-12 14:09:10 +02:00
Øyvind Harboe b5b4fee811 Fix bogus 'transfer errors' with arm11 'memwrite burst enable'. A regression introduced in b8103660fa36a77158bd77379572c09913d85c00 2009-10-12 11:59:18 +02:00
Øyvind Harboe 8f09c5df85 ARM11 error checking 2009-10-09 10:00:05 +02:00
oharboe 0dcfbec7fb do not use dynamically sized stack arrays, not compatible with embedded OS's
git-svn-id: svn://svn.berlios.de/openocd/trunk@2691 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-11 07:43:36 +00:00
oharboe 69b8b5e0aa David Brownell <david-b@pacbell.net> fix warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@2648 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-28 17:18:36 +00:00
oharboe ed8fd94d7c added arm11 timeout error messages
git-svn-id: svn://svn.berlios.de/openocd/trunk@2647 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-28 13:43:26 +00:00
oharboe b747da2663 added note w/reference to discussion on whether or not arm11 code is broken or not.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2580 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-16 11:49:21 +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