aboutsummaryrefslogtreecommitdiff
path: root/src/flash
AgeCommit message (Collapse)Author
2012-03-06flash: Additional check for NULL in str9xpec enable_turboFredrik Hederstierna
Change-Id: Ifde8783b27c64e4a4bbea180cfa2c86f6a9fe49a Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/496 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-03-06SAM3: Remove unused reference to SUPC registersAttila Kinali
The SUPC (Supply Controller) registers are on different base addresses on different SAM3 chips: SAM3U: 0x400e1210 SAM3N: 0x400e1410 SAM3S: 0x400e1410 This creates a problem with the sam3_reg_list array which is const, but would need to be changed at runtime to account for this variability. As this register is not used anywhere, it's simplest to just remove it. Change-Id: I987eb371648d826aa6d5e9de18d38c7bb66d6fca Signed-off-by: Attila Kinali <attila@kinali.ch> Reviewed-on: http://openocd.zylin.com/495 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-06SAM3: Add missing architecture names for SAM3S and SAM3NAttila Kinali
Change-Id: Ie2177487d4315219eb364db360cb7f88d2720783 Signed-off-by: Attila Kinali <attila@kinali.ch> Reviewed-on: http://openocd.zylin.com/494 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-06SAM3S: correct flash sector sizes.Attila Kinali
Lock region count and sector sizes did not match datasheet. (see 6500C-ATARM-8FE11 "SAM3S Series Datasheet", Table 7-1) Change-Id: Ic511802f96ed03856467a24a6736349205a0576a Signed-off-by: Attila Kinali <attila@kinali.ch> Reviewed-on: http://openocd.zylin.com/493 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-02-29Fix assert to check flash programming offsetAttila Kinali
The assert introduced in 00c864835149a96b431fc8f31dd89542d88fd383 checks whether the programming offset equals to page_size of the flash, while it wants to check whether the offset is a multiple of the page_size. Change-Id: I794d021951a28c1cc520b5eea5d500f097721b06 Signed-off-by: Attila Kinali <attila@kinali.ch> Reviewed-on: http://openocd.zylin.com/482 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
2012-02-29flash: add stm32lx High Density DevicesSpencer Oliver
Change-Id: Ieed9de4b078e1ebf659054a758b4f69acdf5b83e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/466 Tested-by: jenkins
2012-02-29flash: change stm32lx driver probe behaviourSpencer Oliver
Currently stm32lx flash driver will remove the readout protection if set during a probe. This may not be what the user wants, so let them decide. Change-Id: I8575e3b339b10a4f7bac57cca9586dcab513d347 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/465 Tested-by: jenkins
2012-02-27flash: add new devices to pic32mx flash driverSpencer Oliver
update as per DS61145 rev J Change-Id: I2b5da84248ff2f44c7ca9d2ed1c52db453714c05 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/461 Tested-by: jenkins
2012-02-26flash: add stm32f2x async flash loaderSpencer Oliver
This enable the stm32f2x flash driver to use the asynchronous algorithm support. Speed increase is as follows: before - wrote 1048576 bytes from file stm32f4x.bin in 30.453804s (33.625 KiB/s) after - wrote 1048576 bytes from file stm32f4x.bin in 23.679497s (43.244 KiB/s) This also fixes a bug that was in the old flash loader. The old loader waited while bit16 of the status reg was 0, the new loader waits until this bit is 0 as stated in the flash spec. Bizarrely this bug did not effect programming on any tested parts. Change-Id: I3efc94d42cbe81283673a8f4203700638080af6e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/460 Tested-by: jenkins
2012-02-26flash: add stellaris async flash loaderSpencer Oliver
This enable the Stellaris flash driver to use the asynchronous algorithm support. Speed increase is as follows: before - wrote 65536 bytes from file test.bin in 5.486040s (11.666 KiB/s) after - wrote 65536 bytes from file test.bin in 2.274001s (28.144 KiB/s) Change-Id: I9004c9aadffa1ae3b0cbf908e6549b5b1f794508 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/403 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-02-26target: add target async algorithm supportSpencer Oliver
Currently the stm32f1x flash driver uses an asynchronous algorithm as part of the block flash programming. This greatly speeds up flash programming as the target is always running. Moving the async code to the target enable other targets to use this added functionality. Change-Id: I8e53f094c2ef7848a7f86ddb9a35b6edbfc8454a Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/402 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-02-22Sometime in the past, nand_fileio_finish started to return ERROR_OK (with ↵Stian Skjelsad
the value of zero) on success. Change-Id: Ifb743c1617e2a6071a87c901fae8165969efcdbf Signed-off-by: Stian Skjelstad <stian@nixia.no> Reviewed-on: http://openocd.zylin.com/468 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-02-16Add stm32f0x probe and info workingJonathan Dumaresq
I used the CPUID instead of adding a new argument to the flash bank command Fixed Type in comments Add the failsafe return value in device_id Change-Id: Ieb5a46fc002b5390a0c81bc8b49f6c687036ae1d Signed-off-by: Jonathan Dumaresq <jdumaresq@cimeq.qc.ca> Reviewed-on: http://openocd.zylin.com/438 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-02-13flash: fix incorrect stm32f2x/stm32f4x flash size registerSpencer Oliver
The ref manuals for the stm32f2x (RM0033 Rev4) and stm32f4x (RM0090 rev1) are unclear to the address of the flash size register (F_ID). According to contacts @ ST this is the correct address, the manuals will be updated in due coarse. Change-Id: If9fb83b3100458d17038cf27c2b23355e1dc5a9e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/448 Reviewed-by: Peter Stuge <peter@stuge.se> Tested-by: jenkins
2012-02-06doxygen: use correct comment syntaxSpencer Oliver
This issue was caused by uncrustify not correctly converting the doxygen comments. Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Change-Id: Ie6dc3b057a08603b670cb27312e5f0d989426e6c Reviewed-on: http://openocd.zylin.com/431 Tested-by: jenkins
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
2012-02-06build: cleanup src/flash/nand directorySpencer Oliver
Change-Id: I21bb466a35168cf04743f5baafac9fef50d01707 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/419 Tested-by: jenkins
2012-02-06build: cleanup src/flash directorySpencer Oliver
Change-Id: I33c32a884095cff139546f760bc8fa6586e8c5b0 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/417 Tested-by: jenkins
2012-01-30stm32f1x: fix bug in flash loader and restrict instruction set to armv6-mAndreas Fritiofson
Correct the offset to the read pointer when clearing it on error. Also restrict the instruction set to armv6-m so the flash driver can be used on Cortex-M0 parts with the same flash controller. Change-Id: I380f9dabcc41fb6e4d43a7e02f355e2381913f39 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/399 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Jonathan Dumaresq <jdumaresq@cimeq.qc.ca> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-01-27flash: fix stellaris class regressionSpencer Oliver
for some reason the following commit was incorrect 769064de4bd8fc59804c37a418b83fcdba6fd36f Only the Sandstorm and Fury class should write this register. Change-Id: Ie18f1da6e9b59fb99cca47aa93c7f2fee447ccea Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/400 Tested-by: jenkins
2012-01-23flash: cleanup/reformat fm3 flash driverFujitsu FM3 Application Team
Signed-off-by: Fujitsu FM3 Application Team <openocd.fseu@de.fujitsu.com> Change-Id: Iaf0bacfa5438a0213a65a3d60e7d461965a5a1ac Reviewed-on: http://openocd.zylin.com/249 Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-01-23NAND: Misleading report of erased blocksTimo Ketola
For example, when blocks 2 and 3 were erased, openocd reported "erased blocks 2 to 4". That should be "2 to 3", I think. Change-Id: Icece63dedd3dd931b70fa73616819a19572e39de Signed-off-by: Timo Ketola <timo@exertus.fi> Reviewed-on: http://openocd.zylin.com/385 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-01-23i.MX25: Set OOB size (MXC NFC)Timo Ketola
SPAS register (OOB size) is left wrong after reset with respect to 2KiB page NAND chip. That will lead to ECC errors after 'reset halt'. Change-Id: If5a4685cb8d6be35879453951611ef1059da219c Signed-off-by: Timo Ketola <timo@exertus.fi> Reviewed-on: http://openocd.zylin.com/384 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
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>