summaryrefslogtreecommitdiff
path: root/src/flash
Commit message (Collapse)AuthorAgeFilesLines
* use COMMAND_PARSE_ENABLE macro where appropriateZachary T Welch2009-11-181-8/+1
| | | | | | | | 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.
* use COMMAND_PARSE_ON_OFF where appropriateZachary T Welch2009-11-181-7/+2
| | | | Updates all command parsing of "on" and "off" arguments.
* split startup.tcl file across modulesZachary T Welch2009-11-182-0/+18
| | | | | | | 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.
* ARM: only use one set of dummy FPA registersDavid Brownell2009-11-171-1/+0
| | | | | | | | | | | | | | | | 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>
* command_handler: change 'cmd_ctx' to CMD_CTXZachary T Welch2009-11-1715-177/+177
| | | | Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
* command_handler: change 'args' to CMD_ARGVZachary T Welch2009-11-1723-198/+198
| | | | | This patch converts all instances of 'args' in COMMAND_HANDLER routines to use CMD_ARGV macro.
* command_handler: change to 'argc' to CMD_ARGCZachary T Welch2009-11-1725-99/+99
| | | | | This patch converts all instances of 'argc' in COMMAND_HANDLER routines to use CMD_ARGC.
* fileio: improve API typesZachary T Welch2009-11-165-12/+15
| | | | | | | | | | | | | 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.
* struct fileio: improve member typesZachary T Welch2009-11-163-3/+3
| | | | | | Add const keyword to file url and cast to free(). Make size an ssize_t and chase all format strings that use it.
* rename CEIL as DIV_ROUND_UPZachary T Welch2009-11-163-8/+8
| | | | | Improves the name of this macro, moves it to types.h, and adds a block of Doxygen comments to describe what it does.
* nand_command_get_device_by_num: make COMMAND_HELPERZachary T Welch2009-11-162-10/+11
| | | | | Use COMMAND_HELPER macro to define nand_command_get_device_by_num. Use CALL_COMMAND_HANDLER to invoke it.
* flash_command_get_bank_by_num: make COMMAND_HELPERZachary T Welch2009-11-1611-41/+41
| | | | | Use COMMAND_HELPER macro to declare flash_command_get_bank_by_num. This is required for COMMAND_PARSE_NUMBER macro.
* Add 'nand verify' commandZachary T Welch2009-11-161-0/+65
| | | | | | | | | | | 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.
* Use nand_fileio_* in write/dump commands.Zachary T Welch2009-11-161-248/+46
| | | | | | | | | | | 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.
* Add nand_fileio_* helper APIs.Zachary T Welch2009-11-161-0/+216
| | | | | | | | | | | | | | | 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.
* #include "target.h" less wildlyDavid Brownell2009-11-164-4/+2
| | | | | | | | | 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>
* target: less implicit inclusion of "command.h"David Brownell2009-11-161-1/+0
| | | | | | | | | | 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>
* target: don't implicitly include "algorithm.h"David Brownell2009-11-1610-2/+12
| | | | | | | | | | | | | | 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>
* lpc2900.h -- remove from Makefile.am tooDavid Brownell2009-11-141-1/+0
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* flash: remove needless lpc2900.h headerDavid Brownell2009-11-142-29/+1
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM7/9: rm arm7_9_get_arch_pointers()David Brownell2009-11-131-4/+3
| | | | | | | | | | 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>
* command_t -> struct commandZachary T Welch2009-11-1317-17/+17
| | | | Remove misleading typedef and redundant suffix from struct command.
* command_context_t -> struct command_contextZachary T Welch2009-11-1327-43/+43
| | | | Remove misleading typedef and redundant suffix from struct command_context.
* flash_bank_t -> struct flash_bankZachary T Welch2009-11-1323-366/+366
| | | | Remove misleading typedef and redundant suffix from struct flash_bank.
* nand_device_t -> struct nand_deviceZachary T Welch2009-11-1314-140/+140
| | | | Remove misleading typedef and redundant suffix from struct nand_device.
* target_t -> struct targetZachary T Welch2009-11-1334-241/+241
| | | | Remove misleading typedef and redundant suffix from struct target.
* image_t -> struct imageZachary T Welch2009-11-134-8/+8
| | | | | | | 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.
* armv4_5_common_t -> struct armZachary T Welch2009-11-133-3/+3
| | | | Remove misleading typedef and just use struct arm.
* working_area_t -> struct working_areaZachary T Welch2009-11-1317-21/+21
| | | | Remove misleading typedef and redundant suffix from struct working_area.
* mips_ejtag_t -> struct mips_ejtagZachary T Welch2009-11-131-2/+2
| | | | Remove misleading typedef and redundant suffix from struct mips_ejtag.
* mips32_common_t -> struct mips32_commonZachary T Welch2009-11-131-2/+2
| | | | Remove misleading typedef and redundant suffix from struct mips32_common.
* avr_common_t -> struct avr_commonZachary T Welch2009-11-131-10/+10
| | | | Remove misleading typedef and redundant suffix from struct avr_common.
* armv7m_algorithm_t -> struct armv7m_algorithmZachary T Welch2009-11-134-4/+4
| | | | Remove misleading typedef and redundant suffix from struct armv7m_algorithm.
* armv4_5_algorithm_t -> struct armv4_5_algorithmZachary T Welch2009-11-138-9/+9
| | | | Remove misleading typedef and redundant suffix from struct armv4_5_algorithm.
* arm_jtag_t -> struct arm_jtagZachary T Welch2009-11-132-2/+2
| | | | Remove misleading typedef and redundant suffix from struct arm_jtag.
* arm7_9_common_t -> struct arm7_9_commonZachary T Welch2009-11-132-2/+2
| | | | Remove misleading typedef and redundant suffix from struct arm7_9_common.
* reg_param_t -> struct reg_paramZachary T Welch2009-11-1310-11/+11
| | | | Remove misleading typedef and redundant suffix from struct reg_param.
* mem_param_t -> struct mem_paramZachary T Welch2009-11-131-1/+1
| | | | Remove misleading typedef and redundant suffix from struct mem_param.
* remove unused aduc702x structure.Zachary T Welch2009-11-131-11/+0
| | | | The ADUC702x_FLASH_MMIO structure was completely used, so it must die.
* aduc702x_flash_bank_t -> struct aduc702x_flash_bankZachary T Welch2009-11-131-6/+5
| | | | | Remove misleading typedef and redundant suffix from struct aduc702x_flash_bank.
* tms470_flash_bank_t -> struct tms470_flash_bankZachary T Welch2009-11-132-12/+12
| | | | Remove misleading typedef and redundant suffix from struct tms470_flash_bank.
* pic32mx_mem_layout_t -> struct pic32mx_mem_layoutZachary T Welch2009-11-131-2/+2
| | | | Remove misleading typedef and redundant suffix from struct pic32mx_mem_layout.
* non_cfi_t -> struct non_cfiZachary T Welch2009-11-132-4/+4
| | | | Remove misleading typedef and redundant suffix from struct non_cfi.
* nand_block_t -> struct nand_blockZachary T Welch2009-11-132-4/+4
| | | | Remove misleading typedef and redundant suffix from struct nand_block.
* str9xpec_flash_controller_t -> struct str9xpec_flash_controllerZachary T Welch2009-11-132-24/+24
| | | | Remove misleading typedef and redundant suffix from struct str9xpec_flash_controller.
* str9x_flash_bank_t -> struct str9x_flash_bankZachary T Welch2009-11-132-8/+8
| | | | Remove misleading typedef and redundant suffix from struct str9x_flash_bank.
* str7x_mem_layout_t -> struct str7x_mem_layoutZachary T Welch2009-11-132-4/+4
| | | | Remove misleading typedef and redundant suffix from struct str7x_mem_layout.
* str7x_flash_bank_t -> struct str7x_flash_bankZachary T Welch2009-11-132-12/+12
| | | | Remove misleading typedef and redundant suffix from struct str7x_flash_bank.
* stm32x_mem_layout_t -> struct stm32x_mem_layoutZachary T Welch2009-11-131-2/+2
| | | | Remove misleading typedef and redundant suffix from struct stm32x_mem_layout.
* stm32x_flash_bank_t -> struct stm32x_flash_bankZachary T Welch2009-11-132-16/+16
| | | | Remove misleading typedef and redundant suffix from struct stm32x_flash_bank.