Laurentiu Cocanu [Thu, 14 Jan 2010 12:59:36 +0000 (13:59 +0100)]
str9x.c: remove optimization when erasing the whole bank
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.
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>
David Brownell [Wed, 13 Jan 2010 11:16:37 +0000 (03:16 -0800)]
Cortex-M3: improved core exception handling
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>
Added interface config file for JTAG/RS232 debug board originally
integrated to Neo 1973 and Neo FreeRunner phones.
Adapter was tested with i.MX31, S3C2410 and AT91SAM9260 processors.
Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
David Brownell [Sun, 10 Jan 2010 06:15:57 +0000 (22:15 -0800)]
jtag/tcl help/usage fixups
The usual: expand several helptexts to be more correct and to use
full sentences; make the usage messages use the same EBNF as the
User's Guide; use function names for their addresses.
Also add a comment about that odd jtag_command_handlers_to_move[] thing.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Sun, 10 Jan 2010 05:56:11 +0000 (21:56 -0800)]
parport (mostly) doc fixes
The "parport_port" commands generally don't *require* a port_number;
they're of the "apply any parameter, then print result" variety. Update
the User's Guide accordingly.
Some of those commands are intended to be write-once: parport_port,
and parport_cable. Say so.
Use proper EBNF for the parport_write_on_exit parameter.
Parport address 0xc8b8 is evidently mutant. Say so in the "parport.cfg"
file, to avoid breaking anyone with that mutant config. But update the
User's Guide to include a sane example for the LP2 port.
Finally document the "presto_serial" command.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Sat, 9 Jan 2010 16:58:38 +0000 (08:58 -0800)]
src/flash/nor: usage/help/doc updates
Make "usage" messages use the same EBNF as the User's Guide;
no angle brackets. Improve and correct various helptexts.
Don't use "&function"; a function's name is its address.
Remove a couple instances of pointless whitespace; shrink a
few overlong lines; fix some bad indents.
Add TODO list entry re full support for NAND/NOR bank names.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Sat, 9 Jan 2010 07:18:46 +0000 (23:18 -0800)]
NAND: help/usage/doc updates
Usage messages should use the same EBNF as the User's Guide;
no angle brackets. Be more complete too ... some params were
missing. Improve and correct various helptexts.
Make user's guide refer to the NAND "driver" name, not the
controller name; that's a bit more precise.
Don't use "&function"; its name is its address. Line up struct
initializers properly. Remove some blank lines.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Sat, 9 Jan 2010 00:47:58 +0000 (16:47 -0800)]
NOR: add FIXMEs for writing ones
It can invalidate ECC codes, and in general is not guaranteed
to work. (However on some chips it _appears_ to behave.) Just
don't do it; don't write in those cases.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Fri, 8 Jan 2010 00:30:09 +0000 (16:30 -0800)]
ARM720: help/usage updates
Deprecate the "pass an instruction opcode" flavor of cp15
access in favor of the "arm mcr ..." and "arm mrc ..."
commands, which offer fewer ways to break things.
Use the same EBNF syntax in the code as for the user's guide.
Update User's Guide to say where to find those magic values
(which table in the ARM920 TRM).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Fri, 8 Jan 2010 00:25:03 +0000 (16:25 -0800)]
ARM720: help/usage updates
Deprecate the "pass an instruction opcode" flavor of cp15 access
in favor of the "arm mcr ..." and "arm mrc ..." commands, which
offer fewer ways to break things.
Use the same EBNF syntax in the code as for the user's guide.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Fri, 8 Jan 2010 00:21:10 +0000 (16:21 -0800)]
ARM11: help/usage updates
Usage syntax messages have the same EBNF as the User's Guide;
there should be no angle brackets in either place.
Uupdate some helptext to be more accurate.
Fix the User's Guide in a few places to be more consistent (mostly
to use brackets not parentheses) and to recognize that parameter may
be entirely optional (in which case the command just displays output,
and changes nothing). Also reference NXP, not Philips, for LPC chips.
Don't use "&function"; functions are like arrays, their address
is their name.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Fri, 8 Jan 2010 00:20:14 +0000 (16:20 -0800)]
ARM7/ARM9: help/usage updates
Provide helptext which was sometimes missing; update some of it
to be more accurate.
Usage syntax messages have the same EBNF as the User's Guide;
there should be no angle brackets in either place.
Fix the User's Guide in a few places to be more consistent (mostly
to use brackets not parentheses) and to recognize that parameter may
be entirely optional (in which case the command just displays output,
and changes nothing). Also reference NXP, not Philips, for LPC chips.
Don't use "&function"; functions are like arrays, their address
is their name. Shrink some overlong lines.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Thu, 7 Jan 2010 23:52:38 +0000 (15:52 -0800)]
ARMv7: help/usage updates
Provide helptext which was sometimes missing; update some of it
to be more accurate.
Usage syntax messages have the same EBNF as the User's Guide;
there should be no angle brackets in either place.
Don't use "&function"; functions are like arrays, their address
is their name. Shrink some overlong lines, remove some empties.
Add a couple comments about things that should change: those
extra TCK cycles for MEM-AP reads are in the wrong place (that
might explain some problems we've seen); the DAP command tables
should be shared, not copied.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Thu, 7 Jan 2010 22:51:59 +0000 (14:51 -0800)]
XScale: help/usage updates
Provide helptext which was sometimes missing; update some of it
to be more accurate (mostly they display something w/no args).
Usage syntax messages have the same EBNF as the User's Guide.
In some cases, *exactly* what the user's guide shows... e.g.
talking about "offset" not "address" for trace_image.
Don't use "&function"; functions are like arrays, their name
is their address.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Tue, 5 Jan 2010 21:32:39 +0000 (13:32 -0800)]
don't require 'openocd.cfg' to start
Starting the daemon with with just a bare "openocd" I saw:
Can't find openocd.cfg
That's not an error; don't treat it as if it were. There may
be an error later -- like, "no interface set up" -- but let
messages only report real errors, not fake ones.
David Brownell [Tue, 5 Jan 2010 21:03:27 +0000 (13:03 -0800)]
ARM: add #defines for JTAG ack codes
JTAG has only two possible JTAG ack codes for APACC and DPACC
register reads/writes. Define them, and remove empty "else"
clause in the code which now uses those codes.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Øyvind Harboe [Tue, 5 Jan 2010 13:57:45 +0000 (14:57 +0100)]
gdb: fix regression in gdb_port command
The gdb_port command can be invoked during normal execution
to report the port used for gdb, whereas it was listed as
CONFIG stage only, which caused an error when excuting
it to return the reported error.
Also in line with the grander goal of making more commands
available during all "modes" (perhaps retiring config mode),
there is no particular reason to limit gdb_port to the
config stage.
New versions of udev (148+) emit the following warnings:
udevd[425]: BUS= will be removed in a future udev version,
please use SUBSYSTEM= to match the event device, or
SUBSYSTEMS= to match a parent device, in /lib/udev/rules.d/60-openocd.rules:1
udevd[425]: SYSFS{}= will be removed in a future udev version,
please use ATTR{}= to match the event device, or
ATTRS{}= to match a parent device, in /lib/udev/rules.d/60-openocd.rules:4
udevd[425]: SYSFS{}= will be removed in a future udev version,
please use ATTR{}= to match the event device, or
ATTRS{}= to match a parent device, in /lib/udev/rules.d/60-openocd.rules:7
...
See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560141
[dbrownell@users.sourceforge.net: add IDs for Stellaris ICDI, Olimex Tiny-H]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Sat, 2 Jan 2010 23:53:33 +0000 (15:53 -0800)]
ARM: ADIv5 JTAG symbol cleanup
Rename DAP_IR_* as JTAG_DP_* since those symbols are specifically
for JTAG-DP (or SWJ-DP in JTAG mode), and won't work with SWD.
Define the JTAG ABORT and IDCODE instructions for completeness;
add a comment about where to (someday) use ABORT.
Fix messaging which assumes everything is an SWJ-DP; say "JTAG-DP"
instead, it's at least more appropriate for all JTAG transports.
Shrink the affected lines.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Sat, 2 Jan 2010 23:53:18 +0000 (15:53 -0800)]
ARM: dap info fix + tweaks
Fix: don't print the BASE address except if it's a MEM-AP;
that's an unlikely error, but there's no point getting it wrong.
Tweaks: comments, capitalization.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Sat, 2 Jan 2010 23:53:06 +0000 (15:53 -0800)]
ARM: ADIv5 export cleanup
Make some private functions "static". Remove their public declarations,
and what is now an obviously unused function. Shrinks this object's size
(about 5% on x86_64) while making the code's scope easier to understand.
Shrink the affected lines.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Sat, 2 Jan 2010 23:53:03 +0000 (15:53 -0800)]
ARM: ADIv5 symbol and comment cleanup
Instead of magic numbers, use their AP_REG_* constants. Rename
the ROM address symbol as BASE to match ARM's documentation.
Comment various other symbols in the header; add some missing ones.
Remove an unused struct. Add some doxygen for stuff including the
DAP structure and initialization.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Sat, 2 Jan 2010 23:52:35 +0000 (15:52 -0800)]
streamline and document helptext mode displays
Most commands are usable only at runtime; so don't bother saying
that, it's noise. Moreover, tokens like EXEC are cryptic. Be
more clear: highlight only the commands which may (also) be used
during the config stage, thus matching the docs more closely.
There are
- Configuration commands (per documentation)
- And also some commands that valid at *any* time.
Update the docs to note that "help" now shows this mode info.
This also highlighted a few mistakes in command configuration,
mostly commands listed as "valid at any time" which shouldn't
have been. This just fixes ones I noted when sanity testing.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Dean Glazeski [Thu, 31 Dec 2009 22:01:32 +0000 (16:01 -0600)]
Fix usage/help search for subcommands.
This makes it so that the usage/help command properly uses the whole command,
including subcommand, in the search for help information. This previously
caused erroneous output from the usage command handler.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Dean Glazeski [Sat, 2 Jan 2010 01:58:38 +0000 (19:58 -0600)]
Add the current command to the command information
I wanted to make it so I can be ignorant of a commands invocation string, so
I tried to use CMD_CURRENT (aka cmd->current) which is supposed to house a
pointer to the current command. It turns out that this wasn't being set.
This patch adds the current command structure to the command invocation
structure before sending it along to the command handler.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Antonio Borneo [Wed, 30 Dec 2009 23:13:16 +0000 (07:13 +0800)]
ARM7_9: Fix segfaults
Handlers for commands
- arm7_9 semihosting <enable | disable>
- $_TARGETNAME arp_reset assert 1
didn't check if target has already been examined, and could
segfault when using the NULL pointer "arm7_9->eice_cache".
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Antonio Borneo [Wed, 30 Dec 2009 18:43:56 +0000 (02:43 +0800)]
ARM9TDMI: Fix segfault.
The handler for "arm9tdmi vector_catch ..." did not check
if target has already been examined. Without this fix it
segfaults when using NULL pointer "arm7_9->eice_cache".
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Mon, 28 Dec 2009 20:59:47 +0000 (12:59 -0800)]
Fix Luminary FT2232 layout docs/configs
Most of this patch updates documentation and comments for various
Luminary boards, supporting two bug fixes by helping to make sense
of the current mess:
- Recent rev C lm3s811 eval boards didn't work. They must use
the ICDI layout, which sets up some signals that the older
boards didn't need. This is actually safe and appropriate
for *all* recent boards ... so just make "luminary.cfg" use
the ICDI layout.
- "luminary-lm3s811.cfg", was previously unusable! No VID/PID;
and the wrong vendor string. Make it work, but reserve it
for older boards where the ICDI layout is wrong.
- Default the LM3748 eval board to "luminary.cfg", like the
other boards. If someone uses an external JTAG adapter, all
boards will use the same workaround (override that default).
The difference between the two FT2232 layouts is that eventually
the EVB layout will fail cleanly when asked to enable SWO trace,
but the ICDI layout will as cleanly be able to enable it. Folk
using "luminary.cfg" with Rev B boards won't see anything going
wrong until SWO support is (someday) added.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Sun, 27 Dec 2009 20:16:55 +0000 (12:16 -0800)]
create tcl/board/dm365evm.cfg
This config is only lightly tested, and doesn't work well yet;
but it's a start.
* Notably missing is PLL configuration, since each DaVinci
does that just a bit differently; and thus DDR2 setup.
* The SRST workaround needed for the goof in the CPLD's VHDL
depends on at least the not-yet-merged patch letting ARM9
(and ARM7) chips perform resets that don't use SRST.
So this isn't yet suitable for debugging U-Boot.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
David Brownell [Sun, 27 Dec 2009 19:34:31 +0000 (11:34 -0800)]
NOR: make flash_write_unlock() pad to sector end
Resolve a regression when using newish automagic "write_image"
modes, by always padding to the end of affected sectors.
Also document some issues associated with those automagic options,
in the User's Guide and also some related code comments.
We might need similar padding at the *beginning* of some sectors,
but this is a minimalist fix for the problems which have currently
been reported (plus doc updates).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>