summaryrefslogtreecommitdiff
path: root/src/target/target.c
Commit message (Collapse)AuthorAgeFilesLines
...
* target: make "examined" flag be per-targetDavid Brownell2009-11-151-13/+6
| | | | | | | | | | | | | | | | | | Previously this flag was stored in "target_type", so that for example if there were two ARM7TDMI targets in a scan chain, both would claim to have been examined although only the first one actually had its examine() method called. Move this state to where it should have been in the first place, and hide a method that didn't need exposure ... the flag is write-once. Provide some doxygen. The examine() method is confusing, since it isn't separating one-time setup from the after-each-reset stuff. And the ARM7/ARM9 version is, somewhat undesirably, not leaving the debug state alone after reset ... probably more of an issue for trace setup than for watchpoints and breakpoints. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Fix for md* commands, similar to mw*.Krzysztof Dziuba2009-11-141-1/+2
|
* Invalid command syntax errors with MWW.Dean Glazeski2009-11-141-1/+2
| | | | | This fixes an issue due to the new command handler syntax caused by the mw handler playing with the args pointer before using the CMD_NAME macro. Fix is to move this call above the lines changing args.
* compile with cygwin (32-bit)Ferdinand Postema2009-11-141-7/+9
| | | | | | | | Changed some printf format strings.. [dbrownell@users.sourceforge.net: shrink lines, fix indents] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* command_context_t -> struct command_contextZachary T Welch2009-11-131-14/+14
| | | | Remove misleading typedef and redundant suffix from struct command_context.
* target_t -> struct targetZachary T Welch2009-11-131-113/+113
| | | | Remove misleading typedef and redundant suffix from struct target.
* reg_t -> struct regZachary T Welch2009-11-131-3/+3
| | | | Remove misleading typedef and redundant suffix from struct reg.
* target_type_t -> struct target_typeZachary T Welch2009-11-131-20/+20
| | | | Remove misleading typedef and redundant suffix from struct target_type.
* image_t -> struct imageZachary T Welch2009-11-131-4/+4
| | | | | | | 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.
* trace_t -> struct traceZachary T Welch2009-11-131-1/+1
| | | | Remove misleading typedef and redundant suffix from struct trace.
* breakpoint_t -> struct breakpointZachary T Welch2009-11-131-3/+3
| | | | Remove misleading typedef and redundant suffix from struct breakpoint.
* target_event_action_t -> struct target_event_actionZachary T Welch2009-11-131-3/+3
| | | | Remove misleading typedef and redundant suffix from struct target_event_action.
* target_timer_callback_t -> struct target_timer_callbackZachary T Welch2009-11-131-10/+10
| | | | Remove misleading typedef and redundant suffix from struct target_timer_callback.
* target_event_callback_t -> struct target_event_callbackZachary T Welch2009-11-131-8/+8
| | | | Remove misleading typedef and redundant suffix from struct target_event_callback.
* working_area_t -> struct working_areaZachary T Welch2009-11-131-9/+9
| | | | Remove misleading typedef and redundant suffix from struct working_area.
* reg_arch_type_t -> struct reg_arch_typeZachary T Welch2009-11-131-2/+2
| | | | Remove misleading typedef and redundant suffix from struct reg_arch_type.
* reg_cache_t -> struct reg_cacheZachary T Welch2009-11-131-2/+2
| | | | Remove misleading typedef and redundant suffix from struct reg_cache.
* watchpoint_t -> struct watchpointZachary T Welch2009-11-131-3/+3
| | | | Remove misleading typedef and redundant suffix from struct watchpoint.
* reg_param_t -> struct reg_paramZachary T Welch2009-11-131-2/+2
| | | | Remove misleading typedef and redundant suffix from struct reg_param.
* mem_param_t -> struct mem_paramZachary T Welch2009-11-131-2/+2
| | | | Remove misleading typedef and redundant suffix from struct mem_param.
* 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.
* fileio_t -> struct fileioZachary T Welch2009-11-131-1/+1
| | | | Remove useless structure typedef.
* add CMD_NAME macro for command handlersZachary T Welch2009-11-131-3/+3
| | | | | By introducing the CMD_NAME macro, this parameter may be integrated as args[-1] in command.[ch], without touching any other call sites.
* use CALL_COMMAND_HANDLER instead of direct callsZachary T Welch2009-11-131-5/+5
| | | | | | By using CALL_COMMAND_HANDLER, parameters can be reordered, added, or even removed in inherited signatures, without requiring revisiting all of the various call sites.
* use COMMAND_HELPER for command helper functionsZachary T Welch2009-11-131-5/+4
| | | | | Define the numerous helpers that inherit command handler parameters using the COMMAND_HELPER macro.
* use COMMAND_HANDLER macro to define all commandsZachary T Welch2009-11-131-25/+23
|
* add const keyword to some APIsZachary T Welch2009-11-111-1/+1
| | | | | | Add 'const' keyword to 'char *' parameters to allow command handlers to pass constant string arguments. These changes allow the 'args' command handler to be changed to 'const' in a subsequent patch.
* target: MMU-aware init for memory read/writeDavid Brownell2009-11-101-23/+42
| | | | | | | | | | | | | | | | | | Start switching MMU handling over to a more sensible scheme. Having an mmu() method enables MMU-aware behaviors. Not having one kicks in simpler ones, with no distinction between virtual and physical addresses. Currently only a handful of targets have methods to read/write physical memory: just arm720, arm920, and arm926. They should all initialize OK now, but the arm*20 parts don't do the "extra" stuff arm926 does (which should arguably be target-generic). Also simplify how target_init() loops over all targets by making it be a normal "for" loop, instead of scattering its three parts to the four winds. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Target: minor cleanupDavid Brownell2009-11-101-9/+21
| | | | | | | | - improve some names -- a "default" prefix is not descriptive - add doxygen @todo entries for some issues - avr8 isn't ever going to need those MMU hooks Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Target: fix bad error messagesDavid Brownell2009-11-101-7/+10
| | | | | | And shrink a few too-long lines. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target.c: remove useless declarationsZachary T Welch2009-11-091-103/+127
| | | | | This patch removes the last batch of forward references from the tree, moving the target command registration routines to the end of the file.
* Revert "target: add target->type->has_mmu fn"David Brownell2009-11-091-33/+5
| | | | | | | | | | | | | | | | This patch introduced a bug preventing flash writes from working on Cortex-M3 targets like the STM32. Moreover, it's the wrong approach for handling no-MMU targets. The right way to handle no-MMU targets is to provide accessors for physical addresses, and use them everywhere; and any code which tries to work with virtual-to-physical mappings should use a identity mapping (which can be defaulted). And ... we can tell if a target has an MMU by seeing if it's got an mmu() method. No such methood means no MMU. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* finish removing deprecated/obsolete commandsDavid Brownell2009-11-091-4/+4
| | | | | | | | | | | | | | | | | | | | It's been about a year since these were deprecated and, in most cases, removed. There's no point in carrying that documentation, or backwards compatibility for "jtag_device" and "jtag_speed", around forever. (Or a few remnants of obsolete code...) Removed a few obsolete uses of "jtag_speed": - The Calao stuff hasn't worked since July 2008. (Those Atmel targets need to work with a 32KHz core clock after reset until board-specific init-reset code sets up the PLL and enables a faster JTAg clock.) - Parport speed controls don't actually work (tops out at about 1 MHz on typical HW). - In general, speed controls need to live in board.cfg files (or sometimes target.cfg files), not interface.cfg ... Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Overhaul time support APIZachary T Welch2009-11-091-53/+30
| | | | | | | | | | | | | | | | | | | This patch changes the duration_* API in several ways. First, it updates the API to use better names. Second, string formatting has been removed from the API (with its associated malloc). Finally, a new function added to convert the time into seconds, which can be used (or formatted) by the caller. This eliminates hidden calls to malloc that require associated calls to free(). This patch also removes the useless extern keyword from prototypes, and it eliminates the duration_t typedef (use 'struct duration'). These API also allows proper error checking, as it is possible for gettimeofday to fail in certain circumstances. The consumers have all been chased to use this new API as well, as there were relatively few cases doing this type of measurement. In most cases, the code performs additional checks for errors, but the calling code looks much cleaner in every case.
* target: don't swap MMU/no-MMU work areasDavid Brownell2009-11-061-16/+17
| | | | | | | | | | | | | | | Resolve serious bug inserted by the "target: require working area for physical/virtual addresses to be specified" patch. It forced use of (invalid) virtual addresses when the MMU was disabled, and vice versa. Observed to break at least Cortex-M3, ARM926, ARM7TDMI whenever work areas are used, such as during bulk writes to flash, DDR2, SRAM, and so on. Also, fix overlong lines and whitespace goofs. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* 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.
* 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>
* 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>
* watchpoint_add() cleanupDavid Brownell2009-11-051-1/+2
| | | | | | | | | | | | 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>
* target: add target->type->has_mmu fn.Øyvind Harboe2009-11-051-5/+33
| | | | | | | | | 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: require working area for physical/virtual addresses to be specifiedØyvind Harboe2009-11-031-6/+24
| | | | | | | | | | | | | | | | 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>
* Remove debug output that could cause compile warnings.Øyvind Harboe2009-10-231-2/+0
|
* mcr/mrc interface work. Implemented for arm926ejs and arm720t. mcr/mrc ↵Øyvind Harboe2009-10-231-7/+155
| | | | commands added.
* have "reg" command print cache names tooDavid Brownell2009-10-221-0/+2
| | | | | | | When dumping over 100 registers (as on most ARM9 + ETM cores), aid readability by splitting them into logical groups. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Added target_read/write_phys_memory() fn's. mdX/mwX commands updated to ↵Øyvind Harboe2009-10-211-10/+65
| | | | support phys flag to specify bypassing of MMU.
* Do not replace virt2phys with the default one if it was assignedYauheni Kaliuta2009-10-131-1/+0
| | | | Signed-off-by: Yauheni Kaliuta <y.kaliuta@gmail.com>
* Propagate error from assert, deassert and halt on tcl target object.Øyvind Harboe2009-10-131-5/+9
|
* If halt times out, stop GDB. Allows e.g. manual reset via monitor commands.Øyvind Harboe2009-10-121-2/+37
|