aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-11-13add src/hello.c to augment new command tutorialZachary T Welch
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-13command_handler_t: make cmd an indirect parameterZachary T Welch
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-13command_handler_t: make args parameter constZachary T Welch
This patch prevents command handlers from modifying the strings passed in the 'args' array.
2009-11-13command_handler_t: make cmd parameter constZachary T Welch
Prevents the command name from being modified in command handlers. Again, this has cascading effects, but the patches are fairly minimal.
2009-11-13command_handler_t: make argc unsignedZachary T Welch
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-13add CMD_NAME macro for command handlersZachary T Welch
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-13use CALL_COMMAND_HANDLER instead of direct callsZachary T Welch
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-13add PLD_DEVICE_COMMAND_HANDLER macroZachary T Welch
Update virtex module to use abstracted PLD command handling.
2009-11-13nand: add NAND_DEVICE_COMMAND_HANDLER macroZachary T Welch
Abstracts the extended NAND command handling to allow the function signature to be controlled by __COMMAND_HANDLER.
2009-11-13use FLASH_BANK_COMMAND_HANDLER macroZachary T Welch
Defines all flash_bank_command handlers using the new macro.
2009-11-13add FLASH_BANK_COMMAND_HANDLER macroZachary T Welch
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-13s3c24xx: use COMMAND_HANDLER with command helperZachary T Welch
Add S3C24XX_DEVICE_COMMAND macros to abstract common command handler conventions.
2009-11-13arm_adi,armv7[am]: use COMMAND_HELPER for helpersZachary T Welch
Rewrites the dap_* command helpers to use the COMMAND_HELPER paradigm. Uses CALL_COMMAND_HELPER to hide inherited calling conventions.
2009-11-13use COMMAND_HELPER for command helper functionsZachary T Welch
Define the numerous helpers that inherit command handler parameters using the COMMAND_HELPER macro.
2009-11-13use COMMAND_HANDLER macro to define all commandsZachary T Welch
2009-11-13add command_handler_t typeZachary T Welch
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-13add COMMAND_HANDLER and COMMAND_HELPER macrosZachary T Welch
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-13add command_output_handler_tZachary T Welch
Add a typedef for command output handler function type, simplifying the appearance of functions that use it and eliminating duplicate code.
2009-11-13Cortex-A8: fix indentDavid Brownell
The "remove (forward) declarations" patch goofed indentation on the "cortexa8_target" struct; fix. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-12nand: rename device to nandZachary T Welch
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-12ETM: start support for ETMv2+David Brownell
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-12WinXP-x64: find right D2XX librariesLiam Redmond
This trivial patch allows the config script to find the correct FTDI2xx libraries under Windows XP x64 using msys. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-12parport: add support for the jtag_khz command.Jonas Horberg
Add the khz and speed_div functions to the parport interface driver. Add the parport_toggling_time function that tells the parport driver how long (in nanoseconds) it takes for the hardware to toggle TCK. [dbrownell@users.sourceforge.net: tweak doc for clarity, mention multimeter, and whitespace fixes] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-11ETM: remove old mid-level ETM handleDavid Brownell
Now that nothing uses the old ETM handle any more, remove it. Add minimal header tweaks, letting non-ARM7 and non-ARM9 cores access ETM facilities. Now ARM11 could support standard ETM (and ETB) access as soon as it derives from "struct arm" ... its scanchain 6 is used access the ETM, just like ARM7 and ARM9. The Cortex parts (both M3 and A8) will need modified access methods (via ETM init parameters), so they use the DAP. Our first A8 target (OMAP3) needs that for both ETM and ETB, but the M3 ETM isn't very useful without SWO trace support (it's painfully stripped down), so that support won't be worth adding for a while. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-11ETM: use new toplevel ETM handleDavid Brownell
Make ETM itself use the new toplevel ETM handle, instead of the to-be-removed lower level one. As of this patch, nothing should be using the old ARM7/ARM9-specific handle. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-11ETM: update port driversDavid Brownell
Make both useful ETM port drivers (etb, etm_dummy) use the new toplevel ETM handle, instead of the to-be-removed lower level one. Do the same for the "oocd-trace" prototype too; and fix its error reporting paths: return failure codes, don't exit(), etc Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-11ETM: update arm[79]tdmi_examine()David Brownell
Make ARM7 and ARM9 cores use the new toplevel ETM handle to trigger ETM setup, not the to-be-removed lower level one. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-11ARM: start generalized base typeDavid Brownell
Rename "struct armv4_5_common_s" as "struct arm". It needs a bit more work to be properly generic, and to move out of this header, but it's the best start we have on that today. Add and initialize an optional ETM pointer, since that will be the first thing that gets generalized. The intent being: all ARMs should eventually derive from this "struct arm", so they can reuse the current ETM logic. (And later, more.) Currently the ARM cores that *don't* so derive are only ARMv7-M (and thus Cortex-M3) and ARM11. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-11fix 'jtag interface' behaviorZachary T Welch
Without this patch, running "openocd -c 'jtag interface'" segfaults. Now, it returns the string "undefined" when the interface is unset.
2009-11-11improve command registrationZachary T Welch
Eliminate duplicate code for linking commands into a list. Adds a check to ensure the command does not already exist; if it does, return that one instead of creating a duplicate.
2009-11-11add help regardless of callbackZachary T Welch
Add help for commands regardless of whether a handler is involved. With this, all sorts of new commands can be found in 'help' text. Hopefully, all of them have been documented.... Sadly, the lsort function appears to handle nested lists poorly, such that sub-commands do not group with their parents.
2009-11-11eliminate duplicate helptext managementZachary T Welch
Add helpers to manage adding entries to the helptext list. Adds support for arbitrarily nested commands.
2009-11-11add command_name helperZachary T Welch
The command_name function returns a malloced string for a given command and its parents. This can be used to display a message to the user, but it is used internally to handle registration and syntax errors. This helps permit arbitrary command nesting.
2009-11-11wrap help commandZachary T Welch
Use continuation characters to wrap the help command into 80 columns.
2009-11-11remove obsolete doxygen commentsZachary T Welch
Documenting command handler parameters is redundant and pointless.
2009-11-11remove more useless declarationsZachary T Welch
Removes forward declarations by moving command registration after defintion of the command handlers.
2009-11-11cortex_a8: remove declarations, use static keywordZachary T Welch
2009-11-11add const keyword to some APIsZachary T Welch
Add 'const' keyword to 'char *' parameters to allow command handlers to pass constant string arguments. These changes allow the 'args' command handler to be changed to 'const' in a subsequent patch.
2009-11-11change argv to args in command handlersZachary T Welch
Subsequent patches expect all command handlers to use a uniform parameter naming scheme. In the entire tree, these two files used standard 'argv' instead of our non-standard 'args'. This patch opts to reduces the noise required to unify the command handlers, using dominant 'args' form. A future patch may be used to convert us back to the standard argv, but that requires coordination with all developers to minimize disruptions.
2009-11-11script_debug(): improve typesZachary T Welch
Use unsigned type for number of arguments.
2009-11-11command.c: make private routines staticZachary T Welch
This patch also improves the signature of run_command function.
2009-11-11log: improve log_callback_fn signatureZachary T Welch
Use unsigned type for line number in log_callback_fn signature.
2009-11-11time_support: improve use of typesZachary T Welch
Update timeval_add_time to use long int; implement timeval_add with it. Update timeval_ms to check gettimeofday return value, return int64_t.
2009-11-11makefiles: improve build orderZachary T Welch
Separates various groups of files to be built in logical succession. In each layer, the core module (target.c, nand.c, etc.) is built _after_ their helper modules (e.g. image.c, nand_ecc.c) but _before_ any of their drivers (e.g. arm966e.c, mx3_nand.c). This allows problems introduced at the bottom of the stack to result in build failures as soon as possible, as the helpers and core should wrap portions of them.
2009-11-11ETM cleanupDavid Brownell
Various cleanups of ETM related code. - Saner error return paths - Simplify arm7_9 init ... no need for extra zeroing! - Shrink some lines - Tweak some diagnostics - Use shorter name for ETM struct type. - Don't exit() and similar. The diagnostics look forward to having this ETM code work with more than just ARM7/ARM9. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-10fix bug in ARM720: bugfixZachary T Welch
2009-11-10ARM720: bugfixDavid Brownell
The "ARM720 uses the new inheritance/nesting scheme" patch wrongly scrubbed a calloc() from arm720t_target_create(). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-10target: MMU-aware init for memory read/writeDavid Brownell
Start switching MMU handling over to a more sensible scheme. Having an mmu() method enables MMU-aware behaviors. Not having one kicks in simpler ones, with no distinction between virtual and physical addresses. Currently only a handful of targets have methods to read/write physical memory: just arm720, arm920, and arm926. They should all initialize OK now, but the arm*20 parts don't do the "extra" stuff arm926 does (which should arguably be target-generic). Also simplify how target_init() loops over all targets by making it be a normal "for" loop, instead of scattering its three parts to the four winds. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-10target.cfg: (re)move some bogus reset_config linesDavid Brownell
General rule, this is all board-specific and doesn't belong in target config files. Some of these were just cosmetic. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-10stm32.cfg: remove reset_configThomas Kindler
Here's a patch for the double-reset problem on STM32. I've tested downloading and debugging with GDB and Eclipse, and everything seems to work fine. This effectively sets reset_config to none. trst_only would also be ok, but that's better left to a board configuration file since not all boards wire it up. The NVIC is used to trigger reset, which at least on this chip also pulses nSRST so the whole system does get rest -- exactly once. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>