aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2012-10-04Modified Sector Erase for AT91SAM4SOlivier Schonken1-1/+8
In FLASHD_ErasePages AT91C_EFC_FCMD_EPA is used to erase sectors. According to the datasheet FARG[15:2] defines the page from which the erase will start.This page must be modulo 4, 8, 16 or 32 according to the number of pages to erase. FARG[1:0] defines the number of pages to be erased. Previously (firstpage << 2) was used to conform to this, seems it should not be shifted... Changed it to (firstPage) | erasePages. Change-Id: I791cc7fc4faf056623ad5a6c7e860315306098a1 Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com> Reviewed-on: http://openocd.zylin.com/830 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-10-04build: fix broken ftd2xx bus blasterSpencer Oliver1-1/+1
If configure is executed without --enable-ft2232_ftd2xx then the bus blaster or presto will fail to build with unresolved external ftd2xx_status_string. Make sure we run the ftd2xx build test if --enable-usb_blaster_ftd2xx is enabled. Change-Id: I09d270d6fcd083d77f6785b8969d9acb3dfef11d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/892 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2012-10-02gdbserver: code cleanupSpencer Oliver1-45/+32
Change-Id: Iab2966be8dd145f33f41902e2d55afe03d0f5856 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/857 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-10-02build: remove unnecessary jim.h includeSpencer Oliver1-1/+0
as well as not being required, as it is already included by jim-nvp.h. It also makes the doxygen output a bit clearer to read. Change-Id: Ia2bed7142b4a56b48b1ecf0734e63f860dcd1014 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/859 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-10-02sysfsgpio: remove ignoring return value build warningSpencer Oliver1-10/+29
fixes following gcc warning: error: ignoring return value of write, declared with attribute warn_unused_result Change-Id: I96ea6649078449208a77690caea2cb237c388e6e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/854 Tested-by: jenkins Reviewed-by: Marc Reilly <marc@cpdesign.com.au> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-10-02flash: add stm32f3 rev 2 flash supportSpencer Oliver1-0/+8
Change-Id: Ibab5112f5f70a609136d01ebc50530a334640d03 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/809 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-10-02ftdi: incorrectly using output register for directionSpencer Oliver1-1/+1
fix a simple copy/paste bug. Change-Id: I5caaa4d16d30f26a453bd6a00c95261fd6e716c5 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/849 Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-10-02ftdi: correct ftdi_initialize error textSpencer Oliver1-1/+1
Change-Id: If230c0b5b3a18fd273106b743404079d0cbc9ddc Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/840 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-10-02ftdi: fix adapter_init rclk fallbackSpencer Oliver1-0/+5
adapter_init expects jtag_get_speed (via ftdi_khz) to return a valid fallback speed if the adapter does not support rclk. The call was failing and so was the rest of the adapter init. The makes the new ftdi driver emulate the old ftdi driver. Change-Id: Ic7fac7d201241eb181e98f1ba7111f159731f6e0 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/839 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-09-29Fix: Error while reading from USB endpointPeter Horn1-1/+1
This patch fixes the bug reported here: http://sourceforge.net/mailarchive/message.php?msg_id=28350157 When using Rlink under Linux, openocd exits with: "Error: Read of endpoint 2 returned -75, expected 17" The return value of -75 translates into EOVERFLOW. The cause is a wrong output buffer size argument passed to dtc_run_download(). Change-Id: I5d056705181ab6a6d4355524df06a0ea9c605961 Signed-off-by: Peter Horn <peter.horn@bluewin.ch> Reviewed-on: http://openocd.zylin.com/862 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2012-09-27jtag: remove libftdi enum-compare warningSpencer Oliver1-1/+1
See Trac #52 for details. Change-Id: Idb509ead2b51bfcceeb00d0224a4d1c395b28a04 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/801 Tested-by: jenkins Reviewed-by: Olivier Schonken <olivier.schonken@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-09-27Add extra Coresight component ROM identifiers for the Cortex-M4Evan Hunter1-0/+12
Signed-off-by: Evan Hunter <ehunter@broadcom.com> Change-Id: Iaf2d69cf10c341d3a516986677f69a4389b29b1a Reviewed-on: http://openocd.zylin.com/841 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-09-26Added SPIFI flash driver, algorithms, and docsGeorge Harris3-0/+971
Added a flash driver designed to allow program/erase of memory-mapped SPI flash chips for LPC43xx/LPC18xx family micros. This driver includes three algorithms - erase, write, and SPIFI peripheral initialization (to allow memory-mapped access after a reset). The driver has been added to the flash driver table (drivers.c), and the OpenOCD documentation has been updated to include the flash driver configuration command. Change-Id: I79f4ff8f1f07de4e5f2fe4f8c23aeb903f868514 Signed-off-by: George Harris <george@luminairecoffee.com> Reviewed-on: http://openocd.zylin.com/783 Tested-by: jenkins Reviewed-by: Aurelien Jacobs <aurel@gnuage.org> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-09-26SPI nor drivers refactorGeorge Harris4-64/+134
Moved common SPI flash driver code (device table, common commands) into flash/nor/spi.c and spi.h. Updated flash/nor/stmsmi.c to reflect this refactor. Change-Id: I141644b0af71d3835f29f06dd15b505a00e5b6ec Signed-off-by: George Harris <george@luminairecoffee.com> Reviewed-on: http://openocd.zylin.com/782 Tested-by: jenkins Reviewed-by: Aurelien Jacobs <aurel@gnuage.org> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-09-26drivers: new jtag bitbang driver using sysfs gpioMarc Reilly3-0/+514
This driver implements a bitbang jtag interface using gpio lines exported via sysfs. The aim of this driver implementation is to use system GPIOs but to avoid the need for an additional kernel driver. A config suitable for RaspberryPi is included. Change-Id: Ib2acf720247a219768d1cbfeebd88057ed2d7b8b Signed-off-by: Marc Reilly <marc@cpdesign.com.au> Reviewed-on: http://openocd.zylin.com/762 Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-09-07stlink: issue error for stm32 option writingSpencer Oliver1-0/+8
The stlink interface currently does not support 16bit read/writes. Until a fix is included we issue a error that this is unsupported. Change-Id: I4552cf2bd3b29e90ecc905325b743c08e2b92d67 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/808 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-09-07flash: fix sam3 page read/write address computation errorChuen Chou1-2/+2
In at91sam3.c for Atmel SAM3 flash support, there are arithmetic errors in the functions sam3_page_read() and sam3_page_write(). Address locations are computed incorrectly due to an extra addition operation. This leads to memory locations being skipped during flash writes and reads. Smaller programs are written successfully into flash, with memory gaps, while larger programs of legitimate size fail because the skipped memory is not utilized and therefore unavailable. The changes address this condition, and have been tested with an Atmel SAM3X-EK evaluation board. Change-Id: I9ea3b9ed0130b71cbc32b2294e31a6a2bc71b47a Signed-off-by: Chuen Chou <zhouquan27@gmail.com> Reviewed-on: http://openocd.zylin.com/806 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-09-06cortex_m: suggest using hardware srst if VECTRESET usedSpencer Oliver1-1/+1
If the target does not support SYSRESETREQ we fall back to using VECTRESET. This however does not reset the peripherals and we issue a warning to the user to suggest using a reset-init script. Also suggest that using hardware srst will give them the same functionality as using SYSRESETREQ. Change-Id: Ie1781c4b849fed66c52222e6539735537c879fb3 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/802 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29Pic32mx: make row programming work with any offsetSalvador Arroyo1-8/+44
In function pic32mx_write_block() if the parameter offset is not a multiple of row size the row offset (offset % row_size) will be ignored by the flash controller, shifting the code to the beginning of the row. Word programming gets it right. Change-Id: I134913e3d533688f791bbcb0c6e8983524197f3c Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/796 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29server: warn if user changes server port after initSpencer Oliver1-0/+4
So the user can view the current port number these cmds were changed to COMMAND_ANY. However this means that the user can also attempt to change the port number after init, even though this is not supported. Issue a warning that this is not supported. Change-Id: I3d20dcd81277e7d994240a8e314f27672ff760c4 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/788 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29stlink: fix typoSpencer Oliver1-1/+1
Change-Id: I5fe7b695b00faef966e7621614bbd60b6e694a4f Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/800 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29stlink: improve swd hardware resetSpencer Oliver1-1/+8
Treat SWD wait result as success, otherwise hardware reset will sometimes fail. Change-Id: I0dbdbe9e75924fe0dde547a72883c60c3db7b15e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/799 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29ftdi: fix overflow if last field of a scan is emptyAndreas Fritiofson1-1/+13
The last bit of a scan is clocked during TAP movement so it's necessary for the last field to have at least one bit. Strip trailing empty fields and make sure the TAP is not affected if there's nothing to scan. Clients probably shouldn't add empty fields so add a debug message to be able to track and fix them. Change-Id: I27552568bc11146570b9b99ed8a1ae81b5fb2c50 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/794 Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29mpsse: check available buffer space even for discarded data scansAndreas Fritiofson1-4/+4
When there's no data to scan in or out, we still use the clock data out command and fill the buffer with zeroes, so make sure the buffer is checked for available space. Change-Id: Ia6005c40c81f7fdb89379f1b5023fe383184d210 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/793 Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29adapter: remove superfluous line breaksSpencer Oliver1-3/+0
Change-Id: I8e68b9d6f571ef7715a2f4cad0aa78fe4e3b48e8 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/798 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29adapter: add 'adapter speed:' prefix to outputSpencer Oliver1-2/+2
Currently only the adapter speed is printed, which can be rather misleading when DEBUG_INFO is disabled, all the user sees is 6000 kHz instead lets print adapter speed: 6000 kHz Change-Id: I8f02a63f47344457e3c3d0a6774157fa18206440 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/797 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29Add another scripts search path for Windows buildsFreddie Chopin1-28/+37
Add single "scripts" folder to search path for Windows OpenOCD builds that don't use cygwin bin/openocd.exe scripts/interface/dummy.cfg scripts/target/at91eb40a.cfg Do some refactoring of current code (thx to Andreas). Change-Id: Idbb08d1368b06f25da44f4f9ab1511db992b1724 Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com> Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/785 Tested-by: jenkins
2012-08-29kinetis: bugfix in kinetis_write() fallback pathAndreas Fritiofson1-1/+7
Offset calculation into buffer was wrong and code would read outside buffer if count was not a multiple of four. Change-Id: Ied625b10221423d5a5f25d27ce1edd8c2c3eca8a Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/749 Reviewed-by: Peter Stuge <peter@stuge.se> Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29kinetis: ensure flash writes are not truncatedChristopher Kilgour1-11/+54
The number if longwords or "sections" (Freescale term) written for a Kinetis flash write (4, 8, or 16 bytes depending on the part density/granularity) are now rounded up to ensure there are no truncations when the desired write is not a multiple of the minimum write size. Change-Id: I8db40a8769d8ac5393a46cbf4e5ff0df82faf916 Signed-off-by: Christopher Kilgour <techie@whiterocker.com> Reviewed-on: http://openocd.zylin.com/738 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29jtag: fix clang ulink memory leaksSpencer Oliver1-9/+36
Memory leaks discovered by clang 3.1 Change-Id: I8a784ba9726deac508424eddb27e9c8409e2773f Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/795 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29Patch: Make pic32mx unlock work at higher scan frequenciesSalvador Arroyo1-0/+2
For example in a pic32mx220, pic32mx unlock don't work if adapter_khz is set to 5000 or more. A short delay after asserting reset fix the problem. Change-Id: I62e493edfcea585c36c8de77a969cebac7227b96 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/790 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29stlink: stlink_interface_init_target use hex prefixSpencer Oliver1-3/+2
Change-Id: I782da74687bcf111c1f04c53b2c1120d6a034441 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/791 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29arm7_9: Fix broken halfword/byte memory readsAndreas Fritiofson5-66/+84
Always scan out all bits, but make sure only the allowed number of bytes end up in the caller-provided buffer. Discard the rest by adding another scan field when size < 4. Rewrite the endianness callback to avoid reading outside allocated memory. Make it directly usable as a callback without the need for a wrapper. Move the shared callback to a more suitable home in arm7_9_common. This fixes the regressions introduced in commits 991ed5a2b657e660f744eefddb084724e52938ea cb90d32e386a7489d31136997209c61e9559ff5e and c3074f377c1da33ca8ba8493826e1b52351eebc6 Change-Id: Ia8bde8c5a9844e89a1d6c0bc8534cd26f02f8d11 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/789 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24Severe bug in Pracc codeSalvador Arroyo1-1/+1
The function wait_for_pracc_rw() fails if Pracc bit is 0. The variable ejtag_ctrl is loaded with the content of the control register in the first scan. In the second scan Pracc bit is scanned out as 0, letting the proccesor go. The result is unpredictable. All the strange data corruption when scanning at certain frequencies, or the strange delays needed when entering or leaving fasdata area are retated to this bug. Now the code works at any scan frequency, tested up to 15000Khz and indepently of processor speed, tested at 31.25Khz and 4/8Mhz. Change-Id: Iedfd81d06d6af4bc738a521f720e42323025b268 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/769 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24target: remove unused working area 'user' fieldSpencer Oliver2-15/+0
working_area::user has never been used so lets remove it. Change-Id: I1200311b34248549c1fe30c9f675e6129b7bebee Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/781 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24cfi: fix type-punning warnings in cfi_spansion_write_blockAndreas Fritiofson1-9/+9
Retest the condition when needed, instead of abusing the common_magic field as a flag. There are only two options here. Either it's an armv7m or it's another arm. is_arm(...) will return true even for armv7m, so it's imperative to check in the right order. Change-Id: Ic227f19f7babf1b0b0fe075f9a3abc4eabc7d5f1 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/779 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24build: fix clang warningsMartin Nowak4-5/+5
Change-Id: I3c6a63a18034535f0a8c2c62ba8a708f09d7839b Signed-off-by: Martin Nowak <dawg@dawgfoto.de> Reviewed-on: http://openocd.zylin.com/765 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24target: catch dap_lookup read errorSpencer Oliver1-0/+2
Issue found by clang-3.1 Change-Id: I2e922ec83117e75db5bec1e82edaa75a9e6e7464 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/778 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24flash: remove lpc2000 clang warningsSpencer Oliver1-4/+4
By Initialising the param_table we remove the clang warning's. We are also make sure we are not passing any rogue values to lpc2000_iap_call. Change-Id: Idb3b0077d1dae5f03dedab1d46d01140fe9ffb10 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/777 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24tcl: fix potential memory leaksSpencer Oliver1-10/+11
Reorder to allocate all memory after COMMAND_PARSE_NUMBER call. This removes a clang warning about un-released memory Change-Id: I8dbeb664a6467077157015bd879bc0aefc5e8614 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/776 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24build: fix memory leaksSpencer Oliver7-17/+46
Fix the memory leaks found by clang-3.1 Change-Id: Iaae68627ef599c324c9c9ee5737c22e92512862d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/775 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24flash: fix FC_FLEX_RAM class code pathSpencer Oliver1-0/+2
If the flash class was defined as FC_FLEX_RAM then this would always drop through to the default handler. This bug was found by clang, so untested. Change-Id: I2d9fe6415dd216728a145519400f7b9ef1bd3c3a Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/773 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Mathias Küster <kesmtp@freenet.de>
2012-08-24helper: command.c cleanupSpencer Oliver1-8/+10
Change-Id: I66643960e38625e843b5f54d1c072e4eee78284d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/772 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-02target: add valid smp target checkSpencer Oliver1-1/+3
Check that the target is valid before calling any target functions. Change-Id: I538fccc79d5ec89976e14beab02cb20490b299bb Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/766 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-02Add missing files (header and .txt) for release.Freddie Chopin1-1/+11
make distcheck is used to make packages with OpenOCD release, this command uses information from Makefile.am files to know which files should be included in the package and which can be left only in repository. This patch makes a few headers from recent JTAG drivers and one txt file with info about target tcl config files included in released packages. Change-Id: I91202290633a30f53624a8c7d9a0ebf72c40772b Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-on: http://openocd.zylin.com/767 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-08-01arm946e: add icache/dcache manipulation commands.Alexander Osipenko1-0/+98
Provide cache operations coherent with internal target state. Functions similar to xscale target. Change-Id: Ic6b9a894154f6e4f5672b5d7f5035c9774ee9499 Signed-off-by: Alexander Osipenko <sipych@gmail.com> Reviewed-on: http://openocd.zylin.com/695 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-01arm946e: cp15 command returns value to the scriptAlexander Osipenko1-37/+65
Not just print it. This enables scripts to analyze valuable config options of arm946e-s cores, do internal BIST memory tests and more. Be careful to flush caches before disabling it. Do not forget that BIST test overwrites memory. - cp15 rewritten from COMMAND_HANDLER to jim_handler. Change-Id: I734da0be6db0a3127c2daa94ed75efef94da8ceb Signed-off-by: Alexander Osipenko <sipych@gmail.com> Reviewed-on: http://openocd.zylin.com/694 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-01arm946e: cleanup C0.C cache type reg accessAlexander Osipenko2-38/+39
Cache type register C0.C is read-only, and display hard core configuration information. This information is unlikely be changed in runtime. - removed C0.C access when result is not used in arm946e_invalidate_dcache() - access C0.C only once per target, store result in cp15_cache_info field of target structure - fix cache index count calculation Change-Id: I12bc4c967fdf07f54d755f2f2f42406c0ababc1a Signed-off-by: Alexander Osipenko <sipych@gmail.com> Reviewed-on: http://openocd.zylin.com/693 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-01arm946e: don't use global variables for contextAlexander Osipenko1-26/+25
Global variables 'dc' 'ic' had been used in the code to keep target's state of D-cache and I-cache on debug entry. This may lead to incorrect operation in configurations with multiple cores and unequal cache states. Fix: move cache state to the appropriate bits of the 'cp15_control_reg' field (already present but unused). Vaule of cp15 control register stored here on arm946e_post_debug_entry(), and analyzed later in arm946e_write_memory(). Change-Id: I71ef82be00c21d6fffb3726cec4974d1ece70dfe Signed-off-by: Alexander Osipenko <sipych@gmail.com> Reviewed-on: http://openocd.zylin.com/692 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-01flash: stm32f1x: Pad odd byte writes early to avoid 16-bit writesAndreas Fritiofson1-54/+49
For odd byte counts, stm32x_write() pads the last byte and writes it using a discrete 16-bit access. The stlink debugger can't issue 16-bit writes so it fails for odd byte writes. This patch changes stm32x_write() to pad odd byte writes into a new buffer and use the normal code path with a single block write. The fallback path, when working area cannot be allocated, has to use 16-bit writes though which means that sufficient working area is required for stlink and odd byte writes. Change-Id: I4c5dc456300b6e1056f76b0095be8aceee3e954f Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/756 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>