aboutsummaryrefslogtreecommitdiff
path: root/src/flash
AgeCommit message (Collapse)Author
2015-11-27adi_v5: Fix wrong ap valueAlamy Liu
Problem dap->ap_current is register value, not field value. it restores invalid ap when it calls dap_ap_select(dap, ap_old) later. * assume the current ap is 1, dap->ap_current value would be (1 << 24). ap_old = dap->ap_current; <-- ap_old = 1<<24 = 0x1000000. ... dap_ap_select(dap, ap_old); <-- select 0x1000000, not 1. * All AP registers accessing fail afterwards. One of the reproducible case(s): CORE residents in AP >= 1 dap_lookup_cs_component() being used to find PE(*). In most cases, PE would be found in AP==0, hence the problem is hidden. When AP number is 1, dap->ap_current would have the value of 1<<24. Anyone get the AP value with dap->ap_current and resotre it later would select the wrong AP and all accessing later would fail. The ARM Versatile and/or FPGA would have better chance to provide this kind of environment that PE residents in AP>=1. As they have an 'umbrella' system at AP0, and main system at AP>=1. * PE: Processing Element. AKA Core. See ARM Glossary at http://infocenter.arm.com/help/topic/com.arm.doc.aeg0014g/ABCDEFGH.html Fix Use dap_ap_get_select() to get ap value. a. Retrieve current ap value by calling dap_ap_get_select(); src/flash/nor/kinetis.c src/target/arm_adi_v5.c b. The code is correct (dap->ap_current >> 24), but it's better to use dap_ap_get_select() so everything could be synchronized. src/flash/nor/sim3x.c Change-Id: I97b5a13a3fc5506cf287e299c6c35699374de74f Signed-off-by: Alamy Liu <alamy.liu@gmail.com> Reviewed-on: http://openocd.zylin.com/2935 Reviewed-by: Andreas Färber <afaerber@suse.de> Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2015-11-26flash/nor/lpc2000: add alternative part ID for LPC1343Jakub Kubiak
http://support.code-red-tech.com/CodeRedWiki/DebugAccessChip > Note that once you have recovered debug access to your MCU, then in most cases you should then modify your Debug Configuration to turn vector catch off again. If this is not done, then this can cause problems in some circumstances with some versions of the Code Red IDE. For example with NXP LPC13xx parts, connecting more than once to the MCU with vector catch enabled can lead to the part ID being incorrectly read - which can again cause debug connections to fail This patch adds an alternative part ID for LPC1343. With this patch "program" command works fine for flashing. Change-Id: I8632e898a4c33102455925d25715b4f4edfa1d97 Signed-off-by: Jakub Kubiak <jakub@kubiak.es> Reviewed-on: http://openocd.zylin.com/2782 Tested-by: jenkins Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-11-26niietcm4: support for NIIET's Cortex-M4 microcontrollersBogdan Kolbov
This adds docs, example config, flash driver. Driver is only supports K1921VK01T model for now. Change-Id: I135259bb055dd2df1a17de99f066e2b24eae1b0f Signed-off-by: Bogdan Kolbov <kolbov@niiet.ru> Reviewed-on: http://openocd.zylin.com/3011 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-11-23efm32: remove duplicate part name decoding.Karl Palsson
The probe and info methods had duplicate sections decoding family names to generate a human friendly part name. Extract this to a common helper. Change-Id: I4c6309d83c601e154b7c14ad9c15c53854ee1e98 Signed-off-by: Karl Palsson <karlp@tweak.net.au> Reviewed-on: http://openocd.zylin.com/2932 Tested-by: jenkins Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-11-23efm32: basic Happy Gecko target supportKarl Palsson
Basic basic support to get running, magic numbers taken from revision 0.90 of the reference manual. Signed-off-by: Karl Palsson <karlp@tweak.net.au> Change-Id: Iff6ab94d30698f056ef09f7a856b7285fed8f441 Reviewed-on: http://openocd.zylin.com/2931 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-11-20Kinetis: suppress false alarms "MCU is secured"Tomas Vanek
Kinetis driver checks MDM STAT register to detect secured state of MCU. An unsecured clean device typically triggered a huge fat alarm message. Now when driver detects secured state it tries to halt MCU and then re-reads status register. Command "mdm mass_erase" used to deassert reset when finished and MCU started looping in hard fault - WDOG reset cycle. Now "reset halt" is issued. Clean flash is not run after mass_erase. Change-Id: I23f393509fbd8751d44ffc744ff2d67f1074f74e Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3010 Tested-by: jenkins Reviewed-by: Thomas Schmid <thomas@rfranging.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-11-20flash: at91samd: flash write code cleaningTomas Vanek
SAMD driver suffered from following problems: 1) Flash was erased as an integral part of flash write. It was not documented so with usual workflow it resulted in erasing flash twice (and reducing flash lifespan) and in almost double flashing time. 2) Sector erase was silently skipped if "is_erased" flag was set. "is_erased" logic was not reliable, e.g. when a row write was aborted after successful write of some pages, sector was still considered as erased. "is_erased" flag could not cope with flash writes from a user program. 3) Writing of a block with start address unaligned to a flash page resulted in failed assert and OpenOCD abort. 4) Disabling cache in bit 18 of 16-bit halfword never worked. MCU implements cache invalidate in hardware so there is no need to take care about. This bug was reported by Tony DiCola. New code does not erase flash in write operation. Instead it traditionally relies on erasing flash beforehand. "is_erased" logic and cache disabling is completely removed. It simplifies write procedure a lot and flash write is now faster. The change partly solves ticket #109 SAMD/SAM4L driver doubles flash erase. Change-Id: I582b497d01a351575533a1f8c9810a4413be0216 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3045 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-11-20flash: at91samd: Add SAML21 variant B device support and fix SAMC20/SAMC21Andreas Loehre
This adds support for the Atmel SAML21 variant B parts. There is minimal change between the two variants, but in variant B the automatic page write which the at91samd flash driver relies on to be enabled is disabled by default. With this patch the write row function will now issue a page write command after each of the four pages in the row if the MANW (manual write) bit is set. This also fixes flash write for the SAMC20/SAMC21 devices which have the MANW bit set by default as well. I have also moved the device ID (DID) register bitfield extraction from the find_part into helper macros. These can be used in the future if there are more workarounds for specific devices. Tested (programming) on: ATSAML21-XPRO ATSAML21-XPRO-B SAMC21 Xplained Pro SAMD21 Xplained Pro SAMD20 Xplained Pro Change-Id: I401a8aa1efd64730840c0d62cf49a1e880ea5900 Signed-off-by: Andreas Loehre <alohre@gmail.com> Reviewed-on: http://openocd.zylin.com/2903 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2015-11-20at91samd: handle reset run/halt in DSUTomas Vanek
Atmel introduced a "Device Service Unit" (DSU) that holds the CPU in reset if TCK is low when srst (RESET_N) is deasserted. Function is similar to SMAP in ATSAM4L, see http://openocd.zylin.com/2604 Atmel's EDBG adapter handles DSU reset correctly without this change. An ordinary SWD adapter leaves TCK in its default state, low. So without this change any use of sysresetreq or srst locks the chip in reset state until power is cycled. A new function dsu_reset_deassert is called as reset-deassert-post event handler. It optionally prepares reset vector catch and DSU reset is released then. Additionally SWD clock comment is fixed in at91samdXX.cfg and clock is lowered a bit to ensure a margin for RC oscillator frequency deviation. adapter_nsrst_delay 100 is commented out because is no more necessary after http://openocd.zylin.com/2601 Change-Id: I42e99b1b245f766616c0a0d939f60612c29bd16c Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/2778 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-11-11flash/nor/xmc4xxx: Loosen checks for XMC4500Andreas Färber
According to Infineon, XMC4500 EES AA13 with date codes before GE212 - as seen on an XMC4500 General App Kit - had a zero SCU_IDCHIP register. Handle this by extending our checks to not error out on zero SCU_IDCHIP and by printing a useful info string in that case. Change-Id: Ic2d641a314627dd5a1ff775a0113999191b95e3d Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/2751 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Jeff Ciesielski <jeffciesielski@gmail.com>
2015-11-11flash: New driver for XMC4xxx microcontroller familyJeff Ciesielski
This is a complete flash driver for the Infineon XMC4xxx family of microcontrollers, based on the TMS570 driver by Andrey Yurovsky. The driver attempts to discover the particular variant of MCU via a combination of the SCU register (to determine if this is indeed an XMC4xxx part) and the FLASH0_ID register (to determine the variant). If this fails, the driver will not load. The driver has been added to the README and documentation. Tests: * Hardware: XMC4500 (XMC4500_relax), XMC4200 (XMC4200 enterprise) * SWD + JTAG * Binary: 144k, 1M Note: * Flash protect only partly tested. These parts only allow the flash protection registers (UCB) to be written 4 times total, and my devkits have run out of uses (more on the way) Future Work: * User 1/2(permalock) locking support via custom command * In-memory flash loader bootstrap (flashing is rather slow...) Change-Id: I1d3345d5255d8de8dc4175cf987eb4a037a8cf7f Signed-off-by: Jeff Ciesielski <jeffciesielski@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/2488 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-11-10flash: driver for Atmel SAMV, SAMS, and SAMEMorgan Quigley
This is a driver for the Atmel Cortex-M7 SAMV, SAMS, and SAME. I started with the at91sam4.c driver and then restructured it significantly to try to simplify it and limit the functionality to just a flash driver, as well as to comply with the style guide. Change-Id: I5340bf61f067265b8ebabd3adad45be45324b707 Signed-off-by: Morgan Quigley <morgan@osrfoundation.org> Reviewed-on: http://openocd.zylin.com/2952 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2015-11-10cfi: Fix fallback to memory writesEsben Haabendal
Change-Id: I2d09139b95ff62c62a0b071584e85a87494ed313 Signed-off-by: Esben Haabendal <esben@haabendal.dk> Reviewed-on: http://openocd.zylin.com/3095 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-11-05flash/nor/spi: Add GigaDevice gd25q16c/32c/128c flash supportMahavir Jain
Change-Id: I44052fd3467d7e0bbdc038b815204e39fa499684 Signed-off-by: Mahavir Jain <mjain@marvell.com> Reviewed-on: http://openocd.zylin.com/3029 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-11-05Kinetis: properly pad flash section writesTomas Vanek
kinetis_write() with byte count not divisible by prog_section_chunk_bytes computed wrong wc and therefore paded section chunk by some random data instead of 0xff Change-Id: Ic7c66d8a3ceacda9e611e98b9fbf943b8001774b Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/2994 Tested-by: jenkins Reviewed-by: Thomas Schmid <thomas@rfranging.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-11-05Kinetis: Disable watchdog on Kx devices when programming.Thomas Schmid
Kx devices with FTFA flash need the watchdog disabled when programming. I tried to keep overhead as small as possible and re-use registers that were already inquired (e.g. sim_sdid). Change-Id: Ibc29a26ec34102d78a6c3920dd16f63e134a8f6f Signed-off-by: Thomas Schmid <thomas@rfranging.com> Reviewed-on: http://openocd.zylin.com/2986 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Paul Fertser <fercerpav@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-03flash/nor/stm32f2x: Add STM32F469 partMaxime Coquelin
Change-Id: I4e13ceb0ba954dc2fea059ddeef10109be938c9c Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com> Reviewed-on: http://openocd.zylin.com/3042 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-10-30Add handling for STM32L4.Uwe Bonnes
Option handling not yet implemented. Change-Id: I5a11ef3221896cb02babe4e6e71073c43aa8740b Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-on: http://openocd.zylin.com/2941 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-10-30stm32f2x: Add memory barrier needed for STM32F7 flashing.Uwe Bonnes
Change-Id: I44fca55c46fc8f960ba46a0604692ce98909face Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-on: http://openocd.zylin.com/2939 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-10-30stm32f2x.c: Add STM32F74x handling.Uwe Bonnes
Change-Id: I2e7a8e9f855fc99a3f2535e2af6c0921329a5013 Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-on: http://openocd.zylin.com/2940 Tested-by: jenkins Reviewed-by: Rémi PRUD'HOMME <prudhomme.remi@gmail.com> Reviewed-by: Juha Niskanen <juha.niskanen@haltian.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-10-30stm32f2x.c: Handle STM32F42x/43x 1 MiByte devices with DB1M option set.Uwe Bonnes
Change-Id: Ic51d34a9abe9693fd21e9b3247523821b6fb1fe3 Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-on: http://openocd.zylin.com/2938 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-10-09nrf51: recognize hwid 0084Peter A. Bigot
Chip markings: N51822 / QFACA1 / 1513AN Change-Id: Idb7fc723850ea08b60b9f5c97a53f1ae8dfc8eb2 Signed-off-by: Peter A. Bigot <pab@pabigot.com> Reviewed-on: http://openocd.zylin.com/2936 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-10-09Kinetis: new devices K02, K26, K63, K64, K66, correct K21 and K22 variantsTomas Vanek
K22FN1M0 and K22FX512 has FTFE flash and old style SDID. K22FN128, 256 and 512 has FTFA flash and new style SDID K63 and K64 detects as K61 and K62, see Errata 1N83J e7534 Change-Id: I2aca6f1f18819bb2b2ec4982036510de444ad2ac Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/2867 Tested-by: jenkins Reviewed-by: Thomas Schmid <thomas@rfranging.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Patrick Stewart <patstew@gmail.com>
2015-10-09Kinetis: give a reasonable default for max_flash_prog_sizeTomas Vanek
max_flash_prog_size euals to pflash_sector_size_bytes for most of devices. There is no point setting max_flash_prog_size for devices without FS_PROGRAM_SECTOR capability. Check for zero sector_size to avoid div by zero exception in case of device has FlexNVM but the driver does not define nvm_sector_size_bytes Change-Id: Iaf4e007fb1ec3d24c373350410e4bebe504a4c3e Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/2958 Tested-by: jenkins Reviewed-by: Thomas Schmid <thomas@rfranging.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Patrick Stewart <patstew@gmail.com>
2015-10-09Kinetis: Add K24 support and tidy upPatrick Stewart
The K24 uses the KL-style SDID register and has some flashing quirks, so the kinetis driver does not support it properly. Extend the chip detection routine to support the new SDID format. Add a parameter for the maximum flash size, as the K24 only supports 1k flashing blocks but has 4k sector size. Remove global 'granularity' array, as it's only really needed in one function. Replace 'klxx' with an enum showing which flash commands are actually supported on a given chip. Signed-off-by: Patrick Stewart <patstew@gmail.com> Change-Id: Ie244fab564d58c5cfe4fa36a025f0b2674ffad69 Reviewed-on: http://openocd.zylin.com/2864 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-09-30flash/nor/spi: Add Winbond w25q128fvAlex Forencich
Change-Id: I2e13c02361982468f41f218421ece9046bcc9a5f Signed-off-by: Alex Forencich <alex@alexforencich.com> Reviewed-on: http://openocd.zylin.com/2951 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-09-30numicro: Integrate Nuvoton NuMicro flash driver.Nemui Trinomius
Flash driver "mini51.c" and "nuc1x.c" are same target MCU. This patch integrates each driver and functions, and makes into new "NuMicro" flash driver. Change-Id: Ifff5c1cfdd265acca0f489631695be9194fa144c Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp> Reviewed-on: http://openocd.zylin.com/2794 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-09-30flash: Analog Devices ADuCM360 supportIvan Buliev
A target config and a simple flash driver for the ADuCM360 microcontroller. The EEPROM of the chip may be erased and programmed. Change-Id: Ic2bc2f91ec5b6f72e3976dbe18071f461fe503b8 Signed-off-by: Ivan Buliev <i.buliev@mikrosistemi.com> Reviewed-on: http://openocd.zylin.com/2787 Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Tested-by: jenkins
2015-08-19flash/nor/jtagspi: 'retval' may be used uninitializedAlamy Liu
Problem As my compiler has "warnings being treated as errors" on, it shows the error message: error: 'retval' may be used uninitialized in this function Investigation Nothing wrong with the logic, 'retval' would have a value before returning. Just wanna get rid of the compiling "warning as error" message. Solution Provide a reasonable default value Change-Id: I712c15f82819c6c48bee9dceca8de4b18aeb29b0 Signed-off-by: Alamy Liu <alamy.liu@gmail.com> Reviewed-on: http://openocd.zylin.com/2905 Tested-by: jenkins Reviewed-by: Robert Jordens <jordens@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-08-06flash : Add support for Atmel at91sam4sa16bEvan Hunter
Change-Id: Ief6833b4bf587fbf53c8fbeee2fc276a95ca0a8a Signed-off-by: Evan Hunter <ehunter@broadcom.com> Reviewed-on: http://openocd.zylin.com/2878 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-08-06at91samd: add chip IDs for SAMC20 and SAMC21 familiesAndrey Yurovsky
Add the chip IDs corresponding to the new 5V "SAMC" parts which are otherwise identical to the SAMD and should work with this driver. Also add the configurations for their Xplained Pro boards. Change-Id: Ic268d4ac384a3a77d4211a94da9f9faf4d8c0f7b Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-on: http://openocd.zylin.com/2809 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-08-06sim3x: fix build failure with clang 3.6Paul Fertser
This fixes a warning as reported by the current clang version: ../../../../src/flash/nor/sim3x.c:867:20: error: address of array 'sim3x_info->device_package' will always evaluate to 'true' . Change-Id: Ie160cbe6df8f491e9beff38d47e2f13575529bf9 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2838 Tested-by: jenkins Reviewed-by: Oleksij Rempel Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-08-06flash/nor/jtagspi: add JTAGSPI driverRobert Jordens
Many FPGA board speak JTAG and have a SPI flash for their bitstream attached to them. The SPI flash is programmed by first uploading a proxy bitstream to the FPGA that connects the JTAG interface to the SPI interface if the IR contains a certain USER instruction. Then the SPI flash can be erase, written, read directly through the JTAG DR. The JTAG and SPI signaling is compatible. Such a proxy bitstream only needs to connect TDO-MISO, TDI-MOSI, TCK-CLK, and the activate the chip select when the IR contains the special instruction and the JTAG state machine is in the DR-SHIFT state. Change-Id: Ibc21d793a83b36fa37e2704966aa5c837c4dd0d2 Signed-off-by: Robert Jordens <jordens@gmail.com> Reviewed-on: http://openocd.zylin.com/2844 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-08-06flash/nor/tcl: add read_bank and verify_bankRobert Jordens
The only read access to flash chips so is through the target's memory. Flashes like jtagspi do not expose a memory mapped interface to the flash. These commands use the flash_driver_read() driver API directly. Change-Id: I40b910de650114a3f676507f9f059a234377d862 Signed-off-by: Robert Jordens <jordens@gmail.com> Reviewed-on: http://openocd.zylin.com/2842 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-08-06flash/nor/spi: add micron/numonyx n25q128Robert Jordens
http://www.micron.com/products/nor-flash/serial-nor-flash https://www.micron.com/~/media/documents/products/data-sheet/nor-flash/serial-nor/n25q/n25q_128mb_3v_65nm.pdf Signed-off-by: Robert Jordens <jordens@gmail.com> Change-Id: Icfb830387fabfb1a67e4d00bdf21a10420f6fc1c Signed-off-by: Robert Jordens <jordens@gmail.com> Reviewed-on: http://openocd.zylin.com/2841 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-05-17psoc4: add support for Cypress CCG1 familyVincent Palatin
Add the identifiers to support the flash on the Cypress Type-C Port Controller chips of the CCG1 family : http://www.cypress.com/ccg1/. Tested successfully on CYPD1132-16SXI. Change-Id: I3fe6283379e5bcab964afac31b547ef95535aa2c Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-on: http://openocd.zylin.com/2757 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-05-17nrf51: refine and extend known devices tablePeter A. Bigot
The notation Gx0 in the nRF51 Series Compatibility Matrix indicates that the specified HWID is valid only for build code 0 of each chip, and for subsequent builds the HWID will be different. Replace the Gx0 notation with G0 throughout, and add the missing HWID for nRF51422 QFAC A1 (present on the newer nRF51 developer boards). See: https://www.nordicsemi.com/eng/nordic/download_resource/41917/5/55913589 See: https://devzone.nordicsemi.com/question/30774/mapping-hwid-to-revision-information/ Change-Id: I79d842137d41342db35904867c48b06fbc6fbc70 Signed-off-by: Peter A. Bigot <pab@pabigot.com> Signed-off-by: Angus Gratton <gus@projectgus.com> Reviewed-on: http://openocd.zylin.com/2593 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-04-16flash: at91samd: add SAML21 support, fix part ID issueAndrey Yurovsky
This adds support for the new Atmel SAML21 family of low-power Cortex M0+ devices. Their Flash controller is essentially the SAMDxx one so the change consists of adding the new part IDs. Unfortunately the device ID logic had a couple of mistakes in it that did not affect anything on SAMD2x devices (due to 0 values expected there) but that is a problem on L21, it's therefore addressed here and things should now match the datasheets. Tested on Amtel SAML21 Xplained Pro development kit against the included SAML21J18A there. Also tested for regressions on a SAMD20 and SAMD21 using their dev kits. Change-Id: I768f75e064b8656c15148730dacaa4c3acfc4101 Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-on: http://openocd.zylin.com/2690 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-04-16flash/nor/mdr: add docs, remove memory leak on probe()Paul Fertser
This adds the mandatory Info documentation for the driver as well as the usage field. As a clean up, this also includes freeing of the allocated memory which results in a memory leak if probe is invoked multiple times. Valgrind-tested. Reported by Dmitry Shpak. Change-Id: I2b1d9b9e8b069c6665b11d880b40ce19a1b26ce6 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2694 Tested-by: jenkins Reviewed-by: Дмитрий Шпак <disona@yandex.ru> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-04-16flash: efm32: Add support for EZR32LG and EZR32WG.Marc Schink
This patch was tested with an EZR32WG Starter Kit. Change-Id: I0f7c619e715fe30e88e6da3bead0806dd3bce819 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/2700 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
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-14AT91SAM4L: handle reset run/halt in SMAPTomas Vanek
This is a remake of http://openocd.zylin.com/1966 originally written by Angus Gratton <gus@projectgus.com> ATSAM4L has a "System Manager Access Port" (SMAP) that holds the CPU in reset if TCK is low when srst (RESET_N) is deasserted. Without this change any use of sysresetreq or srst locks the chip in reset state until power is cycled. A new function smap_reset_deassert is called as reset-deassert-post event handler. It optionally prepares reset vector catch and SMAP reset is released then. Change-Id: Iad736357b0f551725befa2b9e00f3bc54504f3d8 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/2604 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-04-14flash/nor/lpc2000: free allocated working area when target_write failsPaul Fertser
In some circumstances (e.g. inappropriate jtag clock) target_write_memory in lpc2000_iap_working_area_init might fail. The allocated working area should be freed inside lpc2000_iap_working_area_init in this error case. This was leading to a weird segfault due to stack corruption later when reset was executed. Reported by quitte (Jonas Meyer). Change-Id: Ia2ed42a9970a4d771727fd516a6eea88e9b859e2 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2696 Tested-by: jenkins
2015-04-14flash/nor/lpc2000: properly free working area used in get_lpc2000_part_id()Paul Fertser
The IAP working area needs to be freed here, just like in all the other driver functions since an automatic local variable is used to store a pointer to it. This was reported by quitte (Jonas Meyer) on IRC as a strange totally unrelated segfault after doing certain operations (leading to target reset) from GDB. He has provided me with remote access to the specific machine and configuration that exposed the issue, and after some debugging it became apparent that a auto local variable (holding the gdb connection pointer) gets overwritten somehow. Placing an appropriate breakpoint just before the event and using a watchpoint made the cause apparent: reset lead to freeing of all working areas, and there was one holding a pointer to a variable that was auto local in get_lpc2000_part_id(). Change-Id: I7e634d890135ca0f3b4b311e09e8385a03982bd6 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2695 Tested-by: jenkins
2015-04-14Tcl exception codes cleanup, shutdown command amendmentsPaul Fertser
This patch might influence openocd Tcl commands behaviour in subtle ways, please give it a nice testing. The idea is that if an OpenOCD Tcl command returns an error, an exception is raised, and then the return code is propogated all the way up (or to the "catch" if present). This allows to detect "shutdown" which is not actually an error but has to raise an exception to stop execution of the commands that follow it in the script. openocd_thread special-cases shutdown because it should then terminate OpenOCD with a success error code, unless shutdown was called with an optional "error" argument which means terminate with a non-zero exit code. Change-Id: I7b6fa8a2e24c947dc45d8def0008b4b007c478b3 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2600 Tested-by: jenkins Reviewed-by: Juha Niskanen <juha.niskanen@haltian.com> Reviewed-by: Jens Bauer <jens@gpio.dk> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2015-04-14lpc2000: Removed cmd51_can_xxxxb variables.Nemui Trinomius
Current flash driver can fail to write across the sector boundary. This patch fixes "thisrun_bytes" set to "cmd51_dst_boundary" value instead of "cmd51_can_xxxxb" Referred to SevenW's post and fix,thanks. http://sourceforge.net/p/openocd/mailman/openocd-devel/thread/fa32e7d6654df22470dc5f4a3dbc984a%40familiebenschop.nl/#msg33594152 Tested on below listed chips. LPC810,LPC811,LPC812,LPC824,LPC1115,LPC1343,LPC1347,LPC1227, LPC1769,LPC1788,LPC54102,LPC4088 and LPC2388. Change-Id: If1c6a1daa58ca27c405bd959a784e599a7a8f4d4 Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp> Reviewed-on: http://openocd.zylin.com/2607 Tested-by: jenkins Reviewed-by: Jens Bauer <jens@gpio.dk> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-04-14Added Atmel SAM4SA16C chip (chip ID 0x28a70ce0).Patrick Noffke
Change-Id: I45e8e807a36c39940b910b3edb40698c7d8dabd6 Signed-off-by: Patrick Noffke <patrick@noffke.me> Reviewed-on: http://openocd.zylin.com/2625 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-03-25flash/nor: mrvlqspi: fix printf formatting issuesMahavir Jain
Change-Id: I74cfce7bb8dbc13fbc3005b5a96213417f93a9f2 Signed-off-by: Mahavir Jain <mjain@marvell.com> Reviewed-on: http://openocd.zylin.com/2577 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Stian Skjelstad <stian@nixia.no>
2015-03-25flash/nor/kinetis: do not attempt mass-erase in place of a bank erasePaul Fertser
Many kinetis parts come in multi-bank configuration, so this optimisation here can't be performed safely. Investigated and fixed by Richard Braun. Change-Id: I2b56614b47951595c403a1a8edd3afe11b85679b Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2594 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>