summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* ARM11: per-core options should not be globalDavid Brownell2010-02-212-33/+44
| | | | | | | | | | Address some FIXME comments by getting rid of globals, moving per-core parameters in the existing per-core data structure. This will matter most whenever there are multiple ARM11 cores, e.g. ARM11 MPcore chips, but in general is just cleanup. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARMv7-M: start using "struct arm"David Brownell2010-02-215-9/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | This sets up a few of the core "struct arm" data structures so they can be used with ARMv7-M cores. Specifically, it: - defines new ARM core_modes to match the microcontroller modes (e.g. HANDLER not IRQ, and two types of thread mode); - Establishes a new microcontroller "core_type", which can be used to make sure v7-M (and v6-M) cores are handled right; - adds "struct arm" to "struct armv7m" and arranges for the target_to_armv7m() converter to use it; - sets up the arm.core_cache and arm.cpsr values - makes the Cortex-M3 code maintain arm.map and arm.core_mode. This is currently set up as a parallel data structure, primarily to minimize special cases for the semihosting support with microcontroller profile cores. Later patches can rip out the duplicative ARMv7-M support and start reusing core ARM code. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* arm920t line length cleanupDavid Brownell2010-02-201-115/+247
| | | | | | | | | | | | The recent patch to fixbreakpoints and dcache handling added a bunch of overlong lines (80+ chars) ... shrink them, and do the same to a few lines which were already overlong. Also add a few FIXME comments to nudge (a) replacement of some magic numbers with opcode macros, which will be much better at showing what's actually going on, and (b) correct return codes. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* FreeBSD buildfixDavid Brownell2010-02-201-2/+2
| | | | | | | | | Fix an unused variable warning seen when building the parport driver under FreeBSD. Using information from Xiaofan Chen <xiaofanc@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* atm920t : fix breakpoints and data cache handlingMarc Pignat2010-02-191-17/+103
| | | | | | | | | Breakpoints did not work because the data cache was not flushed properly. As a bonus add capability to write to memory marked as read only by the MMU, which allows software breakpoints in such memory regions.
* ARM920T scanchain 15 comments/cleanupDavid Brownell2010-02-161-51/+112
| | | | | | | | | | | | | | | | | For folk who don't know the ARM920 JTAG interface very well, the two modes of scan chain 15 access to CP15 are confusing. Make those parts of the ARM920 code less opaque, by: - Adding comments referencing the relevant parts of the TRM, catching up to similar updates in the User's Guide. - Replacing magic numbers in physical access clients with symbolic equivalents. No functional change. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* gpl: fix GPL startup messageØyvind Harboe2010-02-152-2/+3
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* fix crash with DSP563XXMathias Kuester2010-02-141-0/+25
| | | | | | | | | | | When a DSP563xx-aware GDB asks OpenOCD for target registers, the result should be a GDB with register data ... not an OpenOCD crash. (Note that mainline GDB doesn't currently support this core, so for now, this requires a GDB with FreeScale patches.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* STR9xpec: issue warning when unlocking deviceSpencer Oliver2010-02-121-0/+8
| | | | | | | Issue warning to user when unlocking or writing the option bytes. The new settings will not take effect until a target reset. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* STM32x: issue warning when unlocking device (bug #16)Spencer Oliver2010-02-121-2/+6
| | | | | | | Issue warning to user when unlocking or writing the option bytes. The new settings will not take effect until a target reset. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* arm720t: virt2phys callback addedØyvind Harboe2010-02-121-4/+14
| | | | | | | | This is a copy and paste of arm926ejs. Not tested, but ready for testing at least. There is a good chance that it will work if the generic armv4_5 fn's are robust enough... Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm920: add virt2phys fnMarc Pignat2010-02-121-3/+13
| | | | | | | Copy of the 926ejs function. I have tested it only using my rtems application (where virtual address mapping == physical). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm11: fix another infinite loop bugØyvind Harboe2010-02-101-4/+23
| | | | | | | | | | | | | reset init would get stuck in an infinite loop when e.g. khz was too high. Added timeout. This is a copy of paste of a number of such bugfixes in the arm11 code. Arm11 code reviewed for further such infinite loop bugs and I couldn't find any more. Xing fingers it's the last one... Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* target: add todo in target_write_memory() about alignmentØyvind Harboe2010-02-091-2/+13
| | | | | | | target_write_buffer() does not align "buffer" in host memory passed to target_write_memory(). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ADIv5: doxygenDavid Brownell2010-02-062-32/+138
| | | | | | | | | | | | | | | | | Provide doxygen for many of the public ADIv5 interfaces (i.e. the ones called from Cortex core support code). Add FIXMEs (and a TODO) to help resolve implementation issues which became more apparent when trying to document this code: - Error-prone context-sensitivity (queued/nonqueued) in many procedures. - Procedures that lie by ignoring errors and wrongly claiming success. Also, there was no point in a return from dap_ap_select(); it can't fail, and no caller checks its return status. Clean that up, make it void. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* zy1000: complete zy1000_uart to jim command switchØyvind Harboe2010-02-051-6/+6
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ARMv7-M: make DAP commands verify target is an ARMv7-MDavid Brownell2010-02-042-3/+31
| | | | | | | | Init the ARMv7-M magic number. Define predicate verifying it. Use it to resolve a lurking bug/FIXME: make sure the ARMv7-M specific DAP ops reject non-ARMv7-M targets. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* JLink: reference protocol documentationDavid Brownell2010-02-041-0/+4
| | | | | | | Segger publishes some documentation on this protocol; reference it, so future maintainers can know it exists. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* CMD: duplicate cmd error msgSpencer Oliver2010-02-041-1/+4
| | | | | | | | | When registering cmds we report duplicate attempts to register a cmd as a LOG_ERROR. Some situations need this, such as when registering dual flash banks. http://www.mail-archive.com/openocd-development@lists.berlios.de/msg11152.html Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* JTAG: fix bug when no interface connectedSpencer Oliver2010-02-031-0/+7
| | | | | | - fix coredump when OpenOCD is started without a jtag interface connected. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* flash/str7x: After reset init the flash is unlockedEdgar Grimberg2010-02-021-2/+14
| | | | | | | | | | | | | | The default state of the STR7 flash after a reset init is unlocked. The information in the flash driver now reflects this. The information about the lock status cannot be read from the flash chip, so the user is informed that flash info might not contain accurate information. [dbrownell@users.sourceforge.net: line length shrinkage] Signed-off-by: Edgar Grimberg <edgar.grimberg@zylin.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM semihosting: fix EOF handling with SYS_READNicolas Pitre2010-02-021-1/+1
| | | | | | | | The semihosting interface has a strange convention for read/write where the unused amount of buffer must be returned. We failed to return the total buffer size when the local read() call returned 0. Signed-off-by: Nicolas Pitre <nico@marvell.com>
* gdb: restore behavior from 0.3.1 for srst_asserted and power_restoreØyvind Harboe2010-02-012-15/+46
| | | | | | | | srst_asserted and power_restore can now be overriden to do nothing. By default they will "reset init" the targets and halt gdb. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ADIv5: more messaging cleanup, docsDavid Brownell2010-01-311-12/+20
| | | | | | | | | When the TAR cache was explicitly invalidated, don't bother printing it; the actual hardware status is more informative. Provide some doxygen for the MEM-AP setup routine. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* build: fix problems with "struct stat" not being defined under eCosØyvind Harboe2010-01-311-0/+1
| | | | | | | Include <sys/stat.h> according to http://www.opengroup.org/onlinepubs/000095399/functions/stat.html Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* telnet: fix strage blank spaces at beginning of telnet linesØyvind Harboe2010-01-311-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Sometimes we saw two strange blank spaces at the beginning of the telnet lines. progress ogress > This patch fixes this problem: progress progress > The code changes are *reasonably* clean, but perhaps it could be made a bit more elegant, but I didn't want to change things after I finished diagnosis/testing & submitting the patch. The problem was that logging can send the text and the newline separately in two different requests and the telnet code would incorrectly remove the prompt from the end of a line. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* Subject: ADIv5: fix more diagnosticsDavid Brownell2010-01-311-9/+16
| | | | | | | | | | | If the MEM-AP cache is invalid, don't display it; just report that invalidity as an error. (This bug has been observed with "mdw 0 32" after just a "reset halt". Some code is being wrongly bypassed...) If it's valid, display that cache at DEBUG level, not ERROR. Also, don't assume it's an AHB-AP; it could be another flavor of MEM-AP. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ADIv5 error checking for Tcl commandsDavid Brownell2010-01-301-1/+17
| | | | | | | | | Reject invalid AP numbers (256+) as Tcl operation parameters. Shrink one of the overlong lines. Add my copyright to the ADIv5 code (multiple contributions). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM ADIv5: fix diagnostics for block writesDavid Brownell2010-01-301-5/+14
| | | | | | They were reporting "read" errors, not "write" errors. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ADIv5: cleanup, rename swjdp_transaction_endcheck()David Brownell2010-01-293-34/+43
| | | | | | | | | | | | | | | | Make messages reference "DAP" if they're actually transport-agnostic, or "JTAG-DP" when they're JTAG-specific. Saying SWJ-DP is often wrong (on most Cortex-A8 chips) and is confusing even if correct (since we don't yet support SWD). Rename a JTAG-specific routine to jtagdp_transaction_endcheck() to highlight that it's JTAG-specific, and that identify DAP clients undesirably depending on JTAG. (They will all need to change for SWD support.) Shrink a few overlong lines of code. Copy a comment from code removed in a previous patch (for the ARMv7-M "dap baseaddr" command). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARMv7-M: use command handler for "dap baseaddr".David Brownell2010-01-291-30/+1
| | | | | | | | | | Make the ARMv7-M DAP code reuse the command handler for "dap baseaddr". For some reason, this DAP command wasn't converted earlier. This is a code shrink and simplification; it also removes a needless transport dependency on JTAG. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* NOR: cleanup driver declsDavid Brownell2010-01-2918-202/+200
| | | | | | Fix goofy struct indents. Function names *are* their addresses. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Clang buildfixesAlex Austin2010-01-292-1/+11
| | | | | | | | | Building with clang took a few very small changes. The change to helper/log.h is because clang doesn't like an expression where the result is unused. In helper/system.h, I just defined true and false since clang doesn't have them builtin. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM: reference DPM defn from v6/v7 arch specDavid Brownell2010-01-281-0/+6
| | | | | | | | The term "DPM" is probably not well known ("Device Power Management"?), so identify its source in the current ARM architecture specification. It's relevant to ARMv6, ARMv7-A, and ARMv7-R ... but not "M" profiles. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM semihosting: win32 and cygwin fixesSpencer Oliver2010-01-282-16/+32
| | | | | | | | | | | | Cygwin would fail to reopen a previously written file if the mode is not given. Simplified converting the open flags and made sure the win32 O_BINARY bit is set. Added define for systems that do not support O_BINARY. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* ARM semihosting: fix writing to stdoutSpencer Oliver2010-01-282-8/+6
| | | | | | | | SYS_FLEN would be called before a write on a descriptor to check its size. Currently lseek would fail with -1 when given the stdout/stderr descriptor. Changing to use fstat seems to be the standard way of handling this. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* Cortex-M3: report lockup, and recoverDavid Brownell2010-01-271-0/+15
| | | | | | | | | | | | ARMv7-M defines a "lockup" state that's entered in certain double fault sequences which can't be recovered from without external help. OpenOCD has previously ignored this. Issue a diagnostic saying the chip has locked up, and force exit from this state by halting the core. It's not clear this is the best way to handle lockup; but there should now be less confusion. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM ADIv5: messaging tweaksDavid Brownell2010-01-271-2/+5
| | | | | | | Add space missing after the invalid ACK value. On init, say which AP is being used, and don't assume it's an AHP-AP. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-A8: debug messaging tweaksDavid Brownell2010-01-271-5/+6
| | | | | | | Make that "TODO" message say what needs to be done. Say what part of examining failed. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* cygwin buildfixDavid Brownell2010-01-261-2/+2
| | | | | | | isspace() parameter must be an integer, else a 'char' gets used as an array index (sigh). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* SVF: all content between parentheses is one parametersimon qian2010-01-251-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | | More SVF fixes: * Treat all content between parentheses as part of the same parameter; don't (wrongly) treat whitespace as a delimiter. * Use isspace() to catch that whitespace; it's not all single spaces, newlines etc are also valid. * When parsing bitstrings, strip leading whitespace too. So for example, these are equivalent and should (now) be OK: "TDI( 1234 )" "TDI( 1 2 3 4 )" "TDI(00 12 34 )" "TDI( 00 12 34)" [dbrownell@users.sourceforge.net: comment updates; trivial cleanup] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* core arm11: Silence logs at level 3 if there is no activityEdgar Grimberg2010-01-252-5/+7
| | | | | | | | If the target and openocd are idling, the log should normally be silent at level 3. (Given no verbose logging options.) Signed-off-by: Edgar Grimberg <edgar.grimberg@zylin.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* SVF: insert space before '(' and after ')'simon qian2010-01-231-7/+29
| | | | | | | | | | | | | See http://forum.sparkfun.com/viewtopic.php?p=90983#90983 for discussion; basically, the SVF parser wrongly expects "TDI (123)" but the space is optional and it should accept "TDI(123)" too. In the same way, "TDI(123)TDO(456)" should work too. Rather than update the command parsing, this just makes sure the expected spaces are present. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* EmbeddedICE - fix Feroceon/Dragonite messageDavid Brownell2010-01-221-2/+9
| | | | | | | The breakpoint/watchpoint message was wrong for Feroceon and Dragonite, which have only one working watchpoint unit. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM11: fix breakpoints with GDBDavid Brownell2010-01-221-9/+15
| | | | | | | | | | | This fixes a bug whereby GDB's breakpoints weren't activated. The root cause is a confused interface to resume(). Fix by almost ignoring the "handle breakpoints" parameter; it only seems related to the case of skipping breakpoint-at-PC. Update a few coments to clarify what's happening. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Various doc/comment updatesDavid Brownell2010-01-211-0/+1
| | | | | | | | Doxygen: don't be needlessly verbose; alphabetically sort members TODO: add random bits; clarify which manuals are referenced ARM disassembler: mention a few opcodes that still aren't handled Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ADIv5 header cleanup (+ #defines)David Brownell2010-01-211-7/+27
| | | | | | | | | | Update the comments about DP registers and some of the bitfields. Remove inappropriate (and unused) DP_ZERO declaration. Add some (currently unused) #defines needed for SWD protocol support, based on previous patches from Andreas Fritiofson and Simon Qian. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target: print reason why GDB haltsØyvind Harboe2010-01-211-0/+10
| | | | | | | | | | | If GDB halts unexpectedly, print reason: srst assert or power out detected. If polling fails, then things are a bit trickier. We do not want to spam telnet or the log with polling failed messages. Leave that case be w/a comment in a code for now. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* target: Fixed format problem for mdhEdgar Grimberg2010-01-211-1/+1
| | | | | | Fixed format problem for mdh. It needs to display 4 chars. Signed-off-by: Edgar Grimberg <edgar.grimberg@zylin.com>
* gdb_server: handle stepi/continue packet while target is running with more graceØyvind Harboe2010-01-211-9/+14
| | | | | | | | | | Rather than issuing a halt and then stepi/resume, just wait for target to halt. Issue a sterner warning via gdb console that any gdb register changes will be ignored in this case. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>