Commit Graph

2078 Commits (9b1a938a22e570d080024880bd04c4bbef4b8037)

Author SHA1 Message Date
oharboe bd7cbd01e8 David Brownell <david-b@pacbell.net> Accomodate targets which don't support various target-specific
reset operations.  Maybe they can't; or it's a "not yet" thing.

Note that the assert/deassert operations can't yet trigger for
OMAP3 because resets currently include JTAG reset in all cases,
resetting the ICEpick and thus disabling the TAP for Cortex-A8.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2620 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 19:52:02 +00:00
ntfreak 7a1ac49ac9 - fix build warnings
- add svn props to recently added files armv7a.[ch]

git-svn-id: svn://svn.berlios.de/openocd/trunk@2618 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 12:19:44 +00:00
oharboe 8e1d516927 Michael Schwingen <rincewind@discworld.dascon.de> a small CFI cleanup
git-svn-id: svn://svn.berlios.de/openocd/trunk@2617 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 08:21:11 +00:00
oharboe 696ed5fdc4 strange.... the code build and links w/Linux GCC target but fails w/arm-elf. The code was clearly broken as it was missing two extern's in the .h file...
git-svn-id: svn://svn.berlios.de/openocd/trunk@2616 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 07:17:19 +00:00
oharboe d11c8e3c8e Ferdinand Postema <ferdinand@postema.eu> fix warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@2615 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 07:14:05 +00:00
oharboe fd4c0f33b1 Michael Schwingen <rincewind@discworld.dascon.de> The attached patch adds a "xscale vector_table" command that allows to set
the values that are written in the mini-IC (plus documentation updates that
describe why this is needed).

git-svn-id: svn://svn.berlios.de/openocd/trunk@2613 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 07:09:48 +00:00
oharboe ae4c224459 Audrius Urmanavičius <didele.deze@gmail.com> Latest source (R2606) does not compile under Windows+Cygwin - fails with error about possibly uninitialized use of variable 'ch'.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2612 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 07:04:25 +00:00
oharboe 1d0b276c9f David Brownell The rest of the Cortex-A8 support from Magnus: replace the previous
nonfunctional cortex_a8 code with something that at least basically
works (for halt/step/resume, without MMU) even if it is incomplete.
(With tweaks from Øyvind, and cleanup from Dave.)

This code has mainly been developed and tested against R1606, it has 
been built and tested against R2294 where it runs but step and resume 
commands are broken due to regression (which should be fixed now).

This code is really written for OMAP3530.  It doesn't identify debug
resources using generic DAP calls to scan the ROM table, or perform
topology detection.  The OMAP3530 DAP exposes two memory access ports:

 - Port #0 is connected to L3 interconnect (the main bus) with
   passthrough to the L4 EMU bus ... so it will be used for most
   memory accesses.

 - Port #1 is connected to a dedicated debug bus (L4 EMU), with
   access to L4 Wakeup, and holds the ROM table ... so it must
   be used for most debug and control operations.

The are some defines to handle this in cortex_a8.c, which should be
replaced with more general code.  Having access to another Cortex-A8
implementation would help get that right.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2609 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 06:58:34 +00:00
oharboe 6f7491c1c1 David Brownell Subset of Cortex-A8 support from Magnus: create an armv7a file
and seed it with DAP access support using the current ADIv5 code.
(With tweaks and cleanup from Øyvind and Dave.)

The ARMv7-AR architecture manual is not publicly available (even
in subset form like the ARMv7-M spec), so it's hard to distinguish
between the Cortex-A8 implementation and the ARMv7-A architecture.

The register set presumably is architectural, and so it's stored
here; it's like earlier ARMs, with small additions.  Ditto the
instruction set, though Thumb2 support is used (extending Thumb
support from ARMv6 with more 32-bit instructions) and there's this
ThumbEE thing too.  There is a new "debug monitor" mode, not yet
fully addressed here, to support debugging in environments (like
motor control) where halting debug mode is inadvisable.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2608 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 06:57:26 +00:00
oharboe 0ed5f5afd9 add missing isblank() for eCos
git-svn-id: svn://svn.berlios.de/openocd/trunk@2607 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-25 06:45:40 +00:00
oharboe bf5f21e39a Steve Grubb <sgrubb@redhat.com> fix various and sundry leaks
git-svn-id: svn://svn.berlios.de/openocd/trunk@2606 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-24 07:53:46 +00:00
oharboe 332c8d78d8 Jonas Horberg <jhorberg@sauer-danfoss.com>
The trunk is currently broken for interfaces without
the speed_div function (interface specific clock speed
value to kHz conversion). Example: parport.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2605 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-24 07:26:05 +00:00
oharboe 8b73ec8d64 Florian Boor <florian.boor@kernelconcepts.de> fixes a segfault executing commands from the web interface using the
"Run Command" tab.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2601 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-21 06:22:01 +00:00
oharboe afae28fb2c Piotr Ziecik <kosmo@semihalf.com> This patch adds handling blank characters between hex digits in
SVF file, making OpenOCD compatible with files generated by
Altera Quatrus II 9.0.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2600 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-20 08:55:34 +00:00
ntfreak ef30f22fd3 - remove enable-ft2232-highspeed configure option, high speed ftdi support is now detected during the configure stage
- warning now issued if high speed ftdi device found and openocd was built using an old driver

git-svn-id: svn://svn.berlios.de/openocd/trunk@2599 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-20 07:54:49 +00:00
oharboe 028e535604 David Brownell <david-b@pacbell.net>More Thumb2 disassembly:
ARMv7-M: A5.3.6 Load/store dual or exclusive, table branch

GCC will generate the table branch instructions, usually with inlined
tables that will confuse this disassembler.  LDREX and STREX are not
issued by GCC without inline assembly.

This means all Thumb2 instructions implemented by Cortex-M3 can now
be disassembled.  Cortex-A8 cores support more Thumb2 instructions,
but most of those aren't yet publicly documented.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2598 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-20 07:15:46 +00:00
ntfreak c2f593bdc1 Jonas Horberg [jhorberg@sauer-danfoss.com]:
Fix small typo in ftd2xx type detection

git-svn-id: svn://svn.berlios.de/openocd/trunk@2597 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-19 08:39:06 +00:00
oharboe 18d8ac5267 David Brownell <david-b@pacbell.net>Fix some command helptext:
- spell "address" right
 - list bp/wp params as optional

And make those source lines wrap at sane margins.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2596 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-19 06:31:44 +00:00
oharboe 57578b4ea3 David Brownell <david-b@pacbell.net> Clean up some Cortex-M3 reset handling.
- AIRCR_SYSRESETREQ is generic; use it on any system where
  SRST won't fly, not just on Stellaris-based ones.

 - Reformat and improve comments about the Stellaris quirk; and
  xref the only public docs (an email) about the issue.

It seems that *most* Stellaris chips have this problem.  Tempest
parts aren't yet in general sampling; and if rev B silicon for
earlier chips exists, it's not very visible yet.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2595 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-19 06:30:08 +00:00
ntfreak 69dd81dcf8 David Brownell [david-b@pacbell.net]:
Simplify dumping of register lists by only printing cached values
if they are marked as valid.  Most of the time, they are invalid;
so printing *any* value is just misleading.

Note that for ARM7 and ARM9 most EmbeddedICE registers (except for
debug status) could be cached most of the time; and their register
cache isn't maintained properly (many accesses seem to bypass that
cache code).

git-svn-id: svn://svn.berlios.de/openocd/trunk@2594 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-18 19:55:01 +00:00
ntfreak a634b5d52e Jonas Horberg [jhorberg@sauer-danfoss.com]
https://lists.berlios.de/pipermail/openocd-development/2009-August/009939.html

1. It can only be built with the FTD2XX driver. libftdi supports FT2232H/FT4232H 
since version 0.16 

2. A speed value of 0 is used as a RTCK request indicator. This clashes with the 
valid clock division value 0 that provide the highest fixed clock frequency. 

3. The ft2232_speed_div function return the maximum selectable frequency (30MHz) 
when RTCK is activated. It should return 0. 

4. The ft2232_khz function return ERROR_OK when RTCK is requested even for 
devices lacking RTCK support. It should return ERROR_FAIL so the upper driver layers 
can detect this and try to fallback to a fixed frequency. 

5. FT2232H/FT4232H have a backward compatibility function that divide the clock 
by 5 to get the same frequency range as FT2232D. There is no code that disable 
this functionality. I can not find anything about if this is enabled or disabled by default. 
I think it is safest to actively disable it. 


git-svn-id: svn://svn.berlios.de/openocd/trunk@2591 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-18 14:41:58 +00:00
ntfreak bb5086b83e Jonas Horberg [jhorberg@sauer-danfoss.com]
Change jtag_rclk behaviour so it can be called before the interface init function

git-svn-id: svn://svn.berlios.de/openocd/trunk@2590 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-18 12:14:01 +00:00
oharboe ed22097a55 David Brownell <david-b@pacbell.net> Add "cortex_m3 vector_catch" command and docs. One minor
issue with this is that the core debug support uses this
mechanism, then trashes its state over reset.  Users can
Work around that (for now) by re-assigning the desired
config after reset.

Also fixes "target halted due to target-not-halted" goof.
When we can't describe the reason using OpenOCD's limited
vocabulary, say "reason undefined" instead of saying it's
not halted.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2588 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-18 10:25:28 +00:00
oharboe a4c7e2dd96 David Brownell <david-b@pacbell.net> Clean up ARM7/ARM9 EmbeddedICE register handling ... don't use parallel
arrays (error prone) or assume all registers are 32-bits wide (they can
have fewer bits); don't use spaces in register names, so they can be
passed more easily to the "reg" command.

Minor updates for ARM9 vector_catch support:  it's an 8-bit value.  This
seems to help this core's vector_catch command work a bit better; but its
behavior wih the register cache is still goofy.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2587 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-18 10:22:44 +00:00
oharboe 5badd9b29a David Brownell <david-b@pacbell.net> Several of the ARMv7M registers are 8 bits or less; don't
display them as 32 bits unless that's their true size.
(Removes some confusion.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2586 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-18 10:20:25 +00:00
oharboe 35e5e07127 Piotr Ziecik <kosmo@semihalf.com> Due to errors in chipselect management in davinci_nand driver
OpenOCD was able to access only to chips attached to first EMIF
chipselect. This patch fixes chipselect management code and allows
OpenOCD to access to NAND devices attached to any EMIF CS line.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2585 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-18 10:18:18 +00:00
oharboe a33e272abd Ferdinand Postema <ferdinand@postema.eu> cygwin 32 bit warning
git-svn-id: svn://svn.berlios.de/openocd/trunk@2581 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-16 11:52:50 +00:00
oharboe b747da2663 added note w/reference to discussion on whether or not arm11 code is broken or not.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2580 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-16 11:49:21 +00:00
ntfreak 59b295dbbe Audrius Urmanavičius [didele.deze@gmail.com]:
Add flash programming support for NXP LPC1700 cortex_m3 based family


git-svn-id: svn://svn.berlios.de/openocd/trunk@2579 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-13 13:54:53 +00:00
ntfreak 720c39ba2f David Brownell <david-b@pacbell.net>:
Warn about anyone using "jtag_speed" commands; that command is obsolete, and will someday be removed.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2578 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-07 09:37:59 +00:00
ntfreak ad800b1c02 Ferdinand Postema [ferdinand@postema.eu]
- fix vector catch issues with certain ARM9 cores - AT91SAM9260 and STR9

git-svn-id: svn://svn.berlios.de/openocd/trunk@2576 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-07 09:19:06 +00:00
ntfreak 84903467ec - fix segfault introduced during cortex reg cleanup
git-svn-id: svn://svn.berlios.de/openocd/trunk@2575 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-07 09:09:06 +00:00
ntfreak d40fd9e0f4 Gary Carlson [gcarlson@carlson-minot.com]:
- revert patch from rev1507 as it was causing reset issues with arm9 cores

git-svn-id: svn://svn.berlios.de/openocd/trunk@2574 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-06 23:34:34 +00:00
zwelch 398f60af56 michal smulski <michal.smulski@ooma.com>:
Fix ARM11 half-word bulk memory read and write.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2572 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-06 19:52:56 +00:00
oharboe 5a824c934f Fix NPE in GDB_EVENT_END as logforwarding was not disabled early enough
git-svn-id: svn://svn.berlios.de/openocd/trunk@2570 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-27 18:56:43 +00:00
oharboe e31e6a10de David Brownell <david-b@pacbell.net> More testcase work:
A5.3.11 Data processing (shifted register)

The usual kinds of problems; the most noteworthy were that
the "S"et flags bit was mis-handled in these instructions.
---
This is the last patch from a quickie set of tests covering all
encodings of the instructions with 32-bit opcodes.  There may
be some corner cases left, plus the instructions that aren't
yet handled, but the Thumb2 disassembler is no longer just
"lightly" tested with GCC output ... the new code paths have
mostly been verified.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2568 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-26 20:00:39 +00:00
oharboe 49e2267f1f More instruction decoding fixes:
A5.3.5 Load/store multiple
       A5.3.7 Load word

There was a longstanding bug in Thumb-1 LDM; the rest of the LDM/STM
fixes are just using width specs to match UAL syntax, except for two
opcode name typos.  Load word had two bitmask goofs.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2567 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-26 19:59:33 +00:00
oharboe 3bcf8a8a25 David Brownell <david-b@pacbell.net> More fixes from test cases:
A5.3.8 Load halfword, unallocated memory hints

It's mostly the usual sort of bitmasking goofage and getting the
width specs right.  In one case an older x86 GCC generated bad code
unless I structred a conditional differently (sigh).

git-svn-id: svn://svn.berlios.de/openocd/trunk@2566 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-26 19:58:25 +00:00
oharboe fc318c0298 David Brownell <david-b@pacbell.net> More instruction decoding fixes:
A5.3.5 Load/store multiple
       A5.3.7 Load word

There was a longstanding bug in Thumb-1 LDM; the rest of the LDM/STM
fixes are just using width specs to match UAL syntax, except for two
opcode name typos.  Load word had two bitmask goofs.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2565 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-26 19:56:58 +00:00
oharboe 67dbf35896 David Brownell <david-b@pacbell.net> More instruction decoding fixes based on test cases, covering
ARMv7-M arch manual:

 A5.3.1 Data processing (modified immediate)
 A5.3.3 Data processing (plain binary immediate)
 A5.3.4 Branches and miscellaneous control

and other (immediate) encodings referenced there.  Several of
these just tweak the new syntax ("Unified" ARM/Thumb: UAL) but
there were a few bugs too.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2564 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-24 16:49:44 +00:00
oharboe ad3a24f944 David Brownell <david-b@pacbell.net> Bugfix some instruction decoding ... I've crafted asm files
with testcases covering several new encodings in these sections
of the ARMv7-M arch manual:

 A5.3.12 Data processing (register)
 A5.3.13 Miscellaneous operations
 A5.3.14 Multiply, and multiply accumulate
 A5.3.15 Long multiply, long multiply accumulate, and divide

The issues were mostly in '12 and '13; some new related 16-bit
opcodes had issues too.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2563 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-24 16:48:12 +00:00
oharboe 431925a452 Andreas Fritiofson <andreas.fritiofson@gmail.com> I noticed there are a few checks for (rt == 0xf) even though that case
is handled with an early return at the top of the function.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2562 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-24 05:42:45 +00:00
oharboe 50aa561796 David Brownell <david-b@pacbell.net> thumb2 disassembly for Load halfword
git-svn-id: svn://svn.berlios.de/openocd/trunk@2561 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-23 15:35:16 +00:00
oharboe 31b520c379 David Brownell <david-b@pacbell.net> thumb2 disassembly for Load byte, memory hints
git-svn-id: svn://svn.berlios.de/openocd/trunk@2560 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-23 15:34:03 +00:00
oharboe c7565cc381 Ferdinand Postema <ferdinand@postema.eu> fix cygwin warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@2559 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-23 07:04:21 +00:00
oharboe 30b1bbceea David Brownell <david-b@pacbell.net> fix warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@2558 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-23 07:02:43 +00:00
ntfreak d460a7cd6c David Brownell <david-b@pacbell.net>:
Dump SP on poll, and show whether it's MSP or PSP.

Thread mode can use either stack pointer, so this is
part of the state that's not yet displayed.

Shrink some lines.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2555 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-21 20:19:02 +00:00
ntfreak 4da019edeb David Brownell <david-b@pacbell.net>:
Clean up treatment of registers in ARMv7-M and Cortex-M3. 

 - At the arch level:
    * Just list registers and names; don't impose core-specific
      policy about how they are accessed.
    * Each register has a symbol.
    * Remove the register mode field (irrelevant to debugger)

 - At the core/implementation level:
    * Just map the registers to their relevant access methods;
      don't require the arch level to say how that should work
      (cores other than Cortex-M3 could do it differently).
    * Don't use undefined bits from register 20.
    * Use register IDs that are part of the ARMv7-M interface.

In short, there's now a real distinction between the arch
and core layers.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2554 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-21 20:15:11 +00:00
ntfreak eea0486263 David Brownell <david-b@pacbell.net>:
Minor updates to the Thumb2 disassembly:

 - Bugfixes:
    * Distinguish branch from misc via "!=" not "=="
    * MRS register shift is 8 bits (vs MSR being 16)
 - Format tweaks:
    * CPS needed tab (not space)
    * add commma before some shifts
    * add space after comma in LDM/STM
    * use ".W" width spec on various instructions

git-svn-id: svn://svn.berlios.de/openocd/trunk@2553 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-21 20:05:05 +00:00
ntfreak cd0ca916b3 David Brownell <david-b@pacbell.net>:
Revert parts of the previous ARMv7-M register patch.
It turns out that part of the issue is a documentation
problem for the Cortex-M3 r1 parts. So for the rest,
simpler fixes are possible (in followup patch).

git-svn-id: svn://svn.berlios.de/openocd/trunk@2552 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-21 20:03:17 +00:00
ntfreak 55b1ea1d8e - fix issue with reading device id, bug appeared when flash_address code was added
- fix issue when multiple flash chips are connected, eg. x16 x 2 on 32bit mcu bus

git-svn-id: svn://svn.berlios.de/openocd/trunk@2551 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-20 07:03:11 +00:00
oharboe 8b994145b8 Andreas Fritiofson <andreas.fritiofson@gmail.com> UTF8 fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@2549 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-17 19:54:25 +00:00
oharboe bd4377194e microscopic whitespace cleanup
git-svn-id: svn://svn.berlios.de/openocd/trunk@2547 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-16 10:43:15 +00:00
oharboe 4deb8530c6 microscopic white space fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@2546 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-16 10:30:50 +00:00
zwelch 1af6b72fc1 Magnus Lundin <lundin@mlu.mine.nu>, Oyvind Harboe <oyvind.harboe@zylin.com>, David Brownell <david-b@pacbell.net>:
Move the dap command handler implementations to arm_adi_v5.c,
leaving just thin wrappers in armv7m.c.  There should be no
change in functionality here.  (From Magnus.)

Minor style cleanup:  whitespace, line length, etc.  Update spec
references to use docs which are currently available.  (From Dave.)


git-svn-id: svn://svn.berlios.de/openocd/trunk@2544 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-16 00:08:36 +00:00
zwelch 16e17ab1b3 Magnus Lundin <lundin@mlu.mine.nu>, Oyvind Harboe <oyvind.harboe@zylin.com>, David Brownell <david-b@pacbell.net>:
Some cleanup of the ARMv7-M support:

 - Reference the relevant ARMv7-M ARM doc (DDI 0405C to non-Vendors), and
   update the Cortex-M3 doc refs (DDI 0337C is no longer available).

 - Those registers aren't actually general, and some are incorrect (per all
   public docs anyway).  Update comments and code accordingly.

     * What the Core Debug facility exposes is *implementation-specific*
       not architectural.  These values aren't fully portable.  They match
       Cortex-M3 ... so no current implementation will make trouble, but
       the next v7m implementation might.

     * Four of the registers are actually not exposed that way.  Before
       Cortex-M3 r2p0 they are read/written through MRS/MSR instructions.
       In that newest silicon, they are four bytes in one register, not
       four separate registers.

 - Update the CM3 code to report when that one register is available,
   and not try to access it when it isn't.  Also declare the register
   numbers that an eventual MRS/MSR solution will need to be using.

 - Stop line wrapping the exception labels.

So for parts before r2p0 OpenOCD behavior is effectively unchanged, and
still buggy; but for those newer parts a few things might now be correct.

Most current Cortex-M3 parts use r1p1 (or earlier); this seems to include
most LM3S parts and all STM32 parts.  Parts using r2p0 are available, and
include fourth generation LM3S parts ("Tempest") plus AT91SAM3 and LPC17xx
parts which are now sampling.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2543 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-16 00:08:21 +00:00
zwelch 0c2ff267aa David Brownell <david-b@pacbell.net>:
More 32-bit Thumb2 instruction decoding:

	A5.3.7 Load word 


git-svn-id: svn://svn.berlios.de/openocd/trunk@2542 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 23:49:12 +00:00
zwelch fdfd434c24 David Brownell <david-b@pacbell.net>:
More 32-bit Thumb2 instruction decoding:

	A5.3.12 Data processing (register)


git-svn-id: svn://svn.berlios.de/openocd/trunk@2541 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 23:49:05 +00:00
zwelch 00adcc773a David Brownell <david-b@pacbell.net>:
More 32-bit instruction decoding:

	A5.3.11 Data processing (shifted register)


git-svn-id: svn://svn.berlios.de/openocd/trunk@2540 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 23:49:00 +00:00
zwelch 930269b483 David Brownell <david-b@pacbell.net>:
More instructions decoded:

	A5.3.5 Load/store multiple 

The preferred PUSH/POP syntax is shown when appropriate.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2539 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 23:48:54 +00:00
zwelch 421b8e133a David Brownell <david-b@pacbell.net>:
More instructions decoded:

	A5.3.14 Multiply, and multiply accumulate 
	A5.3.15 Long multiply, long multiply accumulate, divide

The EABI requires *adjacent* register pairs, but the long multiply
ops can use any pair of registers; interesting.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2538 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 23:48:43 +00:00
zwelch 889bd3e716 David Brownell <david-b@pacbell.net>:
More Thumb2 32-bit opcode support:

	 A5.3.10 Store single data item 

Byte, word, halfword.  Offset, pre-index, post-index.  And
a "make like you're unprivileged" option when using small
immediate offsets.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2537 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 23:48:37 +00:00
zwelch 84e86e9aee David Brownell <david-b@pacbell.net>:
Print old-style Thumb NOP instructions as such.  (GCC uses "mov r8, r8"
instead of the architected NOP which is new in Thumb2.)


git-svn-id: svn://svn.berlios.de/openocd/trunk@2536 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 23:48:32 +00:00
zwelch d2088f0d29 David Brownell <david-b@pacbell.net>:
Make disassembly of the Thumb load-literal instruction show the
address of the literal being loaded (so users can avoid doing
that math themselves).  Add and use an Align(PC,4) utility.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2535 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 23:48:27 +00:00
zwelch f163d0009d David Brownell <david-b@pacbell.net>:
Make the Thumb2 disassembler handle more 32-bit instructions:

  A5.3.3 Data processing (plain binary immediate)

These use mostly twelve bit literals, but there are also bitfield
and saturated add primitives.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2534 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 23:48:21 +00:00
zwelch 0165ae4405 David Brownell <david-b@pacbell.net>:
Make the Thumb2 disassembler handle more 32-bit instructions:

  A5.3.1 Data processing (modified immediate)

My small sample shows GCC likes to use many of these instructions.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2533 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 23:48:16 +00:00
zwelch 8b89224c6e David Brownell <david-b@pacbell.net>:
Make the Thumb2 disassembler handle a bunch of 32-bit instructions:

  A5.3.4 Branches and miscellaneous control
 
Note that this shifts some responsabililty out of helper functions,
making the code and layout simpler for 32-bit decoders:  they only
need to know how to format the instruction and its parameters.

Also, technical note:  with this patch, Thumb1 decoders could now
call the Thumb2 decoder if they wanted to get nicer treatment of
the exiting 32-bit B/BLX instructions.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2532 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 23:48:11 +00:00
zwelch b71e3aff6d David Brownell <david-b@pacbell.net>:
Change layout of Thumb disassembly to work better with Thumb2:

 - Move opcode to the left, allowing space for four hex bytes:
    * after address, two spaces not one tab (taking 6 spaces)
    * after 2-byte opcode, four spaces before tab
 - Also, after opcode mnemonic use a tab not a space, to make
   operands line up

Sample output (after some patches decoding a few 32-bit instructions):

0x00003e5a  0xf4423200	ORR	r2, r2, #131072	; 0x20000
0x00003e5e  0x601a    	STR 	r2, [r3, #0x0]
0x00003e60  0x2800    	CMP	r0, #0x00
0x00003e62  0xd1f3    	BNE	0x00003e4c
0x00003e64  0xf008fa38	BL	0x0000c2d8

The affected lines of code now wrap at sane margins too.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2531 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 23:39:48 +00:00
zwelch 309870e414 David Brownell <david-b@pacbell.net>:
Initial support for disassembling Thumb2 code.  This works only for
Cortex-M3 cores so far.  Eventually other cores will also need Thumb2
support ... but they don't yet support any kind of disassembly.

 - Update the 16-bit Thumb decoder:
 
     * Understand CPS, REV*, SETEND, {U,S}XT{B,H} opcodes added
       by ARMv6.  (It already seems to treat CPY as MOV.)

     * Understand CB, CBNZ, WFI, IT, and other opcodes added by
       in Thumb2.

 - A new Thumb2 instruction decode routine is provided.
 
     * This has a different signature:  pass the target, not the
       instruction, so it can fetch a second halfword when needed.  
       The instruction size is likewise returned to the caller.

     * 32-bit instructions are recognized but not yet decoded.
   
 - Start using the current "UAL" syntax in some cases.  "SWI" is
   renamed as "SVC"; "LDMIA" as "LDM"; "STMIA" as "STM".

 - Define a new "cortex_m3 disassemble addr count" command to give
   access to this disassembly.

Sanity checked against "objdump -d" output; a bunch of the new
instructions checked out fine.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2530 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 23:39:37 +00:00
oharboe 2ff59c9aaf print errno when parport fails to open.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2529 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-15 12:30:06 +00:00
oharboe 197a195191 1.54 snapshot
git-svn-id: svn://svn.berlios.de/openocd/trunk@2523 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-14 10:38:26 +00:00
ntfreak ebd46e23b3 Gary Carlson <gcarlson@carlson-minot.com>
Spencer Oliver <spen@spen-soft.co.uk>

- fix jlink win32/linux/darwin startup issues
- see https://lists.berlios.de/pipermail/openocd-development/2009-July/009438.html

git-svn-id: svn://svn.berlios.de/openocd/trunk@2513 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-13 06:36:51 +00:00
oharboe 5198968116 Magnus Lundin Thc cortex_m3_poll function does not identify that a target is running unless we transition from RESET.
This patch correctly identifies a running target.

Patch made a tad more palatable by David Brownell <david-b@pacbell.net>


git-svn-id: svn://svn.berlios.de/openocd/trunk@2510 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-12 19:29:08 +00:00
duane 5627e841e3 Simple warning fix
git-svn-id: svn://svn.berlios.de/openocd/trunk@2507 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-11 02:01:22 +00:00
oharboe 1ee66e0ce7 Fix SEGFAULTs and broken error handling for flash programming w/working area
git-svn-id: svn://svn.berlios.de/openocd/trunk@2499 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-08 18:29:03 +00:00
oharboe d68096dcf2 typo in comment
git-svn-id: svn://svn.berlios.de/openocd/trunk@2496 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-08 10:25:23 +00:00
oharboe f4a9db660b fix return value for "reset" and "runtest" command. Found by code inspection.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2488 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-07 10:47:23 +00:00
oharboe fc889f0357 delete long retired commented out code (daemon_startup)
git-svn-id: svn://svn.berlios.de/openocd/trunk@2487 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-07 10:43:44 +00:00
ntfreak cd1b2c15ab - change sleep to usleep - fixes issue under win32 build
git-svn-id: svn://svn.berlios.de/openocd/trunk@2483 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 15:41:55 +00:00
ntfreak d41f2bfb14 - fix build when using a cross compiler - do not try and run any host tools
- add missing types.h when platform does not contain elf.h

git-svn-id: svn://svn.berlios.de/openocd/trunk@2482 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 15:19:10 +00:00
oharboe 26b60a6ade more debug output for translation of arm mode number to enum
git-svn-id: svn://svn.berlios.de/openocd/trunk@2481 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 15:04:20 +00:00
oharboe 6128c515db a bit more debug output for translation of invalid mode numbers
git-svn-id: svn://svn.berlios.de/openocd/trunk@2480 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 14:58:13 +00:00
oharboe d5e183c31f Fix certain arm926ejs targets(e.g. i.MX27) which report an unknown MOE(method of entry) - interpret this as dbgrq. "reset run" + "halt" + "step" now works.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2479 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 14:25:25 +00:00
oharboe 56944ac1c8 Fix regression in "step" command introduced in 2190
git-svn-id: svn://svn.berlios.de/openocd/trunk@2478 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 13:42:11 +00:00
oharboe a4081acc51 revert svn 1679 - fixes cp15 read/write timeout. Single stepping still broken.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2477 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 12:03:55 +00:00
zwelch d6a686c852 Ferdinand Postema <ferdinand@postema.eu>:
Updates to private TAP state tables in amtjtagaccel interface driver.

The first change is the neccesary one to correct a long-standing bug that
caused the IDCODE to be shifted by one bit too many.  This was caused by
an incorrect path from state RESET to state DRSHIFT.

The value of those 2 bytes were 0x8a and 0x04. This means that the
bitstream to do this transition is 0b 00100 01010 (send LSB first). This
will bring you from the reset state to the shift state; however, you
enter the shift-state twice, which explains why the ID-CODE that will be
read next will be shifted 1 bit.  The fix changes these to 0x05 and 0x00.
This will send the bitstream 0b 00101 (send LSB first).  This will bring
the TAP controller from the RESET state to the DRSHIFT state directly,
without entering the DRSHIFT state twice.

After checking the whole table, two other transitions were found that
could be optimized (5 bits in stead of 10 bits).

Summary off all changes:
  From   To       Old values  Old Bitstream  New values  New Bitstream  Remarks
  ----   -------  ----------  -------------  ----------  -------------  -------
  RESET  DRSHIFT  0x8a 0x04   0b00100 01010  0x05 0x00   0b00101        1,2
  IDLE   DRSHIFT  0x85 0x08   0b01000 00101  0x04 0x00   0b00100        2
  IDLE   IRSHIFT  0x8b 0x08   0b01000 01011  0x06 0x00   0b00110        2

[1] Fixes the IDCODE bug
[2] Optimization


git-svn-id: svn://svn.berlios.de/openocd/trunk@2472 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 10:34:49 +00:00
zwelch a604b570da Gary Carlson <gcarlson@carlson-minot.com>:
Fix intermittent J-Link interface startup failures:
- Use usb_reset to ensure selected dongle is in known good state.
- Assert emulator reset durning status check to prevent supurious failures.
- Eliminate status check loop; not needed due to other fixes.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2471 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 10:34:33 +00:00
oharboe e48e7000b0 10ms timeout check on cp15 read/write
git-svn-id: svn://svn.berlios.de/openocd/trunk@2470 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 09:32:22 +00:00
oharboe 83655bf49b simplify debug_reason check
git-svn-id: svn://svn.berlios.de/openocd/trunk@2469 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 09:28:37 +00:00
oharboe 5fe4500e50 try to use tabs instead of spaces
git-svn-id: svn://svn.berlios.de/openocd/trunk@2465 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 08:01:22 +00:00
oharboe fca8cddc26 human readable error message upon invalid arguments
git-svn-id: svn://svn.berlios.de/openocd/trunk@2464 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 07:33:38 +00:00
oharboe 07f13dff2a zy1000 now listens for port 1234. Upon accepting connection reboot zy1000.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2463 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 07:31:46 +00:00
zwelch a239d6b334 Fix FTD2XX build for CygWin.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2454 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-02 11:16:57 +00:00
oharboe 12c13acdf8 zy1000 1.53 snapshot
git-svn-id: svn://svn.berlios.de/openocd/trunk@2451 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-02 09:11:18 +00:00
zwelch b3e6cb6d56 David Brownell <david-b@pacbell.net>:
Restore some whitespace that got clobbered by over-aggressive
whitepace eradication patches a while back.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2446 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-02 04:55:10 +00:00
zwelch a13d08bced Add missing copyright header to target_type.h.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2444 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-01 19:55:46 +00:00
zwelch f7c85c42a0 Add missing copyright header and fix @page direction in membuf.h.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2443 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-01 19:55:39 +00:00
ntfreak f486f86c6c - correct stm32 connectivity line programming as per latest manual
git-svn-id: svn://svn.berlios.de/openocd/trunk@2439 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-01 10:15:53 +00:00
zwelch 3eb441bbcc Remove at91sam3.h from flash.c; use extern like other drivers.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2438 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-30 22:25:09 +00:00
ntfreak 2afb46ab34 - remove cygwin build warnings in at91sam3.c
git-svn-id: svn://svn.berlios.de/openocd/trunk@2434 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-30 21:13:53 +00:00