1. 08 Mar, 2019 1 commit
  2. 16 Oct, 2018 1 commit
  3. 10 Apr, 2018 1 commit
    • Tomas Vanek's avatar
      target, flash: prepare infrastructure for multi-block blank check · eb8912ec
      Tomas Vanek authored
      'flash erase_check' command runs a check algorithm on a target
      if possible. The algorithm is run repeatedly for each flash sector.
      Unfortunately every start and stop of the algorithm impose not negligible
      In practice it means checking is faster than plain read only for
      sectors of size approx 4 kByte or bigger. And checking sectors
      as short as 512 bytes runs approx 4 times slower than plain read.
      The patch changes API call target_blank_check_memory() and related
      to take an array of sectors (or arbitrary memory blocks).
      Changes in target-specific checking routines are kept minimal.
      They use only the first block from the array and process it by
      the unchanged algorithm.
      default_flash_blank_check() routine repeats target_blank_check_memory()
      until all blocks are checked, so it works with both multi-block
      and single-block based checkers.
      Change-Id: I0e6c60f2d71364c9c07c09416b04de9268807f5e
      Signed-off-by: default avatarTomas Vanek <vanekt@fbl.cz>
      Reviewed-on: http://openocd.zylin.com/4297
      Tested-by: jenkins
      Reviewed-by: default avatarAndreas Bolsch <hyphen0break@gmail.com>
  4. 13 Jan, 2018 1 commit
  5. 18 Oct, 2017 1 commit
  6. 10 Feb, 2017 1 commit
    • Dongxue Zhang's avatar
      target: Add 64-bit target address support · 47b8cf84
      Dongxue Zhang authored
      Define a target_addr_t type to support 32-bit and 64-bit addresses at
      the same time. Also define matching TARGET_PRI*ADDR format macros as
      well as a convenient TARGET_ADDR_FMT.
      In targets that are 32-bit (avr32, nds32, arm7/9/11, fm4, xmc1000)
      be least invasive by leaving the formatting unchanged apart from the
      for generic code adopt TARGET_ADDR_FMT as unified address format.
      Don't silently change gdb formatting here, leave that to later.
      Add COMMAND_PARSE_ADDRESS() macro to abstract the address type.
      Implement it using its own parse_target_addr() function, in the hopes
      of catching pointer type mismatches better.
      Add '--disable-target64' configure option to revert to previous 32-bit
      target address behavior.
      Change-Id: I2e91d205862ceb14f94b3e72a7e99ee0373a85d5
      Signed-off-by: default avatarDongxue Zhang <elta.era@gmail.com>
      Signed-off-by: default avatarDavid Ung <david.ung.42@gmail.com>
      [AF: Default to enabling (Paul Fertser), rename macros, simplify]
      Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
      Signed-off-by: default avatarMatthias Welwarsky <matthias.welwarsky@sysgo.com>
  7. 30 Oct, 2016 1 commit
    • Andreas Färber's avatar
      flash/nor: Add erased_value to drivers and pass it to targets · eaacb900
      Andreas Färber authored
      struct flash_driver has a default_padded_value field that is similar,
      but it can be changed by the user for the specific purpose of padding.
      Add a new erased_value field and initialize it for all targets,
      particularly stm32lx, xmc4xxx and virtual.
      Use this value in core.c:default_flash_mem_blank_check(), the slow path.
      Extend the target API to pass erased_value down to target code.
      Adding an argument ensures that we catch all callers.
      This allows us to merge xmc4xxx.c:xmc4xxx_blank_check_memory() into
      It further allows us to use default_flash_blank_check() in place of
      xmc4xxx.c:xmc4xxx_flash_blank_check(), adding a potential slow path
      fallback, as well as stm32lx:stm32lx_erase_check(), adding the potential
      armv7m fast path with fallback to default_flash_mem_blank_check().
      Fix a mips32 code comment while at it (zeroed -> erased).
      The armv4_5 and mips32 target implementations will now error out if an
      erase value other than 0xff is used, causing default_flash_blank_check()
      to fall back to the default_flank_mem_blank_check() slow path.
      Change-Id: I39323fbbc4b71c256cd567e439896d0245d4745f
      Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
      Reviewed-on: http://openocd.zylin.com/3497
      Tested-by: jenkins
      Reviewed-by: default avatarTomas Vanek <vanekt@fbl.cz>
  8. 24 May, 2016 2 commits
  9. 09 Mar, 2015 1 commit
  10. 13 Sep, 2013 2 commits
  11. 07 Aug, 2013 3 commits
    • Hsiangkai Wang's avatar
      gdb_server: support File-I/O Remote Protocol Extension · 0a4c8990
      Hsiangkai Wang authored
      The File I/O remote protocol extension allows the target to use the
      host's file system and console I/O to perform various system calls.
      To use the function, targets need to prepare two callback functions:
      * get_gdb_finish_info: to get file I/O parameters from target
      * gdb_fileio_end: pass file I/O response to target
      As target is halted, gdb_server will try to get file-I/O information
      from target through target_get_gdb_fileio_info(). If the callback function
      returns ERROR_OK, gdb_server will initiate a file-I/O request to gdb.
      After gdb finishes system call, gdb will pass response of the system call
      to target through target_gdb_fileio_end() and continue to run(continue or step).
      To implement the function, I add a new data structure in struct target,
      called struct gdb_fileio_info, to record file I/O name and parameters.
      Details refer to GDB manual "File-I/O Remote Protocol Extension"
      Change-Id: I7f4d45e7c9e967b6d898dc79ba01d86bc46315d3
      Signed-off-by: default avatarHsiangkai Wang <hsiangkai@gmail.com>
      Reviewed-on: http://openocd.zylin.com/1102
      Tested-by: jenkins
      Reviewed-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
    • Hsiangkai Wang's avatar
      gdb server: new feature, add stop reason in stop reply packet for gdb · 80d412ba
      Hsiangkai Wang authored
      In GDB remote serial protocol, the stop reply packet could contain more
      detail stop reason. The currently defined stop reasons are listed below.
      * watch
      * rwatch
      * awatch
      * library
      * replaylog
      This commit adds stop reason, watch/rwatch/awatch, in stop reply packet for
      just hit watchpoint. As manual indicates, at most one stop reason should be present.
      The function needs target to implement new hook, hit_watchpoint. The hook will fill
      the hit watchpoint in second parameter. The information will assist gdb to locate
      the watchpoint. If no such information, gdb needs to scan all watchpoints by itself.
      Refer to GDB Manual, D.3 Stop Reply Packets
      Change-Id: I1f70a1a9cc772e88e641b6171f1a009629a43bd1
      Signed-off-by: default avatarHsiangkai Wang <hsiangkai@gmail.com>
      Reviewed-on: http://openocd.zylin.com/1092
      Tested-by: jenkins
      Reviewed-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
    • Hsiangkai Wang's avatar
      gdb_server: support gdb target description · d979d78e
      Hsiangkai Wang authored
      * Add a parameter in .get_gdb_reg_list() to return different
        register lists as generating target description.
      * Modify STRUCT REG to let gdb generate target description
        according to register information.
      The modified structure of register is
      struct reg {
              const char *name;
              uint32_t number;  /* for regnum="num" */
              struct reg_feature *feature;  /* for register group feature name */
              bool caller_save;  /* for save-restore="yes|no" */
              void *value;
              bool dirty;
              bool valid;
              bool exist;
              uint32_t size;
              struct reg_data_type *reg_data_type;  /* for type="type" */
              const char *group;  /* for group="general|float|vector" */
              void *arch_info;
              const struct reg_arch_type *type;
      Change-Id: I2096b67adf94518ba0b8b23d8c6a9f64ad7932b8
      Signed-off-by: default avatarHsiangkai Wang <hsiangkai@gmail.com>
      Reviewed-on: http://openocd.zylin.com/1382
      Tested-by: jenkins
      Reviewed-by: default avatarFranck Jullien <franck.jullien@gmail.com>
      Reviewed-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
      Reviewed-by: default avatarAndreas Fritiofson <andreas.fritiofson@gmail.com>
  12. 05 Jun, 2013 1 commit
  13. 13 Mar, 2013 3 commits
  14. 23 Dec, 2012 1 commit
  15. 21 May, 2012 1 commit
  16. 06 Feb, 2012 1 commit
  17. 08 Oct, 2011 1 commit
  18. 30 Aug, 2011 1 commit
  19. 01 Apr, 2011 1 commit
  20. 17 Mar, 2011 1 commit
  21. 29 Dec, 2010 1 commit
  22. 29 Oct, 2010 1 commit
  23. 09 Aug, 2010 1 commit
    • Øyvind Harboe's avatar
      arm7/9: fix "reset run + halt" · 3e71449a
      Øyvind Harboe authored
      if polling is off, then "reset run + halt" would fail
      since halt incorrectly assumed the target was in the
      reset state as it is the internal poll implementation
      that moves the sw tracking of the target state out
      of the reset state.
      To reproduce:
      > reset run; halt
      JTAG tap: zy1000.cpu tap/device found: 0x1f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x1)
      BUG: arm7/9 does not support halt during reset. This is handled in arm7_9_assert_reset()
      Signed-off-by: default avatarØyvind Harboe <oyvind.harboe@zylin.com>
  24. 04 Apr, 2010 1 commit
    • David Brownell's avatar
      simplify and unconfuse target_run_algorithm() · 88fcb5a9
      David Brownell authored
      For some reason there are *two* schemes for interposing logic into
      the run_algorithm() code path...  One is a standard procedural wapper
      around the target method invocation.
      the other (superfluous) one hacked the method table by splicing
      a second procedural wrapper into the method table.  Remove it:
      	* Rename its  slightly-more-featureful wrapper so it becomes
      	  the standard procedural wrapper, leaving its added logic
      	  (where it should have been in the first place.
                Also add a paranoia check, to report targets that don't
      	  support algorithms without traversing a NULL pointer, and
      	  tweak its code structure a bit so it's easier to modify.
      	* Get rid of the superfluous/conusing method table hacks.
      This is a net simplification, making it simpler to analyse what's
      going on, and then interpose logic . ... by ensuring there's only one
      natural place for it to live.
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
  25. 13 Jan, 2010 1 commit
  26. 03 Dec, 2009 1 commit
    • Zachary T Welch's avatar
      change #include "types.h" to <helper/types.h> · df0e90ec
      Zachary T Welch authored
      Changes from the flat namespace to heirarchical one.  Instead of writing:
      	#include "types.h"
      the following form should be used.
      	#include <helper/types.h>
      The exception is from .c files in the same directory.
  27. 01 Dec, 2009 1 commit
    • David Brownell's avatar
      target: "mcr" and "mrc" are ARM-specific · 177bbd88
      David Brownell authored
      Switch "mrc" and "mcr" commands to be toplevel ARM operations,
      as they should initially have been.
      Correct the usage message for both commands:  it matches ARM
      documentation (as one wants!) instead of reordering them to
      match the funky mrc() and mcr() method usage (sigh).
      For Cortex-A8: restore a line that got accidentally dropped,
      so the secure monitor mode shadow registers will show again.
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
  28. 28 Nov, 2009 1 commit
    • David Brownell's avatar
      target: uplevel add_{break,watch}point() error checks · acbe054a
      David Brownell authored
      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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
  29. 26 Nov, 2009 1 commit
    • David Brownell's avatar
      target: target_get_name() --> target_type_name() · b715a81f
      David Brownell authored
      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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
  30. 25 Nov, 2009 1 commit
    • Zachary T Welch's avatar
      remove target_type register_command callback · 66ee3034
      Zachary T Welch authored
      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.
  31. 15 Nov, 2009 1 commit
    • David Brownell's avatar
      target: make "examined" flag be per-target · 9ac7cdec
      David Brownell authored
      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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
  32. 13 Nov, 2009 3 commits