Commit Graph

4383 Commits (93f2afa45f4cfcb8afd08dae5a17996dba5c7a9c)

Author SHA1 Message Date
David Brownell 93f2afa45f initial "transport" framework
This adds the guts of a transport framework with initialization,
which should work with current JTAG-only configurations (tested
with FT2232).

Each debug adapter can declare the transports it supports, and
exactly one transport is initialized.  (with its commands) in
any given OpenOCD session.

  * Define a new "struct transport with init hooks and a few
 "transport"  subcommands to support it:

     "list" ... list the transports configured (just "jtag" for now)
     "select" ... makes the debug session use that transport
     "init" ... initializes the selected transport (internal)

  * "interface_transports" ... declares transports the current interface
    can support.  (Some will do this from C code instead, when there are
    no hardware versioning (or other) issues to prevent it.

Plus some FT2232 tweaks, including a few to streamline upcoming
support for an SWD transport (initially for Luminary adapters).

Eventually src/jtag should probably become src/transport, moving
jtag-specific stuff  to transport/jtag.

Signed-off-by: David Brownell <db@helium.(none)>
2010-07-02 16:45:28 -04:00
Spencer Oliver deb176d335 ft2232: revert ft2232_read_scan changes
Revert change made in commit dd88b461da.
Caused segfaults when using ftdi driver under win32.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-07-02 17:00:57 +01:00
Spencer Oliver f97b6b59ab ft2232: bugfix from previous commit
fix build error with commit dd88b461da

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-07-01 19:43:58 +01:00
Marc Pignat dd88b461da ft2232: simplify ft2232_read_scan 2010-07-01 09:32:56 +02:00
Marc Pignat cd7f443103 ft2232: cleanup ft2232_write
* Include the size check into ft2232_write, so calling it is simpler.
* Use sizeof(buffer) when possible
2010-07-01 09:32:48 +02:00
Olaf Lüke 2986320cde at91sam3s* support
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-25 21:37:53 +02:00
Øyvind Harboe fb96b8607a openocd: setup_command_handler() must not be static
when OpenOCD is linked with an app this fn can be used from
the outside.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-23 11:43:40 +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
Antonio Borneo 6cb2d6dd7a error number: review
Review allocation of error numbers in openocd
to avoid overlap.
Put brackets around negative numbers to avoid
issues during macro expansion.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-23 07:55:43 +02:00
Øyvind Harboe 4fa3cc7746 am3517 evm: use physical write to memory while target is running
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-22 12:49:56 +02:00
Øyvind Harboe d236a48e8f cortex a8: only physical read/write's are available when target is running
Memory read/writes to virtual memory, requires that the CPU is
halted.

Use 'phys' option to write to memory while target is running.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-22 12:47:30 +02:00
Øyvind Harboe 33e7696cfa target: $_TARGET mdw now has a phys option
just like the mdw command

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-22 12:43:30 +02:00
Øyvind Harboe 8b82171f75 target: mwX on target object now supporst phys argument
$_TARGETNAME mww phys 0x10 0xdeadbeef

=> write 0xdeadbeef to physical address 0x10

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-22 12:36:32 +02:00
Edgar Grimberg f44eeba16f xsvf: Fix shadow issues on Mac
wait is declared in /usr/include/sys/wait.h

Signed-off-by: Edgar Grimberg <edgar.grimberg@zylin.com>
2010-06-22 08:24:26 +02:00
Edgar Grimberg bf8d954352 target: Fix shadow issues on Mac
wait is declared in /usr/include/sys/wait.h

Signed-off-by: Edgar Grimberg <edgar.grimberg@zylin.com>
2010-06-22 08:24:23 +02:00
Edgar Grimberg bef497aeb0 flash: fix shadow issues on Mac
Wait is declared in /usr/include/sys/wait.h

Signed-off-by: Edgar Grimberg <edgar.grimberg@zylin.com>
2010-06-22 08:24:19 +02:00
Øyvind Harboe fe1f7f63b6 board: add alpha am3517evm ti board config file
Signs of life: reset(kinda), halt, resume and memory
display/modify.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-22 08:22:01 +02:00
Øyvind Harboe 9a8fe44c83 gitignore: start list of emacs temp files to ignore
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-22 08:22:01 +02:00
Øyvind Harboe b50bb632ad cortex a8: print message that locking debug access succeeded on second try
when locking the debug access fails on the first try, it's a
bit noisy, so print out message that it succeeded on second try.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-22 08:22:01 +02:00
Øyvind Harboe 4d238c7f91 cortex a8: add error propagation for poll/resume
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-22 08:22:01 +02:00
Øyvind Harboe 59bf45be1f cortex a8: add timeouts waiting for restart, prepare and halt
It would previously sit in an infinite loop rather
than reporting an error.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-22 08:22:01 +02:00
Øyvind Harboe 37cfbe4917 cortex a8: add error propagation for mem_ap_read/write_atomic_u32
Error propagation avoids e.g. infinite loops waiting
for target to halt, etc.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-22 08:22:00 +02:00
Øyvind Harboe 19925e4d7f arm_adi_v5: error propagation fixes
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-22 08:22:00 +02:00
Antonio Borneo f747b16e4e nand/mx2: review scope of symbols
Add "static" qualifier to private variable.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-21 22:14:24 +08:00
Antonio Borneo 9b5572857a nor/str7x: review scope of symbols
Add "static" qualifier to private function.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-21 22:14:23 +08:00
Antonio Borneo bc7fa896e6 openocd.c: review scope of symbols
Add "static" qualifier to private data.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-21 22:14:21 +08:00
Antonio Borneo 190986eb8c nor/virtual: review scope of symbols
Add "static" qualifier to private functions.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-21 22:14:19 +08:00
Antonio Borneo ff1c09fbea target/avrt: review unused symbols
Remove unused functions:
- mcu_write_dr_u16
- mcu_write_dr_u8
- mcu_write_ir_u16
- mcu_write_ir_u32

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-21 22:14:18 +08:00
Antonio Borneo decd417064 target/avr: review scope of symbols
Add "static" qualifier to private functions.
Move duplicated global declarations from "target/avrt.c"
and "nor/avrf.c" to "target/avrt.h".
Remove unused declarations form "nor/avrf.c".

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-21 22:14:17 +08:00
Antonio Borneo d26b5236ba target/feroceon: review scope of symbols
Add "static" qualifier to private functions.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-21 22:14:15 +08:00
Antonio Borneo 3f59fcf77e target/mips_m4k: review scope of symbols
Add "static" qualifier to private functions.
Remove private prototypes from include file.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-21 22:14:14 +08:00
Antonio Borneo b978dcbbee helper/jim-eventloop.h: review unused definitions
Remove unused typedef and define

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-21 22:14:12 +08:00
Antonio Borneo 3cfbf70559 helper/jim-eventloop: review unused symbols
Remove unused functions:
- Jim_CreateSignalHandler
- Jim_DeleteSignalHandler

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-21 22:14:11 +08:00
Antonio Borneo ec073e8943 helper/jim-eventloop: review scope of symbols
Add "static" qualifier to private functions.
Remove private prototypes from include file.
Remove empty definition of JIM_STATIC.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-21 22:14:08 +08:00
Øyvind Harboe 2fbb0b5972 jtag: retire jtag_get_error()
This fn is an implementation detail of jtag_execute_queue()
that is not to be exposed externally.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-21 13:43:36 +02:00
Øyvind Harboe dcba070958 jtag: do not use jtag_get_error()
normal code should not call jtag_get_error(), but rather check
the return code from jtag_execute_queue().

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-21 13:43:23 +02:00
Øyvind Harboe 7013b960fe adi_v5_jtag: add missing error handling
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-21 09:03:31 +02:00
Øyvind Harboe 8d1dcb9bcd cortex a8: add missing error handling
cortex examine was missing error handling.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-21 09:03:31 +02:00
Andreas Fritiofson acee9d1c65 arm-jtag-ew: -Wshadow fix
declaration of ‘index’ shadows a global declaration
in /usr/include/string.h

Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2010-06-19 11:37:20 +02:00
Øyvind Harboe 2a25c968bf cortex a8: fix segfault for unexamined targets
print error message instead of segfaulting for
unexamined targets.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-19 09:26:53 +02:00
Antonio Borneo b8f8d756a2 target/dsp563xx: review unused symbols
Remove unused functions:
- dsp563xx_jtag_senddat
- dsp563xx_write_ir_u16
- dsp563xx_write_dr_u16
- dsp563xx_write_ir_u32

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-18 10:03:40 +02:00
Antonio Borneo 2319caff7d target/dsp563xx: review scope of symbols
Add "static" qualifier to private functions.
Remove private prototypes from include file.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-18 10:03:40 +02:00
Andreas Fritiofson 3f9d377ce7 reverse order of Jim stack trace output
The stack traces makes much more sense this way.

Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2010-06-18 08:06:19 +02:00
Andreas Fritiofson 127f9da4fe don't add confusing source info to Jim
When an interactive command fails, the Jim stack trace prints references to
the line in "command.c" where the interpreter was invoked. Since that
location has no relation to the actual command that failed, the information
serves only to add confusion.

By not adding the useless source info to Jim the noise can be reduced,
while still printing a useful trace for nested commands.

Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-18 07:57:15 +02:00
Antonio Borneo c3ee63be77 helper/jim: review unused symbols
Remove unused functions:
- Jim_IdentityHashFunction
- StringAppendObj
- JimReferencesHTDoubleHashFunction

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-18 07:52:51 +02:00
Antonio Borneo cebd817cee helper/jim: review scope of symbols
Add "static" qualifier to private functions.

Function Jim_InterpolateTokens() is private, but has not
been changed to "static".
This function is called only once, so compiler inlines it.
After inline, there is a warning for variable uninitialized.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-18 07:52:47 +02:00
Freddie Chopin ada8f5963d mingw32: -Wshadow fixes in arm-jtag-ew.c
(error: declaration of ‘stat’ shadows a global declaration; /usr/local/lib/gcc/i686-w64-mingw32/4.4.2/../../../../i686-w64-mingw32/include/sys/stat.h:279: error: shadowed declaration is here)

Signed-off-by: Freddie Chopin <freddie_chopin@op.pl>
2010-06-17 21:10:10 +02:00
Freddie Chopin 3eaab9b55b mingw32: -Wshadow fixes in rlink.c
(error: declaration of ‘byte’ shadows a global declaration; /usr/local/lib/gcc/i686-w64-mingw32/4.4.2/../../../../i686-w64-mingw32/include/rpcndr.h:50: error: shadowed declaration is here)

Signed-off-by: Freddie Chopin <freddie_chopin@op.pl>
2010-06-17 21:10:01 +02:00
Freddie Chopin 647fe050db rlink: -Wshadows fixes
(error: declaration of ‘pHDev’ shadows a global declaration; ../../../../src/jtag/drivers/rlink.c:102: error: shadowed declaration is here)

Signed-off-by: Freddie Chopin <freddie_chopin@op.pl>
2010-06-17 21:09:43 +02:00
Freddie Chopin b1cd202f9a mingw32: -Wshadow fixes
in jim.c (error: declaration of ‘boolean’ shadows a global declaration; /usr/local/lib/gcc/i686-w64-mingw32/4.4.2/../../../../i686-w64-mingw32/include/rpcndr.h:52: error: shadowed declaration is here)

Signed-off-by: Freddie Chopin <freddie_chopin@op.pl>
2010-06-17 21:09:24 +02:00