aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor
AgeCommit message (Collapse)Author
2012-04-10topic: add reset functions for SWDSimon Qian
Add swd_init_reset and swd_add_reset. Add adapter_assert_reset and adapter_deassert_reset, and call them instead of JTAG reset functions. Change-Id: Ib2551c6fbb45513e0ae0dc331cfe3ee3f922298a Signed-off-by: Simon Qian <simonqian.openocd@gmail.com> Reviewed-on: http://openocd.zylin.com/526 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-30topic: Flash support for Pic32mx1xx/2xxSalvador Arroyo
Change-Id: I496cb745fb1eb5c9159471838013b8d19418f5c0 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/500 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-19Add warn message if no flash bank found for the current image address.Mathias K
Add a warn message to inform the user that something is wrong with the flash settings or command parameters. Change-Id: Ia55868b2abf2a17845e51620b0f29b2809d841c2 Signed-off-by: Mathias K <kesmtp@freenet.de> Reviewed-on: http://openocd.zylin.com/280 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-14flash: Fix flash write algorithm on pflash only devices.Mathias K
This patch fix the slow flash write issue on pflash only devices. The Family Reference Manual says: For devices with FlexNVM: FlexRAM For devices with program flash only: Programming acceleration RAM So the acceleration RAM is available for the flash section command on this device. Change-Id: If6541a23a4457c5ed8858848a145f35cac63138b Signed-off-by: Mathias K <kesmtp@freenet.de> Reviewed-on: http://openocd.zylin.com/509 Tested-by: jenkins Reviewed-by: Tomas Frydrych <tf+openocd@r-finger.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-13topic: Added support for the SAM3X/A variantsOlivier Schonken
Atmel introduced 7 new Cortex-M3 processors on 2012-02-28 SAM3X4C - 256KB flash SAM3X4E - 256KB flash SAM3X8C - 512KB flash SAM3X8E - 512KB flash SAM3X8H (Only on dev-kit - not in production...) - 512KB flash SAM3A4C - 256KB flash SAM3A8C - 256KB flash The SAM3X/A processors still suffer from the "6 waitstates needed to program device" errata. The CIDR address for the SAM3X/A processors are different from the other SAM3 processors. Unfortunately, the chip identification register is not at a constant address across all of the SAM3 series'. As a consequence, a simple heuristic is used to find where it's at... If the contents at the first address is zero, then we know that the second address is where the chip id register is. We can deduce this because for those SAM's that have the chip id @ 0x400e0940, the first address, 0x400e0740, is located in the memory map of the Power Management Controller (PMC). Furthermore, the address is not used by the PMC. So when read, the memory controller returns zero. Another interesting change is the flash bank address for flash bank 1. It is not fixed at 0x00100000 like the Sam3U. Bank 1 of the at91sam3a/x series starts at 0x00080000 + half the total flash size. Thus for the 256KB devices Bank 1 is located at 0x000A0000, and for the 512KB devices Bank 1 is located at 0x000C0000. The configuration files for the SAM3X/A processors will follow Change-Id: I6c3a707c00e05d993a2ad1d5a423f23b37ffd553 Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com> Reviewed-on: http://openocd.zylin.com/505 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-03-06flash: stm32f1x: add a couple missing stm32x_get_flash_regSzymon Modzelewski
Change-Id: I163de2c1bd962e7ea9ca6c741c1c62224c210677 Signed-off-by: Szymon Modzelewski <szmodzelewski@gmail.com> Reviewed-on: http://openocd.zylin.com/486 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
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-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-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-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-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-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-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>