1. 04 Apr, 2010 3 commits
    • David Brownell's avatar
      Restore deleted '!' character · 2a17fd9f
      David Brownell authored
      
      
      I'm not sure what caused this significant character to get deleted.
      it may be related to intermittent Editor or terminal flakes  I've
      been seeing lately (sigh).  This fix is trivial.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      2a17fd9f
    • David Brownell's avatar
      target: are we running algorithm code? · 876bf9bf
      David Brownell authored
      
      
      Fixing one bug can easily uncover another  .... in this case,
      making sure that we properly invalidate some cached NOR state when
      resuming arbitrary target code turned up an issue when the code
      wasn't quite arbitrary (and we couldn't know that, but some parts
      of OpenOCD assumed the cache would not be invalidated.
      
      Specifically:  some flash drivers (like CFI) update that state in loops
      with downloaded algorithms, thus invalidating the state as it's probed.
      
       + Add a new target state flag, to record whether the target is
        running downloaded algorithm code.
      
       + Use that flag to add a special case:  "trust" downloaded algorithms
         not to corrupt that cached state, bypassing cache invalidation.
      
      Also update some of the documentation to stipulate that this flavor of
      trustworthiness is now *required* ... not just a fortuitous acident.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      876bf9bf
    • 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>
      88fcb5a9
  2. 25 Mar, 2010 1 commit
    • Øyvind Harboe's avatar
      target: fix poll off · ed6756fb
      Øyvind Harboe authored
      
      
      I don't know when "poll off" broke, but "poll off" didn't
      stop background polling of target. The polling status flag
      simply wasn't checked in the handle_target timer callback.
      
      All target polling(including power/reset state) is now stopped
      upon "poll off".
      
      Signed-off-by: default avatarØyvind Harboe <oyvind.harboe@zylin.com>
      ed6756fb
  3. 17 Mar, 2010 3 commits
    • Øyvind Harboe's avatar
      gdb: long running "monitor mww" now works w/gdb · cc197c80
      Øyvind Harboe authored
      
      
      invoke keep_alive() to make sure that the default 2000ms
      timeout does not trigger.
      
      Signed-off-by: default avatarØyvind Harboe <oyvind.harboe@zylin.com>
      cc197c80
    • Øyvind Harboe's avatar
      target: faster mww operations · bf71e34c
      Øyvind Harboe authored
      
      
      Signed-off-by: default avatarØyvind Harboe <oyvind.harboe@zylin.com>
      bf71e34c
    • Øyvind Harboe's avatar
      target: mdX/mwX on target were badly broken · 099ffc75
      Øyvind Harboe authored
      
      
      - incorrect parsing of arguments
      - mdX didn't display arguments correctly
      
      I don't think anyone ever used that code path :-)
      
      Did you know that "target mdw" and mdw are very different?
      
      for {set i 0} {$i < 256} {set i [expr $i+1]} {mwb [expr 0x2000000+$i] $i}
      
       mdw 0x2000000 0x10
      0x02000000: 03020100 07060504 0b0a0908 0f0e0d0c 13121110 17161514 1b1a1918 1f1e1d1c
      0x02000020: 23222120 27262524 2b2a2928 2f2e2d2c 33323130 37363534 3b3a3938 3f3e3d3c
      
      > zy1000.cpu mdb 0x2000000 0x20
      0x02000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ................
      0x02000010 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f ................
      > zy1000.cpu mdh 0x2000000 0x20
      0x02000000 0100 0302 0504 0706 0908 0b0a 0d0c 0f0e ................
      0x02000010 1110 1312 1514 1716 1918 1b1a 1d1c 1f1e ................
      0x02000020 2120 2322 2524 2726 2928 2b2a 2d2c 2f2e  !"#$%&'()*+,-./
      0x02000030 3130 3332 3534 3736 3938 3b3a 3d3c 3f3e 0123456789:;<=>?
      > zy1000.cpu mdw 0x2000000 0x20
      0x02000000 03020100 07060504 0b0a0908 0f0e0d0c ................
      0x02000010 13121110 17161514 1b1a1918 1f1e1d1c ................
      0x02000020 23222120 27262524 2b2a2928 2f2e2d2c  !"#$%&'()*+,-./
      0x02000030 33323130 37363534 3b3a3938 3f3e3d3c 0123456789:;<=>?
      0x02000040 43424140 47464544 4b4a4948 4f4e4d4c @ABCDEFGHIJKLMNO
      0x02000050 53525150 57565554 5b5a5958 5f5e5d5c PQRSTUVWXYZ[\]^_
      0x02000060 63626160 67666564 6b6a6968 6f6e6d6c `abcdefghijklmno
      0x02000070 73727170 77767574 7b7a7978 7f7e7d7c pqrstuvwxyz{|}~.
      
      Signed-off-by: default avatarØyvind Harboe <oyvind.harboe@zylin.com>
      099ffc75
  4. 04 Mar, 2010 1 commit
    • David Brownell's avatar
      NOR: invalidate cached state on target resume · 5fdf9535
      David Brownell authored
      
      
      The NOR infrastructure caches some per-sector state, but
      it's not used much ... because the cache is not trustworthy.
      
      This patch addresses one part of that problem, by ensuring
      that state cached by NOR drivers gets invalidated once we
      resume the target -- since targets may then modify sectors.
      
      Now if we see sector protection or erase status marked as
      anything other than "unknown", we should be able to rely
      on that as being accurate.  (That is ... if we assume the
      drivers initialize and update this state correctly.)
      
      Another part of that problem is that the cached state isn't
      much used (being unreliable, it would have been unsafe).
      Those issues can be addressed in later patches.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      5fdf9535
  5. 02 Mar, 2010 1 commit
    • David Brownell's avatar
      target_resume() doxygen · d72e90ae
      David Brownell authored
      
      
      Add doxygen for target_resume() ... referencing the still-unresolved
      confusion about what the "debug_execution" parameter means (not all
      CPU support code acts the same).
      
      The 'handle_breakpoints" param seems to have resolved the main issue
      with its semantics, but it wasn't part of the function spec before.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      d72e90ae
  6. 01 Feb, 2010 1 commit
  7. 21 Jan, 2010 2 commits
  8. 13 Jan, 2010 1 commit
  9. 09 Jan, 2010 1 commit
  10. 07 Jan, 2010 1 commit
  11. 02 Jan, 2010 1 commit
    • David Brownell's avatar
      streamline and document helptext mode displays · b3bf1d12
      David Brownell authored
      
      
      Most commands are usable only at runtime; so don't bother saying
      that, it's noise.  Moreover, tokens like EXEC are cryptic.  Be
      more clear: highlight only the commands which may (also) be used
      during the config stage, thus matching the docs more closely.
      There are
      
       - Configuration commands (per documentation)
       - And also some commands that valid at *any* time.
      
      Update the docs to note that "help" now shows this mode info.
      
      This also highlighted a few mistakes in command configuration,
      mostly commands listed as "valid at any time" which shouldn't
      have been.  This just fixes ones I noted when sanity testing.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      b3bf1d12
  12. 31 Dec, 2009 1 commit
  13. 28 Dec, 2009 1 commit
  14. 15 Dec, 2009 1 commit
  15. 13 Dec, 2009 1 commit
    • David Brownell's avatar
      target: further shrink Jim-awareness · 38e376d2
      David Brownell authored
      
      
      Don't include <helper/jim.h> from target.h ... not everything
      which touches targets needs to be able to talk to Jim.  Plus,
      most files include this header by another path.
      
      Also, switch the affected files to use the classic sequence
      for #included files:  all <framework/headers.h> first, then
      the "local_headers.h".  This helps prevent growth of problematic
      layering, by minimizing entanglement.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      38e376d2
  16. 08 Dec, 2009 2 commits
  17. 07 Dec, 2009 1 commit
  18. 03 Dec, 2009 3 commits
  19. 02 Dec, 2009 2 commits
  20. 01 Dec, 2009 3 commits
  21. 28 Nov, 2009 4 commits
    • Zachary T Welch's avatar
      explode tcl_target_func into many handlers · 070259ca
      Zachary T Welch authored
      Eliminate the monolithic tcl_target_func by registering each of its
      commands using the new chained command registration mechanism.
      
      Also chains the target's commands under the CPU command, though these
      may not work properly without some further modification.
      070259ca
    • Zachary T Welch's avatar
      split jim_target into multiple handlers · cb8d567b
      Zachary T Welch authored
      The 'target' command group was implemented using its own command
      dispatching, which can be eliminated by using the new chained command
      registration mechanism.  This patch splits the jim_target() function
      into individual handlers, which makes them to be visible to the help and
      usage commands.  These one-trick handlers are much easier to understand.
      cb8d567b
    • 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>
      acbe054a
    • David Brownell's avatar
      target: groundwork for "reset-assert" event · 4e56a230
      David Brownell authored
      
      
      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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      4e56a230
  22. 26 Nov, 2009 2 commits
    • David Brownell's avatar
      target: create and use target_name() · 2653b803
      David Brownell authored
      
      
      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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      2653b803
    • 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>
      b715a81f
  23. 25 Nov, 2009 3 commits
    • Zachary T Welch's avatar
      add 'testee' target type · 9d4c89f3
      Zachary T Welch authored
      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.
      9d4c89f3
    • Zachary T Welch's avatar
      add jim_handler to command_registration · 17a9dea5
      Zachary T Welch authored
      Adding jim_handler field to command_registration allows removing the
      register_jim helper.  All command registrations now go through the
      register_command{,s}() functions.
      17a9dea5
    • 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.
      66ee3034