summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* xscale: fix analyze_trace for trace data collected in wrap modeMike Dunn2010-04-152-216/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the xscale_analyze_trace() function. This function was defective for a trace collected in 'fill' mode (hiccups with repeated instructions) and completely broken when buffer overflowed in 'wrap' mode. The reason for the latter case is that the checkpoint registers were interpreted incorrectly when two checkpoints are present in the trace (which will be true in 'wrap' mode once the buffer fills). In this case, checkpoint1 register will contain the older entry, and checkpoint0 the newer. The original code assumed the opposite. I eventually gave up trying to understand all the logic of the function, and rewrote it. I think it's much cleaner and understandable now. I have been using and testing this for a few weeks now. I'm confident it hasn't regressed in any way. Also added capability to handle (as best as possible) the case where an instruction can not be read from the loaded trace image; e.g., partial image. This was a 'TODO' comment in the original xscale_analyze_trace(). Outside of xcsale_analyze_trace(), these (related) changes were made: - Remove pc_ok and current_pc elements from struct xscale_trace. These elements and associated logic are useless clutter because the very first entry placed in the trace buffer is always an indirect jump to the address at which execution resumed. This type of trace entry includes the literal address in the trace buffer, so the initial address of the trace is immediately determined from the trace buffer contents and does not need to be recorded when trace is enabled. - Added num_checkpoints to struct xscale_trace_data, which is necessary in order to correctly interpret the checkpoint register contents. - In xscale_read_trace() - Fix potential array out-of-bounds condition. - Eliminate partial address entries when parsing trace (can occur in wrap mode). - Count and record number of checkpoints in trace. - Added small, inlined utility function xscale_display_instruction() to help make the code more concise and clear. TODO: - Save processor state (arm or thumb) in struct xscale_trace when trace is enabled so that trace can be analyzed correctly (currently assumes arm mode). - Add element to struct xscale_trace that records (when trace is enabled) whether vector table is relocated high (to 0xffff0000) or not, so that a branch to an exception vector is traced correctly (curently assumes vectors at 0x0).
* TCL SCRIPTS: fix command nameAntonio Borneo2010-04-153-3/+3
| | | | | | | Some tcl script has underline between the words "flash bank" resulting in 'invalid command name "flash_bank"'. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* cortex-a8: more MMU supportAnton Fedotov2010-04-142-98/+321
| | | | | | | | | | | | | | | | | | | + virt2phys() can now convert virtual address to real + read_memory() and write_memory() are renamed to read_phys_memory() and write_phys_memory() + new read_memory() and write_memory() try to resolve real address if mmu is enambled than perform real address reading/writing + if address is bellow 0xc000000 than TTB0 is used for page table dereference, if above - than TTB1. Linux style of user/kernel address separation + if above fails (i.e address is unspecified) than mode is checked whether it is Supervisor (than TTB1) or User (than TTB0) - Software breakpoints doesn't work. You should invoke "gdb_breakpoint_override hard" before you start debugging + cortex_a8_mmu(), cortex_a8_enable_mmu_caches(), cortex_a8_disable_mmu_caches() are implemented Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* TARGET/ARM7_9_COMMON: review scope of symbolsAntonio Borneo2010-04-112-17/+14
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NOR/TMS470: review scope of symbolsAntonio Borneo2010-04-111-7/+7
| | | | | | Add "static" qualifier to private functions and data. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* TARGET/MIPS32: review scope of functionsAntonio Borneo2010-04-112-11/+9
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* TARGET/MIPS32_PRACC: review scope of functionsAntonio Borneo2010-04-112-26/+26
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* TARGET/MIPS32_DMAACC: review scope of functionsAntonio Borneo2010-04-112-20/+19
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* HELPER/LOG: review unused symbolsAntonio Borneo2010-04-102-46/+0
| | | | | | | | | Remove unused functions: - log_catch - log_rethrow - log_try Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* TARGET/MIPS_EJTAG: review scope of functionsAntonio Borneo2010-04-102-4/+4
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NOR/CFI: review scope of functionsAntonio Borneo2010-04-101-3/+3
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* TARGET/DSP563XX_ONCE: review scope of functionsAntonio Borneo2010-04-102-8/+2
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* OPENOCD: review scope of functionsAntonio Borneo2010-04-101-1/+1
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* JTAG/COMMANDS: review scope of functionsAntonio Borneo2010-04-102-2/+1
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* BINARYBUFFER: review scope of data and functionsAntonio Borneo2010-04-101-2/+2
| | | | | | Add "static" qualifier to private data and functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NOR/STR7X: review scope of dataAntonio Borneo2010-04-101-2/+2
| | | | | | Add "static" qualifier to private data. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NAND/TCL: review scope of functionsAntonio Borneo2010-04-102-3/+4
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* MFLASH: review scope of functionsAntonio Borneo2010-04-102-2/+1
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NAND/ARM_IO: review scope of functionsAntonio Borneo2010-04-101-1/+1
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NAND/CORE: review scope of functionsAntonio Borneo2010-04-102-10/+8
| | | | | | | Add "static" qualifier to private functions. Move function's comment from core.h to core.c. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NAND/MX3: review scope of dataAntonio Borneo2010-04-101-1/+1
| | | | | | Add "static" qualifier to private data. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NOR/ADUC702X: review scope of dataAntonio Borneo2010-04-101-1/+1
| | | | | | Add "static" qualifier to private data. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NOR/AVRF: review scope of dataAntonio Borneo2010-04-101-1/+1
| | | | | | Add "static" qualifier to private data. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NOR/CORE: review scope of dataAntonio Borneo2010-04-101-1/+1
| | | | | | Add "static" qualifier to private data. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NOR/DRIVERS: review scope of functionsAntonio Borneo2010-04-102-4/+1
| | | | | | | Add "static" qualifier to private functions. Remove unused "extern" in src/ecosboard.c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* STR9XPEC: review scope of functionsAntonio Borneo2010-04-101-1/+1
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* TCL: review scope of functionsAntonio Borneo2010-04-102-3/+1
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* TIME_SUPPORT: review unused symbolsAntonio Borneo2010-04-102-8/+0
| | | | | | | Remove unused functions: - timeval_add Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* HELLO: review unused symbolsAntonio Borneo2010-04-102-9/+0
| | | | | | | Remove unused functions: - hello_register_commands Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* PLD: review scope of functionsAntonio Borneo2010-04-102-3/+2
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* ADI_V5_JTAG: review scope of dataAntonio Borneo2010-04-101-1/+1
| | | | | | Add "static" qualifier to private data. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* ARM920T: review scope of functionsAntonio Borneo2010-04-101-1/+1
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* ARM_JTAG: review scope of functionsAntonio Borneo2010-04-101-1/+1
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* ARM_SIMULATOR: review scope of functionsAntonio Borneo2010-04-102-5/+1
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* ARMV4_5_MMU: review unused symbolsAntonio Borneo2010-04-101-7/+0
| | | | | | | | | Remove unused data: - armv4_5_mmu_page_type_names Remove prototype of not existing function: - armv4mmu_translate_va Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* ARMV4_5: review scope of dataAntonio Borneo2010-04-102-3/+1
| | | | | | Add "static" qualifier to private data. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* EMBEDDEDICE: review scope of functionsAntonio Borneo2010-04-102-2/+3
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* TARGET: review unused symbolsAntonio Borneo2010-04-102-17/+0
| | | | | | | Remove unused functions: - target_all_handle_event Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* TARGET: review scope of functionsAntonio Borneo2010-04-103-30/+15
| | | | | | | Add "static" qualifier to private functions. Remove unused "extern" in src/ecosboard.c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* ARMv7M: review scope of functionsAntonio Borneo2010-04-101-1/+1
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* Restore deleted '!' characterDavid Brownell2010-04-041-1/+1
| | | | | | | | I'm not sure what caused this significant character to get deleted. it may be related to intermittent Editor or terminal flakes I've been seeing lately (sigh). This fix is trivial. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target: are we running algorithm code?David Brownell2010-04-042-1/+16
| | | | | | | | | | | | | | | | | | | | | | Fixing one bug can easily uncover another .... in this case, making sure that we properly invalidate some cached NOR state when resuming arbitrary target code turned up an issue when the code wasn't quite arbitrary (and we couldn't know that, but some parts of OpenOCD assumed the cache would not be invalidated. Specifically: some flash drivers (like CFI) update that state in loops with downloaded algorithms, thus invalidating the state as it's probed. + Add a new target state flag, to record whether the target is running downloaded algorithm code. + Use that flag to add a special case: "trust" downloaded algorithms not to corrupt that cached state, bypassing cache invalidation. Also update some of the documentation to stipulate that this flavor of trustworthiness is now *required* ... not just a fortuitous acident. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* 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>