summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* ecos: add missing PRId8 definitionØyvind Harboe2010-01-211-0/+1
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* BUILD: remove cygwin gcc 3.4.4 build warningsSpencer Oliver2010-01-203-4/+4
| | | | Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* gdb_server: correctly report flash sector sizesDavid Brownell2010-01-201-31/+46
| | | | | | | | | | | | | | | Report each region of same-size sectors separately, instead of incorrectly reporting that every sector has the same size. This is a longstanding bug on NOR flash chips with non-uniform sector sizes. It was largely hidden by other bugs in flash handling. When some of those were recently fixed, this one was exposed as a regression on str710. [oyvind.harboe@zylin.com: update the loop to behave on str7 ] Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* arm7/9: add nags upon reset about options to improve performanceØyvind Harboe2010-01-201-0/+10
| | | | | | arm7_9 fast_memory_access and working area nags added. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ARMV7M: handle bkpt instruction on resume/stepSpencer Oliver2010-01-203-2/+63
| | | | | | | | | | Skip over a bkpt instruction if found on resume/step. Only software breakpoints known to OpenOCD are currently handled. So this handles the special case of either a user added bkpt or library added, eg. semi-hosting support. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* gdb_server -- subroutinize memory map logicDavid Brownell2010-01-191-107/+116
| | | | | | | | Put the memory map logic into its own subroutine. This will make it a bit easier to package bugfixes, and simplifies the query packet handling. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* gdb_server -- symbol cleanupDavid Brownell2010-01-192-62/+105
| | | | | | | | Make most methods static; net minor object code shrink. Likewise various data symbols; no net change. Shrink some overlong lines. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* update win32 script search pathAndreas Fritiofson2010-01-191-5/+5
| | | | | | | | | | | | | | | | | The default script search path on Windows is out of date with the current layout (from installation and documentation), which makes the standard script library not be found after a normal ./configure && make && make install under msys/MinGW. The same should hold true for cygwin native builds (not verified). Update search path to ../share/openocd/scripts not ../lib/openocd, relative to the openocd executable. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* NOR: fix diagnosticDavid Brownell2010-01-191-1/+1
| | | | | | | The "NOR: last_addr also needs correction when checking alignment" patch omitted a necessary update to the key diagnostic; fix. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* zy1000: flush jtag buffer before changing speedØyvind Harboe2010-01-191-0/+3
| | | | | | | | | It is conceivable that there could be commands in the queue when a speed change request comes in. Flush the hw queue before changing speed. Not observed, found by inspection. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* zy1000: print out PCB revision upon bootØyvind Harboe2010-01-191-1/+5
| | | | | | Simplify debugging a bit. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* flash: add error messages upon incorrect arguments to flash iterationØyvind Harboe2010-01-191-0/+6
| | | | | | | | According to OpenOCD error handling rules the error is logged at where it occurs(same site where an exception would have been thrown). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* vsllink -- add commentDavid Brownell2010-01-181-0/+3
| | | | | | | Previous patch deserved *inline* comment, not just in git revision history. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* commands: allow scan_chain command to be executed during configØyvind Harboe2010-01-181-1/+1
| | | | | | | Adding taps and then dumping them is quite reasonable thing to do in a config script. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* read target voltage first in vsllinksimon qian2010-01-171-0/+8
| | | | | | | | | | | | The very first command after init command should be "read target voltage". This is a tweak for the Old Versaloon firmware. Without this, in most most cases, it works. Under Ubuntu9.04, there is a chance that the USB will fail. The problem disappears if I read target voltage first. For the lastest Versaloon firmware, it's OK. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* NAND: lpc3180 crashes on LPC3250richard vegh2010-01-161-13/+38
| | | | | | | | | | | | | The LPC3180 NAND driver was crashing on some large page chips. Fix: - Crash and related functionality (don't memset too much OOB data) - Some debug messages - Command handling now works [dbrownell@users.sourceforge.net: whitespace/linelength/message cleanup] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ADIv5 improved diagnosticDavid Brownell2010-01-151-2/+3
| | | | | | | Don't just complain about an invalid ACK; say what the value was, to help troubleshooting. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM DPM: disable some nyet-ready breakpoint codeDavid Brownell2010-01-151-6/+14
| | | | | | | | Until we manage breakpoints at runtime (patches not ready for 0.4) the only way this code should touch them is to disable them at server startup (a previous debug session may have left them active). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* jtag.h whitespace/comment cleanupDavid Brownell2010-01-141-9/+8
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM ADIv5: add commentsDavid Brownell2010-01-141-1/+27
| | | | | | | Add doxygen and other comments for what's more or less the lowest level JDAG-DP primitive, to access JTAG_DP_{A,D}PACC registers. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM7/ARM9: improved reset supportDavid Brownell2010-01-141-14/+23
| | | | | | | | | | Teach most remaining ARM cores how to use the "reset-assert" event. Same model as elsewhere: iff a handler is provided for that event, use that instead of trying to assert SRST (which may be unavailable, or inappropriate since it resets too much). Else no change. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* nand flash support for s3c64xxPeter Korsgaard2010-01-143-0/+79
| | | | | | | | | | | | Identical to the existing 2412/2443 support except for the base address and NFCONF value (bit 2 is reserved and should be written as 1 ref UM). Tested on a s3c6410 board, but controller is identical in 6400/6410 except for 8bit MLC ECC support in 6410 which isn't supported by the driver. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* str9x.c: remove optimization when erasing the whole bankLaurentiu Cocanu2010-01-141-15/+3
| | | | | | | | | Using the erase bank command will cause a time out error. Replacing this with the erase sector bank will provide a slower but safer and stable method to erase the flash. Signed-off-by: Laurentiu Cocanu <laurentiu.cocanu@zylin.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ARM7/9 minor cleanupsDavid Brownell2010-01-141-16/+34
| | | | | | | Shrink some overlong lines. Add my 2009 copyright. Move a declaration to the beginning of its block. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* GDB: change gdb_breakpoint_override to COMMAND_ANYSpencer Oliver2010-01-141-1/+1
| | | | | | - enable gdb_breakpoint_override to be used within config script. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* NOR: add optional "flash erase_address" sector paddingDavid Brownell2010-01-134-26/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a NOR flash mechanism where erase_address ranges can be padded out to sector boundaries, triggering a diagnostic: > flash erase_address 0x0001f980 16 address range 0x0001f980 .. 0x0001f98f is not sector-aligned Command handler execution failed in procedure 'flash' called at file "command.c", line 647 called at file "command.c", line 361 > > flash erase_address pad 0x0001f980 16 Adding extra erase range, 0x0001f800 to 0x0001f97f Adding extra erase range, 0x0001f990 to 0x0001fbff erased address 0x0001f980 (length 16) in 0.095975s (0.163 kb/s) > This addresses what would otherwise be something of a functional regression. An earlier version of the interface had a dangerous problem: it would silently erase data outside the range it was told to erase. Fixing that bug turned up some folk who relied on that unsafe behavior. (The classic problem with interface bugs!) Now they can get that behavior again. If they really need it, just specify "pad". Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-M3: improved core exception handlingDavid Brownell2010-01-132-23/+31
| | | | | | | | | | | | | | | | | | | | | | This updates three aspects of debugger/exception interactions: - Save the user's "vector_catch" setting, and restore it after reset. Previously, it was obliterated (rather annoyingly) each time. - Don't catch BusFault and HardFault exceptions unless the user says to do so. Target firmware may need to handle them. - Don't modify SHCSR to prevent escalating BusFault to HardFault. Target firmware may expect to handle it as a HardFault. Those simplifications fix several bugs. In one annoying case, OpenOCD would cause the target to lock up on ome faults which triggered after the debugger disconnected. NOTE: a known remaining issue is that OpenOCD can still leave DEMCR set after an otherwise-clean OpenOCD shutdown. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* arm7/9: enable check that DCC downloads have been enabledØyvind Harboe2010-01-138-0/+9
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm7/9: add fn to check if dcc downloads have been enabledØyvind Harboe2010-01-132-1/+13
| | | | | | | | DCC downloads should be enabled for any self repecting openocd config file for arm7/9. Print out note about it otherwise. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* target: add check_reset hookØyvind Harboe2010-01-133-1/+46
| | | | | | | Allow targets to run checks post reset. Used to check that e.g. DCC downloads have been enabled. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* gdbserver: fix typo that broke read/write watchpointØyvind Harboe2010-01-131-2/+8
| | | | | | | | | | | | | It looks like a bugfix from normal breakpoints was not copied over. Do not use clever mathematics and assumptions to convert from GDB enum for break/watchpoints to OpenOCD enum. Drop connection upon unknown breakpoint type, this code path was not really considered by the previous code I think. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>