summaryrefslogtreecommitdiff
path: root/src/target/arm9tdmi.c
Commit message (Collapse)AuthorAgeFilesLines
* warnings: use more 'const' for char *Øyvind Harboe2010-12-291-1/+1
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm: error propagation of arm_jtag_set_instrØyvind Harboe2010-07-191-4/+12
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm9: revert change arm9tdmi cmd group name to arm9Spencer Oliver2010-07-121-2/+2
| | | | | | | | | This reverts the incorrect change made to the arm9 cmd group in commit d1eca9a74c7c57ba6a3210c51b2a10cc5adb22e1. The code now matches the docs and the release notes. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* jtag: retire jtag_get/set_end_state()Øyvind Harboe2010-03-191-5/+0
| | | | | | | Voila! This get rids of mysteries about what what state the TAP is in. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: remove jtag_get_end_state()'s that should be unecessaryØyvind Harboe2010-03-191-1/+1
| | | | | | | | By a bit of code inspection it seems like all of these instances of jtag_get_end_state() can be unambigously replaced by constants. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: retire one instance of jtag_get_end_state() usageØyvind Harboe2010-03-181-8/+8
| | | | | | Less global variables.... Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: cut down on usage of unintended modification of global end stateØyvind Harboe2010-03-181-8/+8
| | | | | | | | | | | | | jtag_get/set_end_state() is now deprecated. There were lots of places in the code where the end state was unintentionally modified. The big Q is whether there were any places where the intention was to modify the end state. 0.5 is a long way off, so we'll get a fair amount of testing. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm7/9: remove unused post_restore_contextØyvind Harboe2010-03-171-1/+0
| | | | | | | Unused. If something should happen after context restore, then the calling code can just do it afterwards. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: retire tap fieldØyvind Harboe2010-03-081-18/+6
| | | | | | | | | | | | | | | | | jtag_add_dr/ir_scan() now takes the tap as the first argument, rather than for each of the fields passed in. The code never exercised the path where there was more than one tap being scanned, who knows if it even worked. This simplifies the implementation and reduces clutter in the calling code. use jtag_add_ir/dr_plain_scan() for more fancy situations. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ARM: keep a handle to the PCDavid Brownell2010-02-211-1/+2
| | | | | | | | | | | | | | | | Keep a handle to the PC in "struct arm", and use it. This register is used a fair amount, so this is a net minor code shrink (other than some line length fixes), but mostly it's to make things more readable. For XScale, fix a dodgy sequence while stepping. It was initializing a variable to a non-NULL value, then updating it to handle the step-over-active-breakpoint case, and then later testing for non-NULL to see if it should reverse that step-over-active logic. It should have done like ARM7/ARM9 does: init to NULL. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* arm7/9: enable check that DCC downloads have been enabledØyvind Harboe2010-01-131-0/+1
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* misc ARM help/usage updatesDavid Brownell2010-01-071-1/+3
| | | | | | | | | | | | Usage syntax messages have the same EBNF as the User's Guide; there should be no angle brackets in either place. Uupdate some helptext to be more accurate. Don't use "&function"; functions are like arrays, their address is their name. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM9TDMI: Fix segfault.Antonio Borneo2009-12-301-0/+6
| | | | | | | | | The handler for "arm9tdmi vector_catch ..." did not check if target has already been examined. Without this fix it segfaults when using NULL pointer "arm7_9->eice_cache". Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target: move 'extern' decls to *.h filesDavid Brownell2009-12-081-2/+0
| | | | | | | | The exception being declarations for drivers. Those should be split out in some clean way -- like driver add/remove calls made by initialization code -- but that's for another day. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM: rename some generic routinesDavid Brownell2009-12-071-2/+2
| | | | | | | | | | | | | | | | Rename some (mostly) generic ARM functions: armv4_5_arch_state() --> arm_arch_state() armv4_5_get_gdb_reg_list() --> arm_get_gdb_reg_list() armv4_5_init_arch_info() --> arm_init_arch_info() Cores using the microcontroller profile may want a different arch_state() routine though. (Also fix strange indentation in arm_arch_state: use tabs only! And update a call to it, removing assignment-in-conditional.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM: move opcode macros to <target/arm_opcodes.h>David Brownell2009-12-071-0/+1
| | | | | | | | | | | | | | | Move the ARM opcode macros from <target/armv4_5.h>, and a few Thumb2 ones from <target/armv7m.h>, to more appropriate homes in a new <target/arm_opcodes.h> file. Removed duplicate opcodes from that v7m/Thumb2 set. Protected a few macro argument references by adding missing parentheses. Tightening up some of the line lengths turned up a curious artifact: the macros for the Thumb opcodes are all 32 bits wide, not 16 bits. There's currently no explanation for why it's done that way... Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM: rename armv4_5_build_reg_cache() as arm_*()David Brownell2009-12-041-1/+1
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM: switch target_to_armv4_5() to target_to_arm()David Brownell2009-12-041-1/+1
| | | | | | And remove that old symbol. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* remove target_type register_command callbackZachary T Welch2009-11-241-8/+5
| | | | | | Uses chaining of command_registration structures to eliminate all target_type register_callback routines. Exports the command_handler registration arrays for those target types that are used by others.
* arm9tdmi: use register_commands()Zachary T Welch2009-11-241-12/+21
|
* use COMMAND_REGISTER macroZachary T Welch2009-11-241-2/+2
| | | | | Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
* ARM: remove 'armv4_5_common_s' migration #defineDavid Brownell2009-11-221-2/+2
| | | | | | Finish migrating from the old symbol to the new one. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM: pass 'struct reg *' to register r/w routinesDavid Brownell2009-11-201-1/+0
| | | | | | | | | | | | | | | | Implementations need to access the register struct they modify; make it easier and less error-prone to identify the instance. (This removes over 10% of the ARMV4_5_CORE_REG_MODE nastiness...) Plus some minor fixes noted when making these updates: ARM7/ARM9 accessor methods should be static; don't leave CPSR wrongly marked "dirty"; note significant XScale omissions in register handling; and have armv4_5_build_reg_cache() record its result. Rename "struct armv4_5_core_reg" as "struct arm_reg"; it's used for more than those older architecture generations. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* command_handler: change 'cmd_ctx' to CMD_CTXZachary T Welch2009-11-171-4/+4
| | | | Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
* command_handler: change 'args' to CMD_ARGVZachary T Welch2009-11-171-4/+4
| | | | | 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-171-2/+2
| | | | | This patch converts all instances of 'argc' in COMMAND_HANDLER routines to use CMD_ARGC.
* ARM9TDMI: remove now-needless "struct arm9tdmi"David Brownell2009-11-171-11/+20
| | | | | | | 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>
* target: no implicit #includes of "register.h"David Brownell2009-11-161-0/+1
| | | | | | | | | | | | Same deal: "register.h" got needlessly included all over the place because of being in a few widely included headers. So take it out of the header files which included it, and put it in files which use it ... reduce needless interdependencies. Also, don't need that extra "types.h" inclusion. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM: memory utils aren't ARM7/ARM9 dependentDavid Brownell2009-11-151-2/+3
| | | | | | | | | | | | | | | | The arm7_9_checksum_memory() and arm7_9_blank_check_memory() routines are not actually specific to the ARM7 and ARM9 core generations ... they can work for any core which can run algorithms using basic ARM (not Thumb) instructions. Rename them; move the declarations to a more generic site; likewise move the code (and tidy it a bit in the process). NOTE: the blank_check() method falsely returned a success status (0) on one error path, when the algorithm failed. Fixed this bug. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM7/ARM9: use shared examine() methodDavid Brownell2009-11-131-36/+1
| | | | | | | | | No point in having two identical examine methods for the ARM7TDMI and ARM9TDMI drivers; move, rename, shrink, share. Add a bit of doxygen; stop needlessly exporting a method. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ETM: simplify ETM initialization code pathsDavid Brownell2009-11-131-5/+3
| | | | | | | | | Return NULL from etm_build_reg_cache() not ERROR_OK; and share code on that fault path. Let ETM code handle any tracking of its cache -- not callers. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* command_t -> struct commandZachary T Welch2009-11-131-1/+1
| | | | Remove misleading typedef and redundant suffix from struct command.
* command_context_t -> struct command_contextZachary T Welch2009-11-131-2/+2
| | | | Remove misleading typedef and redundant suffix from struct command_context.
* target_t -> struct targetZachary T Welch2009-11-131-25/+25
| | | | Remove misleading typedef and redundant suffix from struct target.
* reg_t -> struct regZachary T Welch2009-11-131-2/+2
| | | | Remove misleading typedef and redundant suffix from struct reg.
* target_type_t -> struct target_typeZachary T Welch2009-11-131-1/+1
| | | | Remove misleading typedef and redundant suffix from struct target_type.
* armv4_5_common_t -> struct armZachary T Welch2009-11-131-1/+1
| | | | Remove misleading typedef and just use struct arm.
* arm9tdmi_vector_t -> struct arm9tdmi_vectorZachary T Welch2009-11-131-1/+1
| | | | | | Remove misleading typedef and redundant suffix from struct arm9tdmi_vector. Renames enum arm9tdmi_vector as enum arm9tdmi_vector_bit.
* reg_cache_t -> struct reg_cacheZachary T Welch2009-11-131-3/+3
| | | | Remove misleading typedef and redundant suffix from struct reg_cache.
* arm_jtag_t -> struct arm_jtagZachary T Welch2009-11-131-20/+20
| | | | Remove misleading typedef and redundant suffix from struct arm_jtag.
* arm9tdmi_common_t -> struct arm9tdmi_commonZachary T Welch2009-11-131-2/+2
| | | | Remove misleading typedef and redundant suffix from struct arm9tdmi_common.
* arm7_9_common_t -> struct arm7_9_commonZachary T Welch2009-11-131-22/+22
| | | | Remove misleading typedef and redundant suffix from struct arm7_9_common.
* scan_field_t -> struct scan_fieldZachary T Welch2009-11-131-4/+4
| | | | Remove useless structure typedef.
* jtag_tap_t -> struct jtag_tapZachary T Welch2009-11-131-1/+1
| | | | | Search and destroy the jtag_tap_t typedef. This also cleans up a layering violation, removing the declaration from types.h.
* command_handler_t: make argc unsignedZachary T Welch2009-11-131-3/+3
| | | | | | 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.
* use COMMAND_HANDLER macro to define all commandsZachary T Welch2009-11-131-2/+1
|
* ETM: update arm[79]tdmi_examine()David Brownell2009-11-111-4/+5
| | | | | | | Make ARM7 and ARM9 cores use the new toplevel ETM handle to trigger ETM setup, not the to-be-removed lower level one. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM9TDMI uses the new inheritance/nesting schemeDavid Brownell2009-11-051-105/+30
| | | | | | | Replace needless pointer traversals and simplify. Also remove most remaining contents from arm9tdmi struct; it's almost removable. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM9TDMI: remove forward declsDavid Brownell2009-11-051-52/+57
| | | | | | | | | | | The forward decls are just code clutter; remove them, by moving their references after definitions. This is another file which never needed even one internal forward declaration. Also shrink a few overly-long lines with function declarations or definitions. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target: remove unused interface fn that clutters codeØyvind Harboe2009-11-051-7/+0
| | | | | | | | | The quit entry point was not being invoked. Just a source of confusion at this point. XScale ran 100x reset upon quit, but that code made no sense, wasn't commented and never invoke. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>