zwelch [Thu, 18 Jun 2009 00:29:39 +0000 (00:29 +0000)]
David Brownell <david-b@pacbell.net>:
Various bits of cleanup, mostly to match the style hints
I just got around to writing up.
- Various @cindex improvements
- Cross reference the command line options in a few spots,
notably for @command{debug_level}
- Clean the config file guidelines a bit:
* They're for all users, not just integrators
* Reference the interface config chapter
* Don't emphasize command line usage here
* Tweak board and target config introductory text
Plus two minor bits of cleanup: remove most date references,
and refer to the reader as "you" not "the user".
oharboe [Wed, 17 Jun 2009 20:49:55 +0000 (20:49 +0000)]
Freddie Chopin <freddie_chopin@op.pl> makes lpc2478.cfg file more "standard" and - what is most important - correct (it's working [; ). I've also added some comments which try to clarify the meaning of all that's in there.
zwelch [Wed, 17 Jun 2009 06:44:29 +0000 (06:44 +0000)]
David Brownell <david-b@pacbell.net>:
Update the Beagle setup:
- OMAP3530 updates:
* split ICEpick TAP enable support to its own file, for
reuse and eventually for storing other utility code
like emulation reset
* clean up, including labeling the tap as for DAP not
for the Cortex-A8 and making endianness non-variable
* add a few FIXMEs
- BeagleBoard cleanup: there's no SRST, "endstate" is gone, etc
I'm not sure I'd say it's further than "barely limping" just yet.
Key issues remain lack of Cortex-A8 support, and more complete
support for resetting.
zwelch [Wed, 17 Jun 2009 06:40:58 +0000 (06:40 +0000)]
David Brownell <david-b@pacbell.net>:
DM6446 config updates:
- List two more TAPs, as disabled, mostly for doc purposes
- Included basic ICEpick support, still disabled by default
- Shorten line lengths
- Use $_TARGETNAME to configure the ETM and ETB
- This ARM core don't support endianness overriding
For now, boards that can't jumper EMU0/EMU1 will need to tweak
a variable's setting.
zwelch [Wed, 17 Jun 2009 00:29:56 +0000 (00:29 +0000)]
Improve definitions of parse_ulong and parse_ullong:
- Use macro to eliminate duplicate body definitions.
- Rename okay as is_okay; add parenthesis to help "clarify" logic.
zwelch [Tue, 16 Jun 2009 12:17:26 +0000 (12:17 +0000)]
David Brownell <david-b@pacbell.net>:
Fix a bug preventing ICEpick "enable that TAP" code from working:
the "runtest" command wrongly finished with a JTAG reset, discarding
the work the TAP enable handler just finished! Instead, JTAG should
stay in RUN/IDLE state.
zwelch [Tue, 16 Jun 2009 12:17:18 +0000 (12:17 +0000)]
David Brownell <david-b@pacbell.net>:
Extend the internal JTAG event handlers to cover enable/disable,
and use those events to make sure that targets get "examined" if
they were disabled when the scan chain was first set up:
- Remove "enum jtag_tap_event", merge with "enum jtag_event",
so C code can now listen for TAP enable/disable events.
- Report those events so they can trigger callbacks.
- During startup, make target_examine() register a handler to
catch ENABLE events for any then-disabled targets.
This fixes bugs like "can't halt target after enabling its TAP".
One class of unresolved bugs: if the target has an ETM hooked
up to an ETB, nothing activates the ETB. But starting up the
ETM without access to the ETB registers fails...
zwelch [Tue, 16 Jun 2009 12:17:12 +0000 (12:17 +0000)]
David Brownell <david-b@pacbell.net>:
Tighten error handling on TAP enable/disable paths a bit:
- Don't enable/disable unless it's necessary. Those event
handlers could have nasty side effects...
- Don't *succeed* enables/disables if there was no code which
could have implemented that action. This prevents bugs like
wrongly acting as if the scan chain changed.
- Minor whitespace cleanup in enable/disable command code.
The big problem is still the lack of code to verify scan chains
were actually updated as requested; this adds a comment on that.
I suspect the best we can do near term will be to verify IDCODE.
zwelch [Tue, 16 Jun 2009 00:23:22 +0000 (00:23 +0000)]
David Brownell <david-b@pacbell.net>:
Distributing FTDI's "ftd2xx" library with OpenOCD violates the
OpenOCD license (GNU GPLv2 with no exceptions).
Make that clear where that build option is presented, and don't
describe the FTDI libraries as an option for any packager. (It's
fine for personal use, of course.)
Plus some related clarifications: libftdi version 0.16 for the
new FT2232H chips (for RTCK and high speed USB); the Amontec
drivers are just ftd2xx variants.
zwelch [Tue, 16 Jun 2009 00:23:13 +0000 (00:23 +0000)]
David Brownell <david-b@pacbell.net>:
Fix some polling issues:
- Don't background-poll disabled TAPs ... this was just a bug
waiting to happen. (And then it happened!)
- Don't fail command line polls of disabled taps; that's not any
kind of error, it's just that you can't do much. But do show
that tap-disabled status.
- Spell "continuous" correctly in the variable name. ;)
Not resolved by this patch: the need for an interlock whereby
other code (like the JTAG layer) can block all other access to
the JTAG layer, e.g. while enabling or disabling TAPs. And
that interlock needs to be timer-safe...
zwelch [Tue, 16 Jun 2009 00:23:00 +0000 (00:23 +0000)]
David Brownell <david-b@pacbell.net>:
Doc update: say "jtag newtap ... -disable" records the
state after exiting the RESET state, matching the only
implementation we're working with so far (TI ICEpick-C).
Matching code updates. Now we can be sure that the
"enabled" flag value is correct after JTAG resets.
zwelch [Tue, 16 Jun 2009 00:22:52 +0000 (00:22 +0000)]
David Brownell <david-b@pacbell.net>:
Fix a memory leak in jtag_tap_free(): unregister the event
callback too.
Also fix the associated conceptual bug in unregistering JTAG
event callbacks: since the same callback procedure is used
many times with different callback data (a TAP handle), that
data must be considered when unregistering any callback.
This could fix some crashes after TAP registration errors,
by making sure the reset event handler doesn't scribble over
memory that's now used by something else.
zwelch [Tue, 16 Jun 2009 00:22:40 +0000 (00:22 +0000)]
David Brownell <david-b@pacbell.net>:
Minor jtag cleanup:
- remove hidden assumption about JTAG event numbering
- move function declarations to a header
- some end'o'line whitespace
- use "calloc" not "malloc + memset"
zwelch [Mon, 15 Jun 2009 23:54:09 +0000 (23:54 +0000)]
David Brownell <david-b@pacbell.net>:
Add another board ... OMAP2420 "H4" board. This won't be very widely
used with OpenOCD, but with mainline support in both U-Boot and Linux
it at least makes for a more complete set (and another testcase).
This is incomplete support in several respects. The ARM11 support is
not very deep yet; most registers aren't available, and the ETM can't
be hooked up. Plus, there's no script for OMAP-specific stuff like
setting up the SDRAM controller. Eventually the same NAND controller
driver should work with OMAP2 and OMAP3.
zwelch [Sat, 13 Jun 2009 00:34:31 +0000 (00:34 +0000)]
Factor load_image argument parsing to parse_load_image_command_args:
- Make fast_load_image use the helper coverage the standard load_image.
- Improve whitespace in the moved lines.
zwelch [Sat, 13 Jun 2009 00:34:10 +0000 (00:34 +0000)]
Cleanup and improve handle_wp_command and handle_rwp_command:
- Simplify argument parsing logic using switch statement.
- Use parse_u32 to ensure all values parse properly.
- Return syntax error when mode argument fails to parse.
zwelch [Sat, 13 Jun 2009 00:34:03 +0000 (00:34 +0000)]
Improve and simplify handle_bp_command and handle_rbp_command:
- Bug fix: return syntax error if remove called without one argument.
- Use parse_u32 to ensure address and length arguments parse properly.
zwelch [Sat, 13 Jun 2009 00:33:34 +0000 (00:33 +0000)]
Improve handle_mw_command argument handling:
- Change: All local variable types are now unsigned.
- Use parse_u32 to ensure address and value parse properly.
- Use parse_uint to ensure count parses properly.
- Move variables to location of first use.
zwelch [Sat, 13 Jun 2009 00:33:11 +0000 (00:33 +0000)]
Cleanup and improve handle_halt_command:
- Make argument check use parse_uint to ensure value parses properly.
- Move variable declarations to location of first use.
zwelch [Sat, 13 Jun 2009 00:33:01 +0000 (00:33 +0000)]
Cleanup and fi handle_wait_halt_command:
- Use unsigned type for delay variable.
- Use parse_uint to ensure delay argument parses properly.
- Bug fix: Return syntax error if more than one argument is given.
- Bug fix: Return syntax error when argument fails to parse.
zwelch [Fri, 12 Jun 2009 22:06:02 +0000 (22:06 +0000)]
David Brownell <david-b@pacbell.net>:
Currently the "debug_level 3" command tracing ignores commands
that could return values to TCL scripts (by plugging in to a
slightly lower level of the interpreter stack).
Fix that by abstracting the tracing command and starting to
make some of those previously-untraced commands use this new
mechanism.
zwelch [Fri, 12 Jun 2009 21:53:17 +0000 (21:53 +0000)]
David Brownell <david-b@pacbell.net>:
Move the discussion of the "scan_chain" command up to go with
the presentation of that topic in the TAP declaration chapter.
This makes the presentation of the TAP and target lists be
parallel, which will be something of an aid to understanding
that they are different (and how).
zwelch [Fri, 12 Jun 2009 21:43:53 +0000 (21:43 +0000)]
David Brownell <david-b@pacbell.net>:
Partial fix to the "long IR length" problems.
- Current code could handle up to 32 bit IR lengths with
full functionality, if it didn't just reject may of them
out of hand. So only reject clear errors, where the IR
mask (or capture instruction) needs more than IrLen bits.
- Longer IR lengths can only be handled in BYPASS mode
for now. Example: TI's DSPs use 38-bit IR lengths.
So we can't issue their IDCODE instructions...
A more complete fix would be able to issue longer instructions;
or minimally, would fail cleanly for the non-BYPASS case.
Note that this *could* make some currently broken scripts fail,
since the previous code accepted garbage values so long as
they didn't use more than 16 bits.
zwelch [Fri, 12 Jun 2009 04:14:28 +0000 (04:14 +0000)]
Further cleanup to MIPS target read/write memory function:
- Move the mips32_..._read_mem calls to top-level of read_mem function.
- Change: Only perform mips_m4k_read_mem conversion when retval == ERROR_OK.
- Prevents pointless conversions of bogus read values after failures.
- Eliminate retval variable from mips_m4k_write_mem; return directly.
- Move declaration of retval variable to point of first use.
- Remove the now redundant switch statements testing size:
- argument sanitizing already covers these cases.
zwelch [Fri, 12 Jun 2009 04:14:18 +0000 (04:14 +0000)]
David Claffey <dnclaffey@gmail.com>:
This patch helps fix MIPS big endian (elf32-tradbigmips) targets.
If "-endian big" is not set in target create, the endianess defaults to
little. mw and md commands will still work, but binary file loads will
have the incorrect word order loaded into memory.
The EJTAG processor access data register (PrAcc) is little endian
regardless of the CPU endianness; it is always loaded LSB first. This
is confirmed by the fact that mips_ejtag_drscan_32() uses buf_set_u32()
to load the scan field; buf_set_u32() is a little-endian formatter. For
big endian targets, data buffers have to be modified so the LSB of each
u32 or u16 is at the lower (first) memory location. If the drscan
out_value word order is set using buf_set_u32() then it makes sense to
also fixup the in_value with buf_get_u32(); a symmetry argument. This
has no affect on little endian hosts.
zwelch [Fri, 12 Jun 2009 01:41:00 +0000 (01:41 +0000)]
Improve vsllink command argument handling:
- Bug fix: Always clear high bit of USB bulk out endpoint.
- Use parse_ulong helpers to ensure numeric strings are parsed properly.
zwelch [Fri, 12 Jun 2009 01:40:48 +0000 (01:40 +0000)]
Improve VID/PID command argument handling in FTDI driver:
- Bug fix: Return a syntax error when less than two arguments are given.
- Bug fix: Use parse_u16 helper to ensure vales are parsed properly.
- Simplify loop termination logic by ensuring argc is always even.
- Move loop induction variable declaration to where it is used.
zwelch [Fri, 12 Jun 2009 01:40:42 +0000 (01:40 +0000)]
Improve handle_irscan_command:
- Use parse_u32 helper to ensure scan values are parsed properly.
- Clear the fields buffer to ensure partial cleanup occur correctly.