summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* simplify and unconfuse target_run_algorithm()David Brownell2010-04-042-19/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason there are *two* schemes for interposing logic into the run_algorithm() code path... One is a standard procedural wapper around the target method invocation. the other (superfluous) one hacked the method table by splicing a second procedural wrapper into the method table. Remove it: * Rename its slightly-more-featureful wrapper so it becomes the standard procedural wrapper, leaving its added logic (where it should have been in the first place. Also add a paranoia check, to report targets that don't support algorithms without traversing a NULL pointer, and tweak its code structure a bit so it's easier to modify. * Get rid of the superfluous/conusing method table hacks. This is a net simplification, making it simpler to analyse what's going on, and then interpose logic . ... by ensuring there's only one natural place for it to live. ------------ Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* buildfixDavid Brownell2010-04-031-1/+2
| | | | | | | | | | Without this, a system using gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu4) aborts builds after reporting: tcl.c: In function ‘handle_irscan_command’: tcl.c:1168: warning: passing argument 1 of ‘buf_set_u32’ discards qualifiers from pointer target type Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* xscale: fix trace buffer functionality when resuming from a breakpointMike Dunn2010-03-291-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: halt at a breakpoint, enable trace buffer ('xscale trace_buffer enable fill'), then resume. Wait for debug exception when trace buffer fills (if not sooner due to another breakpoint, vector catch, etc). Instead, never halts. When halted explicitly from OpenOCD and trace buffer dumped, it contains only one entry; a branch to the address of the original breakpoint. If the above steps are repeated, except that the breakpoint is removed before resuming, the trace buffer fills and the debug exception is generated, as expected. Cause: related to how a breakpoint is stepped over on resume. The breakpoint is temporarily removed, and a hardware breakpoint is set on the next instruction that will execute. xscale_debug_entry() is called when that breakpoint hits. This function checks if the trace buffer is enabled, and if so reads the trace buffer from the target and then disables the trace (unless multiple trace buffers are specified by the user when trace is enabled). Thus you only trace one instruction before it is disabled. Solution: kind of a hack on top of a hack, but it's simple. Anything better would involve some refactoring. This has been tested and trace now works as intended, except that the very first instruction is not part of the trace when resuming from a breakpoint. TODO: still many issues with trace: doesn't work during single-stepping (trace buffer is flushed each step), 'xscale analyze_trace' works only marginally for a trace captured in 'fill' mode, and not at all for a trace captured in 'wrap' mode. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag/tcl.c cleanup -- split out "adapter.c"David Brownell2010-03-276-434/+471
| | | | | | | | | | | | Clean up the jtag/tcl.c file, which was one of the biggest and messiest ones in that directory. Do it by splitting out all the generic adapter commands to a separate "adapter.c" file (leaving the "tcl.c" file holding only JTAG utilities). Also rename the little-used "jtag interface" to "adapter_name", which should have been at least re-categorized earlier (it's not jtag-only). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* NOR TCL: fix usage messageAntonio Borneo2010-03-261-1/+1
| | | | | | | | The command "flash bank" has updated syntax. Add the mandatory parameter <target> to the usage message that prints in case of error. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* TCL scripts: update to current "flash bank" syntaxAntonio Borneo2010-03-2612-20/+24
| | | | | | | | | | | | | | While "flash bank" syntax has been changed long ago, several tcl script are still not fully update. Fix following cases related with "cfi" driver: - syntax error: the mandatory <name> parameter is missing - warning: the <target> parameter is a number, instead of the target name - the comment line above the command does not report actual syntax Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* zy1000: dev toolØyvind Harboe2010-03-252-27/+340
| | | | | | | | | first cut peek/poke over tcp/ip, used for debug/research purposes only. Long term JTAG over TCP/IP might be an offshoot. The performance is usable for development/testing purposes. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* target: fix poll offØyvind Harboe2010-03-251-0/+6
| | | | | | | | | | | I don't know when "poll off" broke, but "poll off" didn't stop background polling of target. The polling status flag simply wasn't checked in the handle_target timer callback. All target polling(including power/reset state) is now stopped upon "poll off". Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* change %x and %d to PRIx32 and PRId32 where needed for cygwinDaniel Bäder2010-03-254-7/+7
|
* zy1000: allow it to build on linux host for testing purposesØyvind Harboe2010-03-252-27/+45
| | | | | | | For testing and checking the build this can be useful, it doesn't have any practical application outside development. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* telnet_server: review unused symbolsAntonio Borneo2010-03-251-12/+0
| | | | | | Remove unused function Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* telnet_server: review scope of functionsAntonio Borneo2010-03-251-9/+11
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* FT2232 Messaaging fixDavid Brownell2010-03-241-1/+1
| | | | | | | The init cleanup patch overlooked a message which was wrongly specific to the "usbjtag" layout. Fix. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* server: review unused symbolsAntonio Borneo2010-03-241-28/+0
| | | | | | Remove unused function Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* server: review scope of functions and dataAntonio Borneo2010-03-241-4/+4
| | | | | | Add "static" qualifier to private functions and data. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* zy1000: fix optimisaion bug in dcc writesØyvind Harboe2010-03-221-8/+2
| | | | | | Introduced & corrected since 0.4. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* fix software breakpoints on xscaleMike Dunn2010-03-221-2/+12
| | | | | | | | | | | | | | | | | | | | | | This patch fixes xscale software breakpoints by cleaning the dcache and invalidating the icache after the bkpt instruction is inserted or removed. The icache operation is necessary in order to flush the fetch buffers, even if the icache is disabled (see section 4.2.7 of the xscale core developer's manual). The dcache is presumed to be enabled; no harm done if not. The dcache is also invalidated after cleaning in order to safeguard against a future load of invalid data, in the event that cache_clean_address points to memory that is valid and in use. Also corrected a confusing typo I noticed in a comment. TODO (or not TODO...?): the xscale's 2K "mini dcache" is not cleaned. This cache is not used unless the 'X' bit in the page table entry is set. This is a proprietary xscale extension to the ARM architecture. If a target's OS or executive makes use of this for memory regions holding code, the breakpoint problem will persist. Flushing the mini dcache requires that 2K of valid cacheable memory (mapped with 'X' bit set) be designated by the user for this purpose. The debug handler that gets downloaded to the target will also need to be extended.
* bitq: fix warning now that out_value is constØyvind Harboe2010-03-221-1/+1
| | | | | | | This was an easy one. Just add the missing "const" to a local variable definition. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ft2232 init mess cleanupDavid Brownell2010-03-211-60/+99
| | | | | | | | | | | | | | | | | | | | | | In the ft2232 driver, initialization for many layouts punts to a routine called usbjtag_init(), instead of a routine specific to each layout. That routine is a mess built around a "what type layout am I" core. That's a bad design ... in this case, especially so, since it bypasses the layout-specific dispatch which was just done, and obfuscates the initialization which is at least somewhat generic, instead of being specific to the "usbjtag" layout. Split and document out the generic parts of usbjtag_init(), and make the rest of those layouts have layout-specific init methods. Also, rename usbjtag_reset() ... that also was not specific to the "usbjtag" layout, and thus contributed to the previous code structure confusion. (Eventually, all layout-specific code (and method tables) should probably live in files specific to each layout. These changes will facilitate those and other cleanups to this driver.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* arm breakpoints: amended fix commentØyvind Harboe2010-03-212-2/+11
| | | | | | | | the handling of caches, should be moved into the breakpoint specific callbacks rather than being plonked into generic memory write fn's. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: make out_value constØyvind Harboe2010-03-215-67/+65
| | | | | | Tightens up the jtag_add_xxx_scan() API Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: move towards making out_value constØyvind Harboe2010-03-205-11/+13
| | | | | | | These were relatively straightforward fixes which are backwards compatible. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* FT2232 comment tweaksDavid Brownell2010-03-191-6/+18
| | | | | | | Note that the FT4232 chips have four channels not two, and Elaborate on uses of the additional channels. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* zy1000: clean up jtag_add_xx_scan fn'sØyvind Harboe2010-03-191-88/+67
| | | | | | | The implementation is now more straightforward as the scan_fields have been greatly simplified over time. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* zy1000: fix bug in end state of DCC writesØyvind Harboe2010-03-191-2/+2
| | | | | | | Introduced in latest commits, found by code inspection & GCC warning. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: retire jtag_get/set_end_state()Øyvind Harboe2010-03-1918-100/+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() usageØyvind Harboe2010-03-191-4/+4
| | | | | | | Code inspection indicated what constant end states to use. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: get rid of unecessary jtag_get_end_state()Øyvind Harboe2010-03-191-12/+21
| | | | | | By code inspection. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: remove unecessary usage of jtag_get_end_state().Øyvind Harboe2010-03-191-2/+2
| | | | | | By code inspection. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: remove jtag_get_end_state()'s that should be unecessaryØyvind Harboe2010-03-195-6/+6
| | | | | | | | 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>
* Fix underlying problem with xscale icache and dcache commandsMike Dunn2010-03-181-6/+11
| | | | | | | | | | | | | | | | | | | | Fix problem with the xscale icache and dcache commands. Both commands were enabling or disabling the mmu, not the caches I didn't look any further after my earlier patch fixed the trivial problem with command argument parsing. Turns out the underlying code was broken. The resolution is straightforward when you look at the arguments to xscale_enable_mmu_caches() and xscale_disable_mmu_caches(). I finally took a deeper look after dumping the cp15 control register (XSCALE_CTRL) and seeing that the cache bits weren't changing, but the mmu bit was (which caused all manner of grief, as you can imagine). This has been tested and works OK now. src/target/xscale.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ADI_v5 - it's not always an "SWJ-DP"David Brownell2010-03-182-175/+175
| | | | | | | So don't use the name "swjdp" for all DAPs; rename to plain old "dap", which *is* always correct. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Merge branch 'master' of ↵David Brownell2010-03-1813-73/+74
|\ | | | | | | ssh://dbrownell@openocd.git.sourceforge.net/gitroot/openocd/openocd
| * jtag: retire one instance of jtag_get_end_state() usageØyvind Harboe2010-03-1813-73/+74
| | | | | | | | | | | | Less global variables.... Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* | remove more duplicationDavid Brownell2010-03-181-25/+0
|/ | | | | | | | Not sure how the original "move code to adi_v5_swd.c" patch left some code in the "arm_adi_v5.c" file, but a recent patch was only a partial fix -- it didn't remove all the duplication. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* oops: committed and pushed two temp files....Øyvind Harboe2010-03-182-3962/+0
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* DOCS: update flash bank examplesSpencer Oliver2010-03-181-21/+21
| | | | | | - include the $_FLASHNAME in all flash bank examples. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* PIC32MX: add unlock cmdSpencer Oliver2010-03-183-2/+83
| | | | | | | 'unlock' performs a full unlock/erase of the device, removing any code protection. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* MIPS: remove unused arg from mips_ejtag_set_instrSpencer Oliver2010-03-185-51/+51
| | | | | | This arg was never used and was just taken from the arm jtag code. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* jtag: cut down on usage of unintended modification of global end stateØyvind Harboe2010-03-1824-99/+4062
| | | | | | | | | | | | | 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>
* linker error: fix problem with duplicate fnØyvind Harboe2010-03-181-33/+0
| | | | | | | | | | | A fn was copied instead of moved to a new file. The linker can discard exact copies of fn's without warning. This is a C++'ism. However on my Ubuntu 9.10 machine, it fails. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* mips: fix warningØyvind Harboe2010-03-171-1/+1
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* gdb: long running "monitor mww" now works w/gdbØyvind Harboe2010-03-171-0/+2
| | | | | | | invoke keep_alive() to make sure that the default 2000ms timeout does not trigger. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* target: faster mww operationsØyvind Harboe2010-03-171-38/+77
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* target: mdX/mwX on target were badly brokenØyvind Harboe2010-03-171-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - incorrect parsing of arguments - mdX didn't display arguments correctly I don't think anyone ever used that code path :-) Did you know that "target mdw" and mdw are very different? for {set i 0} {$i < 256} {set i [expr $i+1]} {mwb [expr 0x2000000+$i] $i} mdw 0x2000000 0x10 0x02000000: 03020100 07060504 0b0a0908 0f0e0d0c 13121110 17161514 1b1a1918 1f1e1d1c 0x02000020: 23222120 27262524 2b2a2928 2f2e2d2c 33323130 37363534 3b3a3938 3f3e3d3c > zy1000.cpu mdb 0x2000000 0x20 0x02000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ................ 0x02000010 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f ................ > zy1000.cpu mdh 0x2000000 0x20 0x02000000 0100 0302 0504 0706 0908 0b0a 0d0c 0f0e ................ 0x02000010 1110 1312 1514 1716 1918 1b1a 1d1c 1f1e ................ 0x02000020 2120 2322 2524 2726 2928 2b2a 2d2c 2f2e !"#$%&'()*+,-./ 0x02000030 3130 3332 3534 3736 3938 3b3a 3d3c 3f3e 0123456789:;<=>? > zy1000.cpu mdw 0x2000000 0x20 0x02000000 03020100 07060504 0b0a0908 0f0e0d0c ................ 0x02000010 13121110 17161514 1b1a1918 1f1e1d1c ................ 0x02000020 23222120 27262524 2b2a2928 2f2e2d2c !"#$%&'()*+,-./ 0x02000030 33323130 37363534 3b3a3938 3f3e3d3c 0123456789:;<=>? 0x02000040 43424140 47464544 4b4a4948 4f4e4d4c @ABCDEFGHIJKLMNO 0x02000050 53525150 57565554 5b5a5958 5f5e5d5c PQRSTUVWXYZ[\]^_ 0x02000060 63626160 67666564 6b6a6968 6f6e6d6c `abcdefghijklmno 0x02000070 73727170 77767574 7b7a7978 7f7e7d7c pqrstuvwxyz{|}~. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* SCRIPT: add add_script_search_dir cmdSpencer Oliver2010-03-173-1/+31
| | | | | | | Add a add_script_search_dir cmd so that adding search dir's can be added to cfg scripts. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* PIC32: add software reset supportSpencer Oliver2010-03-174-3/+61
| | | | | | | | | The PIC32MX does not support the ejtag software reset - it is optional in the ejtag spec. We perform the equivalent using the microchip specific MTAP cmd's. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* MIPS: remove ejtag_srst variantSpencer Oliver2010-03-173-25/+17
| | | | | | | | | | | The mips_m4k_assert_reset has now been restructured so the variant ejtag_srst is not required anymore. The ejtag software reset will be used if the target does not have srst connected. Remove ejtag_srst from docs. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* gdb_server: improved gdb load performanceØyvind Harboe2010-03-171-8/+37
| | | | | | | | | | | by ack'ing memory writes immediately and reporting either at next memory write or stepi/continue time. GDB will then send off a new packet that is ready by the time the previous packet has been written to target memory. On faster adapters this can be as much as 10% improvement. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* zy1000: tweak the DCC inner loop a tiny bitØyvind Harboe2010-03-171-5/+8
| | | | | | Uses FIFO a bit more efficiently now. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>