aboutsummaryrefslogtreecommitdiff
path: root/src/flash
AgeCommit message (Collapse)AuthorFilesLines
2013-05-08efm32: fix FTBFS on ARM due to alignment issuesPaul Fertser1-8/+8
The following warnings prevent OpenOCD from building: efm32.c: In function 'efm32x_read_lock_data': efm32.c:373:8: error: cast increases required alignment of target type [-Werror=cast-align] efm32.c:386:9: error: cast increases required alignment of target type [-Werror=cast-align] efm32.c:394:9: error: cast increases required alignment of target type [-Werror=cast-align] efm32.c:402:9: error: cast increases required alignment of target type [-Werror=cast-align] efm32.c: In function 'efm32x_get_page_lock': efm32.c:430:17: error: cast increases required alignment of target type [-Werror=cast-align] efm32.c: In function 'efm32x_set_page_lock': efm32.c:441:19: error: cast increases required alignment of target type [-Werror=cast-align] cc1: all warnings being treated as errors This patch is compile-tested only. Change-Id: Ia3a8f342e0f5e30c8ea4de9435c5c7a80bc100e3 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1370 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-04-28kinetis: fix "SF1" parts to limit FlexRAM usageChristopher Kilgour1-15/+19
Ensure FlexRAM usage is limited to half the FlexRAM size when programming. Assume the FlexNVM sector size is equal to half the FlexRAM. Fix sector erase checking which had an error introduced when the kinetis_ftfx_command( ) signature was changed. Change-Id: I88edd9c7d4a4ba474cad7b00052feaeedfa8ced8 Signed-off-by: Christopher Kilgour <techie@whiterocker.com> Reviewed-on: http://openocd.zylin.com/1358 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-04-21Add "lpc1800" alias for "lpc4300" flash driverFreddie Chopin1-2/+2
Change-Id: I6d2bb9105cc778bd1d21580022529d684c3b21b0 Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-on: http://openocd.zylin.com/1351 Tested-by: jenkins
2013-04-21flash/nor: add lpc4300 variant to lpc2000 driverMatt Dittrich1-10/+93
This patch adds flash programming support for internal flash of the LPC43x2/3/5/7 part, tested on a LPC4337 (also tested on a LPC1768 and LPC2468). It should also work with LPC1800's with onchip flash. The "base" parameter of the "flash bank" command is now significant for the lpc4300 variant and required to determine the bank number parameter needed by the IAP routines. NOTE: I could only program flash successfully when the chip is powered with "P2_7" pulled low to put it in ISP mode. When running from flash (and not the ISP ROM), the target fails to halt and the sector erase fails. This is similar to the behavior I remember when trying out the spifi driver on a LPC4350... lots of power cycles to make progress, one To burn, one to run. So I am not confident my config is set up correctly. Change-Id: I8a75ef1b95cedd5b5898b2dedff477f502fd19f3 Signed-off-by: Matt Dittrich <mdittrich.dev@gmail.com> Reviewed-on: http://openocd.zylin.com/1126 Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Tested-by: jenkins
2013-04-17topic: STM32W support added to em357 driverBen Nahill1-3/+36
The em357 driver only supported one page configuration (192k in 96 2048k) pages. This is fine for em357 chips since that's the size they have, but ST's STM32W chips (pretty much the same) have different flash configurations available (64, 128, 192, 256k). I can't find anywhere that would indicate the size of the chip anywhere in memory so the selection must be manual, using the 'size' parameter. For backwards compatibility, any size not known to be in use defaults to the 192k configuration. I don't have any em357 devices to test, but I also found that I had to re-assert the FPEC clock enable before performing an erase. This is a single line and shouldn't break any configurations. My testing so far has only been with a 64k device with 8k of RAM. Change-Id: Ic0ac400a9696efaa09d1407dd4a4d456bc2c318b Signed-off-by: Ben Nahill <bnahill@gmail.com> Reviewed-on: http://openocd.zylin.com/1336 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2013-04-17program: do not poll target after reset runSpencer Oliver1-0/+2
Disable polling the target before we issue a 'reset run'. This stops errors or warnings if the target disables the SWD or JTAG interface as part of the application code. Change-Id: I5019dffdad41a8e210003ece1caf89069ee0f223 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1331 Tested-by: jenkins
2013-04-15flash: Added support for at91sam4sd32cPeter Dietzsch1-0/+62
Change-Id: I7223980602d7595a3dd7a3ceaac3f58d4f73f88d Signed-off-by: Peter Dietzsch <peter.dietzsch@ib-dt.de> Reviewed-on: http://openocd.zylin.com/1332 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2013-04-02Added support for ARMv7-M in arm io.Henrik Nilsson1-25/+87
Added support for ARMv7-M targets in arm_nandwrite and arm_nandread. Change-Id: Iab1d78d401f735e191c6a8519f3619035a300fae Signed-off-by: Henrik Nilsson <henrik.nilsson@bytequest.se> Reviewed-on: http://openocd.zylin.com/1188 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-03-24at91sam3: Wrong PLLA frequency calculationsThomas Schmid1-2/+2
The command 'at91sam3 info' ignores PLLA DIV values >1. This patch fixes it. Tested on a SAM3S4C chip. Change-Id: I051f41bb3dcefe1ac785fbcb48477a807daa16a2 Signed-off-by: Thomas Schmid <thomas.schmid@gmail.com> Reviewed-on: http://openocd.zylin.com/1307 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2013-03-15target: Retire target_bulk_write_memory()Andreas Fritiofson1-5/+1
The only caller was arm_nandwrite(). Replace that call with target_write_buffer() instead, which in turn may end up calling the same bulk_write_memory target API function. Change-Id: If34c7474df5cf14af3b732fb4774816818f28e79 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1214 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-03-13Kinetis: Flash command function matches datasheetAlex Austin1-51/+38
The kinetis datasheets specify the flash registers as bytes rather than as words, as the previous implementation did. This also makes a few code sections slightly less endian-magical. Change-Id: If8f4adfc7f4341085ae5b6eacbf7d74bbd74cf08 Signed-off-by: Alex Austin <alex.austin@spectrumdsi.com> Reviewed-on: http://openocd.zylin.com/1192 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-03-13Kinetis: Symbolic names for Addresses and CommandsAlex Austin1-20/+40
Change-Id: I2165b66c37bd1608139b5dd00f48124161e13ef0 Signed-off-by: Alex Austin <alex.austin@spectrumdsi.com> Reviewed-on: http://openocd.zylin.com/1191 Tested-by: jenkins Reviewed-by: Christopher Kilgour <techie@whiterocker.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-03-12tcl: add flash programming helperSpencer Oliver1-1/+68
This adds a program proc that simplifies using OpenOCD as a standalone programmer. Change-Id: I6ece492cd878c170b734e8bb2e09fe8c4557d5a6 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1199 Tested-by: jenkins Reviewed-by: Jörg Fischer <turboj@gmx.de> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2013-03-06flash: fix stm32 failed probe using incorrect flash sizeSpencer Oliver3-6/+12
This fixes an issue if the device is manually probed after the initial probe fails due to being unable to read flash size register. In this situation the driver assumes the user has overridden the flash size when infact this may not be the case. It also seems on the older stm32f1 devices the flash register is not readable when locked, this does not seem to apply to the newer parts - f0, f3, f4. Change-Id: I125f872fcb2d962ca6705f97b62d957e2b31303b Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1187 Tested-by: jenkins Reviewed-by: Johan Almquist <johan.almquist@assaabloy.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-03-06stm32: update stm32f1x driver for f0x and f3x option bytesSpencer Oliver1-4/+14
The stm32f0 and stm32f3 share the same option byte location, but the format differs. Adding an option_offset fixes the broken options_read cmd and incorrectly setting Hardware Watchdog when unlocking a f3x device. Change-Id: I82d66b6198294ea9eedb44ca8b2fb368c0cb15e8 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1184 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-02-25stm32: add support for stm32l1x 256k high density single bank devicesJohan Almquist1-0/+4
Added support for new ST devices in the stm32lx portfolio, with device id 0x427. These have 256k flash, but in a single bank compared to device id 0x436 which is a dual bank flash. Change-Id: Iafdfe990f24bd04b0d6e00385ee70690f3bf8d5f Signed-off-by: Johan Almquist <johan.almquist@assaabloy.com> Reviewed-on: http://openocd.zylin.com/1140 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-02-25stm32: add support for the STM32Lx 384kb dual bank flashJohan Almquist1-6/+44
This update adds support for the STM32Lx 384kb dual bank flash. Previously there was a problem when writing an image that was larger than 192Kb. That lead to openocd printing out two error messages like "Error: access denied / write protected" and "Error: invalid program address". The reason was that the stm32lx driver tried to write half pages which overlapped into the next flash bank. A new configuration file stm32lx_dual_bank.cfg can be used for stm32lx chips with dual bank flash (256kb or 384kb devices). A sanity check was added for probed flash size values to fix the issue seen on some ST samples that answered incorrectly. Change-Id: I69e25131983d88613be8606b438f98870c5f1e52 Signed-off-by: Johan Almquist <johan.almquist@assaabloy.com> Reviewed-on: http://openocd.zylin.com/1125 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-02-25stm32: enable flash bank size overrideSpencer Oliver3-0/+21
It has been seen on some stm32 targets that the flash size register that is probed by the driver may contain an invalid size. This change enables the user to override the probed value. Change-Id: I09359e59a96f9133d3d939670957d32a830a944e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1132 Tested-by: jenkins Reviewed-by: Johan Almquist <johan.almquist@assaabloy.com>
2013-02-02armv7m: use ARM_MODE_THREAD core mode for algoorithm'sSpencer Oliver10-12/+12
This makes sure we are using privileged mode when executing any loaders. Change-Id: I18bf32ec92e1c76a66ab25e3712652bc3650b332 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1108 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-02-02armv7m: use generic arm::core_modeSpencer Oliver10-12/+12
To simplify things change over to using the generic core_mode struct rather than maintaining a armv7m specific one. Change-Id: Ibf32b785d896fef4f33307fabe0d8eb266f7086f Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/966 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-01-21flash: add stm32lx loader Hard Fault workaroundSpencer Oliver1-0/+53
An issue has been seen with the stm32lx flash driver that if a power cycle/reset is applied after a erase, any ram loader will Hard Fault on execution. A similar issue is mentioned in the errata for the device. Two solution's seem to workaround this issue: 1, Handle the exception, this means adding exception vectors to the loader and changing the exception address using nvic vtor register. 2. falling back to using slower direct page writes - approx 50% slower. Using solution 1 would mean restrictions are placed on the loader location. Solution 2 was chosen mainly as it was simpler too implement. Change-Id: I429f06b5a3e3b1d8de90071a88a7df11fc9b46a7 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1010 Tested-by: jenkins
2013-01-21flash: reduce stm32lx loader timeoutSpencer Oliver1-1/+1
Waiting 20secs is a bit much excessive, we could probably reduce to 5. Change-Id: Iffb97adb99c2541a075fe78dbc88a53ddf340214 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1009 Tested-by: jenkins
2013-01-21flash: cleanup stm32lx driverSpencer Oliver1-90/+96
Handle any leading bytes upto the next 128 byte page, enabling us to safely use the faster page write. Rather than use a separate word/byte write to program any trailing bytes we use a combined write function. Use memcpy for byte writes and change loader to using bytes. Change-Id: Ie0164a30388f018dd00e752cf5ff87d4f96ced97 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1008 Tested-by: jenkins
2013-01-21flash: stm32f2x support write protectionSpencer Oliver1-0/+49
Change-Id: I42662681104bb06e28148229464ae144c4a54538 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/989 Tested-by: jenkins
2013-01-21flash: add stm32f2x flash lock/unlock cmdsSpencer Oliver1-15/+235
Change-Id: I35344cc47fa4f0a49c034455c5abf479faa0344a Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/988 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-01-18flash: EFM32 GG/LG page size detection fixRoman D1-8/+16
Fixed flash page size detection according to EFM32 GG/LG errata. MEM_INFO_PAGE_SIZE register containts invalid value in devices with revision number lower than 18 and should not be used. Change-Id: Idb2832246efcbbec2fd98a5c458f72a36df386fb Signed-off-by: Roman D <me@iamroman.org> Reviewed-on: http://openocd.zylin.com/1116 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-01-14flash: EFM32 flash implementationRoman D3-0/+980
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-12-31flash: allow stm32f1x options_write args in any orderSpencer Oliver1-30/+37
Currently we have to supply the arg's to this cmd in a set order, this change fixes that issue. Change-Id: I14a15732e1917a91009e1ac14fba39ca1523c739 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/992 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-12-31flash: use correct stm32f1x option read maskSpencer Oliver1-2/+2
Make sure we do not mask out the BFB2 boot bank bit, as this is used on the larger XL devices. Change-Id: Iacfdf874140e409e0c4ca9b9aee8f5c2f90dc9be Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/991 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-12-31stm32f1x: fix stm32f0/f3 broken unlockSpencer Oliver1-1/+8
The STM32F0 and F3 devices use a different default RDP to configure a unlocked device, make sure we use that. Change-Id: I170779461412c4c202c2cfc8d90baedb7e388150 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/984 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-12-31stm32f1x: preserve user option byte dataSpencer Oliver1-2/+14
The user is able to use 2bytes of the options byte data for whatever purpose they wish. Make sure we preserve this during an option erase/write. Change-Id: Ibf951b11c59a148e671b1eb47fdc9b4f49ccae15 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/983 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-12-31flash: stm32f1x: write option bytes using the loaderSzymon Modzelewski1-60/+19
Some debuggers (stlink) can't issue 16 bit writes and have to use a loader to write flash memory. Currently the loader is not used for option bytes, causing stm32x_write_options to fail silently on such hardware. Fix this by using stm32x_write_block to write option bytes as well. Change-Id: I49c29d53ab5e162463cb349d4c89bef96467e587 Signed-off-by: Szymon Modzelewski <szmodzelewski@gmail.com> Reviewed-on: http://openocd.zylin.com/480 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-12-30flash: stm32lx fallback to slow memory writes when no working areaSpencer Oliver1-4/+10
The current stm32lx driver will fail if no working area is provided - fallback to using slow writes if this is the case. Change-Id: I92b1535fec4aebc855c63ce2c54b10f168f3c07e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1007 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-12-30flash: add new stm32l HD variantSpencer Oliver1-0/+4
Updated as per latest RM0038 Rev 6. Change-Id: Ia11309a1cdc3b8986f808b33a5c565bdc0ba58b0 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1003 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-12-30flash: format stm32f2x driver definesSpencer Oliver1-42/+41
Change-Id: Ie903996368a8d4313df87839d5ba3f2a102796a3 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/987 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-12-24flash: add stm32f2x rev XSpencer Oliver1-0/+4
Updated as per ST RM0033 rev 5 Change-Id: I627fdab69b440b75b8e4f7c474216538fa5273a4 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1001 Tested-by: jenkins
2012-12-14flash: fm3 mb9bfxx7 mb9bfxx8 supportMuranaka Masaki1-6/+90
Patch submitted by Trac #55 Change-Id: I08b0d79d24fe9108ca0bbfbc9b45c60359b6d180 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/981 Tested-by: jenkins
2012-11-19flash: add stm32f42x/stm32f43x supportSpencer Oliver1-3/+25
Other than a larger memory layout these new devices also have an extra MER1 bit to perform the mass erase. Change-Id: I7110a05bac95c1707160d1f5622181664291eb4a Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/985 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2012-11-06Added support for SPI Flash Winbond W25Q64CVGianluca Renzi1-0/+1
Added in spi device table SPI Flash Winbond W25Q64CV 64Mbit Its Device ID 0x001740ef is the same as Spansion S25FL064K (may be a clone?) Change-Id: I3cdbd182a0ccde75c78684cb9d54c76059bf34e0 Signed-off-by: Gianluca Renzi <gianlucarenzi@eurekelettronica.it> Reviewed-on: http://openocd.zylin.com/928 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-10-28flash: update stm32 flash driver versionsSpencer Oliver1-4/+8
Seems ST have changed the ref manual (RM0313 rev1) and reverted to using letters rather than numbers for the stm32f3x family. Change-Id: I3a87ec9b0b2447d57dfef98603d30e28fe9ac927 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/926 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Peter Stuge <peter@stuge.se>
2012-10-17flash: fix at91sam3/4 driver typosSpencer Oliver2-20/+18
Change-Id: I06efdfcc48279b06035e9e173945304310054864 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/896 Tested-by: jenkins Reviewed-by: Olivier Schonken <olivier.schonken@gmail.com>
2012-10-17Fix serious bug in LPC2xxx/LPC17xx flash algorithm.Freddie Chopin1-79/+120
Flash algorithm for LPC17xx/LPC2xxx was trying to "reuse" previously allocated working area on next flashing which is not possible - working areas are freed automatically on reset. This caused all but first flashing attempts to fail. As there is no point in storing pointer to working area, it was converted to local variable. Change-Id: I939946325ff9eecc4861c0f51ab0f73871a3d7b9 Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-on: http://openocd.zylin.com/860 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-10-17Cleanup lpc2000.cFreddie Chopin1-129/+87
Do some cleanup in lpc2000.c - concatenate short lines into single longer lines, move variable declarations to "just before" they are used, etc. Change-Id: Ia7b9f0307dd4857ee8e15c8a6d4d7b5c4392fd80 Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-on: http://openocd.zylin.com/861 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-10-12cfi: remove typos and code cleanupSpencer Oliver1-136/+104
No change to code, just fix some formatting issues. Change-Id: I177430a99bfecbf90a1ddf623321c29d4db516b0 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/906 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-10-12flash: update stellaris flash data to latest dev package 9453Spencer Oliver1-8/+10
Change-Id: I16107a093d4ed7342583f5c32ad16aa98f81d122 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/856 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-10-08dsp5680xx_flash: Remove unused flash bank structureAndreas Fritiofson1-9/+0
Change-Id: I947b6730b3741a71303e440daefa4fcf583cb9cf Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/867 Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-10-08stm32f1x: Increase options erase timeoutAndreas Fritiofson1-9/+14
The erase time for the option byte page is not directly specified but is assumed to be the same as the other pages (or mass erase) which is 20 to 40 ms. The current timeout value is 10 which means 10 ms plus the time to poll the status flag that many times. With faster interfaces or drivers (such as when using the ftdi driver instead of the ft2232 driver) the adapter delay is not enough in some cases, unless the jtag freq is reduced as a workaround. The result is a "timed out waiting for flash" error when trying to write the options. Increase the timeout to a minimum of 100 ms, which is in line with the other erase timeouts. Also make defines of both the erase and the program timeouts. Change-Id: Ia86e71505033c52b60ef30092000689fbb547a18 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/902 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-10-08flash/nor/stellaris: Remove unnecessary write_algorithm checkAndreas Fritiofson1-2/+1
The pointer must be non-null here since we returned if allocation failed. Change-Id: I9b75099ed3b3870c815d1df5760ed1f3fe1d20d6 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/866 Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-10-08flash/nor: make all working area pointers localAndreas Fritiofson11-198/+153
Working area pointers shouldn't be re-used, so there's no point in storing them in the flash bank struct. Make all such pointers local. Change-Id: Iab65b4e8b475fed7fc72fb8928f54590fa69d260 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/865 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-10-04Modified Sector Erase for AT91SAM4SOlivier Schonken1-1/+8
In FLASHD_ErasePages AT91C_EFC_FCMD_EPA is used to erase sectors. According to the datasheet FARG[15:2] defines the page from which the erase will start.This page must be modulo 4, 8, 16 or 32 according to the number of pages to erase. FARG[1:0] defines the number of pages to be erased. Previously (firstpage << 2) was used to conform to this, seems it should not be shifted... Changed it to (firstPage) | erasePages. Change-Id: I791cc7fc4faf056623ad5a6c7e860315306098a1 Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com> Reviewed-on: http://openocd.zylin.com/830 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>