aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-05-09mips32: new code for pracc execSalvador Arroyo
This is only the basic code proposed for mips32_pracc_exec() function. It checks every pracc address against the expected address when reading (instruction fetch). The code expects to start at PRACC_TEXT and any subsequent read address is obtained by adding 4 to the previous one. After shifting out all the instructions the code executes a final check. It checks now for the first pass trough PRACC_TEXT and shift out only NOP instructions. A mips core does not need an additional NOP and after the first check it exits if there is no store access pending. After shifting out one NOP the core must be reading at pracc text or the code exits with error. The code continues shifting out NOPs until all store accesses have been performed. After shifting out 10 NOPs it exits with error. No assumption is made about the number of store instruction shifted out or the ordering of the store accesses. It only checks that the number of store accesses is the same as the number of store instructions at dmseg after execution. mips32_pracc_read_ctrl_addr() and mips32_pracc_finish() are added to simpify a bit the code. Fields pa_ctrl and pa_addr are added in ejtag_info for storing values of pracc control and address. Change-Id: If6322d5c8cbeadcd4acd3972c0f72c8490f53c34 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/1827 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2014-05-09mips32: cleanups in legacy pracc codeSalvador Arroyo
This is the first patch intended to make a more precise pracc check when running in legacy mode (code executed by mips32_pracc_exec()). It only makes some cleanups, mostly due to unnecessary code. With the last cache optimizations for processor access (pa for short) all the pracc functions generate the code following some rules that make pa more easily to check: There are no load instructions from dmseg. All the read pas are instruction fetches. PARAM_IN related stuff is not needed. Registers are restored either from COP0 DeSave or from ejtag info fields. PRACC_STACK related stuff is not needed any more. The code starts execution at PRACC_TEXT and there are no branch or jump instruction in the code, apart from the last jump to PRACC_TEXT. The fetch address is ever known. For every store instruction to dmseg the function code sets the address of the write/store pa. The address of every store pa is known. Current code ends execution when reading a second pass through PRACC_TEXT. This approach has same inconveniences: If the code starts in the delay slot of a jump it makes a jump to PRACC_TEXT after executing the first instruction. A second pass through PRACC_TEXt is read and the function exits without any warning. This seems to occur sometimes when a 24kc core is halted in the delay slot of a branch. If a debug mode exception is triggered during the execution of a function the core restarts execution at PRACC_TEXT. Again the function exits without any warning. If for whatever reason the core starts fetching at an unexpected address the code now sends a jump instruction to PRACC_TEXT, but due to the delay slot the core continues fetching at whatever address + 4 and a second jump instruction will be send for execution. The result of a jump instruction in the delay slot of another jump is UNPREDICTABLE. It may work as expected (ar7241), or let the core in the delay slot of a jump to PRACC_TEXT for example. This means the function called next may also fail (pic32mx). Change-Id: I9516a5146ee9c8c694d741331edc7daec9bde4e3 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/1825 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2014-05-09mips: use cp0 DeSave to cache $15 / t7Salvador Arroyo
Near all pracc functions store $15 in DeSave and restore it when exiting. There is no need to save it, if mips32_pracc_read_regs() save this register in Desave when entering debug mode. mips32_pracc_write_regs() needs to update it when exiting debug mode. Other pracc functions must not modify DeSave. The jump code in the fastdata transfer function needs also some little modifications. Remark: Like in current code the user can read/modify $15 with the cp0 31 commands. Change-Id: I5b7dfc1b6169da846f5d2dd3ad4209a9da2c3fad Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/1565 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2014-05-09mips: load fast data transfer handler code with mips32_pracc_write_mem()Salvador Arroyo
Currently the code is loaded calling mips32_pracc_write_mem_generic(). Cache synchronization is not performed. If configured as write back cache there is no chance to execute the handler. If configured as write through cache and the cache lines written to are not cache resident (I-side cache miss) may work. The patch makes possible to execute the handler in a cached active memory segment (mainly from KSEG0), but nothing else. The data is still loaded without performing cache synchronization, code loaded may not be executable. Performance may not be faster. At start, for example, the code resides in main memory, not in cache, and the core must transfer code from memory. We can really modify the code to force a wait for the first transfer like we do with start and end addresses, making sure the code is cache resident for the rest of the queued transfers. This can also may happen if we execute code (greater than the I cache size) and the handler code is evicted from the cache. Code tested on ar7241. Change-Id: Iffdb4dae108b872fef0e7bacc5ea99649cdc1630 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/1564 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2014-05-09mips: load code in buffer modeSalvador Arroyo
Currently the functions mips32_checksum_memory() and mips32_blank_check_memory() load the code word by word. The bug in cache code is a good reason for doing so. If there is no other reason we can load the code as a buffer to save time. mips_m4k_write_memory() expect a buffer in target endianness, this is done by target_buffer_set_u32_array(). Cleaned up exit code. Tested on ar7241 big endian and pic32mx little endian with verify_image. Flash erase check only tested in pic32mx. Change-Id: Ib63ed98732b2e23b058e7349a0a57934b7604905 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/1562 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-05-09mips32: optimized cache code for pracc accessSalvador Arroyo
Follows the the same rules of optimization used by all pracc functions. Solves some bugs in previous code and adds support for write through caches. Change-Id: If88c6738ca8c8197f327f22b766120a24f71b567 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/1557 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2014-05-09Update to the current Jim TclPaul Fertser
This is a post-release version but hopefully some fixes that went in are worth it; also the changes here make OpenOCD compatible with stock 0.75 version if a distro maintainer decides to use it. Change-Id: I7ad1814c7c4868198475cdca4750c3d0ee4f5f8b Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2121 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2014-05-09README.OSX: recommend XCode 5 as that's the current versionPaul Fertser
Using current "Command Line Tools" with XCode 4 is known to provoke issues (the build "hangs"), see e.g. http://stackoverflow.com/questions/18667916/xcrun-lipo-freezes-with-os-x-mavericks-and-xcode-4-x This fixes https://sourceforge.net/p/openocd/tickets/70/ . Change-Id: I511b347b9388e0e3f1d136b566915021c4b5fbde Reported-by: n321203 <n321203@users.sf.net> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2128 Reviewed-by: Xiaofan <xiaofanc@gmail.com> Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2014-05-09ftdi: Optimize GPIO togglingAndreas Fritiofson
Only send the new I/O state for the bytes that changed. Change-Id: I930edc9518e6019331e68e4756acc5e92dda25a4 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1999 Tested-by: jenkins Reviewed-by: Jens Bauer <jens@gpio.dk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2014-05-05svf: Fix debug and error messages that print hex bufferKamal Dasu
Added SVF_BUF_LOG macro to properly print the hex buffer of parsed string for SIR, SDR, TDI, TDO and MASK. The original debug and error logs with respect to printing real values were misleading and also had endianess issues. All the bits are printed now instead of just u32 values. Change-Id: Ie89902403bdb61ff458418446c2ca1253ea2a63f Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com> Reviewed-on: http://openocd.zylin.com/1964 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2014-05-05doc: document [start end] parameters of "profile" commandPaul Fertser
Change-Id: I56561b08304e5b854a67b06ab6b9cee7a24919b2 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2115 Tested-by: jenkins
2014-05-05generalplus: Add configuration file for General Plus GP326XXXA seriesAndrey Smirnov
Add configuration file for General Plus GP326XXXA series. Tested on GP326833A on GPC-1737B board. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Change-Id: I1ad0e22598b01317bbc823870a7a262e9192c595 Reviewed-on: http://openocd.zylin.com/2058 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-05-05armv7a: fix typo in cache_config help textSpencer Oliver
Change-Id: I48cb83bf56b2f6841c3add68ed94b9f92037357d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2114 Tested-by: jenkins
2014-05-05Fix some C99 format specifiersPaul Fertser
As exposed by arm-none-eabi build, fix the wrong modifiers. Change-Id: Ia6ce7c5c1d40e95059525c3e5d81b752df2fea7c Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2122 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-05-05Add support for Gumstix AeroCore deviceAsh Charles
The Gumstix AeroCore board [1] contains a STM32F427 microcontroller. Schematics for this board will also be made available [2]. The JTAG interface for this chip can be accessed via a USB connection provided by an FTDI chip (0403:6011). [1] https://store.gumstix.com/index.php/products/585/ [2] https://pubs.gumstix.com/boards/AEROCORE Change-Id: I0bf3bb525f51528bedd807b1f7210b09ef2e1015 Signed-off-by: Ash Charles <ashcharles@gmail.com> Reviewed-on: http://openocd.zylin.com/2117 Reviewed-by: Paul Fertser <fercerpav@gmail.com> Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-04-27Restore normal development cyclePaul Fertser
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2014-04-27The openocd-0.8.0 releasev0.8.0Paul Fertser
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2014-04-27nrf51: remove dereference of null pointerSpencer Oliver
found by clang 3.4. Change-Id: Id499b546f65acd7a719498bc97e33b21d1ba565a Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2119 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
2014-04-27quark_x10xx: fix IO r/w operations with paging enabledIvan De Cesaris
Paging checking and disabling wasn't present for IO r/w, so the commands were successful only when paging wasn't enabled (e.g. EFI boot phase). Change-Id: I41366c0fadff3ea1eb8a153291f20a46cd9ddec1 Signed-off-by: Ivan De Cesaris <ivan.de.cesaris@intel.com> Reviewed-on: http://openocd.zylin.com/2118 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-04-15Restore -dev suffixPaul Fertser
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2014-04-15The openocd-0.8.0-rc2 release candidatev0.8.0-rc2Paul Fertser
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2014-04-15NEWS: minor fixes for rc2Paul Fertser
Change-Id: Iba04baae4f3278db8b36283574a82c077d28bb4a Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2113 Tested-by: jenkins
2014-04-14svf: try to reallocate buffers if they're not enoughPaul Fertser
On larger FPGAs the default buffer size is not nearly enough; automatically reallocate it as needed. Change-Id: Ic8071e8cceddeef897ce76996c029250fd22662b Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2099 Tested-by: jenkins Reviewed-by: Kenneth Lorthioir <ibelimb@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-04-14cortex_a: fix endiannes issues on TI TMS570Seth LaForge
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-04-14usb_blaster: fix warning: array subscript has type ‘char’Spencer Oliver
caught by clang 3.4 running on cygwin. Change-Id: I59f652337334e557fb50374f5270ba9c30392b6e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2100 Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2014-04-14mips32, dsp563xx: fix segfault on Gdb attachPaul Fertser
Since c6216201b249e6a97fcc085e413e3d34e0de6fb7 gdb target description generation support is enabled by default and it counts on checking "feature" pointer in reg_list. Both mips32 and dsp563xx neither used calloc nor explicitly set feature (as it was a newly introduced struct field). This patch changes all targets to use calloc for consistency. Change-Id: I9eceadef8b04aacb108e24ae23cb51ca3009586f Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2102 Tested-by: jenkins Reviewed-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-04-14configure: presto ftdi driver requires libftdiPaul Fertser
Change-Id: I4b04eec5084d4b8129e2aff8f3411c6d92e84431 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2101 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2014-04-14jtag/drivers/remote_bitbang: use sizeof to determine maximum unix socket ↵Paul Fertser
path length Different *nix systems use different constants, so sizeof should be used instead. This fixes the build on OS X (as sun_path length is hardcoded to 104 on Darwin). Change-Id: I1df611383dedcfc6d153ec59b453a895c7d84e94 Reported-by: Xiaofan Chen <xiaofanc@gmail.com> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2095 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2014-04-14target: fix incorrect arm cpu monitor mode encodingTim Sander
According to the "Arm Arch Ref Manual ARMv7-a and ARMv7-R edition" the CPSR encoding for Monitor mode is 0b10110 (22) not 0b11010 (26) as is currently used. Change-Id: I73373a0029a81abc92febf518b88bf0dd4dec1fa Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2081 Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Tested-by: jenkins Reviewed-by: Younes REGAIEG <y.regaieg@gmail.com> Reviewed-by: Tim Sander <tim@krieglstein.org> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2014-04-14tcl: bcm6348 target config, BT HomeHub v1 board configLee Bowyer
Also add the board to the firmware recovery script. Change-Id: I4f9c895dae171df7249e3b1c0563b288518b9fe0 Signed-off-by: Lee Bowyer <lee@sodnpoo.com> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2097 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-04-14contrib/rpc_examples: add example for python3Andreas Ortmann
Halt, resume, memory read/write are used in various ways. Change-Id: Ia6727678bfc19cc764f822b739bddaae56e9dc70 Signed-off-by: Andreas Ortmann <ortmann@finf.uni-hannover.de> Reviewed-on: http://openocd.zylin.com/2000 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-04-14openocd.rules: match CMSIS DAP devices by product stringPaul Fertser
Since the standard requires to have "CMSIS-DAP" somewhere in product string, use that to automatically match all the compliant adapters. Change-Id: I1e2ac088333a7d69a136af825248914339debdd8 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2082 Tested-by: jenkins Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-04-14parport: add "aspo" hotpluggable adapter configKarl Hammar
This adds a new adapter config. Design files are available from: http://turkos.aspodata.se/git/openhw/isp/pp_jtag_arm20.sch http://turkos.aspodata.se/git/openhw/isp/pp_jtag_arm20.pcb No need to document it anywhere as only a single device was ever built. Change-Id: If031fdb9dedb1e544401747bfb7fbc5afc4d5407 Signed-off-by: Karl Hammar <karl@aspodata.se> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2094 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-04-14target/cortex_a: check gdb_service before dereferencing in update_halt_gdbPaul Fertser
If gdb was disconnected by the moment the target entered halted state, update_halt_gdb would segfault. Change-Id: I67477e9199c1df097be83a49e38602f975c083f5 Reported-by: Younes REGAIEG <younes.regaieg@imag.fr> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2098 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-04-14README.OSX: add 10.9 specific hintsPaul Fertser
Change-Id: I8c684f2964262fb0670ed74fded26676833aee10 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2080 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2014-04-14Makefile.am: fix build for libftdi1, pass CFLAGS where appropriatePaul Fertser
Change-Id: I9d8afa6ae32fc01e69ec434b5bc9d71524d386a2 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2079 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2014-04-08jtag/aice/aice_usb: remove unused constantsPaul Fertser
Those are breaking the build with clang 3.4 (current default compiler on OS X 10.9.2). Change-Id: I9f2fbfbb6d544498cb8d6a62565e4ebe7223e784 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2077 Tested-by: jenkins Reviewed-by: Hsiangkai Wang <hsiangkai@gmail.com>
2014-04-08flash/nor/at91sam3: remove sam3_page_write_opcodesPaul Fertser
Apparently this helper was never actually used, and current clang produces an unused const variable warning, so it's breaking the build. Change-Id: Ib088bef5e9c0a48942c1d417d46f738469ee7e28 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2076 Tested-by: jenkins Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2014-03-30Restore -dev suffixPaul Fertser
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2014-03-30The openocd-0.8.0-rc1 release candidatev0.8.0-rc1Paul Fertser
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2014-03-30Don't cast return value of [cm]allocAndreas Fritiofson
Change-Id: I0028a5b6757b1ba00031893d9a2a1725f915a0d5 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2069 Tested-by: jenkins Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-30Makefile.am: fix adding contrib directory for distPaul Fertser
With extra / the directory was getting added as a subdirectory of itself. Change-Id: I5a3d5635f3c949f39d88b34a2ddab8244643f560 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2070 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-29NEWS: add release highlightsPaul Fertser
Change-Id: Ifa4459b3b7b58b639d6c885a2ea88cefbfac2680 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1881 Tested-by: jenkins
2014-03-29at91smad: Fixes to 'samd_protect'Andrey Smirnov
Some fixes to 'samd_protect' including: - Fix a bug in which the value of 'set' parameter passed into the function was ignored so it was impossible to remove flash protection once it was set. - Check the protection status of the sector via 'is_protected' field of the corresponding 'flash_sector' structure to see if any actual HW manipulations needs to be done. - Change the way the errors during protection activation are handled. Now even in the case of error in the middle of protecting a number of sectors the subroutine would still update the state of the sector protection in sectors array so as to avoid cases where openocd thinks that the sector is not protected while it actually is. Change-Id: I4cc6445a98ec13bdd94c89f0711c17840738a215 Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-on: http://openocd.zylin.com/2027 Tested-by: jenkins Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-03-29at91samd: Bail early if trying to erase protected sectorAndrey Smirnov
Bail early if trying to erase protected sector and also do not double-erase already erased sectors. Change-Id: Ic2d39af48c3b8e10e78d52dd978b9bc01f671c6a Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-on: http://openocd.zylin.com/2026 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-03-29at91samd: Bail early if trying to write to protected sectorAndrey Smirnov
Bail early if trying to write to protected sector also mark the sector we are writing to as dirty. Change-Id: I892f83461792e1cc2dcccade7aa65717831a6805 Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-on: http://openocd.zylin.com/2025 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-03-29at91samd: Remove 'first' and 'last' checks in 'samd_erase'Andrey Smirnov
Remove 'first' and 'last' checks in 'samd_protect' since those parameters are checked in 'handle_flash_erase_command'. Change-Id: I30e5598a9ab656d81055f26cc63e291377605300 Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-on: http://openocd.zylin.com/2024 Tested-by: jenkins Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-03-29tcl: introduce init_target_events and use it for gdb flashing eventsPaul Fertser
This introduces a new global Tcl procedure that is run just after init_targets and before init_boards. Its default behaviour is to assign gdb-flash-erase-start and gdb-flash-write-end to reasonable defaults. The rationale for doing "reset init" before gdb erases and flashes memory is that all flash drivers are written in assumption that they can safely be used only after chip reset (plus chip-specific configuration in the init handler if any). The need to use "reset halt" after flashing is because a user expects running firmware after loading to be the same as running it from power-on-reset. Change-Id: I9ddc4047611904ca4ca779b73376d2739611948a Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2062 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-29tcl/target: make milandr configs swd-compatiblePaul Fertser
Change-Id: Ibb34f0d7829b205341bcce511ffc2624bdfe2c75 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1962 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-29target: remove memory leaksSpencer Oliver
Found by clang. Change-Id: Ifb25dca52f8d9e8e46a35f0947a7239f26eb3757 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2067 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de>