aboutsummaryrefslogtreecommitdiff
path: root/src/target
AgeCommit message (Collapse)Author
2015-11-13target: cortex_a: add deinit_target handler to free memoryPaul Fertser
Tested with Valgrind accesing a Pandaboard. Change-Id: I51bba044974ecfc4d418998816d44a8563264123 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/3101 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-11-07target: cortex_a: do not create new register cache every resetPaul Fertser
Commit 68101e67ac16bdead3bd6d48cbe0a2bfd63aac02 introduced a regression which resulted for ever-growing registers list (as output by "reg" command), its contents were doubled every reset (actually, every examination). Change-Id: Ie3409c795160a2fc840a5e8a892928df0bcc0c57 Reported-by: Daniele Emancipato <daniele12457@hotmail.com> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/3100 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-11-07Cortex A/R : Allow interrupt disable during single-stepEvan Hunter
Example usage: cortex_a maskisr on cortex_a maskisr off cortex_r maskisr on cortex_r maskisr off Change-Id: I799288d9b848a06f561ba29ec1eb8e5eeace5685 Signed-off-by: Evan Hunter <ehunter@broadcom.com> Reviewed-on: http://openocd.zylin.com/2876 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-11-05armv7a: correct calculation of ttbr0_maskMatthias Welwarsky
This patch brings the calculation of the address ranges handled by ttbr0 and ttbr1 registers in line with ARM DDI 0406C, Table B3-1 Change-Id: Ib807c4b1cb328a6f661e1a0898e744e60d3eccac Signed-off-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-on: http://openocd.zylin.com/3006 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-11-05armv7a: re-read ttb information if ttbcr changesMatthias Welwarsky
If ttbcr is changed after the debugger has examined a target for the first time, address translations may fail. This problem does not show up with Linux because it doesn't use ttbr1, but it shows with other OS that use this feature. If the debugger connects to the target while it's in u-boot, all address translations will fail after the OS has booted and the target can not be debugged. This patch reads the ttbcr in armv7a_mmu_translate_va() and compares it a cached value. If a difference is detected, armv7a_read_ttbcr() is called to re-parse the ttb configuration and update the cache. Change-Id: I1c3adf53ea9d748a0e1e3091d9581e5c43ed64e8 Signed-off-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-on: http://openocd.zylin.com/3005 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-11-03helper/fileio: Use size_t for file size.Marc Schink
Change-Id: Ie116b44ba15e8ae41ca9ed4a354a82b2c4a92233 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/2997 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-11-03target: tell which target state is meantOleksij Rempel
If we work on smp system, the output of step command will depend on Id of default target. This patch adds additional information to help find what on which core is happening. Example of LOG after this patch. imx6.cpu.1: target state: halted ^^^^^^^^^^ target halted in ARM state due to breakpoint, current mode: Supervisor cpsr: 0x60000093 pc: 0x80076c0c MMU: enabled, D-Cache: enabled, I-Cache: enabled imx6.cpu.0: target state: halted ^^^^^^^^^^ target halted in ARM state due to debug-request, current mode: Supervisor cpsr: 0x20000193 pc: 0x802ccb6c MMU: enabled, D-Cache: enabled, I-Cache: enabled Change-Id: I536a2cce33b5ab10af9de2a43b9960320c17729f Signed-off-by: Oleksij Rempel <external.Oleksij.Rempel@de.bosch.com> Reviewed-on: http://openocd.zylin.com/2691 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-11-03cortex_m: dwt_num_comp should be set to zero in cortex_m_dwt_free()Tomas Vanek
A segmentation fault in cortex_m_endreset_event() is sometimes raised with very broken target like Kinetis Kx with erased flash and active WDOG. Debugging revealed that cortex_m->dwt_num_comp is 4 and dwt_list is NULL at cortex_m:290 Change-Id: I229c59d6da13d816df513d1dbb19968e4b5951e2 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/2989 Reviewed-by: Thomas Schmid <thomas@rfranging.com> Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-10-30quark: updating license to GPLv2+Ivan De Cesaris
Intel is relicensing our contributions to OpenOCD under GPL version 2 or any later version. We previously contributed code under GPL version 2 only. It was not our intention to differ from the standard OpenOCD license. We're correcting that here. This also applies retroactively to previous versions of our contributions to OpenOCD. Change-Id: I5e831ed95d03d2044d8e5a8375b21c6e52c933d7 Signed-off-by: Ivan De Cesaris <ivan.de.cesaris@intel.com> Reviewed-on: http://openocd.zylin.com/3044 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-10-30Cortex-M: Detect Flash Patch Revision and implement Rev. 2 handling.Uwe Bonnes
E.g. STM32F7 implements Rev.2. Supercedes abandoned patch 2755 that doesn't evaluate Flash patch revision. Change-Id: I48756b0451c7359475066969c900978a536bc328 Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-on: http://openocd.zylin.com/2868 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-09-30ADIv5: Fix typo in log messageEvan Hunter
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-09-30armv7m: Fix memory leak in register caching.Marc Schink
Change-Id: I184042d277a52f3940d6d6c13f3d94afc557933d Signed-off-by: Marc Schink <openocd-dev@marcschink.de> [andreas.fritiofson@gmail.com: don't check pointers before free()] Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2881 Tested-by: jenkins
2015-09-05server: tcl_trace commandAustin Morton
Implements async target trace output to the tcl server Change-Id: I0178f6404447337d523782a1d2c317457030da40 Signed-off-by: Austin Morton <austinpmorton@gmail.com> Reviewed-on: http://openocd.zylin.com/2588 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-08-06target/testee: manage target->stateRobert Jordens
The testee target is usefull for certain non-cpu pass-through situations, for example in the case of a spi flash mapped to the DR of a JTAG tap, as is the case for most FPGAs with SPI flashs behind them. We just manage the RUNNING/RESET/HALTED state in the testee driver to support it being halted which is a requirement for flash banks. Change-Id: I1b4d52c58a1f6bd753e126bfde74dcc5164d7b69 Signed-off-by: Robert Jordens <jordens@gmail.com> Reviewed-on: http://openocd.zylin.com/2840 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-08-06target: check memory handlers before use for all typesKarl Palsson
MMU types were checking and installing fakes at init, but this wasn't catching all devices. Fixes segfaults when attempting mdw and friends on avr. Change-Id: I5b11f9913157a21f1aeb11ec852f593b529d9be8 Signed-off-by: Karl Palsson <karlp@tweak.net.au> Reviewed-on: http://openocd.zylin.com/2791 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Andreas Färber <afaerber@suse.de>
2015-05-17server: avoid the tcl server crashing when there is no targetAustin Morton
Since commit 1d0cf0df37a4e831ca3121ba8987d5848cad3e42 ("server: tcl_notifications command") connecting to the tcl server would terminate openocd. Fix this. Change-Id: I36e2a7482f7db3a30ff7e9f969c3b6cda9599382 Signed-off-by: Austin Morton <austinpmorton@gmail.com> Reviewed-on: http://openocd.zylin.com/2759 Tested-by: jenkins Reviewed-by: Forest Crossman <cyrozap@gmail.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-04-24target/cortex_a: examination should be done every time it's asked forPaul Fertser
It was observed on AM437x that after every reset the target's debug regions are unpowered. To be able to properly communicate with the target and perform cortex_a init debug access after a reset event the examination need to be performed every time, not just on OpenOCD start. Change-Id: Idf272e127ee88341e806ee00df154eade573451d Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2723 Tested-by: jenkins Reviewed-by: Felipe Balbi <balbi@ti.com>
2015-04-24target: try to reexamine even when polling failsPaul Fertser
After intermittent connection failures or target power failures it might be necessary to try reexamination even when polling fails. This should make communication with Cortex-A targets more reliable. This was runtime tested with stlink attached to an stm32l1 and an FTDI JTAG adapter attached to an stm32f1 target. Change-Id: I38c4db8124b7f4bbf53ddda53c13273449f49c15 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2721 Tested-by: jenkins Reviewed-by: Felipe Balbi <balbi@ti.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Andreas Färber <afaerber@suse.de>
2015-04-16Fix several format specifiers errors exposed by arm-none-eabiPaul Fertser
Change-Id: I1fe5c5c0b22cc23deedcf13ad5183c957551a1b7 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2719 Tested-by: jenkins
2015-04-14target/arm_adi_v5, cortex_m: retry ahbap_debugport_init few times in case of ↵Paul Fertser
an error Some targets need arbitrary amount of time (usually not too long) after reset (both sysresetreq and srst) to do initialisation, and SWD/JTAG is not available during that. According to PSoC4 docs, the debugger should try connecting until it succeeds. Also ahbap_debugport_init might be necessary to perform after using hardware srst too, so add it there (except for the targets that support srst_nogate since they are very unlikely to need it). Change-Id: I3598d5ff7b8e0bf3a5566a57dec4b0b2b243d297 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2601 Tested-by: jenkins
2015-04-14target/cortex_a: emit a clear error message when dbgbase can't be detectedPaul Fertser
In some cases (the most obvious are TI's SoCs) ROM table lacks entries for the cores, so OpenOCD has no way to determine what debug base to use. Due to an error fixed in ec9ccaa28849 it wasn't handled properly, and OpenOCD would continue to try using dbgbase = 0, which happened to work for e.g. AM437x. This patch adds a clear indication to the user that to access such a target, dbgbase must be set manually in the config. Reported by Felipe Balbi on IRC. Change-Id: Id8533e708f44b76550eb8b659564f5f45717c298 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2603 Tested-by: jenkins
2015-04-14jtag/adi_v5_jtag: fix infinite recursion in jtagdp_transaction_endcheck()Paul Fertser
Calling ahbap_debugport_init() is wrong here because the actions performed by it might lead to jtagdp_transaction_endcheck errors thus leading to infinite recursion. The removed code is not needed now because target polling should lead to reexamination automatically, and both cortex_a and cortex_m call ahbap_debugport_init() as part of their target examine handler. This was reported as a real life issue on IRC by Weaselweb with Cortex-A target. Quitte reports similar results in some circumstances (adapter_khz too high) with LPC17xx. Change-Id: I7148022f76a1272b5262d251f2e807ffb1543547 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2697 Tested-by: jenkins
2015-04-14Cortex-A: Don't flush the data/unified cache if MMU is offUwe Kleine-König
When the SCTLR has C set but M unset (i.e. Caching on, but MMU off) the cache if effectively off. So only flush the cache if MMU is on, otherwise stale entries might be committed to memory. Change-Id: Iaff8b6f25b7a41ba838b91d45684c98f99fc0b27 Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-on: http://openocd.zylin.com/2429 Tested-by: jenkins Reviewed-by: Christopher Head <chead@zaber.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Vladimir Svoboda <ze.vlad@gmail.com>
2015-04-02target/target.c: fixed rp check bug in asynchronous flash write algorithm.DmitryShpak
Bug in read pointer check within flash write algorithm made incorrect check if block size is more than 4 bytes (bug was detected with 16 bytes block size). Change-Id: I5b8e7ebca619a0a85ae6e9e496ff792248134d81 Signed-off-by: DmitryShpak <disona@yandex.ru> Reviewed-on: http://openocd.zylin.com/2657 Tested-by: jenkins Reviewed-by: Jens Bauer <jens@gpio.dk> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-03-25target/adi_v5_swd, cortex_m: properly handle more cases requiring reconnectPaul Fertser
This brings SWD reconnection procedure in line with the ARM documentation and changes cortex_m reset procedure to make use of it. The motivation behind this patch is to make SAM4L "reset" and "reset halt" properly without SRST. The complication here is that EDBG issues an additional read of DP_RDBUFF automatically right after writing SYSRESETREQ, that leads to a FAULT which needs to be dealt with properly. With this patch the very first ahbap_debugport_init DAP access will make SWD layer properly reinitialise the link before continuing. Runtime tested with mbed CMIS-DAP + KL25 only. Change-Id: Ic506f9db30931dfa60860036b83f73b897975909 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2596 Tested-by: jenkins Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-03-25drivers/cmsis-dap: port to common SWD frameworkPaul Fertser
Valgrind-tested. Comparison of flashing performance on an FRDM-KL25Z board running mbed CMSIS-DAP variant, 5MHz clock, old driver: wrote 28096 bytes from file demo.elf in 26.833590s (1.023 KiB/s) verified 27264 bytes in 1.754972s (15.171 KiB/s) this implementation: wrote 28096 bytes from file demo.elf in 3.691939s (7.432 KiB/s) verified 27264 bytes in 0.598987s (44.450 KiB/s) Also tested "Keil ULINK-ME CMSIS-DAP" with an STM32F100 target, 5MHz clock, results reading from flash, old driver: dumped 131072 bytes in 98.445305s (1.300 KiB/s) this implementation: dumped 131072 bytes in 8.242686s (15.529 KiB/s) Change-Id: Ic64d3124b1d6cd9dd1016445bb627c71e189ae95 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2356 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-03-25armv7m_trace, stlink: provide APIs to capture trace with an adapterPaul Fertser
Change-Id: I9d193dd5af382912e4fe838bd4f612cffd11b295 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2540 Tested-by: jenkins
2015-03-25armv7m: add generic trace support (TPIU, ITM, etc.)Paul Fertser
This provides support for various trace-related subsystems in a generic and expandable way. Change-Id: I3a27fa7b8cfb111753088bb8c3d760dd12d1395f Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2538 Tested-by: jenkins
2015-03-09server, target, cortex_m: add deinit_target to the API to free resourcesPaul Fertser
This should facilitate dynamic target creation and removal. Currently it helps with getting 0 bytes lost report from Valgrind on exit (after talking to a nucleo board). However, 1,223,886 bytes in 5,268 blocks are still reachable which means the app holds pointers to that data on exit. The majority comes from the jtag command queue, there're also many blocks from TCL command registration. Change-Id: I7523234bb90fffd26f7d29cdd7648ddd221d46ab Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2544 Tested-by: jenkins Reviewed-by: Stian Skjelstad <stian@nixia.no>
2015-03-09target/target: call event handlers around examine when polling resumesPaul Fertser
The target might be using Tcl examine-start and examine-end handlers, they need to be called when the target gets reexamined after polling succeeds again. Change-Id: I371380c6f3c427ec7a0206d73426f6589f18a9bd Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2536 Tested-by: jenkins Reviewed-by: Stian Skjelstad <stian@nixia.no>
2015-03-09target/cortex_m: do not leak memory on reexaminationPaul Fertser
This bug was exposed by Valgrind. Change-Id: If50878664d928c0a44e309ca1452089c1ac71466 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2542 Tested-by: jenkins Reviewed-by: Stian Skjelstad <stian@nixia.no> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-03-09target: fix timer callbacks processingPaul Fertser
Warning, behaviour change: before this patch if a timer callback returned an error, the other handlers in the list were not called. This patch fixes two different issues with the way timer callbacks are called: 1. The function is not designed to be reentrant but a nested call is possible via: target_handle timer event -> poll -> target events before/after reexaminantion -> script_command_run -> target_call_timer_callbacks_now . This patch makes function a no-op when called recursively; 2. The current code can deal with the case when calling a handler leads to its removal but not when it leads to removal of the next callback in the list. This patch defers actual removal to consolidate it with the calling loop. These bugs were exposed by Valgrind. Change-Id: Ia628a744634f5d2911eb329747e826cb9772e789 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2541 Tested-by: jenkins Reviewed-by: Stian Skjelstad <stian@nixia.no> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-03-09arm11: initialise DPM and register cache before reading DSCR for the first timePaul Fertser
When target was already halted during the initial examination, arm11_check_init() was trying to read, store and interpret DSCR contents before the DPM structure is initialised. This caused a segfault like described on http://sourceforge.net/apps/trac/openocd/ticket/65 . This is a totally untested attempt to fix this issue. Change-Id: I2fff115679a3f0023e7a88c749ccb5f045d6cf01 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2043 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-03-09openrisc: add profiling functionFranck Jullien
Change-Id: Ifee89b289069590e6086a4713b165989578e29ec Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Reviewed-on: http://openocd.zylin.com/2494 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-03-09armv7m: do not access FPU registers when not presentPaul Fertser
This is runtime and valgrind tested with l0, l1 and f3 hla boards. Change-Id: I49b0b042253d5f3bf216997f0203583db319fe23 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2516 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-03-09armv7m: add FPU registers supportPaul Fertser
This patch adds the fpv4-sp-d16 registers to the armv7m register set. The work is inspired by Mathias K but takes a different approach: instead of having both double and single presicion registers in the cache this patch works only with the doubles and counts on GDB to split the data in halves whenever needed. Tested with HLA only (on an STM32F334 disco board). Currently this patch makes all ARMv7-M targets report an FPU-enabled target description to GDB. It shouldn't harm if the user is not trying to access non-existing FPU. However, the plan is to make this depend on actual FPU presence later. Change-Id: Ifcc72c80ef745230c42e4dc3995f792753fc4e7a Signed-off-by: Mathias K <kesmtp@freenet.de> [fercerpav@gmail.com: rework to fit target description framework] Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/514 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-03-09target/arm_disassembler: add exception related disassemblypierre Kuo
Add ERET/HVC/SMC disassebly decoding flow, below is testing result > mdw 0x5c 4 0x0000005c: e160006e e1400072 e1600073 ee110f10 > arm disassemble 0x5c 4 0x0000005c 0xe160006e ERET 0x00000060 0xe1400072 HVC 0x0002 0x00000064 0xe1600073 SMC 0x0003 0x00000068 0xee110f10 MRC p15, 0x00, r0, c1, c0, 0x00 > Change-Id: I1beccff885b5b37747edd0b2e9fb2297ce466a00 Signed-off-by: pierre Kuo <vichy.kuo@gmail.com> Reviewed-on: http://openocd.zylin.com/2548 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-03-09target/cortex_a: remove dead assignmentPaul Fertser
Found by clang static checker. Change-Id: I77b0dc18188328fdb28d07b9e5c52e06182d9e2b Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2561 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-03-09server: tcl_notifications commandAustin Morton
Implements async target notifications to the tcl server Change-Id: I4d83e9fa209e95426c440030597f99e9f0c3b260 Signed-off-by: Austin Morton <austinpmorton@gmail.com> Reviewed-on: http://openocd.zylin.com/2336 Reviewed-by: Paul Fertser <fercerpav@gmail.com> Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-02-22Remove long-deprecated "target count" and "target number" commands.Robert P. J. Day
Given that the manual states that these two subcommands are deprecated and were scheduled to be removed back in 2010, remove them and the corresponding documentation from the manual. Change-Id: Iaac633349d7fcb8b7f964109c7d26dd0cc5fc233 Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Reviewed-on: http://openocd.zylin.com/1860 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-02-22 cortex_m: Add Cortex-M0 identification to ROM-table display.Uwe Bonnes
Change-Id: Id7715a83ba9793844475629aaffd10a81ce586b6 Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-on: http://openocd.zylin.com/2549 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Stian Skjelstad <stian@nixia.no>
2015-02-22Cortex A: fix extra memory read and non-word sizesChristopher Head
Without this patch, to perform a memory read, OpenOCD first issues an LDC instruction into DBGITR in Stall mode (thus executing the instruction), then switches to Fast mode and reads from DBGDTRTX once for each word to transfer. At the very end of the transfer, the final Fast mode read of DBGDTRTX has, as always, the side effect of re-issuing the LDC instruction. This causes two problems: (1) If the word immediately beyond the end of the requested region is inaccessible, this spurious LDC will cause a fault. On a fast CPU, the LDC will finish executing by the time the poll of DSCR takes place, failing the entire memory read. On a slow CPU, the LDC might finish executing later, leaving an unexpected and confusing sticky fault lying around for the next operation to see. (2) If the LDC succeeds, it will leave the loaded word in DBGDTRTX, thus setting DBGDSCR.TXFULL=1. The cortex_a_read_apb_ab_memory routine completes without consuming that last word, thus confusing the next routine that tries to use DBGDTRTX (this may not have any visible effect on some implementations, because writing to DBGDTRTXint when TXFULL=1 is defined as Unpredictable, but I believe it caused a visible problem for me). With this patch, the bulk mem_ap_sel_read_buf_noincr is modified to omit the last word of the block. The second-to-last read of DBGDTRTX by that function will cause the issue of the LDC for the last word. After switching back to Normal mode and waiting for that instruction to finish, do a final read of DBGDTRTX to extract the last word into the buffer, leaving TXFULL=0. Without this patch, memory accesses are always expanded such that they are aligned to the access size. With this patch, accesses are issued exactly as ordered by the caller. The caller is expected to handle fragments at the beginning and end of the transfer if the address is unaligned and an unaligned access is not desired. Without this patch, the DFAR and DFSR registers, which report the location and status of data faults, are ignored while performing memory accesses, which could cause problems debugging an OS page fault handler. With this patch, DFAR and DFSR are preserved across memory accesses, and DFSR is decoded in the event of a synchronous fault to provide the caller with more information about the reason for failure. Thanks to Boris Brezillon for the original patch whose ideas led to the non-word access mechanism implemented here and to various code reviewers for their comments. Change-Id: I11ae7104fbe69a522efadefc705c9a217a7eef41 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/2381 Tested-by: jenkins Reviewed-by: Olivier Schonken <olivier.schonken@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-02-11target/profiling: Use the correct method to access registersAndreas Fritiofson
Change-Id: I6b8590dc9d07886b885013b1b767fe2f0739cd6a Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2479 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-02-11xscale: Use the correct method to access registersAndreas Fritiofson
Change-Id: I900a0787812cb24d1f74ca50eb6bb4f85375a353 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2478 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-02-11hla_target: Use the correct method to access registersAndreas Fritiofson
Change-Id: I853fc5117bdf07ecbc4584ff59d324367b2cb3e3 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2477 Tested-by: jenkins Reviewed-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-02-11cortex_m: Use the correct method to access registersAndreas Fritiofson
Convert the DWT register store to use a byte array and fix the byte order bug uncovered by that. Also fix an incorrect access of the PC value. Change-Id: Idb5acab71bdf5a96895c358324b05c335e4d32ca Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2476 Tested-by: jenkins Reviewed-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-02-11nds32: Use the correct method to access registersAndreas Fritiofson
The registers are represented as bit arrays intended to be accessed using the buf_set_* and buf_get_* functions. Storing the register values in integers enables accessing them directly, which gives different results depending on host byte order. Convert the register store to use a byte array instead and fix all the byte order bugs uncovered by that. Also merge the 32 and 64 bit register fields. Only one of them is used at a time and after the change to byte arrays their types are also the same. Change-Id: I456869a1737f4b4f5e8ecbfc1c63c49a75d21619 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2475 Tested-by: jenkins Reviewed-by: Hsiangkai Wang <hsiangkai@gmail.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-02-11mips32: add gdb target description supportAntony Pavlov
This commit is inspired by commit 1255b18fc650193094666ba8afd2018089cc9794 Author: Spencer Oliver <spen@spen-soft.co.uk> Date: Fri Sep 13 09:44:36 2013 +0100 armv7m: add gdb target description support Change-Id: I75c3971fd0599d34ed49fb73975378b57f2a4af0 Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> CC: Spencer Oliver <spen@spen-soft.co.uk> CC: Oleksij Rempel <linux@rempel-privat.de> CC: Paul Fertser <fercerpav@gmail.com> CC: Gregory Fong <gregory.0xf0@gmail.com> Reviewed-on: http://openocd.zylin.com/1972 Reviewed-by: Paul Fertser <fercerpav@gmail.com> Tested-by: jenkins
2015-02-11mips32: use 'unsigned int' for CPU register indicesAntony Pavlov
Change-Id: I77e94b2fe0943a87e1d18d88ebf2a0133aaad728 Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Reviewed-on: http://openocd.zylin.com/2216 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-02-11armv7a: fix interpretation of MMU tableDaniel Glöckner
On armv7 there no longer are 1kB pages. Instead the bit that in older architectures distinguished 1kB pages from 4kB pages is on armv7 used for as execute-never marker. There may now also be 16MB supersections with 40 bit physical address. Change-Id: I959bdb8012782a9d07d968907a21f50e3d9b356a Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net> Reviewed-on: http://openocd.zylin.com/2386 Tested-by: jenkins Reviewed-by: Vladimir Svoboda <ze.vlad@gmail.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>