aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2014-06-01Flash/LPC2000: Add support for auto-probing flash sizeCosmin Gorgovan
Adds support for auto-probing on devices which support the IAP Read Part ID command. Includes IDs for all LPC17XX, LPC13XX, LPC11XX and LPC11XXX devices with publicly available user manuals. To use auto-probing, select the 'auto' lpc2000 variant. Change-Id: Ic617c32925c9ebe0e9d9192ed8ddbfa08e9f0aaa Signed-off-by: Cosmin Gorgovan <cosmin@linux-geek.org> Reviewed-on: http://openocd.zylin.com/2075 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-01Flash/LPC2000: Add support for LPC11(x)xx, LPC13xxCosmin Gorgovan
LPC11(x)xx and LPC13xx devices are mostly compatible with the lpc1700 variant of the LPC2000 driver, but use a fixed flash sector size of 4KB. Change-Id: I033515f4ff6bc61d3b9babd27096f78c99cea927 Signed-off-by: Cosmin Gorgovan <cosmin@linux-geek.org> Reviewed-on: http://openocd.zylin.com/2071 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-06-01STM32F2x: Don't clear FLASH_OPTCR bits when locking registerElliott Partridge
stm32x_write_options is locking the FLASH_OPTCR register by writing 0x00000001 to it, which clears the other bits. This causes problems with subsequent flash operations; the hardware is probably seeing the write protection bits in the register set to '0' (protect), causing a WRPERR. This patch ORs the value of the register with 0x00000001, so that the only change is the lock bit itself. Change-Id: I0e3ca9aa6563ce1b57a01fc0faf7563b6b85f620 Signed-off-by: Elliott Partridge <elliott.partridge@gmail.com> Reviewed-on: http://openocd.zylin.com/2155 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-06-01Disable multiprocessor-id read on ARMv7-R coresAlex Ray
ARMv7-R cores are largely uniprocessor-configured, and when they are multiprocessor-configured the format of the MPIDR register isn't compatible with ARMv7-A cores. Change-Id: I024ec514496fbab5075c6fb34b6acd870e68e1fc Signed-off-by: Alex Ray <a@machinaut.com> Reviewed-on: http://openocd.zylin.com/2096 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-06-01src/target: select the last created target as currentPaul Fertser
Configuration commands assume the last created target is the one they should be applied to. An example of this is sourcing an stm32f1.cfg several times to access several microcontrollers on the same JTAG chain where cortex_m reset_config should apply to the target that was just created, not to the first one. This fixes http://sourceforge.net/p/openocd/tickets/71/ . Change-Id: I1ca41cc05fe5f36c4bc62dde4614da1405754fd8 Reported-by: Michael Eischer <mieischer@users.sf.net> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2142 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-06-01jtag/drivers/stlink: allow to reconnect seamlessly after polling failurePaul Fertser
If the communication with the target was failing (either because of an intermittent connection or the target was rebooted), this is needed to reestablish operational state. Reported-by: Tim Sander <tim@krieglstein.org> Tested-by: Tim Sander <tim@krieglstein.org> Change-Id: I91ea2e2b2b5ef8eb27dfe9bae95ef2a919f67e4e Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2152 Tested-by: jenkins Reviewed-by: Tim Sander <tim@krieglstein.org> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-06-01target: reexamine after polling succeeds againPaul Fertser
If polling was failing, it likely meant that either the target was disconnected or rebooted. In the latter case it needs to be reexamined to be properly configured for the debug session, so do it just in case. Reported-by: Tim Sander <tim@krieglstein.org> Tested-by: Tim Sander <tim@krieglstein.org> Change-Id: I5b067c18d9276d4e86cc59739f196ae7d0931622 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2151 Tested-by: jenkins Reviewed-by: Tim Sander <tim@krieglstein.org> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-06-01adi_v5_cmsis_dap: Fix logging order of appearanceAndrey Smirnov
Move logging for cmsis_dap_queue_ap_read/write to happen after a call to cmsis_dap_ap_q_bankselect so that that SWD operation would appear in the log in the same sequence they happen on the bus. Change-Id: Ic046bc753e661da7924b019c9100d6932fb686bf Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-on: http://openocd.zylin.com/2087 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2014-06-01arm_adi_v5: Do not ignore register polling timeoutAndrey Smirnov
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 Smirnov
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-05-31flash/nor/stm32f1x: add support for F04x partsPaul Fertser
Ref. RM0091 Rev.6. Change-Id: I13bcdb1741edc59712e4fa1849fff38d17709fa7 Reported-by: efuentes@irc.freenode.net Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2150 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-05-31server: fix confusing wording for incoming tcp connectionsPaul Fertser
Change-Id: I40d5de322f3fc38097e04ce538b0fc2b136e0d6a Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1937 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-05-31target/mips32_pracc: fix C99 format specifiersPaul Fertser
Warnings exposed by arm-none-eabi build. Change-Id: Icdaf168d7aaa1a62bdfd41a64e43ef94816d3721 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2140 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-05-31quark_x10xx: cleanup of LOG format specifiersIvan De Cesaris
Fix for LOG format specifiers, this is a superset of those exposed by the arm-none-eabi build. Add 0x prefix for all values printed in hex. Add LOG messages for error cases when enabling or disabling paging. Change-Id: I070c556e0ad31204231a2b572e7b93af22a9bc61 Signed-off-by: Ivan De Cesaris <ivan.de.cesaris@intel.com> Reviewed-on: http://openocd.zylin.com/2149 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-05-16lpcspifi: setup a valid stack pointer before calling ROM code using stackAurelien Jacobs
The spifi_init_code blob is calling the spifi_init() function from the ROM. This ROM function is making use of the stack. So if the stack pointer is invalid, trying to execute this code leads to a double fault and the target_run_algorithm() call return with an error. This patch simply ensure that the stack pointer is properly setup before calling the spifi_init() ROM function. Change-Id: I42a2163cfc2c6dfe5ada97ae8eb2bb6d2e283ff7 Signed-off-by: Aurelien Jacobs <aurel@gnuage.org> Reviewed-on: http://openocd.zylin.com/1836 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-05-10kinetis: Revise CPU un-securing codeAndrey Smirnov
Old version of the code had several problems, among them are: * Located in a generic ADI source file instead of some Kinetis specific location * Incorrect MCU detection code that would read generic ARM ID registers * Presence of SRST line was mandatory * There didn't seem to be any place where after SRST line assertion it would be de-asserted. * Reset was asserted after waiting for "Flash Controller Ready" bit to be set, which contradicts official programming guide AN4835 * Mass erase algorithm implemented by that code was very strange: ** After mass erase was initiated instead of just polling for the state of "Mass Erase Acknowledged" bit the code would repeatedly initiate mass erase AND poll the state of the "Mass Erase Acknowledged" ** Instead of just polling for the state of "Flash Mass Erase in Progress"(bit 0 in Control register) to wait for the end of the mass erase operation the code would: write 0 to Control register, read out Status register ignoring the result and then read Control register again and see if it is zero. * dap_syssec_kinetis_mdmap assumed that previously selected(before it was called) AP was 0. This commit moves all of the code to kinetis flash driver and introduces three new commands: o "kinetis mdm check_security" -- the intent of that function is to be used as 'examine-end' hook for any Kinetis target that has that kind of JTAG/SWD security mechanism. o "kinetis mdm mass_erase"" -- This function removes secure status from MCU be performing special version of flash mass erase. o "kinetis mdm test_securing" -- Function that allows to test securing fucntionality. All it does is erase the page with flash security settings thus making MCU 'secured'. New version of the code implements the algorithms specified in AN4835 "Production Flash Programming Best Practices for Kinetis K- and L-series MCUs", specifically sections 4.1.1 and 4.2.1. It also adds KL26 MCU to the list of devices for which this security check is performed. Implementing that algorithm also allowed to simplify mass command in kinetis driver, since we no longer need to write security bytes. The result that the old version of mass erase code can now be acheived using 'kinetis mdm mass_erase' Tested on accidentally locked FRDM-KL26Z with KL26 Kinetis MCU. Change-Id: Ic085195edfd963dda9d3d4d8acd1e40cc366b16b Signed-off-by: Andrey Smrinov <andrew.smirnov@gmail.com> Reviewed-on: http://openocd.zylin.com/2034 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
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-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-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-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-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-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-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-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-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-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-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>
2014-03-29target: fix handle_profile_command variable typoSpencer Oliver
Change-Id: I5d476aecb4622731890e168b1be3173718151e95 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2066 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-03-29target: remove handle_profile_command memory leakSpencer Oliver
COMMAND_PARSE_NUMBER may return, thus any memory allocated may not be freed, simple reorder fixes the issue. Change-Id: I0ce444a5b032f5c49b6d33a03a8c0b71cad49c8c Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2065 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-03-29Add xscale debug helper sources and everything related to distPaul Fertser
GPL requires providing sources for any derived work. I do not see any reason to not include the xscale stuff into release tarballs. Wildcard matching is used because plain directory name matches implicit rule for executables and xscale.c built is errorneously attempted, and directory name with a slash duplicates a directory (xscale/xscale) in dist. Change-Id: Ie0266470dcb97be87a09ba2dda9b3957f7cbc2fa Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1911 Tested-by: jenkins Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>