Commit Graph

2976 Commits (63dc352876259562948b5d814de197ba534897b9)

Author SHA1 Message Date
David Brownell 5f0223423d ARM11: fix warning on amd64
Previous version of JTAG_DEBUG() macro hid this bug.

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

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-28 11:28:17 -08:00
David Brownell acbe054a38 target: uplevel add_{break,watch}point() error checks
In target_type.h it's documented that the target must be
halted for add_breakpoint() ... and with slight ambiguity,
also for its add_watchpoint() sibling.  So rather than
verifying that constraint in the CPU drivers, do it in the
target_add_{break,watch}point() routines.

Add minor paranoia on the remove_*point() paths too:  save
the return value, and print it out in in the LOG_DEBUG message
in case it's nonzero.

Note that with some current cores, like all ARMv7 ones I've
looked at, there's no technical issue preventing watchpoint or
breakpoint add/remove operations on active cores.  This model
seems deeply wired into OpenOCD though.

ALSO:  the ARM targets were fairly "good" about enforcing that
constraint themselves.  The MIPS ones were relied on other code
to catch such stuff, but it's not clear such code existed ...
keep an eye out for new issues on MIPS.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-28 10:40:26 -08:00
David Brownell 68889ea02f target: remove unused TARGET_EVENT_OLD_* symbols
Just two *_OLD_* symbols left...

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-28 10:36:32 -08:00
David Brownell e0cb27df6b Cortex-A8: support "reset-assert" event
Use the new "reset-assert" event; else SRST; else fail.
Tested on an OMAP3, using the event.

NOTE:  still doesn't handle "reset halt".  For some reason
neither VCR nor PRCR seemed effective; they held the value
that was written, but VCR didn't trigger debug entry when
the reset vector fired (maybe the vector needs configuring?)
and PRCR refused to hold the chip in reset until deassert()
could force the core into debug state.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-27 18:50:26 -08:00
David Brownell 4e56a2303b target: groundwork for "reset-assert" event
This defines a "reset-assert" event and a supporting utility
routine, and documents both how targets should implement it
and how config scripts should use it.  Core-specific updates
are needed to make this work.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-27 18:50:20 -08:00
David Brownell 4d2750e571 ARM11: write_memory() avoids increment check
When writing to a chip's "reset yourself" register, the ARM11 code
was reporting a spurious failure.  Just don't bother checking for
correctly incremented pointers given single-unit writes ... it's
a bit faster that way too.  (Reads should likely do the same thing.
For that matter, such checks are usually just a waste...)

Shrink an overlong parameter name, and associated lines'o'code.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-27 18:40:37 -08:00
Zachary T Welch 77aa7ca8d6 fix regression causing duplicated output
The command refactoring caused subcommand handlers to produce duplicate
output when run.  The problem was introduced by failing to ensure all
such invocations went through a top-level "catcher" script, prefixing
the command name with the 'ocd_' prefix and consuming its results.

The fix is to ensure such a top-level "catcher" script gets created
for each top-level command, regardless of whether it has a handler.
Indeed, this patch removes all command registrations for sub-commands,
which would not have worked in the new registration scheme anyway.

For now, dispatch of subcommands continues to be handled by the new
'unknown' command handler, which gets fixed here to strip the 'ocd_'
prefix if searching for the top-level command name fails initially.
Some Jim commands may be registered with this prefix, and that situation
seems to require the current fallback approach.  Otherwise, that prefix
could be stripped unconditionally and the logic made a little simpler.
The same problem must be handled by the 'help' command handler too,
so its lookup process works as intended.

Overall, the command dispatching remains more complicated than desired,
but this patch fixes the immediate regressions.
2009-11-27 14:30:26 -08:00
Øyvind Harboe a0d983ab06 zy1000: keep up with new command registration stuff
jim and classic style commands are both supported.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-27 20:41:06 +01:00
Zachary T Welch 6ce3a299f3 update minidummy interface driver command handling
Changes the interface definition field reference from register_commands
to commands, which allows the module to compile.
2009-11-27 11:11:26 -08:00
Zachary T Welch f31dfffdef fix 'nand info' command
Move device argument parsing after check for number of arguments;
otherwise, calling this command without any arguments would access
argv[0] before checking whether it even existed.
2009-11-27 11:11:26 -08:00
Øyvind Harboe 46ed068bac zy1000: keep up with changes to log_init()
fn's and return value for log_init() changed to void.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-27 19:42:38 +01:00
Øyvind Harboe bd3ef5ca3d minidummy: fix compilation error
during refactoring a search and replace error crept in

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-27 09:10:37 +01:00
Dean Glazeski 2221a03744 ARM NAND I/O header documentation update.
Fixed the header file to properly specify the doxygen documentation for the
items defined in it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-26 23:57:56 -08:00
Dean Glazeski 8f3c728273 ARM NAND I/O documentation update.
This updates the functions in the file to all have doxygen comments
describing what they do.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-26 23:56:58 -08:00
Dean Glazeski 05a5f682c6 ARM NAND I/O refactor code copying.
Created a function for copying code to the working area on
a target.  The NAND write and read functions are updated to
include use of this function.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-26 23:55:40 -08:00
Dean Glazeski ffc704fdeb ARM NAND I/O read function.
Implementation of the NAND read function for ARM NAND I/O that
includes running a local algorithm on a device to increase the
performance of block reads.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-26 23:52:52 -08:00
Dean Glazeski 7c9cd47893 NAND Flash documentation update.
Updated doxygen comments for different interface structures for
the NAND interface.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-26 23:45:41 -08:00
David Brownell fd5f53f035 XScale: add stub {read,write}_phys routines
Just make these fail, instead of letting them write over
potentially random memory.  Users should be able to work
around the lack of real implementations by disbling the
MMU by hand ... until someone provides a Real Fix.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-26 12:00:56 -08:00
Uwe Hermann 1240ae459f fix typos in source files
Correct some spelling errors in source comments and printed output.

Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-26 10:11:26 -08:00
Eric Wetzel 3f8aa3cb03 fix 'flash protect' and 'flash erase_sector'
Command upgrading introduced two off-by-one bugs in the flash commands.
This patch fixes the 'flash {protect,erase_sector}' commands to check
that they have been passed the correct number of arguments.

Ammended during commit to fix help text for 'erase_address' too.
2009-11-26 07:57:51 -08:00
David Brownell 2653b80307 target: create and use target_name()
Several of the sites now using target_type_name() really
ought to be using an instance-specific name.  Create a
function called target_name(), accessing the instance's
own (command) name.

Use it in several places that really should be displaying
instance-specific names.  Also in several places which
were already doing so, but which had no wrapper to call.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-25 16:38:08 -08:00
David Brownell b715a81f5b target: target_get_name() --> target_type_name()
There are two names that may matter on a per-target basis.
One is a per-instance name (for example, "at91sam7s.cpu").
The other is the name of its type (for example, "arm7tdmi"),
which is shared among multiple targets.

Currently target_get_name() returns the type name, which is
misleading and is rarely appropriate for target diagnostics.
Rename that as target_type_name().

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-25 16:38:08 -08:00
David Brownell cc53ad81d3 ARM: minor armv4/armv5 cleanup
Lines of 300+ characters are still bad; debug tweaks.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-25 16:18:22 -08:00
David Brownell 21378f58b6 ARM: comment tweaks in ADIv5
"OptimoDE DESS" is ARM's semicustom DSPish stuff.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-25 16:14:45 -08:00
David Brownell 5d244b85e2 ARM7/9: shrink run_algorithm_inner() lines
300+ characters is unreasonable.  So is half that.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-25 16:11:26 -08:00
Zachary T Welch 4946925bea use ARRAY_SIZE macro
Search and destroy lingering cases where the ARRAY_SIZE macro should
be used to convey more intrinsic meaning in the OpenOCD code.
2009-11-25 10:32:00 -08:00
Zachary T Welch a3d81eed4d support OPENOCD_DEBUG_LEVEL environment setting
Detect the OPENOCD_DEBUG_LEVEL setting in log_init(), allowing the
very early startup phases to be debugged.
2009-11-25 10:29:06 -08:00
Zachary T Welch be482a5335 log: improve initialization
Removes redundant assignment of start_ms from log_register_commands().
Eliminates command_context parameter and return value.
Adds Doxygen comment block for this API call.
2009-11-25 10:29:06 -08:00
Zachary T Welch 9d4c89f37f add 'testee' target type
Alliteration aside, this should provide the final piece of the puzzle
for developers that want to get started writing a new target type.
In this way, it also seeks to complement the 'dummy' interface driver
and 'faux' NOR flash driver.
2009-11-25 10:29:06 -08:00
Zachary T Welch a93b404161 improve command handling examples
Removes hello and foo commands from top-level registration.  Instead,
the dummy interface driver and faux flash driver have been augmented
to register these commands as sub-commands.
2009-11-25 10:29:05 -08:00
Zachary T Welch d89c631014 add script_command_run helper
Eliminates duplicated code in script_command and handle_unknown_command.
Fixes bug with duplicated help output generated by placeholder commands.
2009-11-25 10:29:05 -08:00
Zachary T Welch 9e5d8a94f1 encapsulate and re-use log capture, retval setup
Factors log capture while running script commands, eliminating
duplicated code between script_command and jim_capture.  Factors
setting a command's Jim "retval" into a new helper as well.

Using these new helpers in the new unknown command handler's
fixes possible regressions caused by these bits being missing.
2009-11-25 10:29:05 -08:00
Zachary T Welch 910bb250c4 combine help and usage command handlers
Remove duplicated handler code by checking the running command name.
2009-11-25 10:29:05 -08:00
Zachary T Welch c297a14f70 improve usage and help command output
Rewrite formatting code in C, removing last remenants of TCL help code.
Sinificantly improves the readability by using smarter indent and wrap.
2009-11-24 21:37:37 -08:00
Zachary T Welch 6b066cd170 allow scripts to update usage information
The add_usage_text command uses the same C handler, which was updated
to support its new polymorphic role.  This patch updates the two script
commands that needed this support: 'find' and 'script'.
2009-11-24 21:37:37 -08:00
Zachary T Welch 8f5ff3ddcf httpd: use register_commands()
Updates httpd_start() to use register_commands() for 'readform' and
'writeform' commands.  Adds server/httpd.h to export the new signatures
for this function (and httpd_stop), which allows removing the obsoleted
declarations inside openocd.c.
2009-11-24 21:37:37 -08:00
Zachary T Welch 17a9dea53a add jim_handler to command_registration
Adding jim_handler field to command_registration allows removing the
register_jim helper.  All command registrations now go through the
register_command{,s}() functions.
2009-11-24 21:37:37 -08:00
Zachary T Welch cd7e76ebf0 refactor command_new to use command_registration
Save stack space: use a struct.  Makes it easier to add new parameters.
2009-11-24 21:37:37 -08:00
Zachary T Welch f74e2e033a remove register_commands from etm_capture_driver
Converts callback to an array of command_registration records.
Moves oocd_trace driver definition to end of file to eliminate
useless forward declaration.
2009-11-24 21:37:36 -08:00
Zachary T Welch 66ee303456 remove target_type register_command callback
Uses chaining of command_registration structures to eliminate all
target_type register_callback routines.  Exports the command_handler
registration arrays for those target types that are used by others.
2009-11-24 21:37:36 -08:00
Zachary T Welch 144e3678bd xscale: use register_commands() 2009-11-24 21:37:36 -08:00
Zachary T Welch 8a41656391 trace: use register_commands() 2009-11-24 21:37:36 -08:00
Zachary T Welch 5f6962b34f target_request: use register_commands() 2009-11-24 21:37:36 -08:00
Zachary T Welch 4e67912fb0 target: use register_commands() 2009-11-24 21:37:36 -08:00
Zachary T Welch c3800b5e67 oocd_trace: use register_commands() 2009-11-24 21:37:36 -08:00
Zachary T Welch a17caa387c etm_dummy: use register_commands() 2009-11-24 21:37:36 -08:00
Zachary T Welch dd063d9914 etm: use register_commands() 2009-11-24 21:37:36 -08:00
Zachary T Welch 8161fd3163 etb: use register_commands() 2009-11-24 21:37:36 -08:00
Zachary T Welch 97fbd793b3 cortex_m3: use register_commands() 2009-11-24 21:37:36 -08:00
Zachary T Welch 28300bbf6f cortex_a8: use register_commands() 2009-11-24 21:37:36 -08:00
Zachary T Welch df95fe25a4 armv7m: use register_commands() 2009-11-24 21:37:36 -08:00
Zachary T Welch d79176e1bc armv7a: use register_commands() 2009-11-24 21:37:35 -08:00
Zachary T Welch 84c03168a5 armv4_5: use register_commands() 2009-11-24 21:37:35 -08:00
Zachary T Welch d1eca9a74c arm9tdmi: use register_commands() 2009-11-24 21:37:35 -08:00
Zachary T Welch 69908ddbd0 arm966e: use register_commands() 2009-11-24 21:37:35 -08:00
Zachary T Welch 11061486b5 arm926ejs: use register_commands() 2009-11-24 21:37:35 -08:00
Zachary T Welch 509fe82b07 arm920t: use register_commands() 2009-11-24 21:37:35 -08:00
Zachary T Welch e232dea176 arm7_9_common: use register_commands() 2009-11-24 21:37:35 -08:00
Zachary T Welch e905fe6e75 arm720t: use register_commands() 2009-11-24 21:37:35 -08:00
Zachary T Welch b40f265f9c arm11: use register_commands() 2009-11-24 21:37:35 -08:00
Zachary T Welch 90d09e35e4 remove nand_controller->register_callbacks
Replace flash_driver callback with pointer to command_registration.
Eliminates all related routines and allows drivers to omit commands.
2009-11-24 21:37:35 -08:00
Zachary T Welch ad090413a8 remove flash_driver->register_callbacks
Replace flash_driver callback with pointer to command_registration.
Eliminates all related routines and allows drivers to omit commands.
2009-11-24 21:37:35 -08:00
Zachary T Welch 6b9bb584a5 tms470: use register_commands() 2009-11-24 21:37:35 -08:00
Zachary T Welch b4e95c3720 str9xpec: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch 5e977b46c3 str9x: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch dfa856ca18 str7x: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch f9606a6cb7 stm32x: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch 737f8f2735 stellaris: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch 0ff0dbba49 pic32mx: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch ccae9ae020 nand: use register_commands()
Eliminates 'nand_cmd' global variable.
2009-11-24 21:37:34 -08:00
Zachary T Welch 1bf7462edb mflash: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch 7609e1091a lpc3180_nand_controller: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch 1cbe3ec6f1 lpc2900: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch a12a29c28a lpc2000: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch b90bf52be3 flash: use register_commands()
Eliminates 'flash_cmd' global variable.
2009-11-24 21:37:34 -08:00
Zachary T Welch 1765b10304 ecos: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch b595ab8b97 cfi: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch c4aa2fd6e7 avrf: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch bdae918dcd at91sam7: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch 2a4a94b7ac at91sam3: use register_commands() 2009-11-24 21:37:34 -08:00
Zachary T Welch 8d46720cda remove register_callbacks from jtag interface
Changes the jtag_interface->register_callbacks field to a list of
commands to be registered.  Changes callback to invocation of
register_commands() with that command registration list.  Removes all
JTAG interface driver register_command callback functions, which the
previous commits had converted into identical calls.
2009-11-24 21:37:33 -08:00
Zachary T Welch fc2d9f8761 vsllink: use register_commands()
Use register_commands() with command registration array.
2009-11-24 21:37:33 -08:00
Zachary T Welch 355a673032 jtag: use register_commands()
Use register commands with command registration array.
2009-11-24 21:37:33 -08:00
Zachary T Welch 9a31d66b3f presto: use register_commands()
Use register_commands() with command registration array.
2009-11-24 21:37:33 -08:00
Zachary T Welch 339e08baa5 parport: use register_commands()
Use register_commands() with a command registration array.
2009-11-24 21:37:33 -08:00
Zachary T Welch b1d034bf2f jlink: use register_commands()
Use register_commands() with command registration array.
2009-11-24 21:37:33 -08:00
Zachary T Welch 779bdbe797 gw16012: use register_commands()
Use register_commands() with command registration array.
2009-11-24 21:37:33 -08:00
Zachary T Welch 3ab599a7e4 ft2232: use register_commands()
Use register_commands() with a command registration array.
2009-11-24 21:37:33 -08:00
Zachary T Welch 30be874de8 at91rm9200: use register_commands()
Use register_commands() with command registration array.
---
This module was broken by previous changes, but no one has complained.
Are there still users for this modules?
2009-11-24 21:37:33 -08:00
Zachary T Welch 0af32bb938 arm-jtag-ew: use register_commands()
Uses register_commands() with command registration array.
2009-11-24 21:37:33 -08:00
Zachary T Welch 48429dcfad amt_jtagaccel: use register_commands()
Use register_commands() with command_registration array.
2009-11-24 21:37:33 -08:00
Zachary T Welch e2f23c5437 pld: use static registration instead of callback
Remove register_callbacks from pld_device structure, using an array
of command_registration records instead.
2009-11-24 21:37:33 -08:00
Zachary T Welch 76b89755c9 pld: use register_commands()
Updates core PLD and virtex2 commands to use register_commands().
2009-11-24 21:37:33 -08:00
Zachary T Welch 75e37b5348 {,x}svf: use register_commands()
Use register_commands() for registering {,x}svf commands.
2009-11-24 21:37:33 -08:00
Zachary T Welch b4c4b5f71e server: use register_commands
Converts server directory to use new command registration paradigm.
2009-11-24 21:37:32 -08:00
Zachary T Welch 29772ec372 log: use register_commands()
Use register_commands() for logging callbacks.  Improve help and add
proper usage.
2009-11-24 21:37:32 -08:00
Zachary T Welch 8de1e7bd9e ioutil: use register_commands()
Use table instead of individual calls.  Add proper usage information.
2009-11-24 21:37:32 -08:00
Zachary T Welch 1595fd7c4b openocd: use register_commands()
Use register_commands() for top-level version and init command.
2009-11-24 21:37:32 -08:00
Zachary T Welch 16e0404777 demonstrate chaining with foo commands
Use the new command registration chaining capabilities to eliminate
the foo_register_commands helper, folding its remaining command
handler setup into the hello_command_handlers registration array.
2009-11-24 21:37:32 -08:00