aboutsummaryrefslogtreecommitdiff
path: root/src/flash
AgeCommit message (Collapse)Author
2009-11-24mflash: use register_commands()Zachary T Welch
2009-11-24lpc3180_nand_controller: use register_commands()Zachary T Welch
2009-11-24lpc2900: use register_commands()Zachary T Welch
2009-11-24lpc2000: use register_commands()Zachary T Welch
2009-11-24flash: use register_commands()Zachary T Welch
Eliminates 'flash_cmd' global variable.
2009-11-24ecos: use register_commands()Zachary T Welch
2009-11-24cfi: use register_commands()Zachary T Welch
2009-11-24avrf: use register_commands()Zachary T Welch
2009-11-24at91sam7: use register_commands()Zachary T Welch
2009-11-24at91sam3: use register_commands()Zachary T Welch
2009-11-24use COMMAND_REGISTER macroZachary T Welch
Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
2009-11-22flash: dynamically allocate working storageØyvind Harboe
Allocate working memory rather than using stack. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-20fix flash/nand name parsingZachary T Welch
Start driver.num check from end, and make sure the numeric part is actually a number. Fix problems trying to parse bank names.
2009-11-19NAND verify doesn't advance.Dean Glazeski
Fix to move the device address up as the contents are verified. Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-19add support for naming NAND banksZachary T Welch
Requires users to name their nand banks, allowing them to be used instead of bank numbers in script commands.
2009-11-19refactor handle_nand_device_commandZachary T Welch
Move bulk of for-loop to a new static command helper function. Adds handle_nand_list_drivers command handler, registered as 'nand drivers'. Improves command help text and error reporting.
2009-11-19add support for naming flash banksZachary T Welch
Requires users to name their flash banks, allowing them to be used instead of bank numbers in script commands.
2009-11-19refactor handle_flash_bank_commandZachary T Welch
Move variables to point of first use, reducing their scope. Add driver_name temporary to help arguments be changed later. Eliminates the useless 'found' variable, changing the code to terminate the loop immediate and return its success.
2009-11-19rename flash and nand command helpersZachary T Welch
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 Welch
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-19nand_fileio_parse_args parses wrong param for sizeDean Glazeski
This changes the size parameter from argv[2] to argv[3], which is what it's supposed to be. Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-18use COMMAND_PARSE_ENABLE macro where appropriateZachary T Welch
Updates all command parsing of simple "enable" and "disable" arguments. A few case in the tree use a tri-state or extended arguments, which cannot use this simple macro. Simlifies the xscale icache/dcache command handler logic.
2009-11-18use COMMAND_PARSE_ON_OFF where appropriateZachary T Welch
Updates all command parsing of "on" and "off" arguments.
2009-11-18split startup.tcl file across modulesZachary T Welch
Moves definitions for each layer into their own file, eliminating layering violations in the built-in TCL code. Updates src/Makefile.am rules to include all files in the final startup.tcl input file, and others Makefile.am rules to distribute the new files in our packages.
2009-11-17ARM: only use one set of dummy FPA registersDavid Brownell
All ARM cores need to provide obsolete FPA registers in their GDB register dumps. (Even though cores with floating point support now generally use some version of VFP...) Clean up that support a bit by sharing the same dummy registers, and removing the duplicate copies. Eventually we shouldn't need to export those dummies. (This makes the ARMv7-M support include the armv4_5 header, and cleans up related #includes, but doesn't yet use anything from there except those dummies.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-17command_handler: change 'cmd_ctx' to CMD_CTXZachary T Welch
Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
2009-11-17command_handler: change 'args' to CMD_ARGVZachary T Welch
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 Welch
This patch converts all instances of 'argc' in COMMAND_HANDLER routines to use CMD_ARGC.
2009-11-16fileio: improve API typesZachary T Welch
Use size_t instead of uint32_t when specifying file sizes. Update all consumers up through the layers to use size_t when required. These changes should be safe, but the higher-levels will need to be updated further to receive the intended benefits (i.e. large file support). Add error checking for fileio_read and file_write. Previously, all errors were being silently ignored, so this change might cause some problems for some people in some cases. However, it gives us the chance to handle any errors that do occur at higher-levels, rather than burying our heads in the sand.
2009-11-16struct fileio: improve member typesZachary T Welch
Add const keyword to file url and cast to free(). Make size an ssize_t and chase all format strings that use it.
2009-11-16rename CEIL as DIV_ROUND_UPZachary T Welch
Improves the name of this macro, moves it to types.h, and adds a block of Doxygen comments to describe what it does.
2009-11-16nand_command_get_device_by_num: make COMMAND_HELPERZachary T Welch
Use COMMAND_HELPER macro to define nand_command_get_device_by_num. Use CALL_COMMAND_HANDLER to invoke it.
2009-11-16flash_command_get_bank_by_num: make COMMAND_HELPERZachary T Welch
Use COMMAND_HELPER macro to declare flash_command_get_bank_by_num. This is required for COMMAND_PARSE_NUMBER macro.
2009-11-16Add 'nand verify' commandZachary T Welch
Add the 'nand verify' command to perform a dump and fake-write simultaneously, checking the read bits against those generated by the write process. Appropriate user documentation for this command has been added to the user guide as well. The algorithm presently makes a relatively naive comparison. Some chips that use ECC may not verify correctly using this implementation, but the new documentation provides details about this limitation.
2009-11-16Use nand_fileio_* in write/dump commands.Zachary T Welch
This patch eliminates duplicated code in the the NAND 'dump' and 'write' by using the new static helper functions. These changes also fix a possible memory leak in nand dump command, in the case that the dump file failed to open. Overall, the changes should be functionally equivalent, but the resulting code will be easier to improve and extend further.
2009-11-16Add nand_fileio_* helper APIs.Zachary T Welch
This patch provides helpers APIs that will eliminate duplicated code in the the NAND 'dump' and 'write' commands by factoring their common code into static helper functions. These helpers may be useful for creating new commands, as shown in the final patch to 'verify' flash from a file. Several previously unreported error conditions now generate messages and propogate the return codes, such as when the file fails to open and bad arguments are given. These changes will fix a possible memory leak in nand dump command, in the case that the dump file failed to open. Overall, the changes should be functionally equivalent, but the resulting code will be easier to improve and extend consistently.
2009-11-16#include "target.h" less wildlyDavid Brownell
Don't include "target.h" from more headers than necessary. This avoids needless interdependencies and duplicated include paths. Don't needlessly include it in source files, either. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16target: less implicit inclusion of "command.h"David Brownell
Lots of files still include it, often through needless duplicate inclusion of "log.h"; sigh. This cleans up the inclusion graph a bunch, so there are fewer inclusion paths, but it doesn't change much otherwise. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16target: don't implicitly include "algorithm.h"David Brownell
Most files in the tree seem to have ended up including this, and *quite* needlessly ... only code implementing or using downloadable algorithms actually needs these declarations. So take it out of the header files which included it, and put it in files which use it ... reduce needless interdependencies. Also: "algorithm.h" doesn't need to include "types.h" again; it already comes from a different header. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-14lpc2900.h -- remove from Makefile.am tooDavid Brownell
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-14flash: remove needless lpc2900.h headerDavid Brownell
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13ARM7/9: rm arm7_9_get_arch_pointers()David Brownell
Remove the last external user of arm7_9_get_arch_pointers(), and that annoying downcast utility. Add an is_arm7_9() predicate. Stop returning specious success codes on various failure paths in the ARM7/ARM9 commands which used that downcast utility. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13command_t -> struct commandZachary T Welch
Remove misleading typedef and redundant suffix from struct command.
2009-11-13command_context_t -> struct command_contextZachary T Welch
Remove misleading typedef and redundant suffix from struct command_context.
2009-11-13flash_bank_t -> struct flash_bankZachary T Welch
Remove misleading typedef and redundant suffix from struct flash_bank.
2009-11-13nand_device_t -> struct nand_deviceZachary T Welch
Remove misleading typedef and redundant suffix from struct nand_device.
2009-11-13target_t -> struct targetZachary T Welch
Remove misleading typedef and redundant suffix from struct target.
2009-11-13image_t -> struct imageZachary T Welch
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-13armv4_5_common_t -> struct armZachary T Welch
Remove misleading typedef and just use struct arm.
2009-11-13working_area_t -> struct working_areaZachary T Welch
Remove misleading typedef and redundant suffix from struct working_area.