1. 03 Mar, 2010 4 commits
    • David Brownell's avatar
      ADIv5: use new DAP ops for AP read/write · 381ce430
      David Brownell authored
      
      
      Make ADIv5 internals use the two new transport-neutral calls for reading
      and writing DP registers; and do the same for external callers.  Also,
      bugfix some of their call sites to handle the fault returns, instead of
      ignoring them.
      
      Remove most of the JTAG-specific calls, using their code as the bodies
      of the JTAG-specific implementation for the new methods.
      
      NOTE that there's a remaining issue:  mem_ap_read_buf_u32() makes calls
      which are JTAG-specific.  A later patch will need to remove those, so
      JTAG-specific operations can be removed from this file, and so that SWD
      support will be able to properly drop in as just a transport layer to the
      ADIv5 infrastructure.  (The way read results are posted may need some more
      attention in the transport-neutrality interface.)
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      381ce430
    • David Brownell's avatar
      ADIv5: use new DAP ops for DP read/write · 61ee632d
      David Brownell authored
      
      
      Make ADIv5 internals use the two new transport-neutral calls for reading
      and writing DP registers.  Also,  bugfix some of their call sites to
      handle the fault returns, instead of ignoring them.
      
      Remove the old JTAG-specific calls, using their code as the bodies
      of the JTAG-specific implementation for the new methods.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      61ee632d
    • David Brownell's avatar
      ADIv5: use new dap_run() operation · 24b1426a
      David Brownell authored
      
      
      Make ADIv5 use one of the new transport-neutral interfaces: call
      dap_run(), not jtagdp_transaction_endcheck().
      
      Also, make that old interface private; and bugfix some of its call
      sites to handle the fault returns, instead of ignoring them.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      24b1426a
    • 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 1 commit
  3. 27 Feb, 2010 1 commit
  4. 25 Feb, 2010 1 commit
  5. 24 Feb, 2010 1 commit
  6. 21 Feb, 2010 6 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
    • David Brownell's avatar
      ADIv5 clean up AP selection and register caching · 249263d2
      David Brownell authored
      
      
      Handling of AP (and AP register bank) selection, and cached AP
      registers, is pretty loose ... start tightening it:
      
       - It's "AP bank" select support ... there are no DP banks.  Rename.
         + dap_dp_bankselect() becomes dap_ap_bankselect()
         + "dp_select_value" struct field becomes "ap_bank_value"
      
       - Remove duplicate AP cache init paths ... only use dap_ap_select(),
       and don't make Cortex (A8 or M3) cores roll their own code.
      
       - For dap_ap_bankselect(), pass up any fault code from writing
       the SELECT register.  (Nothing yet checks those codes.)
      
       - Add various bits of Doxygen
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      249263d2
  7. 07 Feb, 2010 1 commit
    • David Brownell's avatar
      ADIv5: doxygen · 6f262b69
      David Brownell authored
      
      
      Provide doxygen for many of the public ADIv5 interfaces (i.e. the ones
      called from Cortex core support code).
      
      Add FIXMEs (and a TODO) to help resolve implementation issues which
      became more apparent when trying to document this code:
      
       - Error-prone context-sensitivity (queued/nonqueued) in many procedures.
      
       - Procedures that lie by ignoring errors and wrongly claiming success.
      
      Also, there was no point in a return from dap_ap_select(); it can't fail,
      and no caller checks its return status.  Clean that up, make it void.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      6f262b69
  8. 31 Jan, 2010 4 commits
  9. 29 Jan, 2010 1 commit
    • David Brownell's avatar
      ADIv5: cleanup, rename swjdp_transaction_endcheck() · 3d3128a8
      David Brownell authored
      
      
      Make messages reference "DAP" if they're actually transport-agnostic, or
      "JTAG-DP" when they're JTAG-specific.  Saying SWJ-DP is often wrong (on
      most Cortex-A8 chips) and is confusing even if correct (since we don't
      yet support SWD).
      
      Rename a JTAG-specific routine to jtagdp_transaction_endcheck() to highlight
      that it's JTAG-specific, and that identify DAP clients undesirably depending
      on JTAG.  (They will all need to change for SWD support.)
      
      Shrink a few overlong lines of code.  Copy a comment from code removed
      in a previous patch (for the ARMv7-M "dap baseaddr" command).
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      3d3128a8
  10. 27 Jan, 2010 1 commit
  11. 15 Jan, 2010 1 commit
  12. 14 Jan, 2010 1 commit
  13. 08 Jan, 2010 1 commit
    • David Brownell's avatar
      ARMv7: help/usage updates · 17921f51
      David Brownell authored
      
      
      Provide helptext which was sometimes missing; update some of it
      to be more accurate.
      
      Usage syntax messages have the same EBNF as the User's Guide;
      there should be no angle brackets in either place.
      
      Don't use "&function"; functions are like arrays, their address
      is their name.  Shrink some overlong lines, remove some empties.
      
      Add a couple comments about things that should change:  those
      extra TCK cycles for MEM-AP reads are in the wrong place (that
      might explain some problems we've seen); the DAP command tables
      should be shared, not copied.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      17921f51
  14. 05 Jan, 2010 2 commits
  15. 02 Jan, 2010 4 commits
  16. 03 Dec, 2009 1 commit
  17. 26 Nov, 2009 1 commit
  18. 17 Nov, 2009 3 commits
  19. 13 Nov, 2009 5 commits