Commit Graph

2228 Commits

Author SHA1 Message Date
Øyvind Harboe
a1609e5ad1 Removed unused interface_jtag_set_end_state and wrote down some notes on TCP/IP client/server scheme. 2009-10-20 15:54:53 +02:00
Øyvind Harboe
79e257a209 Added the faux flash driver and target. Used for testing. 2009-10-20 12:23:56 +02:00
Øyvind Harboe
ad75639611 Added 'unlock' option to flash write_image 2009-10-20 12:03:36 +02:00
Øyvind Harboe
e4dba30b63 More svn to git version string fixes. 2009-10-20 09:46:23 +02:00
David Brownell
6907ef9d50 SVF: better spec conformance for STATE switch
Don't add extra TCK in current state; exit from RESET had four extras.
Only IDLE --> IDLE needs such an extra clock.  (At least one TCK must
be issued.)

Allow entry to RESET; SVF allows it, so must we (despite those entries
being commented out of the statemove table).

When entering RESET, always use TLR ... we might end up with extra clocks
in reset that way, which is harmless, but we'll never end up in any other
state than RESET, which is useful paranoia.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-19 23:33:08 -07:00
David Brownell
d243e641d3 jtag_add_statemove() always uses TLR to get to RESET
As decided a while back, this isn't a transition we want to chance.
Whenever someone wants to got to RESET, force it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-19 22:50:51 -07:00
David Brownell
3cc147efd9 SVF/XSVF: comment and whitespace fixes
SVF: comment the predefined/default paths; make them static const

SVF, XSVF: whitespace fixes, mostly so copyrights display sanely

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-19 22:50:51 -07:00
Zachary T Welch
53979244b1 Improve Makefile rules for XScale debug handler; fixes 'make distcheck'. 2009-10-19 19:59:02 -07:00
Redirect 'Slash' NIL
0388a9c0e5 MinGW: use WinSock2
After reading a bit further, it appears that ws2_32 (Windows Sockets 2)
is included in all versions of Windows and backwards compatible with
wsock32, at least according to

 http://msdn.microsoft.com/en-us/library/ms740673%28VS.85%29.aspx.

Only Win95 seems to require a manual installation; is not a big deal.

So I think we can drop this whole business of detecting 64 bit MinGW and
just use -lws2_32 for all MinGW platforms.
2009-10-19 17:48:19 -07:00
Nicolas Pitre
6726b78707 fix single step of bx instruction going into Thumb mode
Without this fix, the following code cannot be single stepped:

	add	ip, pc, #1
	bx	ip
	[thumb code here]
2009-10-19 22:04:07 +02:00
Redirect 'Slash' NIL
113679ff59 corrective fix for MinGW GNU C99 printf compliance
Compilation on cygwin, using gcc v3 with option -mno-cygwin,
currently produces a large number of the following warnings:

   warning: `gnu_printf' is an unrecognized format function type

These have been introduced with the recent MinGW GNU C99 printf
compliance patch, as gnu_printf was only introduced with gcc v4.4
and is not recognized with earlier versions.

The attached fix adds gcc version detection to the previous patch
to avoid the problem.
2009-10-19 09:49:34 -07:00
oyvind
557d1b6490 Sync with official Jim Tcl repository. 2009-10-19 15:16:42 +02:00
oyvind
89a8a37998 Switch from svn to git version string handling. 2009-10-19 15:08:52 +02:00
Redirect 'Slash' NIL
990f50a73b safer conversion to HANDLER on MinGW-W64
Assign to "intptr_t", which on some versions of MS-Windows
will widen the variable; then cast to HANDLE.
2009-10-17 22:18:38 -07:00
Redirect 'Slash' NIL
73349dc5ac More MinGW C99 printf compliance
Passing "--std=gun99" is unfortunately not sufficient to make current
MinGW compilers conform with respect to checking printf format strings.
(The C runtime seems not to have problems.)

Fix by using a "gnu_printf" format specifier not "printf".
2009-10-17 17:47:52 -07:00
Redirect \"Slash\" NIL
c9fbfbd95c jim-eventloop for MinGW-w64
Use JIM_WIDE_MODIFIER for the sscanf format, and apply it for MINGW32 as
well as other Windows environments.  (Microsoft doesn't conform to the
C99 standard, and uses "%I64d" not "%lld" for "long long".)

NB: __MINGW32__ should work on both w32 and w64,.
2009-10-17 12:15:13 -07:00
David Brownell
05d6716936 build tweak for bin2char
Work better when building outside the source tree.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-17 12:14:19 -07:00
David Brownell
cb7965da15 xscale: better fix for debug_handler.bin
Generate a C struct with the data, and use that, instead of an
assembly language file.  The assembly language causes issues on
Darwin and MS-Windows, which don't necessarily use GNU AS; or
if they do, don't necessarily use its ELF syntax.

It's also better in two other ways:  fewer global symbols; and
the init-time size check gets optimized away at compile time.
(Unless it fails, in which case bigger chunks of the file vanish.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-16 13:52:40 -07:00
David Brownell
a61b57a87f another portability update
Just use "%p" instead of consing up some integral type for pointer printf.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-14 20:24:31 -07:00
David Brownell
510db585fd portability updates
Based on some patches from <redirect.slash.nil@gmail.com>
for preliminary Win64 compilation.  More such updates are
needed, but they need work.  Compile tested on 64 and 32 bit
Linuxes, and Cygwin.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-14 20:04:33 -07:00
David Brownell
bc792857a5 doc updates to match "help" better
This makes the documentation a closer match to "help" output:

 - "pathmove" somehow was not documented in the User's Guide

 - "jtag_nsrst_assert_width" and "jtag_ntrst_assert_width"
   are new; both needed descriptions.

 - Removed two undocumented and fairly useless script mechanisms:
    * production/production_info/production_test ... using it,
      requires replacing everything; so having it adds no value.
    * cpu ... way out of date; hopeless to keep that current

Note that anyone using that "production" stuff already defines
their own procedures, and can keep using them with no change.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-14 15:18:00 -07:00
Øyvind Harboe
a894c2d8b2 S29WS-N CFI query fix is to try 0x555 if 0x55 fails. 2009-10-14 12:01:52 +02:00
Øyvind Harboe
4490a42a09 Work in progress on arm11 reset. Assert srst. 2009-10-14 11:14:04 +02:00
David Brownell
1ee8ef4210 Fix problems building xscale_debug.S 2009-10-14 11:04:37 +02:00
Lennert Buytenhek
9b9bc78ef1 fix detection of PLD instructions
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-13 15:35:01 -07:00
Lennert Buytenhek
ed1e45b388 fix pass_condition() LE condition code check
The LE check is obviously buggy (as easily triggered during some
testing), but I didn't audit the rest of the cases.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-13 15:33:04 -07:00
David Brownell
5535399a46 cosmetic cleanup in TMS tables
Cleanup comments and layout/whitespace in the TMS tables.
Table contents stayed the same (ignoring whitespace).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-13 10:55:24 -07:00
Yauheni Kaliuta
6a2fd7cad5 Cleanup: nuke trailling whitespaces
Signed-off-by: Yauheni Kaliuta <y.kaliuta@gmail.com>
2009-10-13 19:16:57 +02:00
Yauheni Kaliuta
bc0cc62afd Do not replace virt2phys with the default one if it was assigned
Signed-off-by: Yauheni Kaliuta <y.kaliuta@gmail.com>
2009-10-13 17:55:44 +02:00
Øyvind Harboe
79bf27da71 Retired gdb_attach. gdb-detach event covers this functionality. 2009-10-13 13:44:15 +02:00
Øyvind Harboe
4d32b6eee9 Missing type for eCos. 2009-10-13 13:13:29 +02:00
Øyvind Harboe
20c8f64f0a Fix warning. 2009-10-13 12:22:23 +02:00
Øyvind Harboe
1f917bdc0c Delete commented out code. Add a bit of error checking. 2009-10-13 12:10:23 +02:00
Øyvind Harboe
86cbbe8a4a Propagate error from assert, deassert and halt on tcl target object. 2009-10-13 12:10:23 +02:00
David Brownell
b6c4d1006f xscale: stackframe corruption bugfix
Resolve a "FIX" comment; yes that was superfluous given that the
JTAG core does that check by default.  It was also buggy since it
wrote to a stack frame that went away before the write happened!!

Other fixes:  remove pointless malloc(); zero-init scan_field_t
values wherever they appear; whitespace scrub; spelling fix.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-13 01:21:24 -07:00
Øyvind Harboe
85398ccdcf More error propagation fixes. 2009-10-12 15:25:00 +02:00
Øyvind Harboe
23c629a85e arm11 burst writes are now only enabled for writes larger than 1 word. Single word writes are frequently used from reset init scripts to non-memory peripherals. 2009-10-12 15:13:44 +02:00
Øyvind Harboe
35affce085 Retire arm11 no_increment. Intended for future expansion to read/write to ports. New arm11 commands would have to be added to exploit it. 2009-10-12 14:21:38 +02:00
Øyvind Harboe
0ca473468c Propagate wDTR/rDTR failure immediately, otherwise it's followed up by timeout errors. 2009-10-12 14:10:49 +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
David Brownell
5e837387aa simplify XScale debug handler installation
Load the XScale debug handler from the read-only data section
instead of from a separate file that can get lost or garbaged.
This eliminates installation and versioning issues, and also
speeds up reset handling a bit.

Plus some minor bits of cleanup related to loading that handler:
comments about just what this handler does, and check fault codes
while writing it into the mini-icache.

The only behavioral changes should be cleaner failure modes after
errors during handler loading, and being a bit faster.

NOTE:  presumes GNU assembly syntax, with ".incbin"; and ELF,
because of the syntax of the ".size" directive.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-12 02:39:18 -07:00
David Brownell
9f6c23f479 more xscale cleanup (mostly removing JTAG hooks)
Streamline/shrink some needless JTAG stuff:

 - Use #defines for the JTAG instructions; they can't ever change
 - Remove an unused (!) shadow of tap->ir_length
 - Stop using a copy of target->tap
 - Don't bother saving the variant after sanity checking ir_length

Also, make target_create() work as on other targets:  build the
register cache later, making init_target() no longer be a NOP.
Handle malloc failure; remove a comment that was obsoleted by the
not-so-new target syntax.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-12 02:39:01 -07:00
Øyvind Harboe
026559068d Merge commit 'origin/master' 2009-10-12 09:28:56 +02:00
Øyvind Harboe
c8d935ab7c If halt times out, stop GDB. Allows e.g. manual reset via monitor commands. 2009-10-12 09:27:27 +02:00
David Brownell
2d924a59db xscale_load_ic cleanup
Remove unused and deprecated (in the arch spec) mode for loading
code into the *main* icache (vs the "mini" icache).  Disable some
extremely noisy (and rarely useful) low-level debug messages

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-11 10:35:52 -07:00
David Brownell
688003cb23 xscale.c cleanup
Declare almost everything as static.
Move stuff to remove most forward references.
Remove most forward declarations.
Warn if the unimplemented register functions get called.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-11 10:35:28 -07:00
David Brownell
8b3bfcfc5b xscale bugfix to handler loading
Just fill out the rest of the cache line with NOPs; don't change
the record of how much data we consumed.  Otherwise the count of
how much data is left can roll over from positive to negative
("VERY positive") and skip the loop termination of zero.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-11 10:06:08 -07:00
David Brownell
5aba621b55 xscale minor cleanup
Add a header comment referencing useful XScale specs.
Make most data static, and the tables readonly.
Scrub extra blank lines.
Return fault codes from one routine.
Remove a needless NOP methood.

(BUGFIX) When we update R0, mark R0 as dirty/valid ... not R15/PC!

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-11 02:52:00 -07:00
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