aboutsummaryrefslogtreecommitdiff
path: root/src/target/arm_adi_v5.h
AgeCommit message (Collapse)AuthorFilesLines
2016-01-22adi_v5_jtag: implement DAP WAIT supportMatthias Welwarsky1-0/+4
ADIv5 specifies that DP and AP accesses may generate a WAIT response when the hardware is not able to complete a request for various reasons in time before the next request is sent. Currently, the software treats a WAIT response as a fatal error and aborts operation on the DAP. This patch implements WAIT handling by keeping a journal of all outstanding and completed accesses, including their response status. At certain times (when dap_run() is called), the journal is inspected for WAIT responses and all discarded accesses are replayed to complete them. Special care is taken to not re-execute already successfully completed operations. Change-Id: I2790070388cf1ab2e8c9a042d74eb3ef776aa583 Signed-off-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-on: http://openocd.zylin.com/3166 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-12-29arm_adi_v5: Make the DAP API statelessAndreas Fritiofson1-35/+12
Remove entirely the concept of a "selected" AP that has to be maintained between calls. All the information the DAP ops need are now provided to each call through the AP/DAP pointer. Consolidate the cache of the SELECT fields into one single field caching the entire register. Change-Id: I2e1c93ac5ee8ac38a7d680ca2c660c30093a6b87 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3165 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2015-12-29arm_adi_v5: dap_queue_ap_* DAP->AP parameterAndreas Fritiofson1-11/+18
Move the mandatory dap_ap_select() call into the dap_queue_ap_read/write wrapper. This avoids the need for dap_ap_select() and the notion of a "current" AP within target code. Change-Id: I5cde8f3eef2c662f7458be6f3b3dd44ea693bd74 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3164 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2015-12-29arm_adi_v5: Remove all mem_ap_sel_* functionsAndreas Fritiofson1-13/+12
All mem_ap_* functions now make sure the SELECT register is updated with the AP number that it's operating on. This shouldn't have to be handled explicitly. Change-Id: Ib193d8930fabb6a25715064355f98258c9580b5d Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3153 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2015-12-29arm_adi_v5: Rename TAR and CSW setters and make them AP-specificAndreas Fritiofson1-4/+0
Change-Id: I0ab66b259e929e6ba826ada9cf8e35614df46410 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3152 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2015-12-29arm_adi_v5: Split ahbap_debugport_initAndreas Fritiofson1-1/+2
This function does two separate things, powering up the DP and setting up a MEM-AP. But the DP needs to be powered before even searching for a MEM-AP to initialize and targets may have multiple MEM-APs that need initializing. Split the function into dap_dp_init() and mem_ap_init() and change all call sites to use the appropriate one. Change-Id: I92f55e09754a93f3f01dd8e5aa1ffdf60c856126 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3151 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2015-12-29arm_adi_v5: Clean up dap info commandAndreas Fritiofson1-0/+17
Reduce use of magic numbers and add AXI type MEM-AP detection. Don't try to call dap_rom_display on a non-existent AP. AP identification is unique per designer, so make sure the JEDEC code matches ARM when interpreting the AP type. Change-Id: I8e86b7de61811382afe99bf15094ab71b43f5fdf Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3150 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2015-12-29arm_adi_v5: Change mem_ap calls to take pointer to AP and not DAPAndreas Fritiofson1-11/+11
Change-Id: I8d3e42056aa5828cb917ca578a54b7d53846a150 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3149 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2015-12-29arm_adi_v5: Convert the AP references from numbers to pointersAndreas Fritiofson1-1/+1
Change the debug_ap and memory_ap fields of the cortex_a target and the debug_ap field of the cortex_m target to be pointers to the struct adiv5_ap instead of AP numbers in some known DAP. This reduces the dependency on the DAP struct in the targets and enables MEM-AP accesses to take the relevant AP as parameter. Change-Id: I39d7b134d78000564b7eec5bff464adf0ef89147 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3147 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2015-12-29cortex_m: Discover the AP to use, just like Cortex-AAndreas Fritiofson1-3/+4
This required fixing the AP ID parsing in dap_find_ap() to match IHI0031C. The AXI type was added too. Change-Id: I44577a7848df37586e650dce0fb57ac26f5f858c Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3146 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2015-12-29arm_adi_v5: Add a back-pointer from an AP to its DAPAndreas Fritiofson1-0/+10
This will make it possible to reference directly the AP used for debug in the target instance and remove the DAP reference. This will in turn enable getting rid of the need to select an "active" AP in the DAP (using dap apsel). Change-Id: I265846a427c714204f4fd3df3cdb75843686c2d0 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3144 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2015-12-29arm_adi_v5: Remove unused is_swd flagAndreas Fritiofson1-5/+0
Not clear what it was supposed to be used for. It probably shouldn't. Change-Id: Ife1d833e59ba80f93876447d752a0ca7e7b57b0f Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3143 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2015-12-29target/arm: Remove usage of struct arm_jtag in ARMv7 targetsAndreas Fritiofson1-1/+1
The Cortex-A and Cortex-M keeps an arm_jtag struct around just to be able to pass a pointer to it to one common JTAG function which anyway only uses the TAP field. Refactor the function to take a TAP directly, remove the legacy struct from cortex instances and store the TAP pointer only in the DAP. Cortex-M makes a call to arm_jtag_setup_connection() with the struct but the function does nothing useful for a Cortex-M target so remove the call. Change-Id: I3b33709ef55372ef14522ed4337e9f2e817ae3ab Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3142 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2015-12-29arm_debug: Support multiple APs per DAP and remove DAP from armv7* structsPatrick Stewart1-31/+48
Separate out the values from adiv5_dap that are associated with a specific AP into a new struct, so we can properly support multiple APs. Remove the DAP struct from the armv7* structs, because we can have multiple CPUs per DAP, and we shouldn't have multiple DAP structs. Tidy up a few places where ap_current is used incorrectly. Change-Id: I0c6ef4b49cc86b140366347aaf9b76c07cbab0a8 Signed-off-by: Patrick Stewart <patstew@gmail.com> Reviewed-on: http://openocd.zylin.com/2984 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-12-29cortex_m: Select an AP when accessing the DAPPatrick Stewart1-17/+1
Prepare to support multiple cortex-m cores on one DAP. Uses mem_ap_sel_* functions and removes mem_ap_* functions. Adds a new debug_ap parameter to the cortex_m (currently set to zero as in existing code). Change-Id: I6926029d1e7bf44a42d453d1aff349bda824ba72 Signed-off-by: Patrick Stewart <patstew@gmail.com> Reviewed-on: http://openocd.zylin.com/2983 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-12-29adi_v5: return proper value on timeoutAlamy Liu1-1/+1
ERROR_WAIT is better than ERROR_FAIL in timeout condition. Change-Id: Iefe837f276a9091ce6c18db5947212c449f49d89 Signed-off-by: Alamy Liu <alamy.liu@gmail.com> Reviewed-on: http://openocd.zylin.com/2934 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-12-29adi_v5: Rename AP_REG_* to MEM_AP_REG_* and add LA supportAlamy Liu1-12/+13
This is a TODO in the src/target/arm_adi_v5.h for MEM-AP registers. Some new registers are introduced in ADIv5.2 specification. MEM_AP_REG_MGT (0x20) // Memory Barrier Transfer register MEM_AP_REG_TAR64 (0x08) // Bits[63:32] of Transfer Address MEM_AP_REG_BASE64 (0xF0) // Bits[63:32] of Debug Base Address Refer to 7.5 MEM-AP register summary in IHI0031C: ARM Debug Interface Architecture Specification ADIv5.0 to ADIv5.2 Change-Id: I3bc4296a04c35f5c64f851e5865d3099922613fa Signed-off-by: Alamy Liu <alamy.liu@gmail.com> Reviewed-on: http://openocd.zylin.com/2904 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-09-30ADIv5: Fix typo in log messageEvan Hunter1-1/+1
Change-Id: I9c5e648566b1dd43cb55fd5e30edf8d5f0d189a6 Signed-off-by: Evan Hunter <ehunter@broadcom.com> Reviewed-on: http://openocd.zylin.com/2892 Tested-by: jenkins Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-01-09swd: handle various failure conditionsPaul Fertser1-0/+6
When communication with target fails for whatever reason, it makes sense to do JTAG-to-SWD (in case the target got power-cycled or the DAP method was reset anyhow), SWD line reset sequence (part of JTAG-to-SWD already) and the mandatory IDCODE read. Schedule that to be performed on the next poll. Fix the return values for ftdi and jlink drivers to be consistent with OpenOCD error codes and remove ad-hoc calls to perform DAP method switching (as it's now done from the upper layer automatically). Change-Id: Ie18797d4ce7ac43d8249f8f81f1064a2424e02be Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2371 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Mateusz Manowiecki <segmentation@fault.pl>
2014-10-06arm_adi_v5: make dap_lookup_cs_component() traverse subtables and handle ↵Paul Fertser1-1/+1
multicore When looking for a debug base address of a core, one should search through all the ROM tables, not just the top-level one. This code also assumes that the first found entry (in a depth-first search) will correspond to core 0, the second to core 1 etc. The patch is supposed to be an alternative implementation of http://openocd.zylin.com/#/c/1313/. Change-Id: Ifc88971a02fe3d9c00d9bf72a822ade5804d4e09 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1920 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-06-28adi_v5: Make sure all bit masks are unsigned and wide enough.Andreas Fritiofson1-28/+28
Also align them with spaces instead of tabs. Change-Id: I1c01412a3ea77b29e8e133f5c92d05ed79d7c0f3 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2133 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-28swd: Convert API to asynchronousAndreas Fritiofson1-3/+3
Change-Id: I859568dbb2ad4e92411980751c3f747bd70638b8 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1959 Tested-by: jenkins Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-28adi_v5: Remove unused features of the DAP and SWD interfacesAndreas Fritiofson1-44/+1
These features are not currently used so remove or disable them before something starts to. Not having them around simplifies redesign of the APIs. Change-Id: Iad25cc71c48b68a1fa71558141bf14d5ab20d659 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1955 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-28adi_v5_swd: Read RDBUFF once after a sequence of AP readsAndreas Fritiofson1-0/+6
Increases performance by a factor of two for long reads. Change-Id: I81a7a83835058560c6a53a43c3cc991100f01766 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1954 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-28adi_v5_swd: Improve SWD supportFatih Aşıcı1-7/+16
Fix bug in parity calculation macro. Cache and update the selected DP bank when necessary. Add aborts when the Ack code signals a failure (we should really only clear the sticky bits, but this will do for now). Change-Id: I38a4da136ba1d9e989b33c1875a80c0b1b2be874 Signed-off-by: Fatih Aşıcı <fatih.asici@gmail.com> Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1950 Tested-by: jenkins
2014-06-01arm_adi_v5: Do not ignore register polling timeoutAndrey Smirnov1-0/+29
Previous to this commit 'ahbap_debugport_init' would ignore if timeout happened or not when waiting for CDBGPWRUPACK and CSYSPWRUPACK and would continue initialization regardless. It also would not reset the timeout counter after finishing polling for CDBGPWRUPACK and starting for CSYSPWRUPACK which could potentially cause some problems. Also refactor code of both snippets into a more generic function to avoid duplication. Change-Id: I16e4f50e6819e08c4126e71ef8cec7db559d608e Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-on: http://openocd.zylin.com/2086 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2014-06-01arm_adi_v5: Add convenience "atomic"" function for DP readsAndrey Smirnov1-0/+12
Add convenience "atomic"" function dap_dp_read_atomic_u32() Change-Id: Ic9ebb58959d2f14bbf03be42a26b0fe58ecfeddb Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-on: http://openocd.zylin.com/2085 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-04-14cortex_a: fix endiannes issues on TI TMS570Seth LaForge1-0/+9
The TI TMS470 and TMS570 series of processors are BE-32 processors, despite BE-32 not being supported by ARM in the Cortex-R4 core. TI hacked in BE-32 support, which requires odd swizzling in OpenOCD to make memory reads and writes function correctly. In particular, without this change, OpenOCD word reads and writes had the bytes reversed, and halfword and byte packed reads were reading garbage. In my testing, this change fixes these problems. Change-Id: I21dd30f4b9003f20fcc85f674ab833407bb61f74 Signed-off-by: Seth LaForge <sethml@google.com> Reviewed-on: http://openocd.zylin.com/2064 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-01-11adi_v5: Remove unnecessary MEM-AP access functionsAndreas Fritiofson1-40/+18
It's far nicer to pass a size parameter than to split the calls to separate wrappers which are combined to a single function anyway. Change-Id: I716741ebf916f6f8e9358a31c8f4fe761107c82f Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1847 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31Clean up many C99 integer types format specifiersPaul Fertser1-2/+2
This eliminates most of the warnings reported when building for arm-none-eabi (newlib). Hsiangkai, there're many similar warnings left in your nds32 files, I didn't have the nerve to clean them all, probably you could pick it up. Change-Id: Id3bbe2ed2e3f1396290e55bea4c45068165a4810 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1674 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-02arm_adi_v5: Rewrite MEM-AP transfer implementationAndreas Fritiofson1-0/+5
Create a single pair of relatively simple functions to handle all variants of MEM-AP transfers. This replaces the many separate functions that handled different access sizes and packed or non-packed transfers, which were all implemented rather differently. With this single implementation, performance should be more consistent, regardless of transfer type. Change-Id: I89960e437fc6ba68a389c074fab8eac91abcf844 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1658 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-09-20adiv5: check packed transfers are supportedSpencer Oliver1-0/+3
Currently we try and use MEM-AP packed transfers as much as possible for 8/16bit transfers. However not all targets support packed transfers, so check before using. Change-Id: I66256007f25ccd0c583f23db5acf6d1aa8b5e57d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1602 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-06-05update files to correct FSF addressSpencer Oliver1-1/+1
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1426 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2013-04-11arm_adi_v5: fix for csw nonsecure access.Michel JAOUEN1-0/+2
Add command to fix CSW_SPROT in register AP_CSW. This solves dap apmem access in non secure access. Change-Id: I7cfcb6434d75f5cfd4a2630a059901cdeea010ce Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-on: http://openocd.zylin.com/1276 Tested-by: jenkins Reviewed-by: mike brown Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-04-02arm_adi_v5: fix mem_ap_read_buf_u32() JTAG nastiness..mike brown1-0/+21
Moved JTAG code out of transport-neutral file (arm_adi_v5.c) into transport specific file (adi_v5_jtag.c). Added ap_block_read to dap_ops interface (arm_adi_v5.h) to support the move. Change-Id: I796d3984f138aad052b97c77ac9c12ffd1158f74 Signed-off-by: mike brown <mike@theshedworks.org.uk> Reviewed-on: http://openocd.zylin.com/1277 Tested-by: jenkins Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-03-15adi_v5: search for Debug and Memory AP supportEvan Hunter1-0/+14
Adds dap_find_ap() function. Change-Id: I6643025624009b12d4936de67a605da52c07be49 Signed-off-by: Evan Hunter <ehunter@broadcom.com> Reviewed-on: http://openocd.zylin.com/909 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-03-15cortex_a : optimize apb read/write access.Evan Hunter1-2/+8
Rewrite: Adheres more closely to 'fast read/write' examples in TRM. up to 50x faster Change-Id: Ieb4da57d8367628f3e7306827a5b1f0ab550e641 Signed-off-by: Evan Hunter <ehunter@broadcom.com> Reviewed-on: http://openocd.zylin.com/903 Tested-by: jenkins Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-02-06build: cleanup src/target directorySpencer Oliver1-11/+8
Change-Id: Ia055b6d2b5f6449a38afd0539a8c66e7d7e0c059 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/430 Tested-by: jenkins
2011-04-01types: write memory now uses constØyvind Harboe1-6/+6
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2011-02-17arm_adi_v5: add/move apsel member in struct adiv5_dapLuca Ellero1-15/+18
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>
2011-02-14arm_adi_v5: add wrapping transfer functions with selection of apLuca Ellero1-1/+1
Signed-off-by: Luca Ellero <lroluk@gmail.com>
2011-02-14arm_adi_v5: add transfer functions prototypes with selection of apLuca Ellero1-0/+31
Signed-off-by: Luca Ellero <lroluk@gmail.com>
2010-12-24initial SWD transport (SWD infrastructure #2)David Brownell1-0/+3
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(-)
2010-11-05ADIv5: Implement function to lookup CoreSight componentMarek Vasut1-0/+4
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>
2010-11-05ADIv5: Introduce function to detect ROM Table locationMarek Vasut1-1/+3
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>
2010-06-19cortex a8: fix segfault for unexamined targetsØyvind Harboe1-0/+7
print error message instead of segfaulting for unexamined targets. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-16ADIv5 transport support moves to separate filesDavid Brownell1-7/+3
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>
2010-03-05ADIv5 share DAP command supportDavid Brownell1-11/+2
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>
2010-03-04rename "swjdp_common" as "adiv5_dap"David Brownell1-33/+31
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>
2010-03-02ADIv5: use new DAP ops for AP read/writeDavid Brownell1-4/+0
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>