aboutsummaryrefslogtreecommitdiff
path: root/src/flash
AgeCommit message (Collapse)Author
2012-01-23i.MX25: Add support for i.MX25 NAND Flash ControllerTimo Ketola
This patch is based on Erik Ahlén's work on i.MX35 NFC support. Basically it redefines the CCM.RCSR register which is in a different address in i.MX25. Change-Id: Ia6faf9cb5efae5e564b72ef9a9b7c7f8bfde3ce0 Signed-off-by: Timo Ketola <timo@exertus.fi> Reviewed-on: http://openocd.zylin.com/383 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-01-23flash: update stellaris_set_flash_timing for target classSpencer Oliver
stellaris_set_flash_timing should only be used for Sandstorm and Fury device classes. Change-Id: Ib5eff9d954c039f2c5726a8ecc3ee45d1694cfd3 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/389 Tested-by: jenkins
2012-01-23flash: cleanup stellaris device class detectionSpencer Oliver
read the target class during probe and save for later use. Change-Id: Ib3ad20edc7d206b7f434bdcc6b947e6a5f06dd1f Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/388 Tested-by: jenkins
2012-01-23cleanup: rename armv4_5 to arm for readabilitySpencer Oliver
Nothing more than a name change, just to make reading the code a bit simpler. Change-Id: I73a16b7302b48ce07d9688162955aae71d11eb45 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/390 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-23flash: print bank usage on failureSpencer Oliver
This makes use of the newly introduced usage field in the flash bank structure. Also remove the assertion if usage field is null and lets print a DEBUG_LOG message instead. Change-Id: I384bf0e2c444fcc99deef73aec9ef01149a91c76 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/391 Tested-by: jenkins
2012-01-18flash: add missing stellaris device classesSpencer Oliver
This adds missing classes to the stellaris flash driver. Change-Id: I90f2218479e5eb60950046fef04429b9529f7ddf Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/382 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-18cmd: add missing usage varsSpencer Oliver
we should have caught them all - hopefully. Change-Id: I35435317fccaf5ad0216244d69f76db6857bb582 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/381 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-12build: fix broken commitSpencer Oliver
fixes commit 04fe2ca5547f76686c7dc555f90510eed6fcc551 Change-Id: Id7fcb82fa1a445f1df21b8d98e945f7c0e08ec93 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/375 Tested-by: jenkins
2012-01-12flash: stm32f2x incorrectly using 512 as max family sizeSpencer Oliver
Change-Id: I2bac348c6d0baabd3d88335c5aa0a318ef66653a Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/353 Tested-by: jenkins
2012-01-12flash: detect stm32f4x device id errataSpencer Oliver
This allows us to detect a device arrata where the device id returned is incorrect. This issue only effects stm32f4x Rev A silicon. Change-Id: Ic9f4985f9abf562f97322dcf484199f0a4eb01bb Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/354 Tested-by: jenkins
2012-01-12cmd: add missing usage varSpencer Oliver
Change-Id: I0f05d643b0801b19cc3beb88f0d12d7e4c83ef9c Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/356 Tested-by: jenkins
2012-01-12flash: use correct device_id maskSpencer Oliver
The stm32 drivers have been using 0x7ff as the DEV_ID mask, this should have been 0xfff. Change-Id: I232469620969d6dd1b9a2a2aa15ec18b947dbb05 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/352 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-01-12optimize: replace while loop by memcpyMathias K
There is no need to use a while loop here. This patch simple copy the last bytes with the system function. Change-Id: Ibda72dca449746efeba5a1af2e45c5990f9cf347 Signed-off-by: Mathias K <kesmtp@freenet.de> Reviewed-on: http://openocd.zylin.com/364 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-01-12build: remove unused variablesSpencer Oliver
detected by clang. Change-Id: Id9effcc5437870f37fecd33803f7753c6eca53d6 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/361 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Mathias Küster <kesmtp@freenet.de>
2012-01-12flash: pre-check flash unlock for stm32f2xBruno FLEURETTE
add checking of the current flash lock status before performing the unlock sequence (which would fail in an unlocked state) Change-Id: I693294c9cd2f59e69cb5bf3338120052fd680b1e Signed-off-by: Bruno FLEURETTE <bruno.fleurette@gmail.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/363 Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de>
2012-01-09flash: support stm32f4x flashSpencer Oliver
This uses the same controller as the stm32f2x family. Change-Id: I931a9ceb0cd1219514d14b8b59475179e543dd0f Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/338 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de>
2012-01-09flash: use stm32f2x flash size registerSpencer Oliver
Use the flash size register to calculate flash info. Change-Id: Ia230db8a08d440710c030a9e5001f20561c9f420 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/337 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de>
2012-01-04Change return value on error.Mathias K
On wrong parameters a error is signalized to the calling function. Change-Id: I484443fdb39938e20382edc9246d5ec546a5c960 Signed-off-by: Mathias K <kesmtp@freenet.de> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/282 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-04flash: introduce .usage field for nand and nor flash driver structureØyvind Harboe
Change-Id: I47e7ec8fa8c70d2addc3aa52d7c97e9e1e7bb662 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/301 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-01-04retire ERROR_INVALID_ARGUMENTS and replace with ERROR_COMMAND_SYNTAX_ERRORØyvind Harboe
Change-Id: I6dee51e1fab1944085391f274a343cdb9014c7a4 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/300 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
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>