aboutsummaryrefslogtreecommitdiff
path: root/src/flash/flash.h
AgeCommit message (Collapse)AuthorFilesLines
2009-12-04remove flash.h from treeZachary T Welch1-33/+0
Remove the now vestigial <flash/flash.h> header from the tree, replacing a few references with <flash/nor/core.h>
2009-12-04split flash.h into into flash/nor/*.hZachary T Welch1-320/+2
Move the bulk of the flash.h file into flash/nor/core.h, leaving an empty husk that will be removed in the next patch. The NOR driver structure is an implementation detail, so move it into its own private header file <flash/nor/driver.h> along with helper declaration for finding them by name.
2009-12-04remove target.h from flash.hZachary T Welch1-1/+0
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-04split NOR and NAND flash headersZachary T Welch1-10/+1
Moves common flash errors to <flash/common.h> to decouple these two mostly unrelated trees of code.
2009-12-03change #include "target.h" to <target/target.h>Zachary T Welch1-1/+1
Changes from the flat namespace to heirarchical one. Instead of writing: #include "target.h" the following form should be used. #include <target/target.h> The exception is from .c files in the same directory.
2009-12-03change #include "log.h" to <helper/log.h>Zachary T Welch1-1/+1
Changes from the flat namespace to heirarchical one. Instead of writing: #include "log.h" the following form should be used. #include <helper/log.h> The exception is from .c files in the same directory.
2009-11-24remove flash_driver->register_callbacksZachary T Welch1-5/+3
Replace flash_driver callback with pointer to command_registration. Eliminates all related routines and allows drivers to omit commands.
2009-11-19add support for naming flash banksZachary T Welch1-0/+2
Requires users to name their flash banks, allowing them to be used instead of bank numbers in script commands.
2009-11-19rename flash and nand command helpersZachary T Welch1-1/+1
After adding support for referencing banks by name, renames the COMMAND_HELPERs appropriately: flash_command_get_bank_by_num -> flash_command_get_bank nand_command_get_device_by_num -> flash_command_get_device
2009-11-19allow flash/nand banks commands to accept namesZachary T Welch1-1/+11
Add get_flash_bank_by_name (and get_nand_device_by_name) helpers to retrieves struct flash_bank * (struct nand_device *) given a driver name and an (optional) driver-specific bank index. These are used to extend flash_command_get_bank_by_num (and nand_command_get_device_by_num) to allow all flash (nand) commands to reference defined banks by name, not just by number. To avoid some code duplication, add the flash/common.[ch] files to hold functionality common to both types driver. The first two methods are helpers for the above routines to find a bank specified by a "name" or "name.index" string. get_flash_name_index() finds the '.index' portion, while flash_driver_name_matches() performs the string portion matching.
2009-11-17command_handler: change 'args' to CMD_ARGVZachary T Welch1-10/+10
This patch converts all instances of 'args' in COMMAND_HANDLER routines to use CMD_ARGV macro.
2009-11-17command_handler: change to 'argc' to CMD_ARGCZachary T Welch1-1/+1
This patch converts all instances of 'argc' in COMMAND_HANDLER routines to use CMD_ARGC.
2009-11-16flash_command_get_bank_by_num: make COMMAND_HELPERZachary T Welch1-4/+4
Use COMMAND_HELPER macro to declare flash_command_get_bank_by_num. This is required for COMMAND_PARSE_NUMBER macro.
2009-11-13command_context_t -> struct command_contextZachary T Welch1-4/+4
Remove misleading typedef and redundant suffix from struct command_context.
2009-11-13flash_bank_t -> struct flash_bankZachary T Welch1-23/+23
Remove misleading typedef and redundant suffix from struct flash_bank.
2009-11-13target_t -> struct targetZachary T Welch1-4/+4
Remove misleading typedef and redundant suffix from struct target.
2009-11-13image_t -> struct imageZachary T Welch1-2/+2
Remove misleading typedef and redundant suffix from struct image. Also removes the typedef from enum image_type, as it is used in image.h only.
2009-11-13flash_driver_t -> struct flash_driverZachary T Welch1-3/+3
Remove misleading typedef and redundant suffix from struct flash_driver.
2009-11-13flash_sector_t -> struct flash_sectorZachary T Welch1-3/+3
Remove misleading typedef and redundant suffix from struct flash_sector.
2009-11-13add FLASH_BANK_COMMAND_HANDLER macroZachary T Welch1-2/+6
The FLASH_BANK_COMMAND_HANDLER provides an extended command handler using the __COMMAND_HANDLER macro, whereby changing that macro is sufficient to update flash handlers with the new signature. It also enforces uniform style and scope when implementing this handler.
2009-11-11remove obsolete doxygen commentsZachary T Welch1-6/+0
Documenting command handler parameters is redundant and pointless.
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-09src/flash: remove 'extern' and wrap headersZachary T Welch1-15/+19
Removes 'extern' keywords from function prototypes in the flash headers. Wraps long lines to fit into 80 columns. Adds multiple inclusion protection for s3c2xx_nand.h.
2009-11-05Add Flash/NAND bank command argument helpers.Zachary T Welch1-0/+10
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-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-30Fix search and replace casualty in flash.h doxygen block.zwelch1-1/+1
git-svn-id: svn://svn.berlios.de/openocd/trunk@2425 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23Remove whitespace at end of lines, step 1.zwelch1-14/+14
- Replace '\s*$' with ''. git-svn-id: svn://svn.berlios.de/openocd/trunk@2379 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@2375 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Fixes '=' whitespacezwelch1-4/+4
- 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-18Transform 'u32' to 'uint32_t' in src/flash.zwelch1-8/+8
- 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-1/+1
- 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-05-29Add documentation to flash.h:zwelch1-12/+245
- provides low-level information about each flash API interface, - gives driver authors some documentation about the driver interface, - updated extensively from the original patch provided by Duane Ellis. git-svn-id: svn://svn.berlios.de/openocd/trunk@1942 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11Audit and eliminate redundant #include directives in src/flash headers.zwelch1-5/+7
git-svn-id: svn://svn.berlios.de/openocd/trunk@1711 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-27- convert spaces to tabs in at91sam7.[ch]ntfreak1-8/+8
- add missing svn props git-svn-id: svn://svn.berlios.de/openocd/trunk@1009 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-26Gheorghe Guran <roatlasro@yahoo.com> redone at91sam7 driver. Old driver ↵oharboe1-8/+9
source file renamed. The old driver is still invoked by default and the new driver is invoked by using at91sam7_new git-svn-id: svn://svn.berlios.de/openocd/trunk@1007 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-20- added myself to copyright on files i remember adding large contributions ↵ntfreak1-1/+4
for over the years - cleaned up headers to match rest of code - added missing svn props for previously added files git-svn-id: svn://svn.berlios.de/openocd/trunk@987 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-05Duane Ellis: fix warningsoharboe1-1/+1
git-svn-id: svn://svn.berlios.de/openocd/trunk@890 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-25added yours sincerely for files where I feel that I've made non-trivial ↵oharboe1-0/+3
contributions. git-svn-id: svn://svn.berlios.de/openocd/trunk@872 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-27- moved flash erase_check target code to target.cntfreak1-1/+2
git-svn-id: svn://svn.berlios.de/openocd/trunk@694 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-02fix flash info - now reports erased state properlyoharboe1-0/+1
git-svn-id: svn://svn.berlios.de/openocd/trunk@534 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-05Pavel Chromy: memory leak in at91sam7 flash driver, possible incorrect ↵oharboe1-0/+1
pointer conversion in gpnvm command handling, uninitialized buffer issue in handle_flash_info_command in flash.c, some formatting. git-svn-id: svn://svn.berlios.de/openocd/trunk@446 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-04Bogus error message in GDB removedoharboe1-0/+1
git-svn-id: svn://svn.berlios.de/openocd/trunk@443 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-28Pavel Chromy cleaned up checks for halted, error messages, etc.oharboe1-11/+7
git-svn-id: svn://svn.berlios.de/openocd/trunk@374 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-25dos2unix fix.oharboe1-97/+97
git-svn-id: svn://svn.berlios.de/openocd/trunk@339 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-25- "flash write_binary" is now "flash write_bank" to clarify the focus of theoharboe1-86/+97
command and reduce confusion with "flash write_image". - retired deprecated "flash erase" & "flash write". - added flash_driver_protect/write/erase() that are wafer thin frontend functions to low level driver functions. They implement checks that were inconsistently handled by the drivers, e.g. check for target halted was done in a spotty fashion. - use return ERROR_COMMAND_SYNTAX_ERROR to print out syntax of command instead of having lots of inlined replicas of the command line syntax(some of which were wrong). - use logging instead of dubious translation of error values to human understandable explanations of why things failed. The lower levels log the precise reason and the higher levels can ammend context as the error propagates up the call stack. - simplified flash API slightly with logging instead of allocating and returning information that the caller then has to translate into print statements. git-svn-id: svn://svn.berlios.de/openocd/trunk@337 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-01-27- added autoprobe functionalitymifi1-0/+1
- corrected blocksize handling from GDB "info mem" command (thanks to Øyvind and Spen for these patches) git-svn-id: svn://svn.berlios.de/openocd/trunk@278 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-01-09- rename flash_init and flash_erase to flash_init_drivers and ↵ntfreak1-2/+2
flash_erase_address_range - stops conflicts with redboot. Thanks Øyvind Harboe - gdb connection not dropped if we fail to allocate memory in query packets git-svn-id: svn://svn.berlios.de/openocd/trunk@249 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-12-29- minimum autoconf 2.59 is now required and verified - due to issues with ↵ntfreak1-0/+1
AS_HELP_STRING - native win32 now handles WSAECONNRESET - no longer exits openocd - qCRC packet now works correctly under cygwin (gdb compare-sections command) - removed __USE_GNU define from gdbserver.c - gdb qSupported packet is now handled, with this we are able to tell gdb packet size, memory map of target - added new target script gdb_program_config - called before gdb flash programming - new gdb server command gdb_memory_map (enable|disable> - default is disable - new gdb server command gdb_flash_program (enable|disable> - default is disable - gdb flash programming supported - vFlash packets - image_elf_read_section now does not clear any remaining data, this was causing the gdb checksum to fail with certain files - reformat of usbprog.c - memory leak in command_print fixed - updated texi doc to include new commands - added gdb programming section to docs git-svn-id: svn://svn.berlios.de/openocd/trunk@246 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-12-20- removed flash write_image - binary compare function has been moved to ↵ntfreak1-8/+1
verify_image command - minor code reformat and cleanup - updated docs to include new commands git-svn-id: svn://svn.berlios.de/openocd/trunk@243 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-12-18- added patch for new flash functionality like:mifi1-1/+8
flash verify_image and flash erase_address. - added patch for new parport_write_on_exit command. Even this patch will fix some memory leaks. (thanks too oyvind and Spen for these patches) git-svn-id: svn://svn.berlios.de/openocd/trunk@240 b42882b7-edfa-0310-969c-e2dbd0fdcd60