1. 13 Nov, 2009 17 commits
    • Zachary T Welch's avatar
      command_handler_t: make argc unsigned · d22270e0
      Zachary T Welch authored
      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.
    • Zachary T Welch's avatar
      add CMD_NAME macro for command handlers · a585bdf7
      Zachary T Welch authored
      By introducing the CMD_NAME macro, this parameter may be integrated
      as args[-1] in command.[ch], without touching any other call sites.
    • Zachary T Welch's avatar
      use CALL_COMMAND_HANDLER instead of direct calls · 5b6df55a
      Zachary T Welch authored
      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.
    • Zachary T Welch's avatar
      add PLD_DEVICE_COMMAND_HANDLER macro · 1df5cc18
      Zachary T Welch authored
      Update virtex module to use abstracted PLD command handling.
    • Zachary T Welch's avatar
      nand: add NAND_DEVICE_COMMAND_HANDLER macro · 670f999e
      Zachary T Welch authored
      Abstracts the extended NAND command handling to allow the function
      signature to be controlled by __COMMAND_HANDLER.
    • Zachary T Welch's avatar
      use FLASH_BANK_COMMAND_HANDLER macro · 0796dfff
      Zachary T Welch authored
      Defines all flash_bank_command handlers using the new macro.
    • Zachary T Welch's avatar
      add FLASH_BANK_COMMAND_HANDLER macro · 57c5c5f4
      Zachary T Welch authored
      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.
    • Zachary T Welch's avatar
      s3c24xx: use COMMAND_HANDLER with command helper · 76868e07
      Zachary T Welch authored
      Add S3C24XX_DEVICE_COMMAND macros to abstract common command handler
    • Zachary T Welch's avatar
      arm_adi,armv7[am]: use COMMAND_HELPER for helpers · d02fee19
      Zachary T Welch authored
      Rewrites the dap_* command helpers to use the COMMAND_HELPER paradigm.
      Uses CALL_COMMAND_HELPER to hide inherited calling conventions.
    • Zachary T Welch's avatar
      use COMMAND_HELPER for command helper functions · 63a26b42
      Zachary T Welch authored
      Define the numerous helpers that inherit command handler parameters
      using the COMMAND_HELPER macro.
    • Zachary T Welch's avatar
    • Zachary T Welch's avatar
      add command_handler_t type · ddb6138e
      Zachary T Welch authored
      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.
    • Zachary T Welch's avatar
      add COMMAND_HANDLER and COMMAND_HELPER macros · 3f9fd4e2
      Zachary T Welch authored
      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.
    • Zachary T Welch's avatar
      add command_output_handler_t · 1ae4d93c
      Zachary T Welch authored
      Add a typedef for command output handler function type, simplifying
      the appearance of functions that use it and eliminating duplicate code.
    • David Brownell's avatar
      Cortex-A8: fix indent · 5eb638c7
      David Brownell authored
      The "remove (forward) declarations" patch goofed indentation on the
      "cortexa8_target" struct; fix.
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
    • Zachary T Welch's avatar
      nand: rename device to nand · e8e94ab2
      Zachary T Welch authored
      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.
    • David Brownell's avatar
      ETM: start support for ETMv2+ · d47764ff
      David Brownell authored
      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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
  2. 12 Nov, 2009 7 commits
  3. 11 Nov, 2009 16 commits
    • Zachary T Welch's avatar
      fix 'jtag interface' behavior · 5e1b500b
      Zachary T Welch authored
      Without this patch, running "openocd -c 'jtag interface'" segfaults.
      Now, it returns the string "undefined" when the interface is unset.
    • Zachary T Welch's avatar
      improve command registration · 158698e3
      Zachary T Welch authored
      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.
    • Zachary T Welch's avatar
      add help regardless of callback · 46d9ba4c
      Zachary T Welch authored
      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.
    • Zachary T Welch's avatar
      eliminate duplicate helptext management · a1a3ee57
      Zachary T Welch authored
      Add helpers to manage adding entries to the helptext list.
      Adds support for arbitrarily nested commands.
    • Zachary T Welch's avatar
      add command_name helper · 2d3cc1ea
      Zachary T Welch authored
      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.
    • Zachary T Welch's avatar
      wrap help command · f93c9808
      Zachary T Welch authored
      Use continuation characters to wrap the help command into 80 columns.
    • Zachary T Welch's avatar
      remove obsolete doxygen comments · 2821115a
      Zachary T Welch authored
      Documenting command handler parameters is redundant and pointless.
    • Zachary T Welch's avatar
      remove more useless declarations · 39ab1c1a
      Zachary T Welch authored
      Removes forward declarations by moving command registration after
      defintion of the command handlers.
    • Zachary T Welch's avatar
    • Zachary T Welch's avatar
      add const keyword to some APIs · ca594adb
      Zachary T Welch authored
      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.
    • Zachary T Welch's avatar
      change argv to args in command handlers · 9741e126
      Zachary T Welch authored
      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.
    • Zachary T Welch's avatar
      script_debug(): improve types · e09d8938
      Zachary T Welch authored
      Use unsigned type for number of arguments.
    • Zachary T Welch's avatar
      command.c: make private routines static · c9429693
      Zachary T Welch authored
      This patch also improves the signature of run_command function.
    • Zachary T Welch's avatar
      log: improve log_callback_fn signature · 6a2e83c0
      Zachary T Welch authored
      Use unsigned type for line number in log_callback_fn signature.
    • Zachary T Welch's avatar
      time_support: improve use of types · 0cd414c7
      Zachary T Welch authored
      Update timeval_add_time to use long int; implement timeval_add with it.
      Update timeval_ms to check gettimeofday return value, return int64_t.
    • Zachary T Welch's avatar
      makefiles: improve build order · b7b4efcd
      Zachary T Welch authored
      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.