aboutsummaryrefslogtreecommitdiff
path: root/src/flash/flash.c
AgeCommit message (Collapse)AuthorFilesLines
2009-11-13flash_driver_t -> struct flash_driverZachary T Welch1-20/+20
Remove misleading typedef and redundant suffix from struct flash_driver.
2009-11-13fileio_t -> struct fileioZachary T Welch1-1/+1
Remove useless structure typedef.
2009-11-13add CMD_NAME macro for command handlersZachary T Welch1-1/+1
By introducing the CMD_NAME macro, this parameter may be integrated as args[-1] in command.[ch], without touching any other call sites.
2009-11-13use CALL_COMMAND_HANDLER instead of direct callsZachary T Welch1-1/+2
By using CALL_COMMAND_HANDLER, parameters can be reordered, added, or even removed in inherited signatures, without requiring revisiting all of the various call sites.
2009-11-13use COMMAND_HANDLER macro to define all commandsZachary T Welch1-13/+11
2009-11-11add const keyword to some APIsZachary T Welch1-1/+1
Add 'const' keyword to 'char *' parameters to allow command handlers to pass constant string arguments. These changes allow the 'args' command handler to be changed to 'const' in a subsequent patch.
2009-11-09flash/flash.c: remove forward declarationsZachary T Welch1-57/+62
Remove useless forward declarations. Moves command registration to end of file. Moves flash structure definition to end of file. Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09Overhaul time support APIZachary T Welch1-80/+37
This patch changes the duration_* API in several ways. First, it updates the API to use better names. Second, string formatting has been removed from the API (with its associated malloc). Finally, a new function added to convert the time into seconds, which can be used (or formatted) by the caller. This eliminates hidden calls to malloc that require associated calls to free(). This patch also removes the useless extern keyword from prototypes, and it eliminates the duration_t typedef (use 'struct duration'). These API also allows proper error checking, as it is possible for gettimeofday to fail in certain circumstances. The consumers have all been chased to use this new API as well, as there were relatively few cases doing this type of measurement. In most cases, the code performs additional checks for errors, but the calling code looks much cleaner in every case.
2009-11-06Improve flash indentation.Zachary T Welch1-221/+210
Removes redundant tests and reverses backwards logic to reduce the indentation level in flash.c.
2009-11-05Improve flash.c command argument parsing.Zachary T Welch1-68/+51
2009-11-05Add Flash/NAND bank command argument helpers.Zachary T Welch1-0/+17
This eliminates redundant code for parsing and retreiving the bank specified from a script command argument. This patch was written to replace existing functionality; however, the parsing logic can be updated later to allow flash commands to accept bank names as well as their numbers.
2009-10-20Added the faux flash driver and target. Used for testing.Øyvind Harboe1-0/+2
2009-10-20Added 'unlock' option to flash write_imageØyvind Harboe1-14/+59
2009-10-10printf format warning fixesDavid Brownell1-5/+6
Observed on a Cygwin build. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-09-22- fix build issue under win32 (cygwin/msys) from svn r2746ntfreak1-1/+1
git-svn-id: svn://svn.berlios.de/openocd/trunk@2748 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-22Make it easier to erase or protect through to the enddbrownell1-36/+75
of a (NOR) flash chip: allow passing "last" as an alias for the number of the last sector. Improve several aspects of error checking while we're at it. From: Johnny Halfmoon <jhalfmoon@milksnot.com> git-svn-id: svn://svn.berlios.de/openocd/trunk@2746 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-16Rolf Meeser <rolfm_9dq@yahoo.de> adds flash support for NXP's LPC2900 family ↵oharboe1-2/+4
(ARM968E). git-svn-id: svn://svn.berlios.de/openocd/trunk@2715 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-30David Brownell <david-b@pacbell.net> Remove duplicate check for flash write ↵oharboe1-21/+19
status. Via code review by Steve Grubb <sgrubb@redhat.com>  Also minor fixes for the message from "fill": the byte count is unsigned, not signed; and more importantly, print the real number of bytes written git-svn-id: svn://svn.berlios.de/openocd/trunk@2652 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-17Andreas Fritiofson <andreas.fritiofson@gmail.com> UTF8 fixesoharboe1-1/+1
git-svn-id: svn://svn.berlios.de/openocd/trunk@2549 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-30Remove at91sam3.h from flash.c; use extern like other drivers.zwelch1-1/+1
git-svn-id: svn://svn.berlios.de/openocd/trunk@2438 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24Add support for ATMEL AT91SAM3U - CortexM3 Familyduane1-0/+2
git-svn-id: svn://svn.berlios.de/openocd/trunk@2383 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23Remove whitespace at end of lines, step 1.zwelch1-23/+23
- Replace '\s*$' with ''. git-svn-id: svn://svn.berlios.de/openocd/trunk@2379 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23Remove whitespace that occurs before ')'.zwelch1-4/+4
- Replace '[ \t]*[)]' with ')'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2377 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23Remove whitespace that occurs after '('.zwelch1-3/+3
- Replace '([ \t]*' with '('. git-svn-id: svn://svn.berlios.de/openocd/trunk@2376 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Fixes '[<>]' whitespacezwelch1-2/+2
- Replace ')\([<>]\)(' with ') \1 ('. - Replace ')\([<>]\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\([<>]\)(' with '\1 \2 ('. - Replace '\(\w\)\([<>]\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2375 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Fixes '[|]' whitespacezwelch1-1/+1
- Replace ')\([|]\)(' with ') \1 ('. - Replace ')\([|]\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\([|]\)(' with '\1 \2 ('. - Replace '\(\w\)\([|]\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2374 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Fixes '+' whitespacezwelch1-1/+1
- Replace ')\(+\)(' with ') \1 ('. - Replace ')\(+\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(+\)(' with '\1 \2 ('. - Replace '\(\w\)\(+\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2373 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Fixes '=' whitespacezwelch1-13/+13
- Replace ')\(=\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(=\)(' with '\1 \2 ('. - Replace '\(\w\)\(=\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2372 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Fixes '==' whitespacezwelch1-2/+2
- Replace ')\(==\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(==\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2371 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Fixes '>>' whitespacezwelch1-2/+2
- Replace ')\(>>\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(>>\)(' with '\1 \2 ('. - Replace '\(\w\)\(>>\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2369 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Fixes '!=' whitespacezwelch1-5/+5
- Replace ')\(!=\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(!=\)(' with '\1 \2 ('. - Replace '\(\w\)\(!=\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2363 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Replace 'for(' with 'for ('.zwelch1-2/+2
git-svn-id: svn://svn.berlios.de/openocd/trunk@2360 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Replace 'switch(' with 'switch ('.zwelch1-2/+2
git-svn-id: svn://svn.berlios.de/openocd/trunk@2359 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Replace 'if(' with 'if ('.zwelch1-4/+4
git-svn-id: svn://svn.berlios.de/openocd/trunk@2357 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-21C99 printf() -Werror fixesduane1-28/+55
git-svn-id: svn://svn.berlios.de/openocd/trunk@2345 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18Transform 'u32' to 'uint32_t' in src/flash.zwelch1-27/+27
- Replace '\([^_]\)u32' with '\1uint32_t'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2280 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18Transform 'u8' to 'uint8_t' in src/flashzwelch1-6/+6
- Replace '\([^_]\)u8' with '\1uint8_t'. - Replace '^u8' with 'uint8_t'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2275 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05remove unused include file: inttypes.hoharboe1-2/+0
git-svn-id: svn://svn.berlios.de/openocd/trunk@2072 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31Add target_read_memory wrapper:zwelch1-1/+1
- replaces all calls to target->type->read_memory. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1959 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-21David Brownell <david-b@pacbell.net>: This patch adds annotations tozwelch1-4/+7
the key command_*() helper functions, fixng the bugs that turned up. Several of these bugs were from misuse of PRIi64; that's for 64-bit integers, NOT for "long long" or "u64" (which work best with %lld). git-svn-id: svn://svn.berlios.de/openocd/trunk@1873 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-18Consolidate target selection code into single get_target() that handles both ↵kc8apf1-2/+2
names and numbers. Provided by David Brownell <david-b@pacbell.net> git-svn-id: svn://svn.berlios.de/openocd/trunk@1804 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11Audit and eliminate redundant #include directives in src/flash sources.zwelch1-15/+2
git-svn-id: svn://svn.berlios.de/openocd/trunk@1712 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11Remove redundant sys/types.h #include directives (now in types.h).zwelch1-1/+0
git-svn-id: svn://svn.berlios.de/openocd/trunk@1700 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-07Deleted at9sam7_old driver. Nobody has complained about the new one yet.oharboe1-2/+0
git-svn-id: svn://svn.berlios.de/openocd/trunk@1632 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-30Fix signed/unsigned comparison.zwelch1-1/+1
git-svn-id: svn://svn.berlios.de/openocd/trunk@1577 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-30flash fillX now has a verify stageoharboe1-0/+16
git-svn-id: svn://svn.berlios.de/openocd/trunk@1575 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-27SimonQian <simonqian@simonqian.com> AVR wipoharboe1-0/+2
git-svn-id: svn://svn.berlios.de/openocd/trunk@1540 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-19Zach Welch <zw@superlucidity.net> fix signed/unsigned comparisonsoharboe1-6/+6
git-svn-id: svn://svn.berlios.de/openocd/trunk@1466 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-18The following patches was applied:mifi1-24/+22
- openocd-flash-static-keyword-v3.patch - openocd-lpc2000-fix-erase-obo.patch - openocd-jlink-fix-sign-ptr-warn.patch - openocd-wextra-etm.patch - openocd-wextra-jtag.patch - openocd-add-new-tap-symbols-v6.patch Many thanks to Zach Welch <zw(at)superlucidity.net> git-svn-id: svn://svn.berlios.de/openocd/trunk@1462 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-03-05Audrius Urmanavičius <didele.deze@gmail.com> cleanup flash filloharboe1-3/+3
git-svn-id: svn://svn.berlios.de/openocd/trunk@1399 b42882b7-edfa-0310-969c-e2dbd0fdcd60