aboutsummaryrefslogtreecommitdiff
path: root/src/flash
AgeCommit message (Collapse)Author
2009-11-13command_handler_t: make argc unsignedZachary T Welch
The number of command arguments will always be 0 or more, so use the right type in handlers. This has a cascading effect up through the layers, but the new COMMAND_HANDLER macros prevented total chaos.
2009-11-13add CMD_NAME macro for command handlersZachary T Welch
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 Welch
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-13nand: add NAND_DEVICE_COMMAND_HANDLER macroZachary T Welch
Abstracts the extended NAND command handling to allow the function signature to be controlled by __COMMAND_HANDLER.
2009-11-13use FLASH_BANK_COMMAND_HANDLER macroZachary T Welch
Defines all flash_bank_command handlers using the new macro.
2009-11-13add FLASH_BANK_COMMAND_HANDLER macroZachary T Welch
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-13s3c24xx: use COMMAND_HANDLER with command helperZachary T Welch
Add S3C24XX_DEVICE_COMMAND macros to abstract common command handler conventions.
2009-11-13use COMMAND_HANDLER macro to define all commandsZachary T Welch
2009-11-12nand: rename device to nandZachary T Welch
To be more informative (and consistent with flash and pld trees), change 'device' parameter name to 'nand' in NAND source files. This change eliminates confusing 'device->device->' instance from the code, and it simplifies the forthcoming command handler patches.
2009-11-11remove obsolete doxygen commentsZachary T Welch
Documenting command handler parameters is redundant and pointless.
2009-11-11remove more useless declarationsZachary T Welch
Removes forward declarations by moving command registration after defintion of the command handlers.
2009-11-11add const keyword to some APIsZachary T Welch
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-11change argv to args in command handlersZachary T Welch
Subsequent patches expect all command handlers to use a uniform parameter naming scheme. In the entire tree, these two files used standard 'argv' instead of our non-standard 'args'. This patch opts to reduces the noise required to unify the command handlers, using dominant 'args' form. A future patch may be used to convert us back to the standard argv, but that requires coordination with all developers to minimize disruptions.
2009-11-11makefiles: improve build orderZachary T Welch
Separates various groups of files to be built in logical succession. In each layer, the core module (target.c, nand.c, etc.) is built _after_ their helper modules (e.g. image.c, nand_ecc.c) but _before_ any of their drivers (e.g. arm966e.c, mx3_nand.c). This allows problems introduced at the bottom of the stack to result in build failures as soon as possible, as the helpers and core should wrap portions of them.
2009-11-09{pic32m,stm32}x.c: remove useless declarationsZachary T Welch
Remove useless forward declarations. Moves command registrations to end of files. Moves flash structure definitions to end of files. Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09str{7,9}x*.c: remove useless forward declarationsZachary T Welch
Remove useless forward declarations. Moves command registrations to end of files. Moves flash structure definitions to end of files. Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09flash/<various>.c: remove useless declarationsZachary T Welch
Remove useless forward declarations. Moves flash structure definitions to end of files. Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09flash/<assorted>.c: remove useless declarationsZachary T Welch
Remove useless forward declarations. Moves command registrations to end of files. Moves flash structure definitions to end of files. Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09flash/at91sam[37].c: remove useless declarationsZachary T Welch
Remove useless forward declarations. Moves command registration to end of file. Moves flash structure definitions to end of files. Changes a few references to global flash structure to local refs. Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09flash/lpc2???.c: remove useless declarationsZachary T Welch
Remove useless forward declarations. Moves command registrations to end of files. Moves flash structure definitions to end of files. Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09flash/*nand*.c: remove useless declarationsZachary T Welch
Remove useless forward declarations. Moves command registration to end of files. Moves flash structure definition to end of files. Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09flash/flash.c: remove forward declarationsZachary T Welch
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-09src/flash: remove 'extern' and wrap headersZachary T Welch
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-09Overhaul time support APIZachary T Welch
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-06Simplify nand indentation.Zachary T Welch
Removes check covered by new nand_command_get_device_by_num helper. Reverses logic of probe check to further reduce indentation.
2009-11-06Improve flash indentation.Zachary T Welch
Removes redundant tests and reverses backwards logic to reduce the indentation level in flash.c.
2009-11-05Improve str9xpec command argument parsing.Zachary T Welch
2009-11-05Improve str9x config command argument parsing.Zachary T Welch
2009-11-05Improve str7x config command argument parsing.Zachary T Welch
2009-11-05Improve stm32x.c command argument parsing.Zachary T Welch
2009-11-05Improve stellaris.c erase argument parsing.Zachary T Welch
2009-11-05Improve pic32mx.c command argument parsing.Zachary T Welch
2009-11-05Improve mflash.c command argument parsing.Zachary T Welch
2009-11-05Improve lpc3180_nand_controller.c parsing.Zachary T Welch
This fixes a memory leak in lpc3180_nand_device_command by reordering the malloc to occur after all parsing has completed.
2009-11-05Improve lpc2900.c command argument parsing.Zachary T Welch
2009-11-05Improve lpc288x.c command argument parsing.Zachary T Welch
2009-11-05Improve lpc2000.c command argument parsing.Zachary T Welch
2009-11-05Improve cfi.c command argument parsing.Zachary T Welch
2009-11-05Improve avrf.c command argument parsing.Zachary T Welch
2009-11-05Improve orion_nand.c command argument parsing.Zachary T Welch
2009-11-05Improve davinci_nand.c command argument parsing.Zachary T Welch
2009-11-05Improve at91sam7.c command argument parsing.Zachary T Welch
2009-11-05Improve at91sam3.c command argument parsing.Zachary T Welch
2009-11-05Improve nand.c command argument parsing.Zachary T Welch
2009-11-05Improve flash.c command argument parsing.Zachary T Welch
2009-11-05Add Flash/NAND bank command argument helpers.Zachary T Welch
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 Harboe
2009-10-20Added 'unlock' option to flash write_imageØyvind Harboe
2009-10-14another portability updateDavid Brownell
Just use "%p" instead of consing up some integral type for pointer printf. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-14S29WS-N CFI query fix is to try 0x555 if 0x55 fails.Øyvind Harboe