aboutsummaryrefslogtreecommitdiff
path: root/src/target/etb.c
AgeCommit message (Collapse)AuthorFilesLines
2019-05-14helper/command: change prototype of command_print/command_print_samelineAntonio Borneo1-7/+7
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should switch to CMD as first parameter. Change prototype of command_print() and command_print_sameline() to pass CMD instead of CMD_CTX. Since the first parameter is currently not used, the change can be done though scripts without manual coding. This patch is created using the command: sed -i PATTERN $(find src/ doc/ -type f) with all the following patters: 's/\(command_print(cmd\)->ctx,/\1,/' 's/\(command_print(CMD\)_CTX,/\1,/' 's/\(command_print(struct command_\)context \*context,/\1invocation *cmd,/' 's/\(command_print_sameline(cmd\)->ctx,/\1,/' 's/\(command_print_sameline(CMD\)_CTX,/\1,/' 's/\(command_print_sameline(struct command_\)context \*context,/\1invocation *cmd,/' This change is inspired by http://openocd.zylin.com/1815 from Paul Fertser but is now done through scripting. Change-Id: I3386d8f96cdc477e7a2308dd18269de3bed04385 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/5081 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-07command_registration: add empty usage field to chained commandsAntonio Borneo1-0/+1
Chained command require a subcommand as first argument. The usage field for chained commands is not really important because the "help" command will list all the subcommands with their respective usage. Add a empty usage field on all chained command. The command "jlink config" can be either followed by a subcommand or used alone, so use a dedicated usage string. Change-Id: I43c3f8a766f96a9bdab4e709e3c90713be41fcef Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5017 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-06target/etb: Use 'bool' data typeMarc Schink1-4/+4
Change-Id: I536036b15af10bb1879dbbec84576134fd3dce35 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4966 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2016-05-24Remove FSF address from GPL noticesMarc Schink1-3/+1
Also make GPL notices consistent according to: https://www.gnu.org/licenses/gpl-howto.html Change-Id: I84c9df40a774958a7ed91460c5d931cfab9f45ba Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3488 Tested-by: jenkins Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-01-30Use (uint8_t *) for buf_(set|get)_u(32|64) instead of (void *)Paul Fertser1-1/+1
This helps to uncover incorrect usage when a pointer to uint32_t is passed to those functions which leads to subtle bugs on BE systems. The reason is that it's normally assumed that any uint32_t variable holds its value in host byte order, but using but_set_u32 on it silently does implicit pointer conversion to (void *) and the assumption ends up broken without any indication. Change-Id: I48ffd190583d8aa32ec1fef8f1cdc0b4184e4546 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2467 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-10-06target: constify structuresSpencer Oliver1-1/+1
Change-Id: I875cfab8dec4ade72ed9c9cd7d52baaca182a1ef Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2295 Tested-by: jenkins
2014-01-19target: fix typosSpencer Oliver1-3/+2
Change-Id: Icdb517224e8bcf41a16498088e09955048077d35 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1864 Tested-by: jenkins Reviewed-by: Bill Traynor <btraynor@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-06-05update files to correct FSF addressSpencer Oliver1-1/+1
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1426 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2012-02-06build: cleanup src/target directorySpencer Oliver1-93/+56
Change-Id: Ia055b6d2b5f6449a38afd0539a8c66e7d7e0c059 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/430 Tested-by: jenkins
2011-08-01etb: fix incorrect previous patchsetJie Zhang1-0/+12
This corrects two issues found with openocd. d7f71e7fe9645fa8c3f88cf6fc9ad438aa6708f3 removed some code that was being used. The above then caused even more code to get removed by commit 1cfb2287a67c1f78b76583b2e5ed83ca3560b0d5. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2011-06-07Fix "unused variable" warnings (errors) detected with GCC 4.7.0 - leftover ↵Freddie Chopin1-10/+0
changes
2010-09-20warnings: fix alignment warningsØyvind Harboe1-1/+1
These warnings are for architectures that do not support non-aligned word access. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-21jtag: make out_value constØyvind Harboe1-35/+33
Tightens up the jtag_add_xxx_scan() API Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-19jtag: retire jtag_get/set_end_state()Øyvind Harboe1-3/+0
Voila! This get rids of mysteries about what what state the TAP is in. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-19jtag: remove unecessary usage of jtag_get_end_state().Øyvind Harboe1-2/+2
By code inspection. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-18jtag: cut down on usage of unintended modification of global end stateØyvind Harboe1-4/+4
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>
2010-03-08jtag: jtag_add_ir_scan() now takes a single fieldØyvind Harboe1-1/+1
In the code a single field was all that was ever used. Makes jtag_add_ir_scan() simpler and leaves more complicated stuff to jtag_add_plain_ir_scan(). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-08jtag: retire tap fieldØyvind Harboe1-17/+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>
2010-01-07ARM ETM/ETB/trace: help/usage updatesDavid Brownell1-4/+8
Provide helptext which was sometimes missing; update some of it to be more accurate. Usage syntax messages have the same EBNF as the User's Guide; no angle brackets in either place. Don't use "&function"; functions are like arrays, their address is their name. Shrink some overlong lines, remove some empties. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-19ETM: start cleaning up ETM_CTRL bit handlingDavid Brownell1-7/+7
Provide better comments for the ETM_CTRL bits; use the correct bit for half/full clock mode; and define a few more of the bits available from the earliest ETM versions. The new bit defintions use ETM_CTRL_* names to match their register (instead of ETM_PORT_* or ETMV1_*). For clarity, and better matching to docs, they are defined with bitshifting not pre-computed masks. Stop abusing typdefs for ETM_CTRL values; such values are not limited to the enumerated set of individual bit values. Rename etm->portmode to etm->control ... and start morphing it into a single generic shadow of ETM_CTRL. Eventually etm->tracemode should vanish, so we can just write etm->control to ETM_CTRL. Restore an "if" that somehow got dropped. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-19ETM trigger_percent becomes an ETB commandDavid Brownell1-2/+55
This command was misplaced; it's not generic to all traceport drivers, only the ETB supports this kind of configuration. So move it, and update the relevant documentation. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-07ARM: use <target/arm.h> not armv4_5.hDavid Brownell1-1/+1
Move most declarations in <target/armv4_5.h> to <target/arm.h> and update users. What's left in the older file is stuff that I think should be removed ... the old register cache access stuff, which makes it awkward to support microcontroller profile (Cortex-M) cores. The armv4_5_run_algorithm() declaration was moved too, even though it's not yet as generic as it probably ought to be. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-24remove register_commands from etm_capture_driverZachary T Welch1-6/+1
Converts callback to an array of command_registration records. Moves oocd_trace driver definition to end of file to eliminate useless forward declaration.
2009-11-24etb: use register_commands()Zachary T Welch1-8/+20
2009-11-24use COMMAND_REGISTER macroZachary T Welch1-2/+2
Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
2009-11-17command_handler: change 'cmd_ctx' to CMD_CTXZachary T Welch1-2/+2
Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
2009-11-17command_handler: change 'args' to CMD_ARGVZachary T Welch1-5/+5
This patch converts all instances of 'args' in COMMAND_HANDLER routines to use CMD_ARGV macro.
2009-11-17command_handler: change to 'argc' to CMD_ARGCZachary T Welch1-1/+1
This patch converts all instances of 'argc' in COMMAND_HANDLER routines to use CMD_ARGC.
2009-11-17target: simplify register get/set opsDavid Brownell1-7/+6
No need to indirect from registered integers to pointers. Just stash the pointers directly in the register struct, and don't even bother registering. This is a small code shrink, speeds register access just a smidgeon, and gets rid of another rude exit() path. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-16target: less implicit inclusion of "etm.h"David Brownell1-0/+1
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>
2009-11-16rename CEIL as DIV_ROUND_UPZachary T Welch1-2/+2
Improves the name of this macro, moves it to types.h, and adds a block of Doxygen comments to describe what it does.
2009-11-16target: no implicit #includes of "register.h"David Brownell1-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>
2009-11-13target: remove unused "bitfield" infrastructureDavid Brownell1-2/+0
We have too many different registers, and too many version and context dependent interpretations, for this type of bitfield management to be scalable. (Anyone who really wants bitfield interpretation *can* do that in Tcl code...) There are ... quite a few copies of the same ARM dummy registers. There should eventually be one copy; this many is craziness. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13command_t -> struct commandZachary T Welch1-1/+1
Remove misleading typedef and redundant suffix from struct command.
2009-11-13command_context_t -> struct command_contextZachary T Welch1-1/+1
Remove misleading typedef and redundant suffix from struct command_context.
2009-11-13target_t -> struct targetZachary T Welch1-1/+1
Remove misleading typedef and redundant suffix from struct target.
2009-11-13reg_t -> struct regZachary T Welch1-15/+15
Remove misleading typedef and redundant suffix from struct reg.
2009-11-13etm_context_t -> struct etm_contextZachary T Welch1-5/+5
Remove misleading typedef and redundant suffix from struct etm_context.
2009-11-13etb_t -> struct etbZachary T Welch1-10/+10
Remove misleading typedef and redundant suffix from struct etb.
2009-11-13reg_cache_t -> struct reg_cacheZachary T Welch1-2/+2
Remove misleading typedef and redundant suffix from struct reg_cache.
2009-11-13etmv1_trace_data_t -> struct etmv1_trace_dataZachary T Welch1-1/+1
Remove misleading typedef and redundant suffix from struct etmv1_trace_data.
2009-11-13etm_capture_driver_t -> struct etm_capture_driverZachary T Welch1-1/+1
Remove misleading typedef and redundant suffix from struct etm_capture_driver.
2009-11-13etb_reg_t -> struct etb_regZachary T Welch1-4/+4
Remove misleading typedef and redundant suffix from struct etb_reg.
2009-11-13scan_field_t -> struct scan_fieldZachary T Welch1-5/+5
Remove useless structure typedef.
2009-11-13jtag_tap_t -> struct jtag_tapZachary T Welch1-2/+2
Search and destroy the jtag_tap_t typedef. This also cleans up a layering violation, removing the declaration from types.h.
2009-11-13use COMMAND_HANDLER macro to define all commandsZachary T Welch1-1/+1
2009-11-11ETM: remove old mid-level ETM handleDavid Brownell1-1/+1
Now that nothing uses the old ETM handle any more, remove it. Add minimal header tweaks, letting non-ARM7 and non-ARM9 cores access ETM facilities. Now ARM11 could support standard ETM (and ETB) access as soon as it derives from "struct arm" ... its scanchain 6 is used access the ETM, just like ARM7 and ARM9. The Cortex parts (both M3 and A8) will need modified access methods (via ETM init parameters), so they use the DAP. Our first A8 target (OMAP3) needs that for both ETM and ETB, but the M3 ETM isn't very useful without SWO trace support (it's painfully stripped down), so that support won't be worth adding for a while. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-11ETM: update port driversDavid Brownell1-6/+6
Make both useful ETM port drivers (etb, etm_dummy) use the new toplevel ETM handle, instead of the to-be-removed lower level one. Do the same for the "oocd-trace" prototype too; and fix its error reporting paths: return failure codes, don't exit(), etc Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-11remove more useless declarationsZachary T Welch1-13/+12
Removes forward declarations by moving command registration after defintion of the command handlers.
2009-10-02Minor ETB and ETM bugfixes and doc updatesdbrownell1-47/+46
- ETB * report _actual_ hardware status, not just expected status * add a missing diagnostic on a potential ETB setup error * prefix any diagnostics with "ETB" - ETM * make "etm status" show ETM hardware status too, instead of just traceport status (which previously was fake, sigh) - Docs * flesh out "etm tracemode" docs a bit * clarify "etm status" ... previously it was traceport status * explain "etm trigger_percent" as a *traceport* option ETM+ETB tracing still isn't behaving, but now I can see that part of the reason is that the ETB turns itself off almost immediately after being enabled, and before collecting any data. git-svn-id: svn://svn.berlios.de/openocd/trunk@2790 b42882b7-edfa-0310-969c-e2dbd0fdcd60