summaryrefslogtreecommitdiff
path: root/src/target
Commit message (Collapse)AuthorAgeFilesLines
...
* dsp563xx_once: Correct wrong return value on jtag communication errorsMathias K2011-02-171-7/+7
| | | | | | | | This patch change the return value on a jtag communication error to TARGET_UNKNOWN because this function should return the current target status and not a error code from the underlying api call. Also the validity of the jtag_status is extended to all static bits in this value.
* - remove pipeline context, use once register instead - fix wrong register ↵Mathias K2011-02-172-71/+82
| | | | write in resume and step function - add more conditional branch handling
* - add parameter flush to the once api to signalize if the jtag queue need to ↵Mathias K2011-02-153-167/+90
| | | | be flushed after the command
* - add bulk memory write function - execute jtag queue at the end of the ↵Mathias K2011-02-151-11/+47
| | | | memory transfer
* dsp563xx_once: Correct definition of JTAG_INSTR_CLAMPPhil Fong2011-02-151-1/+1
| | | | | | | | | | | I've been working on Rodrigo on adding support to flash Freescale dsp56800e devices and have been looking at the dsp563xx code. I think the define for the JTAG CLAMP instruction in dsp563xx_once.c is incorrect. It should be 0x05 according the Freescale AN2074 (and is also 0x05 in the dsp568xx according to AN1935). It won't actually change anything in OpenOCD since this define is not used anywhere (as far as I can tell).
* cortex_a9: move dap_ap_select to arm_avi_v5Luca Ellero2011-02-141-92/+66
| | | | | | | | | | | | | | | dap_ap_select was used in the code at various points, but that can lead to confusion, without any knowledge of what AP is really selected at some points. Some bugs derive from this (for example md/mw doesn't work well after issueing "dap apsel" command). Moving it to arm_adi_v5.c (using mem_ap_sel* functions instead of mem_ap_*) make the code more clear and more easier to maintain. In the future it should be made "static" to avoid its use outside arm_adi_v5 One further benefit is the various goto has been removed as well Signed-off-by: Luca Ellero <lroluk@gmail.com>
* arm_adi_v5: add wrapping transfer functions with selection of apLuca Ellero2011-02-142-1/+75
| | | | Signed-off-by: Luca Ellero <lroluk@gmail.com>
* arm_adi_v5: add transfer functions prototypes with selection of apLuca Ellero2011-02-141-0/+31
| | | | Signed-off-by: Luca Ellero <lroluk@gmail.com>
* cortex_a9: check if MMU is enabled on APB read/write memoryLuca Ellero2011-02-141-0/+22
| | | | Signed-off-by: Luca Ellero <lroluk@gmail.com>
* cortex_a9: check target halted on APB read/write memoryLuca Ellero2011-02-141-0/+12
| | | | Signed-off-by: Luca Ellero <lroluk@gmail.com>
* cortex_a9: trivial fixesLuca Ellero2011-02-141-6/+7
| | | | Signed-off-by: Luca Ellero <lroluk@gmail.com>
* buikd: fix cygwin -mno-cygwin build errorSpencer Oliver2011-02-101-1/+1
| | | | | | Remove duplicate inline that causes certain versions of gcc to choke. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* cortex_a9: implement read/write memory through APB-APLuca Ellero2011-02-101-31/+129
| | | | | | | | | | | | | | | This patch adds read/write capability to memory addresses not accessible through AHB-AP (for example "boot ROM code"). To select AHB or APB, a "dap apsel" command must be issued: dap apsel 0 -> following memory accesses are through AHB dap apsel 1 -> following memory accesses are through APB NOTE: at the moment APB memory accesses are very slow, compared to AHB accesses. Work has to be done to get it faster (for example LDR/STR instead od LDRB/STRB) Signed-off-by: Luca Ellero <lroluk@gmail.com>
* cortex_a9: fix dap_ap_select() usageAaron Carroll2011-02-101-6/+20
| | | | | | | Save, select and restore AP in cortex_a9_step and cortex_a9_init_debug_access. Fixes a bug where the wrong AP is selected after a reset. Signed-off-by: Aaron Carroll <aaronc@cse.unsw.edu.au>
* dsp563xx: add x, y and p memory accessMathias K2011-02-082-73/+311
| | | | | | | | | | | Hello, this patch add commands to access to x,y and p memory. For run time optimization some local jtag function was changed to static inline. Regards, Mathias
* cortex_a8/a9: fix some commentsLuca Ellero2011-02-082-8/+8
| | | | Signed-off-by: Luca Ellero <lroluk@gmail.com>
* more changes to dsp563xx codeMathias K2011-02-034-462/+1025
| | | | | | | | | | | | | Hello, this patch adds the missing cpu registers and the correct read/write register functions and fixed most of the halt/step/resume issues. The complete missing error propagation was added. + fix tab/spaces Regards, Mathias
* 24bit buffer supportMathias K2011-02-032-0/+20
| | | | | | | | | | Hello, this patch add 24bit support to the target buffer functions and little/big endian functions. Regards, Mathias
* cortex_m3: allow scripts to override resetAaron Carroll2011-02-021-0/+10
| | | | | | | If a handler for the reset-assert event it present, skip the usual reset handling. This is needed, for example, for board-level resets. Signed-off-by: Aaron Carroll <aaronc@cse.unsw.edu.au>
* cortex_a9: add source files for Cortex A9 support.Aaron Carroll2011-01-314-1/+2275
| | | | | | add target and build support for A9 Signed-off-by: Aaron Carroll <aaronc@cse.unsw.edu.au>
* arm_dpm: add some SCR/RCR macrosAaron Carroll2011-01-311-2/+8
| | | | Signed-off-by: Aaron Carroll <aaronc@cse.unsw.edu.au>
* Add '-coreid' target option to support multiple cores per TAP.Aaron Carroll2011-01-312-0/+23
| | | | | | | | | | | ARM Cortex-A9 multi-core chips expose a single TAP/DAP which connects to both cores. The '-coreid' option selects which core the target should connect to. Note that at present, OpenOCD can connect to either core, but not both simulatenously, until ADI contexts can be shared. Signed-off-by: Aaron Carroll <aaronc@cse.unsw.edu.au>
* 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>
* nit: more LOG_* \n fixesEric Wetzel2011-01-093-14/+14
| | | | | | | | | Remove extra \n from LOG_DEBUG, LOG_INFO, and LOG_WARNING messages Remove LOG_INFO_N LOG_INFO_N was only used once and had a \n at the end Change LOG_USER_N calls that end with \n to LOG_USER
* nit: do not add \n at end of LOG_ERROREric Wetzel2011-01-051-12/+12
| | | | Fixed in many other places, and submitted in response to Øyvind's invitation.
* mips32: add fastdata loader working areaSpencer Oliver2011-01-046-11/+29
| | | | | | | | | | Add a working area that is preserved between calls to mips_m4k_bulk_write_memory - this gives us a speed increase of approx 3kb/sec during flash writes to the pic32mx. This area is released during a resume/reset. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* target: change working area free data typeSpencer Oliver2011-01-042-3/+3
| | | | | | | We only use the struct working_area member 'free' as a true/false type so might as well use a bool data type. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* error handling: the error number is not part of the user interfaceØyvind Harboe2011-01-034-7/+8
| | | | | | | | Do not propagate error number to user. This is for internal programming purposes only. Error messages to the user is reported as text via LOG_ERROR(). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* 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>
* Compilation Warnings on OS X 10.5Andrew MacIsaac2010-12-294-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I received a number of "-Wshadow" related warnings (treated as errors) while trying to build on OS X Leopard. In addition, there were two miscellaneous other warnings in the flash drivers. Attached are two patches which correct these issues and the commit messages to accompany them. My system has the following configuration (taken from uname -a): Darwin 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 === Werror_patch.txt Commit Message === compilation: fixes for -Wshadow warnings on OS X These changes fix -Wshadow compilation warnings on OS X 10.5.8 Compiled with the following configure command: ../configure --prefix=/usr/local --enable-maintainer-mode --enable-jlink --enable-ft2232_libftdi === flash_patch.txt Commit Message === compilation: fixes for flash driver warnings on OS X These changes fix two compilation warnings on OS X 10.5.8: ../../../../src/flash/nor/at91sam3.c:2767: warning: redundant redeclaration of 'at91sam3_flash' ../../../../src/flash/nor/at91sam3.c:101: warning: previous declaration of 'at91sam3_flash' was here and ../../../../src/flash/nor/stmsmi.c:205: warning: format not a string literal and no format arguments Compiled with the following configure command: ../configure --prefix=/usr/local --enable-maintainer-mode --enable-jlink --enable-ft2232_libftdi === Andrew
* warnings: use more 'const' for char *Øyvind Harboe2010-12-299-10/+10
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* target: do not expose error numbers to usersØyvind Harboe2010-12-291-6/+0
| | | | | | | error numbers are only reported at DEBUG log levels and used internally, they are not part of the user interface. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* initial SWD transport (SWD infrastructure #2)David Brownell2010-12-243-8/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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(-)
* config: add init_targets proc that is executed just before initØyvind Harboe2010-12-221-0/+8
| | | | | | | | | | | this allows configuration scripts to export a init_targets proc rather than setting up the target directly. This allows for new conventions in how to set up target vs. board script and how to transfer default settings between board and target scripts. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* xscale: trace buffer remains enabled until explicitly disabledMike Dunn2010-12-042-54/+97
| | | | | | | | | | | | | | | | | | | | | Hi everyone, Since a call went out for patches... been sitting on this for months. For some reason, the xscale trace buffer is automatically disabled as soon as a break occurs and the trace data is collected. This patch was a result of the frustration of always re-enabling it, or else hitting a breakpoint and checking the trace data, only to discover that I forgot to re-enable it before resuming. Don't see why it should work this way. There is no run-time penalty, AFAIK. Along the way, I also cleaned up a little by removing the ugly practice of recording wrap mode by setting the fill count variable to "-1", replacing it with an enum that records the trace mode. I've been using this for months. Comments, criticisms gratefully received. Mike Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
* cortex_m3: change cortec_m3 reset_config behaviourSpencer Oliver2010-12-032-19/+2
| | | | | | | | | Currently the cmd 'cortex_m3 reset_config' will overide the default target's 'reset_config'. Chnage the behaviour to use the target 'reset_config' if configured and fallback if not. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* profile: use 100Hz as a default sampling frequencyØyvind Harboe2010-12-011-2/+2
| | | | | | | | it's a lie that is somewhere in the vicinity of the truth. Certainly 64MHz confuses gprof and produces zero output and no error messages. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* fastload: fix error handling upon running out of memoryØyvind Harboe2010-11-221-6/+16
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* build: add common.mkSpencer Oliver2010-11-181-4/+1
| | | | | | | Rather than specifying common makefile variables move them all to a common.mk. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* cortex_m3: report detected error condition in pollØyvind Harboe2010-11-091-6/+13
| | | | | | | | | | | | If the CPU crashed at some point, poll will discover this. Previously the poll fn would clear the error and print a warning, rather than propagating the error. The new behavior is to report the error back up, but still clear the error. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* target: document that target_poll() will report and clear sticky errorsØyvind Harboe2010-11-091-0/+12
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* CortexA8: Implement debug base autodetectionMarek Vasut2010-11-051-7/+12
| | | | | | | Implement autodetection of debug base. Also, implement a function solving various hardware quirks (like iMX51 ROM Table location bug). Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
* ADIv5: Implement function to lookup CoreSight componentMarek Vasut2010-11-052-0/+45
| | | | | | | 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-052-27/+56
| | | | | | | | | | | 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>
* arm964e: Add support for ARM946E target.ddraskovic2010-11-044-0/+769
| | | | | | | | | | | | | | | | | So far most of the people have been using existing ARM966E in the place of ARM946E, because they have practically the same scan chains. However, ARM946E has caches, which further complicates JATG handling via scan-chain. this was preventing single-stepping for ARM946E when SW breakpoints are used. This patch thus introduces : 1) Correct cache handling on memory write 2) Possibility to flush whole cache and turn it off during debug, or just to flush affected lines (faster and better) 3) Correct SW breakpoint handling and correct single-stepping 4) Corrects the bug on CP15 read and write, so CP15 values are now correctly R/W
* jim tests: use installedØyvind Harboe2010-10-294-31/+46
| | | | Delete obsolete jim that comes with OpenOCD.
* src: add loader src descriptionSpencer Oliver2010-10-283-0/+6
| | | | | | - add comment where to find the various loaders src files. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* Make systesetreq typos read sysresetreq insteadPeter Stuge2010-10-251-1/+1
| | | | Signed-off-by: Peter Stuge <peter@stuge.se>
* TARGET: review handle_load_image_command()Antonio Borneo2010-10-121-16/+8
| | | | | | | | Collect variable definitions. Report syntax error to command dispatcher. Propagate error when unable to open file. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>