aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/drivers.c
AgeCommit message (Collapse)Author
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-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-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-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-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-02-11sim3x: new flash driver for Silabs SiM3 microcontroller familyAndreas Bomholtz
This is a new driver for Silicon Laboratories SiM3 microcontroller family, based on the work of Ladislav Bábel. The driver will try to detect the type of MCU from the device id register, and if this fails it will use the flash size from the flash bank command. Driver added to the documentation and to the README. TCL script added. Tests: * Hardware: SiM3C166 (pre-production) and SiM3U167 * Binary: 4kb, 197kb, 256kb * Flash protect not tested Change-Id: I701e0cf505ca8ad99be7f83543fe5055b2f65dcc Signed-off-by: Andreas Bomholtz <andreas@seluxit.com> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2078 Tested-by: jenkins
2015-02-11psoc4: support for Cypress PSoC 41xx/42xx familyTomas Vanek
New NOR flash driver was derived from stm32lx. Procedure ocd_process_reset_inner is overriden in psoc4.cfg to handle reset halt and system ROM peculiarities. Change-Id: Ib835324412d106ad749e1351a8e18e6be34ca500 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/2282 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-09-22flash/nor: add mrvlqspi flash controller driverMahavir Jain
This patch adds support for QSPI flash controller driver for Marvell's Wireless Microcontroller platform. For more information please refer, https://origin-www.marvell.com/microcontrollers/wi-fi-microcontroller-platform/ Following things have been tested on 88MC200 (Winbond W25Q80BV flash chip): 1. Flash sector level erase 2. Flash chip erase 3. Flash write in normal SPI mode 4. Flash fill (write and verify) in normal SPI mode Change-Id: If4414ae3f77ff170b84e426a35b66c44590c5e06 Signed-off-by: Mahavir Jain <mjain@marvell.com> Reviewed-on: http://openocd.zylin.com/2280 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-02-24nrf51: Implement the support for Nordic's nRF51 devicesAndrey Smirnov
Add support for Nordic's nRF51 chip series. Tested with nRF51822. Change-Id: Id70f6fd76888cc595a353aefb84d25c4cd325d7d Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-on: http://openocd.zylin.com/1945 Tested-by: jenkins Reviewed-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-01-09add support for Atmel SAMD NOR FlashAndrey Yurovsky
This adds a new NOR Flash driver, "at91samd", which supports the built-in Flash on Atmel's D-series Cortex M MCUs, starting with the D20. Parts and their geometry are detected automatically using the DSU and lookup schemes described in the D20 document, 42129F–SAM–10/2013. Future D-series variants and families should presumably use this controller as well (possibly with minor changes and improvements). Tested on the SAMD20 Xplained Pro board, for which we also add the corresponding Flash configuration. Change-Id: Id8d3dd601e9f53121682d1a1190d0be4ea3b83eb Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-on: http://openocd.zylin.com/1684 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-01-09add support for Atmel SAM4L NOR FlashAndrey Yurovsky
This adds a new NOR Flash driver, "at91sam4l", which supports the built-in Flash on Atmel's low-power SAM4L family of Cortex M4 MCUs. Parts and their geometry are detected automatically using the Chip ID and lookup schemes described in document 42023E–SAM–07/2013. Tested on AT91SAM4LC4CA via the SAM4L XPlained Pro development kit. Change-Id: If73499dee92cc8ce231845244ea25c6984f6cecd Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-on: http://openocd.zylin.com/1639 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-09-13flash: add Nuvoton NUC910 series supportNemui Trinomius
Not tested, adapted from http://tech.groups.yahoo.com/group/versaloon/message/391 Change-Id: Ic3273e64fd99bffab16764b06227e09a05d07c8f Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1510 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
2013-09-08mini51: support for Nuvoton NuMicro Mini51 series flash memoryCosmin Gorgovan
Adds a flash driver for Nuvoton MINI51, MINI52 and MINI54 microcontrollers. At the moment, it only supports the erase and write operations. These microcontrollers have a 4 / 8 / 16 KB APROM for application code and a 2 KB LDROM for bootloaders. When the MCU has booted off the APROM, the LDROM isn't mapped in memory but can be programmed, and the other way around. This means that the ARM core is typically rebooted for programming. After a successful write or erase operation, it is rebooted again, using the initial boot source. This driver only supports programming the APROM. This driver is a pure JTAG implementation, it doesn't use any SRAM. I've tested it on a MINI54ZAN microcontroller using an ST-LINK/V2. With the microcontroller running at the default clock frequency of 22.1184 MHz, speed seems to be around 1.1 KB/s. Change-Id: I180889c55af9fb5614cd99a953b755baba14288a Signed-off-by: Cosmin Gorgovan <cosmin@linux-geek.org> Reviewed-on: http://openocd.zylin.com/1546 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-08-07mdr32fx: support for Milandr's MDR32Fx internal flash memoryPaul Fertser
This adds example config and flash driver for russian Cortex-M3 microcontroller model. Run-time tested on MDR32F9Q2I evaluation board; the flash driver should be compatible with MDR32F2x (Cortex-M0) too but I lack hardware to test. There're no status bits at all, the datasheets specifies some delays for flash operations instead. All being in <100us range, they're hard to violate with JTAG, I hope. There're also no flash identification registers so the flash size and type has to be hardcoded into the config. The flashing is considerably complicated because the flash is split into pages, and each page consists of 4 interleaved non-consecutive "sectors" (on MDR32F9 only, MDR32F2 is single-sectored), so the fastest way is to latch the page and sector address and then write only the part that should go into the current page and current sector. Performance testing results with adapter_khz 1000 and the chip running on its default HSI 8MHz oscillator: When working area is specified, a target helper algorithm is used: wrote 131072 bytes from file testfile.bin in 3.698427s (34.609 KiB/s) This can theoretically be sped up by ~1.4 times if the helper algorithm is fed some kind of "loader instructions stream" to allow sector-by-sector writing. Pure JTAG implementation (when target memory area is not available) flashes all the 128k memory in 49.5s. Flashing "info" memory region is also implemented, but due to the overlapping memory addresses (resulting in incorrect memory map calculations for GDB) it can't be used at the same time, so OpenOCD needs to be started this way: -c "set IMEMORY true" -f target/mdr32f9q2i.cfg It also can't be read/verified because it's not memory-mapped anywhere ever, and OpenOCD NOR framework doesn't really allow to provide a custom handler that would be used when verifying. Change-Id: I80c0632da686d49856fdbf9e05d908846dd44316 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1532 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-06-05update files to correct FSF addressSpencer Oliver
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1426 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2013-01-14flash: EFM32 flash implementationRoman D
Limited (no page unprotect, no block writes) implementation of EFM32 flash support. Verified with EFM32 development kit and STLink V2 adapter using SWD. Change-Id: I3db2054d9aa628a1fe4814430425db3c9959c71c Signed-off-by: Roman D <me@iamroman.org> Reviewed-on: http://openocd.zylin.com/1106 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-09-26Added SPIFI flash driver, algorithms, and docsGeorge Harris
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-04-26topic: Added support for the SAM4S variantsOlivier Schonken
Atmel introduced 6 new Cortex-M4 processors on 2011-10-26 SAM4S16C - 1024KB flash LQFP100/BGA100 SAM4S16B - 1024KB flash LQFP64/QFN64 SAM4S16A - 1024KB flash LQFP48/QFN48 SAM4S8C - 512KB flash LQFP100/BGA100 SAM4S8B - 512KB flash LQFP64/QFN64 SAM4S8A - 512KB flash LQFP48/QFN48 The SAM4S processors still suffer from the "6 waitstates needed to program device" errata. Other relevant changes are: 1. Address of flash memory starts at 0x400000. 2. EWP (Erase page and write page) only works for the first two 8KB "sectors" 3. Because of the EWP not working for all the sectors, normal page writes have to be used. The default_flash_blank_check is used to check if lockregions should be erased. 4. The EA (Erase All) command takes 7.3s to complete. (Previous timeout was 500 ms) 5. There are 128 lockable regions of 8KB each. Implemented default blank checking, and page erase for load_image scenarios. This is to compensate for the EWP flash commands only working on the first 2 8KB sectors. Change-Id: I7c5a52b177f7849a107611fd0f635fc416cfb724 Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com> Reviewed-on: http://openocd.zylin.com/528 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-11flash: retire unused eCos flash driverØyvind Harboe
even the AT91EB40a's flash is covered by CFI and nobody ever submitted any other drivers based on eCos code. It's just possible that this idea was missing documentation and "marketing", but it's in git if somebody wants to resurrect it. Change-Id: I66449aa6e0997301f9d67f28098789bfc891d6e9 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/502 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-02-06build: cleanup src/flash/nor directorySpencer Oliver
Change-Id: Ic299de969ce566282c055ba4dd8b94892c4c4311 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/420 Tested-by: jenkins
2011-10-03STM32L: Added flash driver and targetClément Burin des Roziers
Added the flash driver for the STM32L family, which highly differ from the STM32F family. Added the TCL target file for JTAG access.
2011-09-17kinetis cpu flash driverMathias K
Initial release of the freescale kinetis cpu flash driver.
2011-08-09Revert "dsp5680xx: disable for now, it generates warnings"Øyvind Harboe
This reverts commit d567df02b9f3e7d2e7e78b3c2907ecad9aa4bbd4.
2011-07-28flash: update stm32 driver namesSpencer Oliver
Use consistent names for the stm32 family flash drivers, eg. stm32x -> stm32f1x stm32f2xxx -> stm32f2x this makes it easier to add support for newer stm32 families. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2011-07-26add Fujitsu FM3 Family flash supportRonny Strutz
Signed-off-by: Ronny Strutz <ronny@ewoks.de> Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2011-06-28dsp5680xx: disable for now, it generates warningsØyvind Harboe
Use "git revert <commit>" to revert this commit, then build and repair and post patch to the mailing list. Warnings generated with: nios2-elf-gcc (GCC) 3.4.6 (Altera Nios II 9.1 b222) openocd/src/target/dsp5680xx.c: In function 'eonce_rx_upper_data': openocd/src/target/dsp5680xx.c:252: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c: In function 'eonce_rx_lower_data': openocd/src/target/dsp5680xx.c:268: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c: In function 'eonce_pc_store': openocd/src/target/dsp5680xx.c:508: warning: dereferencing type-punned pointer will break strict-aliasing rules openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_read': openocd/src/target/dsp5680xx.c:736: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c:737: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_write_8': openocd/src/target/dsp5680xx.c:823: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_write': openocd/src/target/dsp5680xx.c:938: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c:941: warning: cast increases required alignment of target type openocd/src/target/dsp5680xx.c: In function 'dsp5680xx_f_wr': openocd/src/target/dsp5680xx.c:1355: warning: cast increases required alignment of target type
2011-05-18flash support (only full erase/write) for 568013 and 568037Rodrigo L. Rosa
2011-02-04stm32x: add support for STM32F20xØyvind Harboe
ready for wider testing and comments on basic erase + programming. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2011-01-14Flash driver for em357Erik Botö
Hi, I took the stm32x NOR flash driver and adapted it for the Ember EM357 chip. This chip is very similar to em351 and stm32w so the driver should be easily extended to support those as well if anyone can get their hands on some of those for testing. changelog: Added NOR flash driver em357 Best regards, Erik Botö
2010-11-23FLASH/NOR: rename from spearsmi to stmsmiAntonio Borneo
STMicroelectronics controller SMI is not SPEAr specific. Rename it and change name to every symbol in the code. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-11-16NOR/SPEAr: Add support for Serial NORAntonio Borneo
Add support and documentation for STMicroelectronics SPEAr Serial Memory Interface (SMI). Code tested on SPEAr3xx only. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-05-26flash: add virtual flash bank driverSpencer Oliver
This adds a virtual flash bank driver that allows virtual banks to be defined that refer to an existing flash bank. For example the real address for bank0 on the pic32 is 0x1fc00000 but the user program will either be in kseg0 (0xbfc00000) or kseg1 (0x9fc00000). This also means that gdb will be aware of all the read only flash addresses. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-04-10NOR/DRIVERS: review scope of functionsAntonio Borneo
Add "static" qualifier to private functions. Remove unused "extern" in src/ecosboard.c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2009-12-04split flash.h into into flash/nor/*.hZachary T Welch
Move the bulk of the flash.h file into flash/nor/core.h, leaving an empty husk that will be removed in the next patch. The NOR driver structure is an implementation detail, so move it into its own private header file <flash/nor/driver.h> along with helper declaration for finding them by name.
2009-12-04add flash/nor/drivers.cZachary T Welch
Encapsulates access to the flash_drivers array, providing a base of operations for future dynamic driver module loading features.