summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* zy1000: fix bug when running on non-arm CPUØyvind Harboe2009-11-171-1/+8
| | | | | | | Shifting by more than 32 is undefined for 32 bit integers according to the C standard. Robust solution is conditional code. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* zy1000: fix trivial syntax error introduced by latest refactoringsØyvind Harboe2009-11-171-5/+5
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ARM9TDMI: remove now-needless "struct arm9tdmi"David Brownell2009-11-179-72/+45
| | | | | | | And move the rest of the vector_catch stuff into the C file; it's not part of the module interface. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM7TDMI: remove now-needless "struct arm7tdmi"David Brownell2009-11-174-29/+21
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target: remove some more duplicate includesDavid Brownell2009-11-174-4/+1
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARMv7-A: no exit() callsDavid Brownell2009-11-162-4/+3
| | | | | | | Also, switch integrity check over to the correct magic number, and remove duplicate v4/v5 #define. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-A8: no exit() calls, add missing v7-A initDavid Brownell2009-11-161-31/+16
| | | | | | | Eventually there should be a v7a init routine, but for now all that is inlined here. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* XScale: fewere exit() callsDavid Brownell2009-11-161-4/+4
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* MIPS: no exit() callsDavid Brownell2009-11-162-7/+5
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARMv7-M: no exit() callsDavid Brownell2009-11-161-4/+4
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARMv4/ARMv5: no exit() callsDavid Brownell2009-11-161-6/+8
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM11: fewer exit() callsDavid Brownell2009-11-161-4/+6
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-M3: don't exit()David Brownell2009-11-161-24/+10
| | | | | | | Get rid of undesirable and needless exit() calls from the Cortex-M3 support. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARMv7A: use standard disassemblerDavid Brownell2009-11-161-83/+0
| | | | | | We no longer need v7A-specific code for this. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM11: register (most) standard ARM commandsDavid Brownell2009-11-162-1/+10
| | | | | | | Have ARM11 register the "standard" ARM commands. For now, only disassembly really works. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM: "armv4_5" command prefix becomes "arm"David Brownell2009-11-162-9/+18
| | | | | | | | | | Rename the "armv4_5" command prefix to straight "arm" so it makes more sense for newer cores. Add a simple compatibility script. Make sure all the commands give the same "not an ARM" diagnostic message (and fail properly) when called against non-ARM targets. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* JTAG: fix autoprobe failure.David Brownell2009-11-161-2/+10
| | | | | | | Fix bug noted by Øyvind: terminate the IR length autoscan when the IR is too long, or otherwise broken. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* fileio: improve API typesZachary T Welch2009-11-1612-64/+66
| | | | | | | | | | | | | 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-166-7/+7
| | | | | | Add const keyword to file url and cast to free(). Make size an ssize_t and chase all format strings that use it.
* helper/log: improve API parameter typesZachary T Welch2009-11-162-19/+16
| | | | | | | Uses unsigned type to pass line numbers. Use uint64_t to pass sleep routines their milliseconds. Updates sleep routines to use this type and improve whitespace.
* use Jim_CmdProc in jim_registerZachary T Welch2009-11-162-2/+4
| | | | The jim_register command just needed to use the type defined by jim.h.
* improve constness of open_file_from_pathZachary T Welch2009-11-162-2/+2
|
* make command line options constZachary T Welch2009-11-161-1/+1
| | | | | The getopt_long call allows a const struct option, so mark ours const too.
* ARM: standard disassembler uses Thumb2 entryDavid Brownell2009-11-162-38/+38
| | | | | | | | | | | | | | | | | Tweak "standard" ARM disassembler diagnostics to fail if the target is not "an ARM" (vs. not "an ARMV4/5"), so it makes more sense for cores inheriting this as the "generic" disassembler. Also, to use the Thumb2 entry instead of the original Thumb entry. This makes it work better for both newer cores (which support those added instructions) and for BL and BLX instructions on older cores. (Those instructions are 32-bits, which requires curious state-aware code to go through a 16-bit decode interface...) Plus minor cleanups, notably to have fewer exit paths and to make sure they all return failure codes. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target: don't include "log.h" from "armv4_5.h"David Brownell2009-11-162-1/+1
| | | | | | | No point in multiple includes, and that file doesn't use its functions any more. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM: move mode functions out of headerDavid Brownell2009-11-162-40/+56
| | | | | | | | | They're really too big to inline, at least for code that's not in any performance-critical loops. Also move the associated string table to the rodata section. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* JTAG: no LOG_WARNING() for taps without IDCODEDavid Brownell2009-11-161-1/+1
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* binarybuffer: regression fixDavid Brownell2009-11-161-2/+4
| | | | | | | The "improve inline binarybuffer helpers" mis-handled bytes with the high bit set; treat them as unsigned, not signed. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* "types.h" doxygen fixDavid Brownell2009-11-161-2/+2
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target: less implicit inclusion of "etm.h"David Brownell2009-11-169-2/+13
| | | | | | | Don't include it in more headers than necessary; just use it in the few files that actually need it. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* move ARRAY_SIZE macro to types.hZachary T Welch2009-11-1614-59/+49
| | | | | | | | The ARRAY_SIZE macro was defined in several target files, so move it to types.h. This patch also removes two other identical macros: DIM (from jtag.h) and asizeof (from arm11.h).
* armv7m: make core reg read/write use unsignedZachary T Welch2009-11-162-6/+6
| | | | | | Eliminate redundant check that gets covered by using unsigned type. Created to eliminate noise from subsequent patches, but this kind of conversion will be beneficial in similar ways throughout the tree.
* remove TAP_SCAN_BYTES macroZachary T Welch2009-11-164-11/+9
| | | | Use DIV_ROUND_UP(n, 8) instead of TAP_SCAN_BYTES macro.
* rename CEIL as DIV_ROUND_UPZachary T Welch2009-11-1619-53/+60
| | | | | Improves the name of this macro, moves it to types.h, and adds a block of Doxygen comments to describe what it does.
* move container_of to types.hZachary T Welch2009-11-162-13/+15
| | | | | | The container_of macro is useful as a general solution. It belongs in types.h, rather than target.h where it was introduced. Requires the offsetof macro, which comes from <stddef.h> (moved as well).
* 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.
* cleanup jtag minidriversZachary T Welch2009-11-162-31/+0
| | | | | Remove two vestigial externs from our JTAG minidriver source files. Also, removes many extra blank lines from the minidummy driver.
* 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.
* Add FILEIO_NONE access mode.Zachary T Welch2009-11-161-0/+1
| | | | | | | In some cases, the FILEIO_NONE access mode may be useful as a parameter to indicate that file access should be disabled. High-level routines can use it to skip file access calls, as 'fileio_open' will fail presently if called to open a file using this mode.
* 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.
* binarybuffer: add API documentationZachary T Welch2009-11-161-3/+41
| | | | | Adds Doxygen documentation for a number of the binarybuffer APIs, including "unexpected" behavior exposed during review on the list.
* improve inline binarybuffer helpersZachary T Welch2009-11-161-7/+8
| | | | Use void*, unsigned, and bool types with inline helpers.
* improve buf_set_buf helperZachary T Welch2009-11-162-5/+8
| | | | | Use void * and unsigned types for buffer and their sizes. Allows it to be used with more than uint8_t * without casts.
* improve buf_set_onesZachary T Welch2009-11-162-10/+11
| | | | Use memset instead of loop. Improve types, using void * and unsigned.
* improve buf_cpy helperZachary T Welch2009-11-162-9/+11
| | | | | Use memcpy for bulk of copy, improve final byte handling. Improve types by using void * for buffers and unsigned for size.
* improve buf_cmp and buf_cmp_mask helpersZachary T Welch2009-11-162-39/+40
| | | | | | | | Rewrite buf_cmp to use memcpy for bulk of comparison. Add static helper to perform comparison of trailing byte, which uses another static helper to perform a maksed comparison. The masked comparison helper is used by the buf_cmp_mask to simplify its loop. Improve types to use void *, unsigned, and return bool.
* improve str_to_buf and buf_to_str helpersZachary T Welch2009-11-162-65/+67
| | | | | Improve types: use void * and unsigned. Move all variables to point of first use. Move radix guessing logic to new str_radix_guess helper.
* binarybuffer: move variables to point of first useZachary T Welch2009-11-162-28/+9
| | | | Reduce some noise from subsequent patches.