summaryrefslogtreecommitdiff
path: root/src/target/arm_adi_v5.c
Commit message (Collapse)AuthorAgeFilesLines
* wipHEADmasterTrygve Laugstøl2012-02-221-6/+15
|
* target/arm_adi: Cleaned up the mem_ap_read_buf_u32_swd(), found practical ↵Tomek CEDRO2011-12-101-88/+40
| | | | way to read from MEM-AP with SWD, slightly different than specified in ARM documentation.
* target/arm_adi: imagine that this mess worksgit add arm_adi_v5.c now we need ↵Tomek CEDRO2011-12-101-46/+132
| | | | to get some conclustions out of it because arm documentation again is a mess.
* Minor change in sticky bitnames of ABORT register.Tomek CEDRO2011-11-151-2/+2
|
* target/arm_adi_v5: Split mem_ap_read_buf_u32 into mem_ap_read_buf_u32_jtag() ↵Tomek CEDRO2011-11-151-32/+97
| | | | the old one and mem_ap_read_buf_u32_swd() for swd targets. This is sill dirty and unworking code.
* target/arm_adi_v5: ahbap_debugport_init() returns error when both ↵Tomek CEDRO2011-11-061-3/+6
| | | | CDBGPWRUPACK|CSYSPWRUPACK flags are not set after read retries - this may indicate communication failure.
* Merge branch 'master' of ssh://repo.or.cz/srv/git/openocd/libswdTomek CEDRO2011-11-041-3/+3
|\
| * target/arm_adi_v5.c: Fixed compiler warnings (-Werror=uninitialized) ↵Tomek CEDRO2011-11-031-3/+3
| | | | | | | | producing compilation errors on ubuntu linux 11.10.
* | target/arm_adi_v5: Added SW-DP style sticky error flag hanfling in ↵Tomek CEDRO2011-11-041-3/+19
|/ | | | ahbap_debugport_init().
* SWD: swd tcl commands are now available from CLI and initialized at program ↵Tomek CEDRO2011-10-131-1/+0
| | | | startup with other commands.
* target/arm_adi_v5.c: experimental change in mem_ap_read_buf_u32() to work ↵Tomek CEDRO2011-09-111-15/+78
| | | | with SWD and become JTAG independent. This may break ARM target support for JTAG. Original function was renamed to mem_ap_read_buf_u32_old().
* TARGET/ARMADIV5: DAP operations are set to SWD if transport name is swd.Tomek CEDRO2011-07-281-3/+1
|
* TRANSPORT/TARGET: Updated source tree to build and use new swd ↵Tomek CEDRO2011-06-251-1/+3
| | | | infrastructure from src/transport not jtag/swd.h nor target/adi_v5_swd.c.
* ARM_ADI_V5: DAP initialization will select and initialize transport and its ↵Tomek CEDRO2011-06-221-5/+33
| | | | function set (functions to talk with DAP using JTAG or SWD). Minor description updates.
* Fix "unused variable" warnings (errors) detected with GCC 4.7.0 - trivial fixesFreddie Chopin2011-06-041-4/+2
|
* cortex_a: remove broken dbgbase patchup codeØyvind Harboe2011-04-011-25/+0
| | | | | | | | | | the patchup code would get false positives when checking whether a dbgbase had to be corrected. The solution is to have autodetect default, with manual override in scripts. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* types: write memory now uses constØyvind Harboe2011-04-011-9/+9
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* omap4430: tried to add in workaround for broken dbgbase queryØyvind Harboe2011-03-221-0/+1
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm_adi_v5: add/move apsel member in struct adiv5_dapLuca Ellero2011-02-171-57/+50
| | | | | | | | | | | | | | | This patch tries to make some order in "apsel" mess. "dap apsel" command was quite useless (and broken) by itself. With this patch we can use it to select between AHB or APB memory access (previous patch 05ab8bdb813acdcd74afa71d6656c2df816cb230 was somehow broken). - moves member apsel (in struct adiv5_dap) to ap_current - adds apsel member this strange choice is made trying to keep coherence in "dap apsel" command and to keep compatibility with other code (for example cortex_a8). Signed-off-by: Luca Ellero <lroluk@gmail.com>
* arm_adi_v5: add wrapping transfer functions with selection of apLuca Ellero2011-02-141-0/+74
| | | | Signed-off-by: Luca Ellero <lroluk@gmail.com>
* add cortex-r4 etm id to dap infoMathias K2011-01-271-2/+7
| | | | Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* fix segfault from stack corruption in ahbap_debugport_initAndreas Fritiofson2011-01-261-5/+4
| | | | | | | | | | | | ahbap_debugport_init was queueing reads to a local stack variable but didn't execute the queue before returning. Since the result of the reads are not used anyway, it's better to pass NULL as the destination instead of a dummy variable. I changed this throughout the function, even for the reads that were actually executed. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* CORTEX A8: Fix broken CPU identificationMarek Vasut2010-12-301-3/+17
| | | | | | | This patch fixes the issue where the OMAP CPU (and possibly others) was mistaken for iMX51 and therefore had misadjusted debug base. Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
* initial SWD transport (SWD infrastructure #2)David Brownell2010-12-241-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This piggy backs on JTAG so it's not yet pretty, but that seems unavoidable so far given today's OpenOCD internals. SWD init and data transfer are unfinished and untested, but that should cause no regressions, and will be addressed by the time drivers start using this infrastructure. Checking in whould get the code working better sooner, and turn up any structural/architectural issues while they're easier to fix. The debug adapter drivers will provide simple SWD driver structs with methods that kick in as needed (instead of JTAG). So far just one adapter driver has been updated (not yet ready to use or circulate). The biggest issues are probably - fault handling, where the ARM Debug Interface V5 pipelining needs work in both JTAG and SWD modes and - missing rewrite of block I/O code to work on both of our Cortex-ready transports (Current code is hard-wired to JTAG); relates also to the pipelining issue. - omitted support to activate/deactivate SWO/SWV trace (this is technically trivial, but configuring what to trace is NOT. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> ---- doc/openocd.texi | 17 ++ src/jtag/core.c | 3 src/jtag/interface.h | 4 src/jtag/jtag.h | 2 src/jtag/swd.h | 114 +++++++++++++++++++ src/jtag/tcl.c | 2 src/target/adi_v5_swd.c | 281 ++++++++++++++++++++++++++++++++++++++++++++++-- src/target/arm_adi_v5.c | 8 + src/target/arm_adi_v5.h | 3 9 files changed, 425 insertions(+), 9 deletions(-)
* ADIv5: Implement function to lookup CoreSight componentMarek Vasut2010-11-051-0/+41
| | | | | | | This patch implements "dap_lookup_cs_component()", which allows to lookup CS component by it's identification. Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
* ADIv5: Introduce function to detect ROM Table locationMarek Vasut2010-11-051-26/+53
| | | | | | | | | | | This patch adds function called "dap_detect_debug_base()", which should be called to get location of the ROM Table. By walking ROM Table, it's possible to discover the location of DAP. Sadly, some CPUs misreport this value, therefore I had to introduce an fixup table, which will be used in case such CPU is detected. Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
* warnings: fix alignment warningsØyvind Harboe2010-09-201-1/+1
| | | | | | | These warnings are for architectures that do not support non-aligned word access. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm_adi_v5: dap_run() error propagationØyvind Harboe2010-07-191-15/+28
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm_adi_v5: mem_ap_write error propagationØyvind Harboe2010-07-191-5/+7
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm_adi_v5: error propagation of mem_ap_read_atomic_u32 failureØyvind Harboe2010-07-191-11/+33
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* mem_ap_read_u32 error propagationØyvind Harboe2010-07-191-5/+15
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm_adi_v5: add error propagation for dap_setup_accessportØyvind Harboe2010-07-191-11/+33
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ARM ADI-V5: cleanup CID/PID addressingDavid Brownell2010-07-161-21/+23
| | | | | | | | | | | Use addition for offsetting, not masking. Shorten some lines. Make "component_start" print-only (unused otherwise; don't save). Still doesn't resolve the issue where multiple components are wrongly displaying as NVICs on some Cortex-M3 parts because many PIDs appear to be zeroes ... maybe adapter related?? Signed-off-by: David Brownell <db@helium.(none)>
* ARM ADI-V5: PIDs and CIDs are 8 bitsDavid Brownell2010-07-131-21/+41
| | | | | | | | | Mask the upper bits after 32-bit reads. Alsoo revert the ugly changes to use PRIx32; just cast to unsized integers when printing (two chars not eight). Signed-off-by: David Brownell <db@helium.(none)>
* arm_adi_v5: error propagation fixesØyvind Harboe2010-06-221-18/+22
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm_adi: -Wshadow warning fixØyvind Harboe2010-06-151-3/+3
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm_adi_v5: correct ahbap_debugport_init mem-ap id (bug #23)Spencer Oliver2010-05-211-0/+3
| | | | | | | | We request a id register read at the end of ahbap_debugport_init but we never actually run the queue. In some cases this causes a segfault. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* change %x and %d to PRIx32 and PRId32 where needed for cygwinDaniel Bäder2010-03-251-1/+1
|
* ADI_v5 - it's not always an "SWJ-DP"David Brownell2010-03-181-140/+140
| | | | | | | So don't use the name "swjdp" for all DAPs; rename to plain old "dap", which *is* always correct. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* remove more duplicationDavid Brownell2010-03-181-25/+0
| | | | | | | | Not sure how the original "move code to adi_v5_swd.c" patch left some code in the "arm_adi_v5.c" file, but a recent patch was only a partial fix -- it didn't remove all the duplication. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* linker error: fix problem with duplicate fnØyvind Harboe2010-03-181-33/+0
| | | | | | | | | | | A fn was copied instead of moved to a new file. The linker can discard exact copies of fn's without warning. This is a C++'ism. However on my Ubuntu 9.10 machine, it fails. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ADIv5 transport support moves to separate filesDavid Brownell2010-03-161-423/+11
| | | | | | | | | | | | | | | | | | | Unclutter arm_adi_v5.c by moving most transport-specific code to a transport-specific files adi_v5_{jtag,swd}.c ... it's not a full cleanup, because of some issues which need to be addressed as part of SWD support (along with implementing the DAP operations on top of SWD transport): - The mess where mem_ap_read_buf_u32() is currently coded to know about JTAG scan chains, and thus needs rewriting before it will work with SWD; - Initialization is still JTAG-specific Also move JTAG_{DP,ACK}_* constants from adi_v5.h to the JTAG file; no other code should care about those values. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* jtag: retire tap fieldØyvind Harboe2010-03-081-5/+2
| | | | | | | | | | | | | | | | | jtag_add_dr/ir_scan() now takes the tap as the first argument, rather than for each of the fields passed in. The code never exercised the path where there was more than one tap being scanned, who knows if it even worked. This simplifies the implementation and reduces clutter in the calling code. use jtag_add_ir/dr_plain_scan() for more fancy situations. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ADIv5 share DAP command supportDavid Brownell2010-03-051-23/+116
| | | | | | | | | | | | | | Get rid of needless and undesirable code duplication for all the DAP commands (resolving a FIXME) ... there's no need for coreas to have private copies of that stuff. Stick a pointer to the DAP in "struct arm", letting common code get to it. Also rename the "swjdp_info" symbol; just call it "dap". This is an overall code shrink. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* rename "swjdp_common" as "adiv5_dap"David Brownell2010-03-041-32/+32
| | | | | | | | | | | | | This partially corrects an inappropriate name choice (and its associated FIXME). There are still too many variables named "swjdp", bug little current code actually relies on them referencing an SWJ-DP instead of some other flavor of DAP. Only the two new dap_to{swd,jtag}() calls could behave differently on an SWJ-DP instead of a SW-DP or a JTAG-DP. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ADIv5: use new DAP ops for AP read/writeDavid Brownell2010-03-021-98/+67
| | | | | | | | | | | | | | | | | | | 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: David Brownell <dbrownell@users.sourceforge.net>
* ADIv5: use new DAP ops for DP read/writeDavid Brownell2010-03-021-32/+38
| | | | | | | | | | | 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: David Brownell <dbrownell@users.sourceforge.net>
* ADIv5: use new dap_run() operationDavid Brownell2010-03-021-26/+59
| | | | | | | | | | 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: David Brownell <dbrownell@users.sourceforge.net>
* ARM: start abstracting ADIv5 transports (JTAG/SWD)David Brownell2010-03-021-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: David Brownell <dbrownell@users.sourceforge.net>
* ADIv5: use right ID for Cortex-M3 ETMDavid Brownell2010-03-021-4/+4
| | | | | | | | | 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: David Brownell <dbrownell@users.sourceforge.net>