1. 03 Mar, 2010 1 commit
    • David Brownell's avatar
      ARM: start abstracting ADIv5 transports (JTAG/SWD) · db6c9946
      David Brownell authored
      
      
      To support both JTAG and SWD, ADIv5 needs DAP operations which are
      transport-neutral, instead being of JTAG-specific.  This patch:
      
       - Defines such a transport-neutral interface, abstracting access
         to DP and AP registers through a conceptual queue of operations.
      
       - Builds the first implementation of such a transport with the existing
         JTAG-specific code.
      
      In contrast to the current JTAG-only interface, the interface adds
      support for two previously-missing (and unused) DAP operations:
      
       - aborting the current AP transaction (untested);
       - reading the IDCODE register (tested) ... required for SWD init.
      
      The choice of transports may be fixed at the chip, board, or JTAG/SWD
      adapter level.  Or if all the relevant hardware supports both transport
      options, the choice may be made at runtime, This patch provides basic
      infrastructure to support whichever choice is made.
      
      The current "JTAG-only" transport choice policy will necessarily continue
      for now, until SWD support becomes available in OpenOCD.  Later patches
      start phasing out JTAG-specific calls in favor of transport-neutral calls.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      db6c9946
  2. 02 Mar, 2010 3 commits
    • 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
    • David Brownell's avatar
      LPC1768 updates, IAR board support · 53b3d4dd
      David Brownell authored
      
      
      Fix some issues with the generic LPC1768 config file:
      
       - Handle the post-reset clock config:  4 MHz internal RC, no PLL.
         This affects flash and JTAG clocking.
      
       - Remove JTAG adapter config; they don't all support trst_and_srst
      
       - Remove the rest of the bogus "reset-init" event handler.
      
       - Allow explicit CCLK configuration, instead of assuming 12 MHz;
         some boards will use 100 Mhz (or the post-reset 4 MHz).
      
       - Simplify: rely on defaults for endianness and IR-Capture value
      
       - Update some comments too
      
      Build on those fixes to make a trivial config for the IAR LPC1768
      kickstart board (by Olimex) start working.
      
      Also, add doxygen to the lpc2000 flash driver, primarily to note a
      configuration problem with driver: it wrongly assumes the core clock
      rate never changes.  Configs that are safe for updating flash after
      "reset halt" will thus often be unsafe later ... e.g. for LPC1768,
      after switching to use PLL0 at 100 MHz.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      53b3d4dd
    • David Brownell's avatar
      ADIv5: use right ID for Cortex-M3 ETM · 5b311865
      David Brownell authored
      
      
      Correct a mistake made copying the ID of the Cortex-M3 ETM module
      from the TRM, so that "dap info" on a CM3 with an ETM will now
      correctly describe ROM table entries for such modules.  (They are
      included on LPC17xx and some other cores.)
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      5b311865
  3. 01 Mar, 2010 5 commits
  4. 28 Feb, 2010 13 commits
  5. 27 Feb, 2010 4 commits
    • David Brownell's avatar
      new "stellaris recover" command · e70d42a7
      David Brownell authored
      
      
      Stellaris chips have a procedure for restoring the chip to
      what's effectively the "as-manufactured" state, with all the
      non-volatile memory erased.  That includes all flash memory,
      plus things like the flash protection bits and various control
      words which can for example disable debugger access.  clearly,
      this can be useful during development.
      
      Luminary/TI provides an MS-Windows utility to perform this
      procedure along with its Stellaris developer kits.  Now OpenOCD
      users will no longer need to use that MS-Windows utility.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      e70d42a7
    • David Brownell's avatar
      ADIv5 DAP ops switching to JTAG or SWD modes · 3ef9beb5
      David Brownell authored
      
      
      Define two new DAP operations which use the new jtag_add_tms_seq()
      calls to put the DAP's transport into either SWD or JTAG mode, when
      the hardware allows.
      
      Tested with the Stellaris 'Recovering a "Locked" Device' procedure,
      which loops five times over both of these.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      3ef9beb5
    • David Brownell's avatar
      ft2232: implement TMS sequence command · 8c9b52e8
      David Brownell authored
      
      
      Implement the new TMS_SEQ command on FT2232 hardware.
      Also, swap a bogus exit() call with a clean failure return.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      8c9b52e8
    • David Brownell's avatar
      interface: define TMS sequence command · a3245bd7
      David Brownell authored
      
      
      For support of SWD we need to be able to clock out special bit
      sequences over TMS or SWDIO.  Create this as a generic operation,
      not yet called by anything, which is split as usual into:
      
       - upper level abstraction ... here, jtag_add_tms_seq();
       - midlayer implementation logic hooking that to the lowlevel code;
       - lowlevel minidriver operation ... here, interface_add_tms_seq();
       - message type for request queue, here JTAG_TMS.
      
      This is done slightly differently than other operations: there's a flag
      saying whether the interface driver supports this request.  (In fact a
      flag *word* so upper layers can learn about other capabilities too ...
      for example, supporting SWD operations.)
      
      That approach (flag) lets this method *eventually* be used to eliminate
      pathmove() and statemove() support from most adapter drivers, by moving
      all that logic into the mid-layer and increasing uniformity between the
      various drivers.  (Which will in turn reduce subtle bugginess.)
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      a3245bd7
  6. 25 Feb, 2010 3 commits
    • Mariano Alvira's avatar
      ft2232: add a mechanism to specify channel in layout structs · 4a64820f
      Mariano Alvira authored
      
      
      FT2232-family chips have two or more MPSSE modules.   FTDI documentation
      calls these channels.  JTAG adapter drivers thus need to be able to choose
      which channel to use.  (For example, one channel may connect to a board's
      microcontroller, while another connects to a CPLD.)
      
      Since each channel has its own USB interface, libftdi (somewhat confusingly)
      identifies channels using INTERFACE_* symbols.  Most boards use INTERFACE_A
      for JTAG, which is the default in OpenOCD.  But some wire up a different one.
      
      Note that there are two facets of what makes a wiring "layout":
      
       - The mapping between debug signals map and channel signals ... embedded
         in C functions.
      
       - Label used in Tcl configuration scripts ... part of the "layout" structure.
      
      By letting the channel be part of the layout struct, we permit sharing the C
      functions between Tcl-visible layouts, when those signal mappings are reused.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      4a64820f
    • David Brownell's avatar
      ARM ADIv5 doxygen and cleanup · 79010bf3
      David Brownell authored
      
      
      Add doxygen for mem_ap_read_buf_u{8,16,32}() calls,
      and shrink a few overlong lines.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      79010bf3
    • Hans Peter Mortensn's avatar
      AVR flash: handle AT90CAN128 chips · 7abe9f38
      Hans Peter Mortensn authored
      
      
      I have successfully programmed the AT90CAN128, based on the mega128  
      with some small modifications.
      
      [ dbrownell@users.sourceforge.net: patch cleanup ]
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      7abe9f38
  7. 24 Feb, 2010 1 commit
  8. 22 Feb, 2010 5 commits
  9. 21 Feb, 2010 5 commits
    • David Brownell's avatar
      ADIv5: relocate memacess_tck cycles · c8ea748d
      David Brownell authored
      
      
      When using an AP to access a memory (or a memory-mapped register),
      some extra TCK (assuming JTAG) cycles should be added to ensure
      the AP has enugh time to complete that access before trying to
      collect the response.
      
      The previous code was adding these cycles *before* trying to
      access (read or write) data to that address, not *after*.  Fix
      by putting the delays in the right location.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      c8ea748d
    • David Brownell's avatar
      ADIv5: remove ATOMIC/COMPOSITE interface mode · 3b68a708
      David Brownell authored
      
      
      This removes context-sensitivity from the programming interface and makes
      it possible to know what a block of code does without needing to know the
      previous history (specifically, the DAP's "trans_mode" setting).
      
      The mode was only set to ATOMIC briefly after DAP initialization, making
      this patch be primarily cleanup; almost everything depends on COMPOSITE.
      The transactions which shouldn't have been queued were already properly
      flushing the queue.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      3b68a708
    • David Brownell's avatar
      ARM: ADIv5, deadcode cleanup · ecff7304
      David Brownell authored
      
      
      I have no idea what the scan_inout_check() was *expecting* to achieve by
      issuing a read of the DP_RDBUFF register.  But in any case, that code was
      clearly never being called ("invalue" always NULL) ... so remove it, and
      the associated comment.
      
      Also rename it as ap_write_check(), facilitating a cleanup of its single
      call site by removing constant parameters.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      ecff7304
    • David Brownell's avatar
      ARM: ADIv5 code shrinkage, cleanup · 39cfe627
      David Brownell authored
      
      
      adi_jtag_dp_scan_u32() now wraps adi_jtag_dp_scan(), removing
      code duplication.  Include doxygen for the former.  Comment
      some particularly relevant points.  Minor fault handling fixes
      for both routines:  don't register a callback that can't run,
      or return ERROR_OK after an error.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      39cfe627
    • David Brownell's avatar
      ADIv5 clean up AP fault handling · a97bb675
      David Brownell authored
      
      
      Pass up fault codes from various routines, so their callers
      can clean up after failures, and remove the FIXME comments
      highlighting those previously goofy code paths.
      
       dap_ap_{read,write}_reg_u32()
       dap_ap_write_reg()
       mem_ap_{read,write}_u32()
       mem_ap_{read,write}_atomic_u32()
       dap_setup_accessport()
      
      Make dap_ap_write_reg_u32() just wrap dap_ap_write_reg(),
      instead of cloning its core code (and broken fault handling).
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      a97bb675