Commit Graph

973 Commits

Author SHA1 Message Date
rodrigo_l_rosa
3d0e2547fe dsp5680xx - indent fix
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-12-11 18:40:01 +00:00
rodrigo_l_rosa
f80ef64858 dsp5680xx - match page erase with mass erase
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-24 23:26:50 +00:00
rodrigo_l_rosa
c725167ba8 dsp5680xx - mark erase after unlocking flash
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-24 23:25:57 +00:00
Spencer Oliver
88ca3aabfb flash: cleanup stm32f2x loader
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-18 16:57:23 +00:00
Spencer Oliver
2475e7b14c flash: match stm32f2x loader src name
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-17 22:48:25 +00:00
Andreas Fritiofson
a1f6b6612b stm32f1x: improve variable naming and avoid potential divide-by-zero
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-17 17:28:13 +00:00
Øyvind Harboe
287ba1888b stm32f1x: add more asserts
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-16 23:29:53 +00:00
Tomas Frydrych
a17907d106 kinetis flash: use longword write when writing into pflash
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-15 20:56:17 +00:00
Aurelien Jacobs
67c3ad8c40 at91sam7: ensure probed flash bank has a name (fix a segfault)
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-15 09:27:50 +00:00
Attila Kinali
4c3a87c28f Work around silicon bug in the SAM3 family flash waitstates
* 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-10 15:41:44 +00:00
Øyvind Harboe
b472c2f245 at91sam7: fix warnings by removing dead assignments
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-09 16:30:55 +00:00
Øyvind Harboe
86d8ee7fe2 warning fix: remove unused variable assignment
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-09 16:29:10 +00:00
Øyvind Harboe
234f51429e em357: fix warning by removing unused local variables
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-09 16:27:11 +00:00
Spencer Oliver
e74a081a1a flash: update luminary device table
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-08 21:52:17 +00:00
Øyvind Harboe
d931bb5a05 str9x: explain compiler that a local variable will always be initialized
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-07 20:33:17 +00:00
Øyvind Harboe
00c8648351 at91sam3: fix warnings
- 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-07 20:32:51 +00:00
Øyvind Harboe
4bea65f1b2 str7x: fix error propagation
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-07 20:32:06 +00:00
Øyvind Harboe
61699628c8 cfi: fix gaffe in fixing warnings
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-04 22:53:31 +00:00
Øyvind Harboe
2b20e4afac at91sam9: fix broken error propagation
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-04 09:05:47 +00:00
Øyvind Harboe
955316a727 fix warning: remove assigned to variable
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-02 09:44:08 +00:00
Spencer Oliver
889a306fc8 flash: add Stellaris Blizzard class
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-11-01 19:45:33 +00:00
Øyvind Harboe
9933fa334d cfi: unsupported code paths now report and return error
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-31 20:41:18 +00:00
Jonathan Dumaresq
af51c69fbc Fixes comment typo for page size
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-28 15:24:50 +00:00
Antonio Borneo
40c425e400 NOR/CORE: fix clang warning
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-23 14:37:48 +00:00
Antonio Borneo
7b94f4c99d NAND/CORE: fix clang warning
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-23 14:32:11 +00:00
Antonio Borneo
3432049276 FLASH/CFI: fix clang warnings
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-23 14:16:45 +00:00
Øyvind Harboe
9bb3a05f0e mx2: add error propagation and remove warnings
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-23 13:30:46 +00:00
Øyvind Harboe
dad3850264 fm3: fix warning for superfluous assignment
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-23 13:29:09 +00:00
Øyvind Harboe
d5b5f9f4fd kinetis: fix warning about malloc(0) w/assert
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-23 13:26:53 +00:00
Edgar Grimberg
0577ba8331 tms470: removed unnecessary operations
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-23 11:34:05 +00:00
Antonio Borneo
811f7d3f7e FLASH/STMSMI: fix clang "dead store" warning
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-22 11:45:29 +00:00
Marc Willam / Holger Wech
9ddb94c1f3 Updated fm3.c, added Flash type 2 support, error handling improved
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-19 11:05:27 +00:00
Spencer Oliver
0dac042a10 luminary: add new targets
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-18 06:36:11 +00:00
Attila Kinali
2f6bdac60a Add the SAM3N familly to the chip_details table
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-17 17:40:25 +00:00
Spencer Oliver
8c3c5e53e3 flash: fix lpc2000 driver typo
Change-Id: I3a759ed98a27fd186c12355b846d5e97dba86c5b
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-14 14:18:56 +02:00
Andreas Fritiofson
92b14f8ca9 stm32f1x: use async algorithm in flash programming routine
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-09 00:00:53 +02:00
Andreas Fritiofson
a147563ac1 stm32f1x: use register base instead of register offset
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-09 00:00:52 +02:00
Clément Burin des Roziers
da8ce5f2e1 STM32L: Added flash driver and target
Added the flash driver for the STM32L family, which highly differ from the STM32F family.
Added the TCL target file for JTAG access.
2011-10-03 18:42:39 +02:00
Mathias K
bfe634aa91 kinetis cpu flash driver
Initial release of the freescale kinetis cpu flash driver.
2011-09-17 14:20:37 +02:00
Rodrigo L. Rosa
e1a2d7255e optional crc for flash writing
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-30 15:09:34 -07:00
Jonathan Dumaresq
62eec47ff1 This will add the Value Line HD of stm32 devices.
This has been tested on STM32F100VE
2011-08-25 20:13:16 +02:00
Andreas Bießmann
b2ff00fb86 non_cfi: add SST39WF1601 support
Invented by jknick in sparkfun forum:
http://forum.sparkfun.com/viewtopic.php?t=19788

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2011-08-24 11:12:53 +02:00
olivier Schonken
8292b1b5cd Fix Sam3u flash bank 1 issue 2011-08-21 19:37:20 +02:00
Gunnar Henne
0d5a38d829 cfi: add EN29LV800BB support
Posted by telekatz@gmx.de in the bettyhacks forum for openocd
0.4.0 and integrated into 0.5.0 by Gunnar Henne.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2011-08-18 09:55:44 +01:00
Rodrigo L. Rosa
d1a16ce9d6 fix return error msj
retval was not correctly propagated
2011-08-09 20:55:26 +02:00
Andreas Bießmann
6e5c37be29 flash/nor/cfi: fix TopBottom for atmel chips
There are some older atmel nor chips which have negated logic for
TopBottom detection. This patch adds a special handling for the old
chips. This is the same mechanism as implemented in linux kernel.

Signed-off-by: Andreas Bießmann <andreas.devel@gmail.com>
2011-08-09 20:19:37 +02:00
Øyvind Harboe
7d2bf8805d Revert "dsp5680xx: disable for now, it generates warnings"
This reverts commit d567df02b9.
2011-08-09 20:15:21 +02:00
Spencer Oliver
852289bc49 flash: add support for deprecated stm32 flash cmds
Issue warning when the old cmd is used and redirect to new supported one.
These deprecated cmds will be removed at some point.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2011-07-28 12:47:49 +01:00
Spencer Oliver
b066a7db24 flash: update stm32 driver names
Use consistent names for the stm32 family flash drivers, eg.
stm32x -> stm32f1x
stm32f2xxx -> stm32f2x

this makes it easier to add support for newer stm32 families.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2011-07-28 11:42:27 +01:00
Ronny Strutz
e872d2880e add Fujitsu FM3 Family flash support
Signed-off-by: Ronny Strutz <ronny@ewoks.de>
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2011-07-26 21:15:34 +01:00