aboutsummaryrefslogtreecommitdiff
path: root/src/flash
AgeCommit message (Collapse)Author
2011-12-23Renamed mx2.{c,h} to mxc.{c,h} and added copyright noticeErik Ahlén
Change-Id: I07a280acdce58b8af4a145cd6beafccbb59f20d7 Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/272 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-23Added support for i.MX35 NAND Flash Controller (v2)Erik Ahlén
Change-Id: I7237ec29792b6a7ee690751fa7e6cba0846d5aa8 Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/271 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-23Added command to enable/disable/query BI-swap for MXC NANDErik Ahlén
Change-Id: Ifa3eb739afe0760a974b57c5a17cc3bf7704ba79 Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/270 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-23Made BI-swap optional in mxc.Erik Ahlén
Change-Id: Ibdf3b1e415adcf1fdb38de25fe05da726ef58ca4 Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/269 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-23Added board type as a parameter to mx2 NFC as they have different base ↵Erik Ahlén
addresses. Change-Id: I7bc326e9a8d9f6817f046a7faeebede567c53dd2 Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/268 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-19STM32F2x: check flash unlock, add mass eraseMathias K
Add verification of the flash unlock sequence and return an error if the flash is still locked. Add mass erase subcommand. Change-Id: Id586b1eaf983a3f25b933847dd6608c15bf0b07e Signed-off-by: Mathias K <kesmtp@freenet.de> Reviewed-on: http://openocd.zylin.com/281 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-19Renamed mx2/imx27 to mxc.Erik Ahlén
Renamed all functions, enums, structs and defines from mx2/imx27 to mxc. This is in preparation of adding support for mx35 NFC(v2). Change-Id: I92ad23f0cfab605215bbf0d5846c5c288423facf Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/267 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-12-19Indentation and white space fixes.Erik Ahlén
Change-Id: Iffbaefea4f3d5e9b56b3c36496b44969d7c07e82 Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/266 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-12-11dsp5680xx - indent fixrodrigo_l_rosa
no logic changes, only coding style (spaces to tabs, etc) Change-Id: I5933447c633990e103bc62d088ca2e12f11f031d Signed-off-by: rodrigo_l_rosa <rodrigorosa.lg@gmail.com> Reviewed-on: http://openocd.zylin.com/253 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-11-24dsp5680xx - match page erase with mass eraserodrigo_l_rosa
when last==first==0 then mass erase is executed, it's faster. the page marking was wrong in this case. Change-Id: I5c579d59b5c4778cf057cb5986e086abdd4209b2 Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com> Reviewed-on: http://openocd.zylin.com/232 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-11-24dsp5680xx - mark erase after unlocking flashrodrigo_l_rosa
the unlocking procedure erases the flash mem (even if it wasn't locked), so it should be marked as erased after unlocking. Change-Id: I5cc6a1e1d6cf4e1f243de532eff54111ffd66187 Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com> Reviewed-on: http://openocd.zylin.com/222 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-11-18flash: cleanup stm32f2x loaderSpencer Oliver
Change-Id: I89efdc45bcd61ded437d67d4cbee4c53345d4d76 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/197 Tested-by: jenkins
2011-11-17flash: match stm32f2x loader src nameSpencer Oliver
Change-Id: I60523f809f2d9ec9c9283e0456746ce9a63576a7 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/196 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2011-11-17stm32f1x: improve variable naming and avoid potential divide-by-zeroAndreas Fritiofson
Don't call a variable num_pages if it holds the flash size. Also rearrange flash size to num_pages calculation to avoid divide-by-zero if there will be a device with < 1024 byte pages someday. Change-Id: I2febea39694a2f9750de141f52ec88ae1599c086 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/211 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-16stm32f1x: add more assertsØyvind Harboe
this at least checks the post conditions after convoluted code. Change-Id: Idfa8cbedce5288d8bae5743687949f141dfb07b2 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/187 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2011-11-15kinetis flash: use longword write when writing into pflashTomas Frydrych
Check whether the destination is in the program flash or NVM regions, in the former case, use the normal longword mechanism, not the fast NVM write. Change-Id: I7366b7c8919928ee690252df83b99701776aee82 Signed-off-by: Tomas Frydrych <tomas@sleepfive.com> Reviewed-on: http://openocd.zylin.com/194 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-15at91sam7: ensure probed flash bank has a name (fix a segfault)Aurelien Jacobs
Before this commit, openocd used to segfault when probing flash of an at91sam7x512 (which contains 2 banks of flash). This was due to the way it systematically insert a new flash bank without setting its name. Then, when get_flash_bank_by_name_noprobe() is called, it is doing a strcmp() on the non-initialized bank->name. This commit prevents allocation of second probed bank if it is already allocated (for example, if it is set in a target config file). If a new bank really needs to be allocated, it ensures that a default name is set. Change-Id: I38d15bef1fda2ec746efad37171975136cf7b371 Signed-off-by: Aurelien Jacobs <aurel@gnuage.org> Reviewed-on: http://openocd.zylin.com/171 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-10Work around silicon bug in the SAM3 family flash waitstatesAttila Kinali
* Add flash waitstate support for Atmel SAM3 chips. * Set default waitstates to 6, to workaround a silicon bug in the SAM3 family This code has been tested on SAM3U4, SAM3N4 and SAM3N1 based on Change-Id: I477446f9bfb3e910ea3e2414a6e9a75beb14a214 by Jim Norris <u17263@att.net> Change-Id: I8d360080f6968979ca5e197ad638282cadd18fb7 Signed-off-by: Attila Kinali <attila@kinali.ch> Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/128 Tested-by: jenkins
2011-11-09at91sam7: fix warnings by removing dead assignmentsØyvind Harboe
Change-Id: I836038b3518e617291ac7d5d255a388d9486f67f Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/180 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-09warning fix: remove unused variable assignmentØyvind Harboe
Change-Id: I8c73b0f9a6a10734e539eedcedd79e1a34122f60 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/185 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-09em357: fix warning by removing unused local variablesØyvind Harboe
Change-Id: I9def63d36ed4fa8bf9cdeeedc18b1b25d0e487d6 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/184 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-08flash: update luminary device tableSpencer Oliver
add support for checking target against the device CLASS rather then just the PARTNO. This change also adds the new LM4F family (Blizzard). Change-Id: Ia9d1e33f1f1c2817c0039a2232ecf932fae072f9 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/161 Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-11-07str9x: explain compiler that a local variable will always be initializedØyvind Harboe
Change-Id: I9ddb2793b4cdbf6acea6f69973531491e4ebcc5b Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/145 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-07at91sam3: fix warningsØyvind Harboe
- reduce scope of variables - assert on post condition to fix clang warning Change-Id: Id91038f73a632f9688ba52c9c34eae923626e770 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/160 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-07str7x: fix error propagationØyvind Harboe
stick to convention of "retval" being used as error value to be propagated and use "flash_flags" local variable for flash flags read from how. Change-Id: I63f1f2248b4f4538d6cd7634ae277f7c0aadc346 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/178 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-04cfi: fix gaffe in fixing warningsØyvind Harboe
introduced reading garbage value for arm32. Change-Id: Ib5792a8a3207ee4db6d01d354df98c3cfabce037 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/162 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-04at91sam9: fix broken error propagationØyvind Harboe
Change-Id: I3288ce6f7642e519c26dd099be888a395fe1de94 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/159 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-02fix warning: remove assigned to variableØyvind Harboe
variable is subsequently not used Change-Id: I177d21c6ba9f1f2e3765feffdbf317ea375a8cfe Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/149 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-01flash: add Stellaris Blizzard classSpencer Oliver
Change-Id: I83f0d6edf3ab31d9fa86682f20cec77dc47ba2f6 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/146 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2011-10-31cfi: unsupported code paths now report and return errorØyvind Harboe
found by clang, would have done something undefined and mysterious later on. Change-Id: If7d7aca8514575d229ed0b17378bf8b1bbf347c4 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/133 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-28Fixes comment typo for page sizeJonathan Dumaresq
Change-Id: I6dd8aadcecd680c48e696aeec0daf74d2addbb05 Signed-off-by: Jonathan Dumaresq <jdumaresq@cimeq.qc.ca> Reviewed-on: http://openocd.zylin.com/132 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2011-10-23NOR/CORE: fix clang warningAntonio Borneo
The fix is inline with the Linux coding style that forbids assignment in if condition Change-Id: I10338a249bcfeff87d8596f7e17f209e26b41678 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/86 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-23NAND/CORE: fix clang warningAntonio Borneo
The fix is inline with the Linux coding style that forbids assignment in if condition Change-Id: I42a371d6adfdf3b3fb867705211c47d89776ee2a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/85 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-23FLASH/CFI: fix clang warningsAntonio Borneo
Total of 5 warnings: 3x "Dead store": removed dead assignment to variable; 1x "Dereference of null pointer": this is not an error, but a limited visibility of clang, since pointer erase_region_info is initialized inside cfi_fixup_non_cfi(); 1x "Branch condition evaluates to a garbage value": this is a real coding bug that could issue SIGSEGV, since "goto cleanup" can be executed before initialization of "source". Change-Id: Id3c323c82bb15cbd3bb8fc04b23541f11145f109 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/84 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-23mx2: add error propagation and remove warningsØyvind Harboe
Change-Id: Idd4fb452790e5d7921a749679dbd865586e5a4a9 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/48 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-23fm3: fix warning for superfluous assignmentØyvind Harboe
Change-Id: I4f8e8c2e676a2728ddc6227daf9ca6a7ceb3d505 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/46 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-23kinetis: fix warning about malloc(0) w/assertØyvind Harboe
Change-Id: Ib40204675bfc5429c744f9ed7e2f7098384b753d Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/47 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-23tms470: removed unnecessary operationsEdgar Grimberg
This should silence a warning. Change-Id: Id91a9ebacae836083b1db2654a8e7bf24b2300e9 Signed-off-by: Edgar Grimberg <edgar.grimberg@gmail.com> Reviewed-on: http://openocd.zylin.com/52 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-22FLASH/STMSMI: fix clang "dead store" warningAntonio Borneo
Change-Id: Icfdefdc48432db2057d3fea19dc424571d2385eb Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/50 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-19Updated fm3.c, added Flash type 2 support, error handling improvedMarc Willam / Holger Wech
Change-Id: I684aca11c4554290d0e57c6d3318d8082980c1ef Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net> Reviewed-on: http://openocd.zylin.com/10 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-18luminary: add new targetsSpencer Oliver
update target support from latest SW-DRL 8049 Change-Id: I40aba4d30fe2b79fd955f466c64d99a1dfd63ecf Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/31 Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Tested-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-17Add the SAM3N familly to the chip_details tableAttila Kinali
Change-Id: Ic122d324eacf6e667ed6008ebb84708be944222c Signed-off-by: Attila Kinali <attila@kinali.ch> Reviewed-on: http://openocd.zylin.com/29 Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Tested-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-14flash: fix lpc2000 driver typoSpencer Oliver
Change-Id: I3a759ed98a27fd186c12355b846d5e97dba86c5b Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-09stm32f1x: use async algorithm in flash programming routineAndreas Fritiofson
Let the target algorithm be running in the background and buffer data continuously through a FIFO. This reduces or removes the effect of latency because only a very small number of queue executions needs to be done per buffer fill. Previously, the many repeated target state changes, register accesses (really inefficient) and algorithm uploads caused the flash programming to be latency bound in many cases. Now it should scale better with increased throughput. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2011-10-09stm32f1x: use register base instead of register offsetAndreas Fritiofson
Access the different flash banks' registers using a bank specific register base and a register specific offset. This is equivalent but feels more natural. Some accesses were discovered that maybe should not be hard coded to bank0 registers. Add a note about that. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
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-30optional crc for flash writingRodrigo L. Rosa
crc check was always performed on newly flashed data, now it is optional flash mem can be locked by writing a specific word to a specific address in flash. to verify flash, target must be halted, and this will (when the new halt sequence is implemented) require reseting the chip. if the target is reset after writing the lock words, then it will lock, hence the CRC will fail because it is not possible to read stuff from the target. also added a function that resets the jtag state machine. this is not used yet, but will be soon. it is implemented to allow strict control over JTAG state machine, necessary to implement to halt and unlocking sequences.
2011-08-25This will add the Value Line HD of stm32 devices.Jonathan Dumaresq
This has been tested on STM32F100VE
2011-08-24non_cfi: add SST39WF1601 supportAndreas Bießmann
Invented by jknick in sparkfun forum: http://forum.sparkfun.com/viewtopic.php?t=19788 Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>