summaryrefslogtreecommitdiff
path: root/src/target
Commit message (Collapse)AuthorAgeFilesLines
* ARM920 uses the new inheritance/nesting schemeDavid Brownell2009-11-052-142/+71
| | | | | | | | Use target_to_arm920(), replacing needless pointer traversals and simplifying. Stop setting arm9tdmi->arch_info for arm920 type parts, it's not used any longer. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-M3: use the new inheritance/nesting schemeDavid Brownell2009-11-054-135/+113
| | | | | | | | | | | | Use new target_to_cm3() and target_to_armv7m() inlines, instead of a series of x->arch_info conversions. Remove arch_info, since nothing uses it. Also fix an omission: the Cortex-M3 commands didn't verify that they were operating on that kind of target. Add comment about the ARMv7M version of that omission. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target: provide container_of()David Brownell2009-11-0512-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | Provide a cleaner way to handle single inheritance of targets in C, using the same model Linux does: structs containing other structs, un-nested via calls to a "container_of()" macro that are packaged in typesafe inline functions. Targets already use this containment idiom, but make it much more complicated because they un-nest using embedded "void *" pointers ... in chains of up to five per target, which is all pure needless complication. (Example: arm92x core, arm9tdmi, arm7_9, armv4_5 ... on top of the base "target" class.) Applying this scheme consistently simplifies things, and gets rid of many error-prone untyped pointers. It won't change any part of the type model though -- it just simplifies things. (And facilitates more cleanup later on.) Rule of thumb: where there's an X->arch_info void* pointer, access to that pointer can and should be removed. It may be convenient to set up pointers to some of the embedded structs; and shrink their current "*_common" names (annoyingly long). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM7TDMI: remove forward declsDavid Brownell2009-11-052-92/+88
| | | | | | | | | | | | 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; get rid of arm7tdmi_register_commands(), it's not needed (just delegated); minor whitespace declutter. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM720: remove exports and forward declsDavid Brownell2009-11-051-119/+95
| | | | | | | | | | | | | | Unneeded exports cause confusion about the module interfaces. Make all functions static. Add a short header comment. 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. Remove unneeded indirection for the write_memory() method. Make a table static, remove a can't-happen case with nasty exit(). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* FA526: remove exports and forward declsDavid Brownell2009-11-051-60/+56
| | | | | | | | | | | Unneeded exports cause confusion about the module interfaces. Make most functions static. 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. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM9TDMI: remove forward declsDavid Brownell2009-11-052-58/+69
| | | | | | | | | | | 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>
* ARM966: remove exports and forward declsDavid Brownell2009-11-052-59/+55
| | | | | | | | | | | | | | | | Unneeded exports cause confusion about the module interfaces. Make most functions static. 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 remove needless arm966e_init_target(), in favor of the arm9tdmi routine to which it delegates its work. This saved over 100 bytes of code on x86_32. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM926: more cleanupDavid Brownell2009-11-051-37/+22
| | | | | | | | | | | | An init_target() wrapper isn't needed, and target_create() can shrink a bit. Add a header comment and some doxygen. Remove arm926ejs_catch_broken_irscan() which has been a NOP for quite a few months now, and in any case duplicates logic in the JTAG core to validate IR capture data. But force the capture mask to 0x0f, so those tests are most effective. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM920: remove exports and forward declsDavid Brownell2009-11-052-112/+150
| | | | | | | | | | | | | | | Unneeded exports cause confusion about the module interfaces. Make most functions static. Add a short header comment. 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. This saved almost 900 bytes of code on x86_32; it seems the compiler can leverage its knowledge that these functions are not called from the outside world... Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Improve ETM tracemode update command.Zachary T Welch2009-11-051-88/+84
|
* Improve etm command argument parsing.Zachary T Welch2009-11-051-4/+9
|
* Improve trace command argument parsing.Zachary T Welch2009-11-051-2/+4
|
* Improve arm_adi_v5 command argument parsing.Zachary T Welch2009-11-051-15/+42
|
* Improve cortex_m3 command argument parsing.Zachary T Welch2009-11-051-6/+2
|
* Improve xscale command argument parsing.Zachary T Welch2009-11-051-2/+2
|
* Improve arm11 command argument parsing.Zachary T Welch2009-11-051-7/+7
|
* Improve arm966e command argument parsing.Zachary T Welch2009-11-051-2/+4
|
* Improve arm926ejs command argument parsing.Zachary T Welch2009-11-051-5/+6
|
* Improve arm920t command argument parsing.Zachary T Welch2009-11-051-6/+12
|
* Improve arm720t command argument parsing.Zachary T Welch2009-11-051-2/+5
|
* Improve arm7_9_common command argument parsing.Zachary T Welch2009-11-051-8/+8
|
* Improve armv7m command argument parsing.Zachary T Welch2009-11-051-11/+20
|
* Improve armv7a command argument parsing.Zachary T Welch2009-11-051-5/+12
|
* Improve armv4_5 command argument parsing.Zachary T Welch2009-11-051-2/+2
|
* Improve xscale command argument parsing.Zachary T Welch2009-11-051-12/+12
|
* Improve target.c command argument parsing.Zachary T Welch2009-11-051-88/+36
| | | | | Passes cmd_ctx into parse_load_image_command_args for reporting the parsing errors therein.
* arm920t: add mrcmcr interface fn's.Øyvind Harboe2009-11-051-0/+29
| | | | | | | | The arm920t has a concept of read modify write cycles that may have to be represented in the mrcmcr interface eventually. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm11: check if target is halted before executing mrc/mcr commands.Øyvind Harboe2009-11-051-0/+7
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* target: fix ordering of arguments to mcr and mrc commandsØyvind Harboe2009-11-051-7/+7
| | | | | | Now matches machine code syntax and old arm11 syntax. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* target: check args to mrc/mcr.Øyvind Harboe2009-11-051-0/+24
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ARM11: added mrc/mcr support to arm11 code.Øyvind Harboe2009-11-051-0/+53
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* target: Only register mrc mcr commands when one of the targets support them.Øyvind Harboe2009-11-051-3/+11
| | | | | | This avoids polluting help for targets that can never support mrc/mcr Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* cortex_a8: add mrc mcr interface.Øyvind Harboe2009-11-051-0/+29
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* watchpoint_add() cleanupDavid Brownell2009-11-054-32/+40
| | | | | | | | | | | | Fail watchpoint_add() if it's the same address but the parameters are different ... don't just assume having the same address means the same watchpoint! (Note that overlapping watchpoints aren't detected...) Handle unrecognized return codes more sanely; don't exit()! And describe command params right. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-M3: expose most DWT registersDavid Brownell2009-11-052-21/+144
| | | | | | | | | | | | | | | | | | | | | | | Expose most DWT registers via Tcl; there are a few more, but those are mostly for profiling along with the ITM. Having this set available enables operations which aren't possible with just the standard watchpoint operations. The cycle counter may be interesting. Turn it on after reset by setting the LSB of the dwt_ctrl register, and it counts CPU clocks. You can program the comparator 0 watchpoint to trigger on a given cycle count, rather than a data address. Likewise, comparator 1 may be able to match data values given address matches from one or two other comparators. (Not all hardware supports this capability though; try it. That is something the standard watchpoint methods should eventually handle, for the single address case.) Minor cleanup: remove needless functional indirection for exposing the v7m architctural registers. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-M3: minor cleanupDavid Brownell2009-11-052-16/+4
| | | | | | | | | | | There's no reason to read which interrupts are enabled from the NVIC; that state isn't used. Plus, it's highly dynamic since firmware can change it at any time; remove the support for those state records. Remove duplicate definition of DWT_CTRL address; shrink a line. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-M3: DWT cleanup/fixesDavid Brownell2009-11-051-56/+115
| | | | | | | | | | | | | Fix the watchpoint error checks, and do them in add(), not later in set() when it's mostly too late. Support the full range of watchpoint sizes (1 to 32K bytes each), and check alignments. Minor cleanup of DWT access: shrink lines, use "+" for address calculations, comment a few issues. Add debug message reporting DWT capabilities, matching the message for FBP, and some minor code and spec review comments. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARMv7M: add docs, remove exportsDavid Brownell2009-11-052-29/+63
| | | | | | | | | | | | Add Doxygen for the exported ARMv7-M interfaces. Make the non-exported stuff static. Remove functions and data which are now observably unused. Add comment about a small speedup that the run_algorithm() logic could use. Shrink a few too-long lines. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target: add target->type->has_mmu fn.Øyvind Harboe2009-11-053-5/+48
| | | | | | | | | improve default target->read/write_phys_memory, produce more sensible error messages if the mmu interface functions have not been implemented yet vs. will not be implemented(e.g. cortex m3). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* Make default implementation of mdw/mmw phys return error 'not implemented'Øyvind Harboe2009-11-051-2/+14
|
* target: remove unused interface fn that clutters codeØyvind Harboe2009-11-0516-92/+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>
* debug interface: get rid of unused pre_debug fnØyvind Harboe2009-11-059-16/+0
| | | | | | Removing unused code makes it much less mysterius. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* target: 20 second timeout/megabyte for CRC checkØyvind Harboe2009-11-031-1/+4
| | | | | | | There was a fixed 20 second timeout which is too little for large, slow timeout checks. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm920t: memory writes were broken when MMU was disabledØyvind Harboe2009-11-031-11/+10
| | | | | | | | | | | To support breakpoints, flush data cache line and invalidate instruction cache when 4 and 2 byte words are written. The previous code was trying to write directly to the physical memory, which was buggy and had a number of other situations that were not handled. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* target: require working area for physical/virtual addresses to be specifiedØyvind Harboe2009-11-032-9/+29
| | | | | | | | | | | | | | | | Fixed bug: if virtual address for working memory was not specified and MMU was enabled, then address 0 would be used. Require working address to be specified for both MMU enabled and disabled case. For some completely inexplicable reason this fixes the regression in svn 2646 for flash write in arm926ejs target. The logs showed that MMU was disabled in the case below: https://lists.berlios.de/pipermail/openocd-development/2009-November/011882.html Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm9tdmi: more correct fix for vector_catchDavid Brownell2009-10-311-8/+5
| | | | | | | Just use the array of names we're given, ignoring indices. The "reserved means don't use" patch missed that change. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM926: fix arm926ejs_mmu() reading from bad pointerDavid Brownell2009-10-301-1/+3
| | | | | | | | | I'm suspecting this code can never have worked, since the original commit (svn #335) in early 2008. Fix is just copy/paste from another (working) function. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-M3: remove exports and forward declsDavid Brownell2009-10-282-189/+144
| | | | | | | | | | | Unneeded exports cause confusion about the module interfaces. Make most functions static, and fix some line-too-long issues. Delete some now-obviously-unused code. The forward decls are just code clutter; move their references later, after the normal declarations. (Or vice versa.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM926: remove exports and forward declsDavid Brownell2009-10-281-122/+127
| | | | | | | | | | | | | Unneeded exports cause confusion about the module interfaces. Only the Feroceon code builds on this, so only routines it reuses should be public.. Make most remaining functions static, and fix some of the line-too-long issues. The forward decls are just code clutter; move their references later, after the normal declarations. Turns out we don't need even one forward declaration in this file. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>