aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/stellaris.c
AgeCommit message (Collapse)Author
2010-05-16NOR: add read() callback to struct flash_driverAntonio Borneo
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-04flash: less bogus errorsØyvind Harboe
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-03-03NOR: stellaris message tweaksDavid Brownell
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-02-28stellaris: recover_command use usleep rather than sleepSpencer Oliver
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-28ARMv7M: use software breakpoints for algorithmsSpencer Oliver
- 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-27new "stellaris recover" commandDavid Brownell
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-01-29NOR: cleanup driver declsDavid Brownell
Fix goofy struct indents. Function names *are* their addresses. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-02streamline and document helptext mode displaysDavid Brownell
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>
2009-12-18stellaris: fix min buffer length checksDavid Brownell
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-18stellaris: update bulk flash writesDavid Brownell
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-16stellaris: commentsDavid Brownell
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-16stellaris: probe() cleanupsDavid Brownell
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-16stellaris: remove needless codeDavid Brownell
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-16stellaris: avoid chip writesDavid Brownell
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-14stellaris: device IDsEric Wetzel
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-10anotyer cygwin compile fixDavid Brownell
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-09stellaris: flash protection updates, minor fixesDavid Brownell
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-04remove target.h from flash.hZachary T Welch
The flash.h header does not require the target.h header file, but its implementation source files do. Move it to flash/nor/imp.h.
2009-12-03change #include "armv7m.h" to <target/armv7m.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "armv7m.h" the following form should be used. #include <target/armv7m.h> The exception is from .c files in the same directory.
2009-12-03change #include "algorithm.h" to <target/algorithm.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "algorithm.h" the following form should be used. #include <target/algorithm.h> The exception is from .c files in the same directory.
2009-12-03change #include "binarybuffer.h" to <helper/binarybuffer.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "binarybuffer.h" the following form should be used. #include <helper/binarybuffer.h> The exception is from .c files in the same directory.
2009-12-02move nor drivers to src/flash/norZachary T Welch
Moves NOR flash drivers to 'src/flash/nor/'. Adds 'src/flash/nor/Makefile.am'. Builds 'libocdflashnor.la'.