Commit Graph

55 Commits

Author SHA1 Message Date
Spencer Oliver 08d4411b59 update files to correct FSF address
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1426
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2013-06-05 19:52:42 +00:00
Spencer Oliver feddedb6db armv7m: use ARM_MODE_THREAD core mode for algoorithm's
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-02 16:22:25 +00:00
Spencer Oliver fc2abe63fd armv7m: use generic arm::core_mode
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-02-02 16:21:41 +00:00
Spencer Oliver 2bda1ee49d flash: update stellaris flash data to latest dev package 9453
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-12 21:41:39 +00:00
Andreas Fritiofson 8415353f2b flash/nor/stellaris: Remove unnecessary write_algorithm check
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-08 10:25:50 +00:00
Spencer Oliver f9ea791e9b flash: blank check use default_flash_blank_check
Use default_flash_blank_check, this will use the much faster
blank_check_memory handler if supported - 15x quicker on stm32f4.

Otherwise it will fall back to using the slower default_flash_mem_blank_check.

Change-Id: Ia231b3e95468c9e92594dbdbe1fa2d69e1506fc3
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/632
Tested-by: jenkins
2012-05-14 09:38:26 +00:00
Linus Tolke f28a5d9217 topic: Fixed a clang Dead assignment warning.
The value returned from target_write_buffer is still ignored.

Change-Id: Icb49d4d1313a5e4f7df68d3f122a5f81cfa0604a
Signed-off-by: Linus Tolke <linus@tigris.org>
Reviewed-on: http://openocd.zylin.com/596
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-04-24 20:31:19 +00:00
Simon Qian 7743e0fb43 topic: add reset functions for SWD
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-04-10 12:14:00 +00:00
Spencer Oliver 90cee35696 flash: add stellaris async flash loader
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-26 00:46:48 +00:00
Spencer Oliver 9f0cba528a build: cleanup src/flash/nor directory
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-06 10:54:14 +00:00
Spencer Oliver 1340f952a7 flash: fix stellaris class regression
for some reason the following commit was incorrect
769064de4b

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-27 19:24:19 +00:00
Spencer Oliver 769064de4b flash: update stellaris_set_flash_timing for target class
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-23 11:41:49 +00:00
Spencer Oliver 8959fccc19 flash: cleanup stellaris device class detection
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-23 11:41:26 +00:00
Spencer Oliver 23ece85f33 flash: add missing stellaris device classes
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-18 21:46:48 +00:00
Spencer Oliver 2a34cc8eb6 cmd: add missing usage var
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-12 20:45:01 +00:00
Mathias K afe95871c5 optimize: replace while loop by memcpy
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-12 20:41:51 +00:00
Mathias K 16b6b5e7a8 Change return value on error.
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-04 17:56:46 +00:00
Øyvind Harboe 4668bd264c retire ERROR_INVALID_ARGUMENTS and replace with ERROR_COMMAND_SYNTAX_ERROR
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>
2012-01-04 17:13:46 +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
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
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
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
Luca Bruno 898dd3af46 Fix typo in command output
Fix a bunch of minor typo in user facing output.

Signed-off-by: Luca Bruno <lucab@debian.org>
2011-07-10 17:00:57 +02:00
Uwe Hermann 33a17fd359 Fix a bunch of typos.
Fix a bunch of typos.

Most are in code comments, so nothing should break. UNKOWN_COMMAND and
CMD_UNKOWN are not used elsewhere, so correcting the spelling should
also not break anything.
2011-03-17 07:25:25 +01:00
Eric Wetzel a727418184 stellaris: automatically generate and update device IDs
Added a Perl script to contrib that uses the header files in StellarisWare complete Firmware Development Package provided by TI/Luminary to generate a new list of device IDs

Used Perl script and revision 6734 of TI/Luminary StellarisWare to update device IDs
2011-01-19 08:41:03 +01:00
Øyvind Harboe 4f9a9b8eba warnings: use more 'const' for char *
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-12-29 22:07:39 +01:00
Antonio Borneo f1f8d9a6c9 FLASH/NOR: Remove useless file stellaris.h
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-11-17 17:02:33 +01:00
Spencer Oliver 4617cd0f91 src: add loader src description
- add comment where to find the various loaders src files.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-10-28 10:08:16 +01:00
Spencer Oliver 1ca286557a flash: increase stellaris flash loader buffer
This speeds up programming for targets with more working area,

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-08-31 20:09:25 +01:00
David Brownell a84112f471 stellaris flash comment update
This flash driver works on more than just two chips.
(Though it does need work still, e.g. to protect more than 64K.
(On non-'3748-A0 chips where errata allow that.))

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-08-01 02:27:14 -04:00
Spencer Oliver 260eb4548b flash: remove algorithm exit_point address for supported targets
For the above targets the exit_point is
optional when used with run_algorithm, so remove it.

This makes updating the algorithm less error prone.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-07-20 09:02:42 +01:00
Øyvind Harboe e538367186 stellaris: -Wshadow warning fixes
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-15 23:59:21 +02:00
Spencer Oliver 86e851e1e2 nor: fix memory leaks during probe
Fix similar memory leaks as per commit:
ef72484b78

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-05-29 15:43:42 +01:00
Antonio Borneo bc8be110ff NOR: add read() callback to struct flash_driver
Final target is to force bus_width size during CFI flash
read.
In this first step I need to replace default flash read
with flash specific implementation.
This patch introduces:
- flash_driver_read() layer;
- default_flash_read(), backward compatible;
- read() callback in struct flash_driver;
- proper initialization in every flash_driver instance.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-05-16 13:39:47 +02:00
Øyvind Harboe 282e89c878 flash: less bogus errors
Removed bogus errors when trying to allocate a large
a target memory buffer as possible.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-05-04 09:11:21 +02:00
David Brownell 99939c3c75 NOR: stellaris message tweaks
Give a more accurate failure message when trying to unprotect; don't
complain about pages being write protected, just say that unprotect is
not supported by the hardware ... referencing the new "recover" command,
which is the way to achieve that.

Likewise, when trying to protect, talk about "pages" (matching hardware
doc) not "sectors" (an concept that's alien to these chips).

Also make the helptext for the "recover" command mention that it
also erases the device.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-03-03 13:08:16 -08:00
Spencer Oliver c9560ba190 stellaris: recover_command use usleep rather than sleep
windows api does not define a posix sleep, use usleep that
has an openocd wrapper to the win32 native function.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-02-28 22:48:57 +00:00
Spencer Oliver a851ce0d6f ARMv7M: use software breakpoints for algorithms
- armv7m_run_algorithm now requires all algorithms to use
   a software breakpoint at their exit address
 - updated all algorithms to support this

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-02-28 22:26:52 +00:00
David Brownell e70d42a727 new "stellaris recover" command
Stellaris chips have a procedure for restoring the chip to
what's effectively the "as-manufactured" state, with all the
non-volatile memory erased.  That includes all flash memory,
plus things like the flash protection bits and various control
words which can for example disable debugger access.  clearly,
this can be useful during development.

Luminary/TI provides an MS-Windows utility to perform this
procedure along with its Stellaris developer kits.  Now OpenOCD
users will no longer need to use that MS-Windows utility.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-02-27 00:31:35 -08:00
David Brownell 303b493c22 NOR: cleanup driver decls
Fix goofy struct indents.  Function names *are* their addresses.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-29 13:52:08 -08:00
David Brownell b3bf1d12b2 streamline and document helptext mode displays
Most commands are usable only at runtime; so don't bother saying
that, it's noise.  Moreover, tokens like EXEC are cryptic.  Be
more clear: highlight only the commands which may (also) be used
during the config stage, thus matching the docs more closely.
There are

 - Configuration commands (per documentation)
 - And also some commands that valid at *any* time.

Update the docs to note that "help" now shows this mode info.

This also highlighted a few mistakes in command configuration,
mostly commands listed as "valid at any time" which shouldn't
have been.  This just fixes ones I noted when sanity testing.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-02 15:52:35 -08:00
David Brownell 7641934197 stellaris: fix min buffer length checks
Word count == size/4; cope.  And increase buf_min so it's large
enough to cover the overhead in my tests.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-18 09:59:40 -08:00
David Brownell e40f638063 stellaris: update bulk flash writes
Try to right-size the SRAM buffers, by not:
 - using them for very small writes
 - giving up when a large buffer isn't available
 - allocating buffers much larger than their data

Also don't:
 - bother loading the code unless we allocate the writebuffer too
 - be so verbose with messaging:
    * be more concise
    * reduce importance (e.g. DEBUG not WARNING)
    * remove duplication

The minimum buffer size is something of a guess.  It's eight
times smaller than before, almost the same size as the code
being downloaded.  It probably deserves some tuning.

Also, note an erratum affecting flash protection on some chips;
and narrow many over-wide lines affected by the above changes.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-18 01:33:19 -08:00
David Brownell d265c219b9 stellaris: comments
Someday revisit various issues:  Tempest parts support writing
more than one word at a time; for some target firmware it might
be necessary to save and restore flash IRQ configuration.  (The
safest policy is likely to always reset after flash updates.)

Plus swap some undesirable TAB characters with SPACE.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-16 14:17:31 -08:00
David Brownell 1cd7b3b49b stellaris: probe() cleanups
Fix potential memory leak:  make sure the per-bank data
structures are only allocated in probe(), and that calling
probe() multiple times is a NOP.  Use it for auto_probe().

Require probe() to have done its thing:  don't make access
routines cope with it not having been called.  Shrink a
bunch of failure paths; and in some cases, correct them.

Don't needlessly insist on a halted target for probe().

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-16 14:17:31 -08:00
David Brownell 6f2b9ea9e1 stellaris: remove needless code
No point in reading and discarding a status value when fetching
part description data.  Or having that needless "#if 0" code.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-16 14:17:31 -08:00
David Brownell f85dc92d2a stellaris: avoid chip writes
Previously "reading" clock info (and part info) also, as a side
effect, wrote the flash timing register.  Instead, be more safe:
"reading" should only read.  Write paths still refresh timing,
coping with changes the application code may have made.

Also rename the routine which sets flash timing, indicating what
it's really doing; it's got nothing to do with a "mode".

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-16 14:17:31 -08:00
Eric Wetzel 36dec1b319 stellaris: device IDs
I added the remaining devices and device IDs to stellaris.c, and
removed several devices that don't exist on the Stellaris web page.

Additionally, I found a few devices with duplicate IDs ... the DID1
Version Number for LM3Sxxx parts have DID1 Version = 0x0, and for
LM3Sxxxx have DID1 Version = 0x1. So I extended the comparison to
use the VER and FAM fields from DID1 also.

ID=0x33: LM3S812 (DID1v0) and LM3S2616 (DID1v1)
ID=0x39: LM3S808 (DID1v0) and LM3S2276 (DID1v1)

These are the parts I removed from the file for lack of documentation
(no data sheet to confirm part ID):

  LM3S318,
  LM3S1101, LM3S1108,
  LM3S1615, LM3S1616,
  LM3S2016,
  LM3S2101, LM3S2108,
  LM3S3759, LM3S3768,
  LM3S5757, LM3S5767, LM3S5768, LM3S5769,
  LM3S6815, LM3S6816,
  LM3S6915, LM3S6916,
  LM3S6111, LM3S6118.

Also, sort devices according to part number.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-14 15:59:01 -08:00
David Brownell a34345451d anotyer cygwin compile fix
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-10 17:42:20 -08:00
David Brownell 3d9cb516c2 stellaris: flash protection updates, minor fixes
Bugfix the read side of flash protection:
 - read the right register(s)!
 - handle more than 64K
 - record the results in the right places
 - don't display garbage.

Partially bugfix the write side:
 - use 2KB lock regions instead of 1KB pages (!)
 - validate input range
 - don't try to _remove_ protection (it's write-once)
 - #define values we'll need to commit writes.
 - ... still doesn't handle pages over 64KB mark, or commit writes

And minor cleanup and fixes:
 - get rid of some forward decls
 - properly locate a doxygen comment
 - fix some bad indentation
 - remove superfluous #include
 - add a new part ID (many are still missing)
 - make the downloaded algorithm code be read-only

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-09 21:16:09 -08:00