Commit Graph

2976 Commits (63dc352876259562948b5d814de197ba534897b9)

Author SHA1 Message Date
David Brownell f5093e1605 ARM: simplify ARMv7-A register handling
ARMv7-A doesn't need to duplicate all the standard ARM code
for register handling.

 - Switch Cortex-A8 to use the standard register code
 - Remove duplicated infrastructure from ARMv7-A
 - Have ARMv7-A arch_state() show CPSR, like other ARMs

Add comments to show where the Cortex-A8 isn't actually doing
the right thing for register reads/writes, unless core happens
to be in the right mode to start with.  (Looks like maybe there
may be generic confusion between saved/current PSR values in all
the ARM code ...)

Make related ARMv7-A and Cortex-A8 symbols properly static.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-18 14:46:14 -08:00
David Brownell 8a6d4ced4c ARM: setup "secure monitor mode" shadow regs
Teach the "armv4_5" register code to understand about the
secure monitor mode:

 - Add the other three shadowed registers to the arrays
 - Support another internal mode number (sigh) in mappings
 - Catch malloc/calloc failures building that register cache

This should kick in for Cortex-A8 and ARM1176.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-18 13:23:00 -08:00
David Brownell bbebfd9e13 ARM: add "core_type" field to "struct arm"
It's used to flag cores with the "TrustZone" extension,
and is used in subsequent patches to set up support for
the registers shadowed by its new secure monitor mode.

The ARM1176 and Cortex-A8 both support this new mode.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-18 13:22:27 -08:00
Zachary T Welch 9b1f9810b0 fix segfault at startup
The previous changes to move the startup TCL code resulted in segfaults
during startup.  This seemingly innocuous patch fixes the problem.
I would explain why changing from 'foo[]' to '*foo' caused this issue,
but the difference seems superficial.  For now, this hot fix will do,
but this issue might bear further scrutiny.
2009-11-18 11:56:24 -08:00
Zachary T Welch 5e229bbf87 pass startup_tcl to command_init
Removes external linkage from helper module, making the startup
code a parameter to a new command context's initialization routine.
2009-11-18 07:22:22 -08:00
Zachary T Welch cb7dbc1af4 split startup.tcl file across modules
Moves definitions for each layer into their own file, eliminating
layering violations in the built-in TCL code.  Updates src/Makefile.am
rules to include all files in the final startup.tcl input file, and
others Makefile.am rules to distribute the new files in our packages.
2009-11-18 07:21:42 -08:00
Zachary T Welch 903daa796a move startup.c to libopenocd
Moves the creation of startup_tcl.c from src/helper/ to src/.
Prepares to split the startup.tcl file into its per-module parts.
2009-11-18 03:59:14 -08:00
Zachary T Welch 59f32cbe53 fix regression in md/mw commands
The recent migration broke them, the fixes broken them in a new way,
but this should restore them to working order.  Eliminates the
temporary variable, as the CMD_NAME macro can once again be use
in routines that increment CMD_ARGV without nasty side-effects.
2009-11-18 03:34:52 -08:00
Øyvind Harboe 6e95f16d0a jtag-api: get rid of unecessary buf_set_u23() that make code obtuse.
Also, this is on the path to increasing the word size for
bit vectors from 8 to something wider(32? natural host machine
width?)

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-18 09:24:28 +01:00
David Brownell 181d401d59 ARM: add is_arm_mode()
Add a new is_arm_mode() predicate, and use it to replace almost
all calls to current armv4_5_mode_to_number().

Eventually those internal mode numbers should vanish... along
with their siblings in the armv7a.c file.

Remove a handful of superfluous checks ... e.g. the mode number
was just initialized, or (debug entry methods) already validated.

Move one of the macros using internal mode numbers into the only
file which uses that macro.  Make the tables manipulated with
those numbers be read-only and, where possible, static so they're
not confused with part of the generic ARM interface.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-17 23:50:26 -08:00
David Brownell ec93209f51 ARM: add arm_mode_name()
Add and use arm_mode_name() to map from PSR bits to user
meaningful names.   It uses a new table which, later, can
be used to hold other mode-coupled data.

Add definitions for the "Secure Monitor" mode, as seen on
some ARM11 cores (like ARM1176) and on Cortex-A8.  The
previous mode name scheme didn't understand that mode.

Remove the old mechanism ... there were two copies, caused
by Cortex-A8 needing to add "Secure Monitor" mode support.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-17 23:50:23 -08:00
David Brownell d6c8945662 ARM: only use one set of dummy FPA registers
All ARM cores need to provide obsolete FPA registers in their
GDB register dumps.  (Even though cores with floating point
support now generally use some version of VFP...)

Clean up that support a bit by sharing the same dummy registers,
and removing the duplicate copies.  Eventually we shouldn't need
to export those dummies.

(This makes the ARMv7-M support include the armv4_5 header, and
cleans up related #includes, but doesn't yet use anything from
there except those dummies.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-17 23:50:17 -08:00
Zachary T Welch cfaf7bdd0a remove unused variable from run_command 2009-11-17 11:40:21 -08:00
Zachary T Welch cffc98ad80 add CMD_NAME variable in command_invocation
Update CMD_NAME from its migratory home in CMD_ARGV[-1] to cmd->name.
Allows CMD_ARGV++ idiom to be used safely in command handlers.
2009-11-17 11:40:21 -08:00
Zachary T Welch be084414ba add struct command_invocation for COMMAND_HANDLER
Adds the command_invocation structure to encapsulate parameters for
all COMMAND_HANDLER routines.  Rather than passing several arguments
to each successive subroutine, a single pointer may be passed around.

Changes the CMD_* macros to reference the new fields.

Updates run_command to create an instance and pass it to the handler.
2009-11-17 11:40:21 -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 5b9899d6ea add more command_handler conversion macros
Add additional macros to allow command handling to be migrated easily:
CMD_CTX, CMD_ARGC, and CMD_ARGV.  Updates CMD_NAME to use CMD_ARGV.

In addition to making the remaining patches of this series cleaner,
this introduces easily sed-able symbols that could allow us to retire
these once the command handler infrastructure matures (i.e. pre-1.0).
2009-11-17 11:38:06 -08:00
David Brownell f4788652e4 target: simplify register get/set ops
No need to indirect from registered integers to pointers.
Just stash the pointers directly in the register struct,
and don't even bother registering.

This is a small code shrink, speeds register access just
a smidgeon, and gets rid of another rude exit() path.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-17 09:06:45 -08:00
Øyvind Harboe 959b373f8c jtag_registers: Avalon bridge flushing tweaks
The code is now much more explicit. It flushes every
N writes. For now flush every time, but tinkering with
the bridge FIFO size and how often we flush clearly
points in the direction of the Avalon write FIFO full
being the culprit.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-17 15:39:05 +01:00
Øyvind Harboe 741cd3c3ab zy1000: revC UART forwarding
Name of serial device differs between revB/C.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-17 15:04:17 +01:00
Øyvind Harboe ca32f25638 zy1000: add version command to print FPGA version and timestamps
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-17 15:04:17 +01:00
Øyvind Harboe 83104648e6 zy1000: fix bug when running on non-arm CPU
Shifting by more than 32 is undefined for 32 bit integers according
to the C standard. Robust solution is conditional code.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-17 15:04:17 +01:00
Øyvind Harboe b888b63fe9 zy1000: fix trivial syntax error introduced by latest refactorings
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-17 15:01:48 +01:00
David Brownell 0181296f61 ARM9TDMI: remove now-needless "struct arm9tdmi"
And move the rest of the vector_catch stuff into the C file;
it's not part of the module interface.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-17 01:09:50 -08:00
David Brownell 812ab89f58 ARM7TDMI: remove now-needless "struct arm7tdmi"
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-17 01:09:06 -08:00
David Brownell a2df544fd9 target: remove some more duplicate includes
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-17 01:06:16 -08:00
David Brownell e722396890 ARMv7-A: no exit() calls
Also, switch integrity check over to the correct magic number,
and remove duplicate v4/v5 #define.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 17:58:58 -08:00
David Brownell 36a538c6d7 Cortex-A8: no exit() calls, add missing v7-A init
Eventually there should be a v7a init routine, but for now
all that is inlined here.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 17:57:12 -08:00
David Brownell c5e0026836 XScale: fewere exit() calls
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 17:55:49 -08:00
David Brownell 1d4a09c2ef MIPS: no exit() calls
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 17:55:30 -08:00
David Brownell 1f3e067b86 ARMv7-M: no exit() calls
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 17:54:51 -08:00
David Brownell 9d57f4d5a1 ARMv4/ARMv5: no exit() calls
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 17:52:50 -08:00
David Brownell 6030f2ca03 ARM11: fewer exit() calls
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 17:51:55 -08:00
David Brownell 47f2305229 Cortex-M3: don't exit()
Get rid of undesirable and needless exit() calls
from the Cortex-M3 support.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 16:42:51 -08:00
David Brownell 56adbaffd0 ARMv7A: use standard disassembler
We no longer need v7A-specific code for this.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 16:36:21 -08:00
David Brownell d7d857a189 ARM11: register (most) standard ARM commands
Have ARM11 register the "standard" ARM commands.  For now, only
disassembly really works.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 16:36:12 -08:00
David Brownell f86137066a ARM: "armv4_5" command prefix becomes "arm"
Rename the "armv4_5" command prefix to straight "arm" so it makes
more sense for newer cores.  Add a simple compatibility script.

Make sure all the commands give the same "not an ARM" diagnostic
message (and fail properly) when called against non-ARM targets.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 16:36:09 -08:00
David Brownell 7c393679c0 JTAG: fix autoprobe failure.
Fix bug noted by Øyvind: terminate the IR length autoscan when
the IR is too long, or otherwise broken.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 16:36:03 -08:00
Zachary T Welch 51862bb98c fileio: improve API types
Use size_t instead of uint32_t when specifying file sizes.  Update all
consumers up through the layers to use size_t when required.  These
changes should be safe, but the higher-levels will need to be updated
further to receive the intended benefits (i.e. large file support).

Add error checking for fileio_read and file_write.  Previously, all
errors were being silently ignored, so this change might cause some
problems for some people in some cases.  However, it gives us the chance
to handle any errors that do occur at higher-levels, rather than burying
our heads in the sand.
2009-11-16 15:47:09 -08:00
Zachary T Welch 69df712d1d struct fileio: improve member types
Add const keyword to file url and cast to free().

Make size an ssize_t and chase all format strings that use it.
2009-11-16 15:47:09 -08:00
Zachary T Welch 9763aef76a helper/log: improve API parameter types
Uses unsigned type to pass line numbers.

Use uint64_t to pass sleep routines their milliseconds.  Updates sleep
routines to use this type and improve whitespace.
2009-11-16 15:47:09 -08:00
Zachary T Welch df9b12695f use Jim_CmdProc in jim_register
The jim_register command just needed to use the type defined by jim.h.
2009-11-16 15:47:08 -08:00
Zachary T Welch 0a9daddc2e improve constness of open_file_from_path 2009-11-16 15:47:08 -08:00
Zachary T Welch ccf59123b7 make command line options const
The getopt_long call allows a const struct option, so mark ours
const too.
2009-11-16 15:47:08 -08:00
David Brownell 91ac164d95 ARM: standard disassembler uses Thumb2 entry
Tweak "standard" ARM disassembler diagnostics to fail if the target
is not "an ARM" (vs. not "an ARMV4/5"), so it makes more sense for
cores inheriting this as the "generic" disassembler.

Also, to use the Thumb2 entry instead of the original Thumb entry.
This makes it work better for both newer cores (which support those
added instructions) and for BL and BLX instructions on older cores.
(Those instructions are 32-bits, which requires curious state-aware
code to go through a 16-bit decode interface...)

Plus minor cleanups, notably to have fewer exit paths and to make
sure they all return failure codes.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 15:29:14 -08:00
David Brownell bf97237401 target: don't include "log.h" from "armv4_5.h"
No point in multiple includes, and that file doesn't
use its functions any more.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 15:27:40 -08:00
David Brownell 2fb58116a5 ARM: move mode functions out of header
They're really too big to inline, at least for code that's
not in any performance-critical loops.

Also move the associated string table to the rodata section.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 15:27:36 -08:00
David Brownell a7c04a0e49 JTAG: no LOG_WARNING() for taps without IDCODE
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 15:18:55 -08:00
David Brownell b6e0f2e1c3 binarybuffer: regression fix
The "improve inline binarybuffer helpers" mis-handled bytes
with the high bit set; treat them as unsigned, not signed.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 14:50:07 -08:00
David Brownell 66300d5966 "types.h" doxygen fix
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 10:42:01 -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
Zachary T Welch 10cce4a5fe armv7m: make core reg read/write use unsigned
Eliminate redundant check that gets covered by using unsigned type.
Created to eliminate noise from subsequent patches, but this kind of
conversion will be beneficial in similar ways throughout the tree.
2009-11-16 09:58:11 -08:00
Zachary T Welch 0535a92456 remove TAP_SCAN_BYTES macro
Use DIV_ROUND_UP(n, 8) instead of TAP_SCAN_BYTES macro.
2009-11-16 09:58:11 -08:00
Zachary T Welch a94748ec6d rename CEIL as DIV_ROUND_UP
Improves the name of this macro, moves it to types.h, and adds a block
of Doxygen comments to describe what it does.
2009-11-16 09:58:11 -08:00
Zachary T Welch f0ce88b3af move container_of to types.h
The container_of macro is useful as a general solution.  It belongs
in types.h, rather than target.h where it was introduced.  Requires
the offsetof macro, which comes from <stddef.h> (moved as well).
2009-11-16 09:57:59 -08:00
Zachary T Welch cbc0578372 nand_command_get_device_by_num: make COMMAND_HELPER
Use COMMAND_HELPER macro to define nand_command_get_device_by_num.
Use CALL_COMMAND_HANDLER to invoke it.
2009-11-16 08:44:38 -08:00
Zachary T Welch e84849f5ed flash_command_get_bank_by_num: make COMMAND_HELPER
Use COMMAND_HELPER macro to declare flash_command_get_bank_by_num.
This is required for COMMAND_PARSE_NUMBER macro.
2009-11-16 08:44:38 -08:00
Zachary T Welch d7a0dfa4dc cleanup jtag minidrivers
Remove two vestigial externs from our JTAG minidriver source files.
Also, removes many extra blank lines from the minidummy driver.
2009-11-16 05:30:51 -08:00
Zachary T Welch 555757175e Add 'nand verify' command
Add the 'nand verify' command to perform a dump and fake-write
simultaneously, checking the read bits against those generated by the
write process.  Appropriate user documentation for this command has
been added to the user guide as well.

The algorithm presently makes a relatively naive comparison.  Some chips
that use ECC may not verify correctly using this implementation, but the
new documentation provides details about this limitation.
2009-11-16 01:38:19 -08:00
Zachary T Welch da4cb3c029 Add FILEIO_NONE access mode.
In some cases, the FILEIO_NONE access mode may be useful as a parameter
to indicate that file access should be disabled.  High-level routines can
use it to skip file access calls, as 'fileio_open' will fail presently
if called to open a file using this mode.
2009-11-16 01:38:19 -08:00
Zachary T Welch 51cd370b39 Use nand_fileio_* in write/dump commands.
This patch eliminates duplicated code in the the NAND 'dump' and 'write'
by using the new static helper functions.

These changes also fix a possible memory leak in nand dump command, in
the case that the dump file failed to open.

Overall, the changes should be functionally equivalent, but the
resulting code will be easier to improve and extend further.
2009-11-16 01:38:19 -08:00
Zachary T Welch 23cc85b307 Add nand_fileio_* helper APIs.
This patch provides helpers APIs that will eliminate duplicated code in
the the NAND 'dump' and 'write' commands by factoring their common code
into static helper functions.  These helpers may be useful for creating
new commands, as shown in the final patch to 'verify' flash from a file.

Several previously unreported error conditions now generate messages and
propogate the return codes, such as when the file fails to open and bad
arguments are given.  These changes will fix a possible memory leak in
nand dump command, in the case that the dump file failed to open.

Overall, the changes should be functionally equivalent, but the
resulting code will be easier to improve and extend consistently.
2009-11-16 01:38:19 -08:00
Zachary T Welch 45527ee82c binarybuffer: add API documentation
Adds Doxygen documentation for a number of the binarybuffer APIs,
including "unexpected" behavior exposed during review on the list.
2009-11-16 01:25:47 -08:00
Zachary T Welch d6348d4316 improve inline binarybuffer helpers
Use void*, unsigned, and bool types with inline helpers.
2009-11-16 00:46:34 -08:00
Zachary T Welch 21b452cf67 improve buf_set_buf helper
Use void * and unsigned types for buffer and their sizes.
Allows it to be used with more than uint8_t * without casts.
2009-11-16 00:46:34 -08:00
Zachary T Welch d8d8c5d8c3 improve buf_set_ones
Use memset instead of loop. Improve types, using void * and unsigned.
2009-11-16 00:46:34 -08:00
Zachary T Welch d09e308130 improve buf_cpy helper
Use memcpy for bulk of copy, improve final byte handling.
Improve types by using void * for buffers and unsigned for size.
2009-11-16 00:46:34 -08:00
Zachary T Welch e4ee891759 improve buf_cmp and buf_cmp_mask helpers
Rewrite buf_cmp to use memcpy for bulk of comparison.  Add static
helper to perform comparison of trailing byte, which uses another
static helper to perform a maksed comparison.  The masked comparison
helper is used by the buf_cmp_mask to simplify its loop.
Improve types to use void *, unsigned, and return bool.
2009-11-16 00:46:33 -08:00
Zachary T Welch d50caa97d1 improve str_to_buf and buf_to_str helpers
Improve types: use void * and unsigned.  Move all variables to point of
first use.  Move radix guessing logic to new str_radix_guess helper.
2009-11-16 00:46:33 -08:00
Zachary T Welch 5a43bd2e18 binarybuffer: move variables to point of first use
Reduce some noise from subsequent patches.
2009-11-16 00:46:33 -08:00
Zachary T Welch 82fc2f9628 binarybuffer: fix whitespace related issues
Add inter-operator whitespace.  Improve existing documentation.
2009-11-16 00:46:33 -08:00
David Brownell b695cb7522 #include "target.h" less wildly
Don't include "target.h" from more headers than necessary.  This
avoids needless interdependencies and duplicated include paths.

Don't needlessly include it in source files, either.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 00:35:24 -08:00
David Brownell 8193f17c3a target: no implicit #includes of "register.h"
Same deal:  "register.h" got needlessly included all over the
place because of being in a few widely included headers.

So take it out of the header files which included it, and put
it in files which use it ... reduce needless interdependencies.

Also, don't need that extra "types.h" inclusion.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 00:35:14 -08:00
David Brownell 1186f7efa7 target: less implicit inclusion of "command.h"
Lots of files still include it, often through needless
duplicate inclusion of "log.h"; sigh.

This cleans up the inclusion graph a bunch, so there are
fewer inclusion paths, but it doesn't change much otherwise.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 00:35:11 -08:00
David Brownell db094c2e60 target: don't implicitly include "algorithm.h"
Most files in the tree seem to have ended up including this,
and *quite* needlessly ... only code implementing or using
downloadable algorithms actually needs these declarations.

So take it out of the header files which included it, and put
it in files which use it ... reduce needless interdependencies.

Also: "algorithm.h" doesn't need to include "types.h" again;
it already comes from a different header.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 00:35:05 -08:00
David Brownell aa7c449600 target: don't implicitly include "breakpoint.h"
Most files in the tree seem to have ended up including this,
and *quite* needlessly ... only code implementing or using
breakpoints actually needs these declarations.

So take it out of the header files which included it, and put
it in files which use it ... reduce needless interdependencies.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16 00:34:57 -08:00
David Brownell 5d1a9033ab ARM11: use now-generic memory utils
Now the ARM11 cores can use the renamed arm_checksum_memory()
and arm_blank_check_memory() routines ... do so.

Sanity checked with "flash erase_check" of both NOR banks on an
OMAP2420 ... the algorithm code dumped four lines of of "poll"
status after each of almost 520 blocks (yes, *very* annoying) but
gave plausible results after producing that spam.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-15 10:35:47 -08:00
David Brownell 2280ddeea5 ARM11: fixup method table
Three changes:  remove ARM11_HANDLER() in favor of normal structure
initialization syntax; fix goofy indentation in that structure; and
don't needlessly export arm11_register_commands(), it's only called
through that method table.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-15 10:35:41 -08:00
David Brownell 269040bbad ARM: memory utils aren't ARM7/ARM9 dependent
The arm7_9_checksum_memory() and arm7_9_blank_check_memory()
routines are not actually specific to the ARM7 and ARM9 core
generations ... they can work for any core which can run
algorithms using basic ARM (not Thumb) instructions.

Rename them; move the declarations to a more generic site;
likewise move the code (and tidy it a bit in the process).

NOTE:  the blank_check() method falsely returned a success
status (0) on one error path, when the algorithm failed.
Fixed this bug.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-15 10:35:34 -08:00
David Brownell 9ac7cdec82 target: make "examined" flag be per-target
Previously this flag was stored in "target_type", so that for example
if there were two ARM7TDMI targets in a scan chain, both would claim
to have been examined although only the first one actually had its
examine() method called.

Move this state to where it should have been in the first place, and
hide a method that didn't need exposure ... the flag is write-once.

Provide some doxygen.  The examine() method is confusing, since it
isn't separating one-time setup from the after-each-reset stuff.  And
the ARM7/ARM9 version is, somewhat undesirably, not leaving the debug
state alone after reset ... probably more of an issue for trace setup
than for watchpoints and breakpoints.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-15 10:35:25 -08:00
Zachary T Welch f30136603e arm-jtag-ew,jlink: switch to COMMAND_HANDLER
These drivers were overlooked during the recent upgrade.  Convert them,
moving their registration routines to eliminate their declarations.
2009-11-15 09:12:44 -08:00
Zachary T Welch 6731968873 rlink: fix overzealous sed
Fix an instance where my cleanup when awry.
2009-11-15 09:11:29 -08:00
Zachary T Welch a502676df7 remove unused arm_jtag_buf_to_* helpers
Removes unused arm_jtag_buf_* helpers from arm_jtag.[ch].  These could
reappear if patches are provided to conver the tree to use them, but
this code should not be in the master tree until that series is ready.
2009-11-14 18:21:02 -08:00
Zachary T Welch bc07ee82fb remove unused buf_to_u32_handler
Purge an unused routine from the tree and remove a layering violation.
If this code is needed, it should reappear somwhere in src/jtag/,
where struct scan_field gets defined.
2009-11-14 18:21:02 -08:00
Zachary T Welch 4d4b2958a5 struct scan_field_s -> struct scan_field
Remove obsolete suffix from struct scan_field.  Somehow, these
definitions did not get updated but did not cause any errors.
2009-11-14 18:21:02 -08:00
Krzysztof Dziuba c2edc7908f Fix for md* commands, similar to mw*. 2009-11-14 17:39:27 -08:00
David Brownell ecc659d44d lpc2900.h -- remove from Makefile.am too
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-14 14:58:14 -08:00
David Brownell dd47bba6f8 flash: remove needless lpc2900.h header
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-14 14:53:19 -08:00
David Brownell 7f48f463a1 remove annoying $URL$ startup message
It's completely unused; the obnoxious "DANGER!!!" comments
don't even explain what it was doing (shorthand SVN magic).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-14 12:42:50 -08:00
Dean Glazeski c93ae60bce Invalid command syntax errors with MWW.
This fixes an issue due to the new command handler syntax caused by the mw handler playing with the args pointer before
using the CMD_NAME macro.  Fix is to move this call above the lines changing args.
2009-11-14 10:58:35 -08:00
Zachary T Welch 4088b1e622 add openocd.h for top-level declarations
Create src/openocd.h to hold declarations previously made internally
by src/main.c and src/server/server.c.  This ensures all functions
are verified to be in-sync at compile time (rather than at link),
making it easier to track down bugs.
2009-11-14 07:29:16 -08:00
Ferdinand Postema ab3bdfb2cb compile with cygwin (32-bit)
Changed some printf format strings..

[dbrownell@users.sourceforge.net: shrink lines, fix indents]

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-14 02:22:37 -08:00
David Brownell ecab0cfe25 ARM11: ETM + ETB support
Kick in ETM (and ETB) support for ARM11.  Tested on OMAP 2420,
so update that configuration.  (That's an ARM1136ejs, ETB,
OpenGL ES1.1, C55x DSP, etc.)

Also update the other ARM11 ETM + ETB targets in the tree
to set up these modules.  (Not tested.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13 16:58:14 -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 aafb916bea ARM7/ARM9: use shared examine() method
No point in having two identical examine methods for the
ARM7TDMI and ARM9TDMI drivers; move, rename, shrink, share.

Add a bit of doxygen; stop needlessly exporting a method.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13 16:26:39 -08:00
David Brownell 78c6b922e2 ETM: simplify ETM initialization code paths
Return NULL from etm_build_reg_cache() not ERROR_OK; and share
code on that fault path.

Let ETM code handle any tracking of its cache -- not callers.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13 16:26:39 -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
David Brownell 04b514707f target: remove unused "bitfield" infrastructure
We have too many different registers, and too many version and
context dependent interpretations, for this type of bitfield
management to be scalable.

(Anyone who really wants bitfield interpretation *can* do that
in Tcl code...)

There are ... quite a few copies of the same ARM dummy registers.
There should eventually be one copy; this many is craziness.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13 16:22:36 -08:00
David Brownell afe0298399 ARM7/9: rm arm7_9_get_arch_pointers()
Remove the last external user of arm7_9_get_arch_pointers(), and
that annoying downcast utility.  Add an is_arm7_9() predicate.

Stop returning specious success codes on various failure paths
in the ARM7/ARM9 commands which used that downcast utility.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13 13:44:50 -08:00
Zachary T Welch ef746e27c5 command_t -> struct command
Remove misleading typedef and redundant suffix from struct command.
2009-11-13 13:30:50 -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 d16968e24f remove rlink structure typedefs
Remove useless typedefs from the rlink driver.  Improve whitespace.
2009-11-13 12:19:39 -08:00
Zachary T Welch 96b62996d2 flash_bank_t -> struct flash_bank
Remove misleading typedef and redundant suffix from struct flash_bank.
2009-11-13 11:58:14 -08:00
Zachary T Welch 2f6e56e383 nand_device_t -> struct nand_device
Remove misleading typedef and redundant suffix from struct nand_device.
2009-11-13 11:58:14 -08:00
Zachary T Welch 0f1163e823 target_t -> struct target
Remove misleading typedef and redundant suffix from struct target.
2009-11-13 11:58:14 -08:00
Zachary T Welch d0dee7ccaf reg_t -> struct reg
Remove misleading typedef and redundant suffix from struct reg.
2009-11-13 11:58:13 -08:00
Zachary T Welch ac927559c3 target_type_t -> struct target_type
Remove misleading typedef and redundant suffix from struct target_type.
2009-11-13 11:58:13 -08:00
Zachary T Welch d64a873db4 improve mips32_pracc_context
Use struct mips32_pracc_context instead of a typedef.
2009-11-13 11:58:13 -08:00
Zachary T Welch dfecfd5fd4 image_t -> struct image
Remove misleading typedef and redundant suffix from struct image.

Also removes the typedef from enum image_type, as it is used in
image.h only.
2009-11-13 11:58:13 -08:00
Zachary T Welch af949b2531 armv4_5_common_t -> struct arm
Remove misleading typedef and just use struct arm.
2009-11-13 11:58:13 -08:00
Zachary T Welch d0c19e0a9d etm_context_t -> struct etm_context
Remove misleading typedef and redundant suffix from struct etm_context.
2009-11-13 11:58:13 -08:00
Zachary T Welch 6421c2075c etb_t -> struct etb
Remove misleading typedef and redundant suffix from struct etb.
2009-11-13 11:58:13 -08:00
Zachary T Welch 4952eadd8f trace_t -> struct trace
Remove misleading typedef and redundant suffix from struct trace.
2009-11-13 11:58:13 -08:00
Zachary T Welch d90063ffc5 image_elf_t -> struct image_elf
Remove misleading typedef and redundant suffix from struct image_elf.
2009-11-13 11:58:13 -08:00
Zachary T Welch 2ec440588f cortex_m3_dwt_comparator_t -> struct cortex_m3_dwt_comparator
Remove misleading typedef and redundant suffix from struct cortex_m3_dwt_comparator.
2009-11-13 11:58:13 -08:00
Zachary T Welch cdd2d9c2d0 cortex_m3_fp_comparator_t -> struct cortex_m3_fp_comparator
Remove misleading typedef and redundant suffix from struct cortex_m3_fp_comparator.
2009-11-13 11:58:13 -08:00
Zachary T Welch d727f97889 cortex_a8_wrp_t -> struct cortex_a8_wrp
Remove misleading typedef and redundant suffix from struct cortex_a8_wrp.
2009-11-13 11:58:13 -08:00
Zachary T Welch 42fb6b8876 cortex_a8_brp_t -> struct cortex_a8_brp
Remove misleading typedef and redundant suffix from struct cortex_a8_brp.
2009-11-13 11:58:13 -08:00
Zachary T Welch 53c05c8b1d breakpoint_t -> struct breakpoint
Remove misleading typedef and redundant suffix from struct breakpoint.
2009-11-13 11:58:13 -08:00
Zachary T Welch 1e51cf049c xscale_trace_t -> struct xscale_trace
Remove misleading typedef and redundant suffix from struct xscale_trace.
2009-11-13 11:58:13 -08:00
Zachary T Welch e76d085603 xscale_trace_entry_t -> struct xscale_trace_entry
Remove misleading typedef and redundant suffix from struct xscale_trace_entry.
2009-11-13 11:58:13 -08:00
Zachary T Welch abd7b40408 target_event_action_t -> struct target_event_action
Remove misleading typedef and redundant suffix from struct target_event_action.
2009-11-13 11:58:13 -08:00
Zachary T Welch 55edfdf2ab arm_instruction_t -> struct arm_instruction
Remove misleading typedef and redundant suffix from struct arm_instruction.
2009-11-13 11:58:12 -08:00
Zachary T Welch 22f6a4cef5 arm9tdmi_vector_t -> struct arm9tdmi_vector
Remove misleading typedef and redundant suffix from struct arm9tdmi_vector.

Renames enum arm9tdmi_vector as enum arm9tdmi_vector_bit.
2009-11-13 11:58:12 -08:00
Zachary T Welch 18475360b2 xscale_reg_t -> struct xscale_reg
Remove misleading typedef and redundant suffix from struct xscale_reg.
2009-11-13 11:58:12 -08:00
Zachary T Welch 1f87cf4e80 xscale_common_t -> struct xscale_common
Remove misleading typedef and redundant suffix from struct xscale_common.
2009-11-13 11:58:12 -08:00
Zachary T Welch ea34dc988f xscale_trace_data_t -> struct xscale_trace_data
Remove misleading typedef and redundant suffix from struct xscale_trace_data.
2009-11-13 11:58:12 -08:00
Zachary T Welch 73ad5cbb1a trace_point_t -> struct trace_point
Remove misleading typedef and redundant suffix from struct trace_point.
2009-11-13 11:58:12 -08:00
Zachary T Welch 151347585a debug_msg_receiver_t -> struct debug_msg_receiver
Remove misleading typedef and redundant suffix from struct debug_msg_receiver.
2009-11-13 11:58:12 -08:00
Zachary T Welch 93459582fd target_timer_callback_t -> struct target_timer_callback
Remove misleading typedef and redundant suffix from struct target_timer_callback.
2009-11-13 11:58:12 -08:00
Zachary T Welch 2d5767201b target_event_callback_t -> struct target_event_callback
Remove misleading typedef and redundant suffix from struct target_event_callback.
2009-11-13 11:58:12 -08:00
Zachary T Welch 46fc1d57ac working_area_t -> struct working_area
Remove misleading typedef and redundant suffix from struct working_area.
2009-11-13 11:58:12 -08:00
Zachary T Welch c2b5d8a6fa reg_arch_type_t -> struct reg_arch_type
Remove misleading typedef and redundant suffix from struct reg_arch_type.
2009-11-13 11:58:12 -08:00
Zachary T Welch 74d09617b9 reg_cache_t -> struct reg_cache
Remove misleading typedef and redundant suffix from struct reg_cache.
2009-11-13 11:58:12 -08:00
Zachary T Welch de3fb2f3bc bitfield_desc_t -> struct bitfield_desc
Remove misleading typedef and redundant suffix from struct bitfield_desc.
2009-11-13 11:58:12 -08:00
Zachary T Welch f4e03e3b90 oocd_trace_t -> struct oocd_trace
Remove misleading typedef and redundant suffix from struct oocd_trace.
2009-11-13 11:58:12 -08:00
Zachary T Welch b87f07110a mips_m4k_common_t -> struct mips_m4k_common
Remove misleading typedef and redundant suffix from struct mips_m4k_common.
2009-11-13 11:58:12 -08:00
Zachary T Welch a8141cafde mips_ejtag_t -> struct mips_ejtag
Remove misleading typedef and redundant suffix from struct mips_ejtag.
2009-11-13 11:58:11 -08:00
Zachary T Welch ccde06a08f mips32_core_reg_t -> struct mips32_core_reg
Remove misleading typedef and redundant suffix from struct mips32_core_reg.
2009-11-13 11:58:11 -08:00
Zachary T Welch 3b7aee21b5 mips32_common_t -> struct mips32_common
Remove misleading typedef and redundant suffix from struct mips32_common.
2009-11-13 11:58:11 -08:00
Zachary T Welch 1bd7a78d92 mips32_comparator_t -> struct mips32_comparator
Remove misleading typedef and redundant suffix from struct mips32_comparator.
2009-11-13 11:58:11 -08:00
Zachary T Welch ef36a7fb3b image_mot_t -> struct image_mot
Remove misleading typedef and redundant suffix from struct image_mot.
2009-11-13 11:58:11 -08:00
Zachary T Welch b154972bdb image_memory_t -> struct image_memory
Remove misleading typedef and redundant suffix from struct image_memory.
2009-11-13 11:58:11 -08:00
Zachary T Welch 1a4ff43a7c image_ihex_t -> struct image_ihex
Remove misleading typedef and redundant suffix from struct image_ihex.
2009-11-13 11:58:11 -08:00
Zachary T Welch a87faf5b66 image_binary_t -> struct image_binary
Remove misleading typedef and redundant suffix from struct image_binary.
2009-11-13 11:58:11 -08:00
Zachary T Welch 24df46d067 image_section_t -> struct image_section
Remove misleading typedef and redundant suffix from struct image_section.
2009-11-13 11:58:11 -08:00
Zachary T Welch 99614219ad etmv1_trace_data_t -> struct etmv1_trace_data
Remove misleading typedef and redundant suffix from struct etmv1_trace_data.
2009-11-13 11:58:11 -08:00
Zachary T Welch e2001ba211 etm_capture_driver_t -> struct etm_capture_driver
Remove misleading typedef and redundant suffix from struct etm_capture_driver.
2009-11-13 11:58:11 -08:00
Zachary T Welch 63242c6d45 etm_reg_t -> struct etm_reg
Remove misleading typedef and redundant suffix from struct etm_reg.
2009-11-13 11:58:11 -08:00
Zachary T Welch 01f9dc18fc etb_reg_t -> struct etb_reg
Remove misleading typedef and redundant suffix from struct etb_reg.
2009-11-13 11:58:11 -08:00
Zachary T Welch 2f7fc2921d embeddedice_reg_t -> struct embeddedice_reg
Remove misleading typedef and redundant suffix from struct embeddedice_reg.
2009-11-13 11:58:11 -08:00
Zachary T Welch 26a99ed740 cortex_m3_common_t -> struct cortex_m3_common
Remove misleading typedef and redundant suffix from struct cortex_m3_common.
2009-11-13 11:58:11 -08:00
Zachary T Welch a1971ecacf cortex_a8_common_t -> struct cortex_a8_common
Remove misleading typedef and redundant suffix from struct cortex_a8_common.
2009-11-13 11:58:11 -08:00
Zachary T Welch 72b421418f watchpoint_t -> struct watchpoint
Remove misleading typedef and redundant suffix from struct watchpoint.
2009-11-13 11:58:11 -08:00
Zachary T Welch e7f65c5a11 avr_common_t -> struct avr_common
Remove misleading typedef and redundant suffix from struct avr_common.
2009-11-13 11:58:10 -08:00
Zachary T Welch 4bc80e5a65 mcu_jtag_t -> struct mcu_jtag
Remove misleading typedef and redundant suffix from struct mcu_jtag.
2009-11-13 11:58:10 -08:00
Zachary T Welch 94f5ed90f1 armv7m_core_reg_t -> struct armv7m_core_reg
Remove misleading typedef and redundant suffix from struct armv7m_core_reg.
2009-11-13 11:58:10 -08:00
Zachary T Welch 5e43565ab5 armv7m_algorithm_t -> struct armv7m_algorithm
Remove misleading typedef and redundant suffix from struct armv7m_algorithm.
2009-11-13 11:58:10 -08:00
Zachary T Welch e8a6e3b2f4 armv7m_common_t -> struct armv7m_common
Remove misleading typedef and redundant suffix from struct armv7m_common.
2009-11-13 11:58:10 -08:00
Zachary T Welch 2744a031cb armv7a_core_reg_t -> struct armv7a_core_reg
Remove misleading typedef and redundant suffix from struct armv7a_core_reg.
2009-11-13 11:58:10 -08:00
Zachary T Welch 5415d07139 armv7a_algorithm_t -> struct armv7a_algorithm
Remove misleading typedef and redundant suffix from struct armv7a_algorithm.
2009-11-13 11:58:10 -08:00
Zachary T Welch 248448ee3a armv7a_common_t -> struct armv7a_common
Remove misleading typedef and redundant suffix from struct armv7a_common.
2009-11-13 11:58:10 -08:00
Zachary T Welch f6dae0cf84 armv4_5_mmu_common_t -> struct armv4_5_mmu_common
Remove misleading typedef and redundant suffix from struct armv4_5_mmu_common.
2009-11-13 11:58:10 -08:00
Zachary T Welch 405a5df786 armv4_5_cache_common_t -> struct armv4_5_cache_common
Remove misleading typedef and redundant suffix from struct armv4_5_cache_common.
2009-11-13 11:58:10 -08:00
Zachary T Welch e976786d55 armv4_5_cachesize_t -> struct armv4_5_cachesize
Remove misleading typedef and redundant suffix from struct armv4_5_cachesize.
2009-11-13 11:58:10 -08:00
Zachary T Welch 2dd9c5e1da armv4_5_core_reg_t -> struct armv4_5_core_reg
Remove misleading typedef and redundant suffix from struct armv4_5_core_reg.
2009-11-13 11:58:10 -08:00
Zachary T Welch 15e8e45308 armv4_5_algorithm_t -> struct armv4_5_algorithm
Remove misleading typedef and redundant suffix from struct armv4_5_algorithm.
2009-11-13 11:58:10 -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 c25e00b528 arm_load_store_multiple_instr_t -> struct arm_load_store_multiple_instr
Remove misleading typedef and redundant suffix from struct arm_load_store_multiple_instr.
2009-11-13 11:58:10 -08:00
Zachary T Welch 7de3c44320 arm_load_store_instr_t -> struct arm_load_store_instr
Remove misleading typedef and redundant suffix from struct arm_load_store_instr.
2009-11-13 11:58:10 -08:00
Zachary T Welch f9e091a2d3 arm_data_proc_instr_t -> struct arm_data_proc_instr
Remove misleading typedef and redundant suffix from struct arm_data_proc_instr.
2009-11-13 11:58:10 -08:00
Zachary T Welch 67f2f83937 arm_b_bl_bx_blx_instr_t -> struct arm_b_bl_bx_blx_instr
Remove misleading typedef and redundant suffix from struct arm_b_bl_bx_blx_instr.
2009-11-13 11:58:09 -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 6ba48a1b44 swjdp_reg_t -> struct swjdp_reg
Remove misleading typedef and redundant suffix from struct swjdp_reg.
2009-11-13 11:58:09 -08:00
Zachary T Welch 785115a6a0 arm9tdmi_common_t -> struct arm9tdmi_common
Remove misleading typedef and redundant suffix from struct arm9tdmi_common.
2009-11-13 11:58:09 -08:00
Zachary T Welch 1ad4ee2deb arm966e_common_t -> struct arm966e_common
Remove misleading typedef and redundant suffix from struct arm966e_common.
2009-11-13 11:58:09 -08:00
Zachary T Welch 5f68f45186 arm926ejs_common_t -> struct arm926ejs_common
Remove misleading typedef and redundant suffix from struct arm926ejs_common.
2009-11-13 11:58:09 -08:00
Zachary T Welch 16487e7085 arm920t_tlb_entry_t -> struct arm920t_tlb_entry
Remove misleading typedef and redundant suffix from struct arm920t_tlb_entry.
2009-11-13 11:58:09 -08:00
Zachary T Welch b174a0d75e arm920t_cache_line_t -> struct arm920t_cache_line
Remove misleading typedef and redundant suffix from struct arm920t_cache_line.
2009-11-13 11:58:09 -08:00
Zachary T Welch 8e77975b92 arm7tdmi_common_t -> struct arm7tdmi_common
Remove misleading typedef and redundant suffix from struct arm7tdmi_common.
2009-11-13 11:58:09 -08:00
Zachary T Welch 8012b3963f arm7_9_common_t -> struct arm7_9_common
Remove misleading typedef and redundant suffix from struct arm7_9_common.
2009-11-13 11:58:09 -08:00
Zachary T Welch bcb18b2044 arm720t_common_t -> struct arm720t_common
Remove misleading typedef and redundant suffix from struct arm720t_common.
2009-11-13 11:58:09 -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 3bcd9ad9d0 arm11_reg_state_t -> struct arm11_reg_state
Remove misleading typedef and redundant suffix from struct arm11_reg_state.
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 0eae94879d arm11_reg_defs_t -> struct arm11_reg_defs
Remove misleading typedef and redundant suffix from struct arm11_reg_defs.
2009-11-13 11:58:09 -08:00
Zachary T Welch b1de5eb9a0 reg_param_t -> struct reg_param
Remove misleading typedef and redundant suffix from struct reg_param.
2009-11-13 11:58:09 -08:00
Zachary T Welch 6c965a3da9 mem_param_t -> struct mem_param
Remove misleading typedef and redundant suffix from struct mem_param.
2009-11-13 11:58:09 -08:00
Zachary T Welch 996613522d arm920t_common_t -> struct arm920t_common
Remove misleading typedef and redundant suffix from struct arm920t_common.
2009-11-13 11:58:08 -08:00
Zachary T Welch 52bc6cad87 arm11_register_history_t -> struct arm11_register_history
Remove misleading typedef and redundant suffix from struct arm11_register_history.
2009-11-13 11:58:08 -08:00
Zachary T Welch ea49f2e3ff remove typedef keyword from svf structures
Removes all misleading typedef keywords from structures in svf.c.
2009-11-13 11:58:08 -08:00
Zachary T Welch 95bf461c0a pld_device_t -> struct pld_device
Remove misleading typedef and redundant suffix from struct pld_device.
2009-11-13 11:58:08 -08:00
Zachary T Welch db08ab8a79 virtex2_pld_device_t -> struct virtex2_pld_device
Remove misleading typedef and redundant suffix from struct virtex2_pld_device.
2009-11-13 11:58:08 -08:00
Zachary T Welch cd4c059806 xilinx_bit_file_t -> struct xilinx_bit_file
Remove misleading typedef and redundant suffix from struct xilinx_bit_file.
2009-11-13 11:58:08 -08:00
Zachary T Welch db2086897a pld_driver_t -> struct pld_driver
Remove misleading typedef and redundant suffix from struct pld_driver.
2009-11-13 11:58:08 -08:00
Zachary T Welch 38d826cec1 connection_t -> struct connection
Remove misleading typedef and redundant suffix from struct connection.
2009-11-13 11:58:08 -08:00
Zachary T Welch f7cd2aa0ef telnet_connection_t -> struct telnet_connection
Remove misleading typedef and redundant suffix from struct telnet_connection.
2009-11-13 11:58:08 -08:00
Zachary T Welch f2cbaba3cc tcl_connection_t -> struct tcl_connection
Remove misleading typedef and redundant suffix from struct tcl_connection.
2009-11-13 11:58:08 -08:00
Zachary T Welch 8775a0f663 service_t -> struct service
Remove misleading typedef and redundant suffix from struct service.
2009-11-13 11:58:08 -08:00
Zachary T Welch e01a0be576 telnet_service_t -> struct telnet_service
Remove misleading typedef and redundant suffix from struct telnet_service.
2009-11-13 11:58:08 -08:00
Zachary T Welch 45a165a432 gdb_service_t -> struct gdb_service
Remove misleading typedef and redundant suffix from struct gdb_service.
2009-11-13 11:58:08 -08:00
Zachary T Welch 53bfd73591 gdb_connection_t -> struct gdb_connection
Remove misleading typedef and redundant suffix from struct gdb_connection.
2009-11-13 11:58:08 -08:00
Zachary T Welch 43483e5054 remove unused aduc702x structure.
The ADUC702x_FLASH_MMIO structure was completely used, so it must die.
2009-11-13 11:58:08 -08:00
Zachary T Welch a03c9a8dce aduc702x_flash_bank_t -> struct aduc702x_flash_bank
Remove misleading typedef and redundant suffix from struct
aduc702x_flash_bank.
2009-11-13 11:58:08 -08:00
Zachary T Welch 6a374afe71 tms470_flash_bank_t -> struct tms470_flash_bank
Remove misleading typedef and redundant suffix from struct tms470_flash_bank.
2009-11-13 11:58:08 -08:00
Zachary T Welch 3c9afaa645 pic32mx_mem_layout_t -> struct pic32mx_mem_layout
Remove misleading typedef and redundant suffix from struct pic32mx_mem_layout.
2009-11-13 11:58:08 -08:00
Zachary T Welch 54be77bc79 non_cfi_t -> struct non_cfi
Remove misleading typedef and redundant suffix from struct non_cfi.
2009-11-13 11:58:08 -08:00
Zachary T Welch d0dfec33b6 nand_block_t -> struct nand_block
Remove misleading typedef and redundant suffix from struct nand_block.
2009-11-13 11:58:07 -08:00
Zachary T Welch 92fc7a6fde str9xpec_flash_controller_t -> struct str9xpec_flash_controller
Remove misleading typedef and redundant suffix from struct str9xpec_flash_controller.
2009-11-13 11:58:07 -08:00
Zachary T Welch 6aa82891b6 str9x_flash_bank_t -> struct str9x_flash_bank
Remove misleading typedef and redundant suffix from struct str9x_flash_bank.
2009-11-13 11:58:07 -08:00
Zachary T Welch 774d71f2cf str7x_mem_layout_t -> struct str7x_mem_layout
Remove misleading typedef and redundant suffix from struct str7x_mem_layout.
2009-11-13 11:58:07 -08:00
Zachary T Welch 3b09560ae8 str7x_flash_bank_t -> struct str7x_flash_bank
Remove misleading typedef and redundant suffix from struct str7x_flash_bank.
2009-11-13 11:58:07 -08:00
Zachary T Welch 01b10d65bf stm32x_mem_layout_t -> struct stm32x_mem_layout
Remove misleading typedef and redundant suffix from struct stm32x_mem_layout.
2009-11-13 11:58:07 -08:00
Zachary T Welch c7b2cad52d stm32x_flash_bank_t -> struct stm32x_flash_bank
Remove misleading typedef and redundant suffix from struct stm32x_flash_bank.
2009-11-13 11:58:07 -08:00
Zachary T Welch 40273967bf stm32x_options_t -> struct stm32x_options
Remove misleading typedef and redundant suffix from struct stm32x_options.
2009-11-13 11:58:07 -08:00
Zachary T Welch 9059f9f28e stellaris_flash_bank_t -> struct stellaris_flash_bank
Remove misleading typedef and redundant suffix from struct stellaris_flash_bank.
2009-11-13 11:58:07 -08:00
Zachary T Welch ed9c4ef3c4 s3c24xx_nand_controller_t -> struct s3c24xx_nand_controller
Remove misleading typedef and redundant suffix from struct s3c24xx_nand_controller.
2009-11-13 11:58:07 -08:00
Zachary T Welch eba5608b52 pic32mx_flash_bank_t -> struct pic32mx_flash_bank
Remove misleading typedef and redundant suffix from struct pic32mx_flash_bank.
2009-11-13 11:58:07 -08:00
Zachary T Welch 5948e66ee8 orion_nand_controller_t -> struct orion_nand_controller
Remove misleading typedef and redundant suffix from struct orion_nand_controller.
2009-11-13 11:58:07 -08:00
Zachary T Welch c7b96a4dc1 ocl_priv_t -> struct ocl_priv
Remove misleading typedef and redundant suffix from struct ocl_priv.
2009-11-13 11:58:07 -08:00
Zachary T Welch 958ff04b08 nand_info_t -> struct nand_info
Remove misleading typedef and redundant suffix from struct nand_info.
2009-11-13 11:58:07 -08:00
Zachary T Welch f7ca047213 nand_manufacturer_t -> struct nand_manufacturer
Remove misleading typedef and redundant suffix from struct nand_manufacturer.
2009-11-13 11:58:07 -08:00
Zachary T Welch 8f4860d13f nand_ecclayout_t -> struct nand_ecclayout
Remove misleading typedef and redundant suffix from struct nand_ecclayout.
2009-11-13 11:58:07 -08:00
Zachary T Welch 8605352387 nand_flash_controller_t -> struct nand_flash_controller
Remove misleading typedef and redundant suffix from struct nand_flash_controller.
2009-11-13 11:58:07 -08:00
Zachary T Welch 4bc46d61ca mx3_nf_controller_t -> struct mx3_nf_controller
Remove misleading typedef and redundant suffix from struct mx3_nf_controller.
2009-11-13 11:58:07 -08:00
Zachary T Welch 79338ec6c2 mflash_bank_t -> struct mflash_bank
Remove misleading typedef and redundant suffix from struct mflash_bank.
2009-11-13 11:58:07 -08:00
Zachary T Welch bb6b9988cb mg_drv_info_t -> struct mg_drv_info
Remove misleading typedef and redundant suffix from struct mg_drv_info.
2009-11-13 11:58:07 -08:00
Zachary T Welch fc01dd6a13 mflash_gpio_drv_t -> struct mflash_gpio_drv
Remove misleading typedef and redundant suffix from struct mflash_gpio_drv.
2009-11-13 11:58:06 -08:00
Zachary T Welch a043632a52 mflash_gpio_num_t -> struct mflash_gpio_num
Remove misleading typedef and redundant suffix from struct mflash_gpio_num.
2009-11-13 11:58:06 -08:00
Zachary T Welch ed1aed8dd9 lpc3180_nand_controller_t -> struct lpc3180_nand_controller
Remove misleading typedef and redundant suffix from struct lpc3180_nand_controller.
2009-11-13 11:58:06 -08:00
Zachary T Welch b712a4e8b8 lpc2900_flash_bank_t -> struct lpc2900_flash_bank
Remove misleading typedef and redundant suffix from struct lpc2900_flash_bank.
2009-11-13 11:58:06 -08:00
Zachary T Welch 12f83f0429 lpc288x_flash_bank_t -> struct lpc288x_flash_bank
Remove misleading typedef and redundant suffix from struct lpc288x_flash_bank.
2009-11-13 11:58:06 -08:00
Zachary T Welch a15d4cc75e lpc2000_flash_bank_t -> struct lpc2000_flash_bank
Remove misleading typedef and redundant suffix from struct lpc2000_flash_bank.
2009-11-13 11:58:06 -08:00
Zachary T Welch 632fd663a8 flash_driver_t -> struct flash_driver
Remove misleading typedef and redundant suffix from struct flash_driver.
2009-11-13 11:58:06 -08:00
Zachary T Welch fb59ec739a flash_sector_t -> struct flash_sector
Remove misleading typedef and redundant suffix from struct flash_sector.
2009-11-13 11:58:06 -08:00
Zachary T Welch 98d7ed8523 faux_flash_bank_t -> struct faux_flash_bank
Remove misleading typedef and redundant suffix from struct faux_flash_bank.
2009-11-13 11:58:06 -08:00
Zachary T Welch de1781b7fa ecosflash_flash_bank_t -> struct ecosflash_flash_bank
Remove misleading typedef and redundant suffix from struct ecosflash_flash_bank.
2009-11-13 11:58:06 -08:00
Zachary T Welch 453a103f48 cfi_fixup_t -> struct cfi_fixup
Remove misleading typedef and redundant suffix from struct cfi_fixup.
2009-11-13 11:58:06 -08:00
Zachary T Welch 4c28cc68ed cfi_unlock_addresses_t -> struct cfi_unlock_addresses
Remove misleading typedef and redundant suffix from struct cfi_unlock_addresses.
2009-11-13 11:58:06 -08:00
Zachary T Welch 0139e7d51a cfi_spansion_pri_ext_t -> struct cfi_spansion_pri_ext
Remove misleading typedef and redundant suffix from struct cfi_spansion_pri_ext.
2009-11-13 11:58:06 -08:00
Zachary T Welch 2ded74115d cfi_atmel_pri_ext_t -> struct cfi_atmel_pri_ext
Remove misleading typedef and redundant suffix from struct cfi_atmel_pri_ext.
2009-11-13 11:58:06 -08:00
Zachary T Welch 1f328f2885 cfi_intel_pri_ext_t -> struct cfi_intel_pri_ext
Remove misleading typedef and redundant suffix from struct cfi_intel_pri_ext.
2009-11-13 11:58:06 -08:00
Zachary T Welch 3be0edbc5e cfi_flash_bank_t -> struct cfi_flash_bank
Remove misleading typedef and redundant suffix from struct cfi_flash_bank.
2009-11-13 11:58:06 -08:00
Zachary T Welch a7a8a1c9e2 avrf_flash_bank_t -> struct avrf_flash_bank
Remove misleading typedef and redundant suffix from struct avrf_flash_bank.
2009-11-13 11:58:06 -08:00
Zachary T Welch 6ca63ee756 avrf_type_t -> struct avrf_type
Remove misleading typedef and redundant suffix from struct avrf_type.
2009-11-13 11:58:06 -08:00
Zachary T Welch 3877201581 at91sam7_flash_bank_t -> struct at91sam7_flash_bank
Remove misleading typedef and redundant suffix from struct at91sam7_flash_bank.
2009-11-13 11:58:05 -08:00
Zachary T Welch 246068fd89 jtag_command_t -> struct jtag_command
Remove useless typedef from struct jtag_command.
2009-11-13 11:58:05 -08:00
Zachary T Welch 1053c32d9e jtag_command_container_t -> union jtag_command_container
Remove misleading typedef from union jtag_container.
2009-11-13 11:58:05 -08:00
Zachary T Welch 22b220ad7f sleep_command_t -> struct sleep_command
Remove misleading typedef from struct sleep_command.
2009-11-13 11:58:05 -08:00
Zachary T Welch cf2e402d71 end_state_command_t -> struct end_state_command
Remove misleading typedef from struct end_state_command.
2009-11-13 11:58:05 -08:00
Zachary T Welch 8cc8c0544f reset_command_t -> struct reset_command
Remove misleading typedef from struct reset_command.
2009-11-13 11:58:05 -08:00
Zachary T Welch 2fecae46f6 stableclocks_command_t -> struct stableclocks_command
Remove misleading typedef from struct stableclocks_command.
2009-11-13 11:58:05 -08:00
Zachary T Welch 5f6d8ecf8c runtest_command_t -> struct runtest_command
Remove misleading typedef from struct runtest_command.
2009-11-13 11:58:05 -08:00
Zachary T Welch c07f0600ff pathmove_command_t -> struct pathmove_command
Remove misleading typedef from struct pathmove_command.
2009-11-13 11:58:05 -08:00
Zachary T Welch af3f4a0bbe statemove_command_t -> struct statemove_command
Remove misleading typedef from struct statemove_command.
2009-11-13 11:58:05 -08:00
Zachary T Welch e11c5a3b42 cmd_queue_page_t -> struct cmd_queue_page
Remove misleading typedef from struct cmd_queue_page.
2009-11-13 11:58:05 -08:00
Zachary T Welch 2ddeec9db5 scan_command_t -> struct scan_command
Remove misleading typedef on struct scan_command.
2009-11-13 11:58:05 -08:00
Zachary T Welch 4a29f8e21d more vsllink typedef cleanup
Remove useless typedef for struct insert_insignification_operation.
2009-11-13 11:58:05 -08:00
Zachary T Welch 7c0ba75eae vsllink_jtag_t -> struct vsllink
Remove misleading typedef and redundant suffix.
2009-11-13 11:58:05 -08:00
Zachary T Welch ffc77b61dd presto_t -> struct presto
Remove useless typedef.
2009-11-13 11:58:05 -08:00
Zachary T Welch a3f1c87eb7 ft2232_device_t -> struct ft2232_device
Remove misleading typedef from ft2232_device; it was barely used.
2009-11-13 11:58:05 -08:00
Zachary T Welch 4bc155398e jlink_jtag_t -> struct jlink
Remove misleading typedef and redundant suffix.
2009-11-13 11:58:05 -08:00
Zachary T Welch 9036fdd589 cable_t -> struct cable
Remove useless typedef and redundant suffix from parport struct cable.
2009-11-13 11:58:05 -08:00
Zachary T Welch e1c26950c0 pending_scan_result_t -> struct pending_scan_result
Remove misleading typedef from struct struct pending_scan_result.
Future patches need to remove these duplicated types and code.
2009-11-13 11:58:04 -08:00
Zachary T Welch 8bbb279c28 armjtagew_jtag_t -> struct armjtagew
Remove useless typedef and redundant suffix from struct armjtatew_jtag.
2009-11-13 11:58:04 -08:00
Zachary T Welch 5874d5f2ea use struct jtag_tap_event_action
Remove useless typedef and redundant suffix from jtag_tap_event_action.
2009-11-13 11:58:04 -08:00
Zachary T Welch 363d72a484 jtag_event_callback_t -> struct jtag_event_callback
Remove useless typedef and redundant suffix from jtag_event_callback.
Add documentation for the structure.
2009-11-13 11:58:04 -08:00
Zachary T Welch 9f535f9af7 jtag_interface_t -> struct jtag_interface
Remove useless typedef and redundant suffix from struct jtag_interface.
2009-11-13 11:58:04 -08:00
Zachary T Welch bee796b5b0 bitbang_interface_t -> struct bitbang_interface
Removes another useless typedef and suffix.
2009-11-13 11:58:04 -08:00
Zachary T Welch c20b779b89 bitq_interface_t -> struct biq_interface
Remove useless typedef and redundant suffix.
2009-11-13 11:58:04 -08:00
Zachary T Welch ff3150922b encapsulate bitq_state structure
Move the bitq_state structure from the header to source file, as it
is used internally.

Also removes its silly typedef.
2009-11-13 11:58:04 -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
Zachary T Welch 9f212b01be fileio_t -> struct fileio
Remove useless structure typedef.
2009-11-13 11:58:04 -08:00
Zachary T Welch f59ec2043b log_callback_t -> struct log_callback
Removes useless and confusing typedef for log callback structure.
Types with _t should be suitable for passing by-value as arguments.
2009-11-13 11:58:04 -08:00
Zachary T Welch 99b57b6dcc remove accidental artifact
Somehow I managed to slip a temporary build file into the tree.
Remove it and update the .gitignore file so it doesn't happen again.
2009-11-13 11:52:53 -08:00
Zachary T Welch 89870c86e7 add src/hello.c to augment new command tutorial
The hello module provides the 'hello' command, printing a greetings
to the command console.  It can grow to serve as pedagogical example
of services that OpenOCD developers should use: a runnable style guide.
2009-11-13 10:57:57 -08:00
Zachary T Welch f973320cbb command_handler_t: make cmd an indirect parameter
This patch removes 'cmd' from the list of direct parameters, moving
that pointer to args[-1] (by way of the new CMD_NAME macro).
2009-11-13 10:56:55 -08:00
Zachary T Welch deede35c27 command_handler_t: make args parameter const
This patch prevents command handlers from modifying the strings passed
in the 'args' array.
2009-11-13 10:55:27 -08:00
Zachary T Welch cc63d6e72b command_handler_t: make cmd parameter const
Prevents the command name from being modified in command handlers.
Again, this has cascading effects, but the patches are fairly minimal.
2009-11-13 10:55:27 -08:00
Zachary T Welch d22270e0ed command_handler_t: make argc unsigned
The number of command arguments will always be 0 or more, so use
the right type in handlers.  This has a cascading effect up through
the layers, but the new COMMAND_HANDLER macros prevented total chaos.
2009-11-13 10:55:27 -08:00
Zachary T Welch a585bdf726 add CMD_NAME macro for command handlers
By introducing the CMD_NAME macro, this parameter may be integrated
as args[-1] in command.[ch], without touching any other call sites.
2009-11-13 10:55:00 -08:00
Zachary T Welch 5b6df55a1e use CALL_COMMAND_HANDLER instead of direct calls
By using CALL_COMMAND_HANDLER, parameters can be reordered, added, or
even removed in inherited signatures, without requiring revisiting
all of the various call sites.
2009-11-13 10:51:46 -08:00
Zachary T Welch 1df5cc18f5 add PLD_DEVICE_COMMAND_HANDLER macro
Update virtex module to use abstracted PLD command handling.
2009-11-13 10:51:46 -08:00
Zachary T Welch 670f999e7a nand: add NAND_DEVICE_COMMAND_HANDLER macro
Abstracts the extended NAND command handling to allow the function
signature to be controlled by __COMMAND_HANDLER.
2009-11-13 10:51:46 -08:00
Zachary T Welch 0796dfff89 use FLASH_BANK_COMMAND_HANDLER macro
Defines all flash_bank_command handlers using the new macro.
2009-11-13 10:51:46 -08:00
Zachary T Welch 57c5c5f463 add FLASH_BANK_COMMAND_HANDLER macro
The FLASH_BANK_COMMAND_HANDLER provides an extended command handler
using the __COMMAND_HANDLER macro, whereby changing that macro is
sufficient to update flash handlers with the new signature.  It also
enforces uniform style and scope when implementing this handler.
2009-11-13 10:51:46 -08:00
Zachary T Welch 76868e0713 s3c24xx: use COMMAND_HANDLER with command helper
Add S3C24XX_DEVICE_COMMAND macros to abstract common command handler
conventions.
2009-11-13 10:51:46 -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 63a26b421b use COMMAND_HELPER for command helper functions
Define the numerous helpers that inherit command handler parameters
using the COMMAND_HELPER macro.
2009-11-13 10:51:45 -08:00
Zachary T Welch cfc4d5c6b7 use COMMAND_HANDLER macro to define all commands 2009-11-13 10:51:45 -08:00
Zachary T Welch ddb6138ed4 add command_handler_t type
This patch adds new typedefs for command handler callback functions.
Users of this type signature were updated to use these new types.
It uses the new __COMMAND_HANDLER macro to prevent duplication.
2009-11-13 10:51:45 -08:00
Zachary T Welch 3f9fd4e2a6 add COMMAND_HANDLER and COMMAND_HELPER macros
The COMMAND_HANDLER and COMMAND_HELPER macros allow commands to be
defined in a manner that decouples them from the exact order and type of
their parameters.  Once converted, incremental changes to the command
handler type can be addressed in incremental patches that do not need to
touch the entire tree.

These macros' implementation, __COMMAND_HANDLER, is used to define the
new command_handler_t type, and additional patches will use it to derive
new macros to define extended command types (e.g. flash, nand, pld).
The CALL_COMMAND_HANDLER provides a means of calling helpers or nested
handlers from withing a command handler.

This patch uses C99 varadic macro expansion.  Please report compilers
that cannot handle this code.
2009-11-13 10:51:45 -08:00
Zachary T Welch 1ae4d93c3c add command_output_handler_t
Add a typedef for command output handler function type, simplifying
the appearance of functions that use it and eliminating duplicate code.
2009-11-13 10:51:45 -08:00
David Brownell 5eb638c71e Cortex-A8: fix indent
The "remove (forward) declarations" patch goofed indentation on the
"cortexa8_target" struct; fix.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13 08:45:20 -08:00
Zachary T Welch e8e94ab245 nand: rename device to nand
To be more informative (and consistent with flash and pld trees), change
'device' parameter name to 'nand' in NAND source files.  This change
eliminates confusing 'device->device->' instance from the code, and
it simplifies the forthcoming command handler patches.
2009-11-12 22:25:55 -08:00
David Brownell d47764ff71 ETM: start support for ETMv2+
ARM11 and newer cores include updated ETM modules.  Recognize
their version codes and some key config differences.  Sanity
checked on an OMAP2, with an ETM11RV r0p1 (ETMv3.1).

This still handles only scan chain 6, with at most 128 registers.
Newer cores (mostly, Cortex) will need to use the DAP instead.

Note that the newer ETM modules don't quite fit the quirky config
model of the older ones ... having more port widths is easy, but
the modes aren't the same.  That still needs to change.

Fix a curious bug ... how did the register cache NOT get saved??

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-12 20:24:41 -08:00