Re: [Openocd-development] Slowly moving from 8 to 32 bit words in jtag_add_xxx API

2009-11-21 Thread Øyvind Harboe
On Fri, Nov 20, 2009 at 10:43 PM, Michael Bruck mbr...@digenius.de wrote: On Fri, Nov 20, 2009 at 19:05, Øyvind Harboe oyvind.har...@zylin.com wrote: Just to clarify the whole issue once more, my proposal was actually three different things: 1. Making the use of scan_field safer by providing

Re: [Openocd-development] Slowly moving from 8 to 32 bit words in jtag_add_xxx API

2009-11-21 Thread Michael Schwingen
Øyvind Harboe wrote: 3. Break up jtag_add_dr_scan etc. This works best in tandem with (2). The general idea is not to pass one array of scan fields but to pass them in separate function calls (which would mimic, but replace the ones in (1)). To output a 7 bit field the caller just hands the

Re: [Openocd-development] Slowly moving from 8 to 32 bit words in jtag_add_xxx API

2009-11-21 Thread Øyvind Harboe
On Sat, Nov 21, 2009 at 2:09 PM, Michael Schwingen rincew...@discworld.dascon.de wrote: Øyvind Harboe wrote: 3. Break up jtag_add_dr_scan etc. This works best in tandem with (2). The general idea is not to pass one array of scan fields but to pass them in separate function calls (which would

[Openocd-development] Openocd vrs Commercial jtag dongles

2009-11-21 Thread Duane Ellis
Recently, I've been using quite a few commercial jtag tools from chip vendors. One thing I've noticed is that they all have implement the design with an small usb-controller + FPGA of some type (typically a xilinx spartan). I can see the real benefit, they download and flash the target at an

Re: [Openocd-development] Slowly moving from 8 to 32 bit words in jtag_add_xxx API

2009-11-21 Thread Michael Schwingen
Øyvind Harboe wrote: The important point is that the queuing of JTAG commands can be done in hardware today, with no overhead. We want to keep the actual queue implementation something completely internal to the interface implementations. Understood. I still do not see how the proposed

[Openocd-development] [PATCH 0/3] improve default script search path

2009-11-21 Thread Andreas Fritiofson
This series improves the default script search path to include $HOME/.openocd. It also updates the search path on Windows to match what appears to be the result of a standard 'configure make make install' in one particular MSYS environment. Other environments have not been tested, but the

[Openocd-development] [PATCH 2/3] update win32 script search path

2009-11-21 Thread Andreas Fritiofson
The default script search path on Windows seems to be out of date with the current layout, causing the standard scripts not to be found after a conventional './configure make make install' under msys/MinGW. The same should hold true for cygwin native builds although not verified. Update the

[Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Andreas Fritiofson
Add $HOME/.openocd as the first default script search directory, allowing the user to override the standard scripts. Signed-off-by: Andreas Fritiofson andreas.fritiof...@gmail.com --- src/helper/options.c | 16 +++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git

[Openocd-development] [PATCH 1/3] show script search dirs in debug log

2009-11-21 Thread Andreas Fritiofson
Add this to ease debugging why the standard scripts aren't found on the default script search path in some build/install enviroments. Especially on Windows it's not straight forward where openocd actually looks for the scripts. Signed-off-by: Andreas Fritiofson andreas.fritiof...@gmail.com ---

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Øyvind Harboe
How about using a dynamic allocation and not worrying about max size at all? These changes seem reasonably to me, but without documentation to go with it, I fear nobody would use it. Could you add some? -- Øyvind Harboe http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG

Re: [Openocd-development] Openocd vrs Commercial jtag dongles

2009-11-21 Thread Leon Woestenberg
Hello, On Sat, Nov 21, 2009 at 4:42 PM, Duane Ellis open...@duaneellis.com wrote: Recently, I've been using quite a few commercial jtag tools from chip vendors. One thing I've noticed is that they all have implement the design with an small usb-controller + FPGA of some type (typically a

Re: [Openocd-development] How to add support for a board?

2009-11-21 Thread David Brownell
On Wednesday 18 November 2009, Albert ARIBAUD wrote: Can someone on the list point me to instructions on how to create interface, target and board files for this board? Start with the User's Guide; there's a chapter on that stuff. Thanks. I'd gone through the manual already once, but

Re: [Openocd-development] [PATCH 5/8] improve 'help' command

2009-11-21 Thread David Brownell
On Friday 20 November 2009, Zach Welch wrote: Also, any reason to hold off on this present series or the USB series? These command patches, didn't see a reason. Okay, I've made a few trivial changes to them after working on the changes to support proper usage function, but I will try

Re: [Openocd-development] Openocd vrs Commercial jtag dongles

2009-11-21 Thread David Brownell
On Saturday 21 November 2009, Duane Ellis wrote: It is just blindingly fast... I suspect that many of those speed improvements can be had even with a CPU-based solution ... if the CPU is driving the JTAG interface directly, it can do things like handshaking in microseconds, not the milliseconds

Re: [Openocd-development] Openocd vrs Commercial jtag dongles

2009-11-21 Thread Øyvind Harboe
There are a raft of tricks than can be employed to improve performance. The ZY1000 does 400kBytes/s w/arm7/9 @ 16MHz btw, using OpenOCD. The advantage of ZY1000 is low latency, but it has a feeble host CPU. The history of optimizing the ZY1000 showed significant improvement benefits for USB

Re: [Openocd-development] [PATCH 1/3] show script search dirs in debug log

2009-11-21 Thread David Brownell
On Saturday 21 November 2009, Andreas Fritiofson wrote: +   LOG_DEBUG(adding %s, dir); That one's a no-brainer ... merged. :) No comment on the other two, except that they need thought and I'll wait to see the followup (doc etc) especially on the third one.

Re: [Openocd-development] [PATCH 5/8] improve 'help' command

2009-11-21 Thread Zach Welch
On Sat, 2009-11-21 at 09:36 -0700, David Brownell wrote: On Friday 20 November 2009, Zach Welch wrote: Also, any reason to hold off on this present series or the USB series? These command patches, didn't see a reason. Okay, I've made a few trivial changes to them after working

[Openocd-development] [PATCH 0/12] jtag command registration cleanup

2009-11-21 Thread Zachary T Welch
Hi all, This series builds upon the last to cleanup the JTAG layer command handler registration. First, each module gets converted to use register_commands() with a command registration array. The final patch converts the jtag_interface structure to contain the registration list (and its size),

[Openocd-development] [PATCH 05/12] ft2232: use register_commands()

2009-11-21 Thread Zachary T Welch
Use register_commands() with a command registration array. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/jtag/ft2232.c | 60 +--- 1 files changed, 42 insertions(+), 18 deletions(-) diff --git a/src/jtag/ft2232.c

[Openocd-development] [PATCH 03/12] arm-jtag-ew: use register_commands()

2009-11-21 Thread Zachary T Welch
Uses register_commands() with command registration array. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/jtag/arm-jtag-ew.c | 16 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/jtag/arm-jtag-ew.c b/src/jtag/arm-jtag-ew.c index

[Openocd-development] [PATCH 04/12] at91rm9200: use register_commands()

2009-11-21 Thread Zachary T Welch
Use register_commands() with command registration array. --- This module was broken by previous changes, but no one has complained. Are there still users for this modules? Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/jtag/at91rm9200.c | 15 --- 1 files changed, 12

[Openocd-development] [PATCH 06/12] gw16012: use register_commands()

2009-11-21 Thread Zachary T Welch
Use register_commands() with command registration array. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/jtag/gw16012.c | 18 +- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/jtag/gw16012.c b/src/jtag/gw16012.c index bc0e472..5118562 100644

[Openocd-development] [PATCH 07/12] jlink: use register_commands()

2009-11-21 Thread Zachary T Welch
Use register_commands() with command registration array. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/jtag/jlink.c | 27 +++ 1 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/jtag/jlink.c b/src/jtag/jlink.c index 0f76c9f..200dfe4

[Openocd-development] [PATCH 01/12] openocd: update version/init command registration

2009-11-21 Thread Zachary T Welch
Use register_commands() for top-level version and init command. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/openocd.c | 25 +++-- 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/openocd.c b/src/openocd.c index 379373c..4d13611 100644

[Openocd-development] [PATCH 11/12] vsllink: use register_commands()

2009-11-21 Thread Zachary T Welch
Use register_commands() with command registration array. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/jtag/vsllink.c | 56 +-- 1 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/jtag/vsllink.c

[Openocd-development] [PATCH 10/12] jtag: use register_commands()

2009-11-21 Thread Zachary T Welch
Use register commands with command registration array. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/jtag/tcl.c | 187 1 files changed, 120 insertions(+), 67 deletions(-) diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index

[Openocd-development] [PATCH 12/12] remove register_callbacks from jtag interface

2009-11-21 Thread Zachary T Welch
Changes the jtag_interface-register_callbacks field to a list of commands to be registered. Changes callback to invocation of register_commands() with that command registration list. Removes all JTAG interface driver register_command callback functions, which the previous commits had converted

[Openocd-development] [PATCH 09/12] presto: use register_commands()

2009-11-21 Thread Zachary T Welch
Use register_commands() with command registration array. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/jtag/presto.c | 16 +--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/jtag/presto.c b/src/jtag/presto.c index f22bd9e..6f5833a 100644 ---

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Andreas Fritiofson
On Sat, Nov 21, 2009 at 7:14 PM, Zach Welch z...@superlucidity.net wrote: On Sat, 2009-11-21 at 16:53 +0100, Andreas Fritiofson wrote: Add $HOME/.openocd as the first default script search directory, allowing the user to override the standard scripts. Comments are in-line and at the end.

Re: [Openocd-development] [PATCH 0/3] improve default script search path

2009-11-21 Thread Michael Schwingen
Andreas Fritiofson wrote: This series improves the default script search path to include $HOME/.openocd. Good idea. I proposed that a long time ago, but it was rejected back then for forgotten reasons - which is why I use a wrapper script now. cu Michael

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Øyvind Harboe
On Sat, Nov 21, 2009 at 7:14 PM, Zach Welch z...@superlucidity.net wrote: On Sat, 2009-11-21 at 16:53 +0100, Andreas Fritiofson wrote: Add $HOME/.openocd as the first default script search directory, allowing the user to override the standard scripts. Comments are in-line and at the end.

Re: [Openocd-development] [PATCH 03/12] arm-jtag-ew: use register_commands()

2009-11-21 Thread Øyvind Harboe
Why is a table better than a fn call for registering commands? -- Øyvind Harboe http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer ___ Openocd-development mailing list

Re: [Openocd-development] [PATCH 03/12] arm-jtag-ew: use register_commands()

2009-11-21 Thread Zach Welch
On Sat, 2009-11-21 at 21:31 +0100, Øyvind Harboe wrote: Why is a table better than a fn call for registering commands? It's harder to screw up with the new way of doing things, as the registration parameters are more explicit. It also eliminates a lot of redundant calls to register_command{,s}

[Openocd-development] [patch 0/5] more ARM register cleanup

2009-11-21 Thread David Brownell
I'm trying to get rid of most I know how the register cache is laid out knowledge, and eventually to make the ARM11 code use the standard register framework. These are stepping stones along that path. - ARM11: remove useless #defines - simplify CPSR access - define set_cpsr() and a mapping

[Openocd-development] [patch 1/5] ARM11: remove disabled register hooks

2009-11-21 Thread David Brownell
Minor cleanup of ARM11 register handling: remove disabled register hooks. This should all be handled by shared code, and this stuff is just clutter. --- src/target/arm11.c | 89 --- src/target/arm11.h |7 +--- 2 files changed, 3

[Openocd-development] [patch 3/5] ARM: define two register utilities

2009-11-21 Thread David Brownell
Define arm_reg_current() ... returning handle to a given register, and encapsulating the current mode's register shadowing. It's got one current use, for reporting the current register set to GDB. This will let later patches clean up much ARMV4_5_CORE_REG_MODE() nastiness, saving a bit of code.

[Openocd-development] [patch 4/5] ARM: arm_set_cpsr() handles T and J bits

2009-11-21 Thread David Brownell
Have arm_set_cpsr() handle the two core state flags, updating the CPU state. This eliminates code in various debug_entry() paths, and marginally improves handling of the J bit. Catch and comment a few holes in the handling of the J bit on ARM926ejs cores ... it's unlikely our users will care

[Openocd-development] [patch 5/5] ARM: use arm_reg_current()

2009-11-21 Thread David Brownell
Start using the arm_reg_current() call. This shrinks and speeds the affected code. It can also prevent some coredumps coming from invalid CPSR values ... the ARMV4_5_CORE_REG_MODE() macro returns bogus registers if e.g. Secure Monitor mode isn't supported by the current CPU. --- Not fully

[Openocd-development] [patch 2/5] ARM: simplify CPSR handling

2009-11-21 Thread David Brownell
Stash a pointer to the CPSR in the struct arm, to help get rid of the (common) references to its index in the register cache. This removes almost all references to CPSR offsets outside of the toplevel ARM code ... except a pair related to the current ARM11 simulator logic (which should be

Re: [Openocd-development] STM32: flash write_image has an alignment issue and flash protect/erase is broken

2009-11-21 Thread Øyvind Harboe
On Thu, Nov 19, 2009 at 11:46 PM, Johnny Halfmoon jhalfm...@milksnot.com wrote: Hiya, I've found a few issues in OpenOCD and thought that I'd share before hacking a solution together. The following revision is used: commit 8f446fcf676e9cd13cf53d9946f0cae5d29a10ec Date:   Thu Nov 19

Re: [Openocd-development] [PATCH 04/12] at91rm9200: use register_commands()

2009-11-21 Thread David Brownell
On Saturday 21 November 2009, Zachary T Welch wrote: +static const struct command_registration at91rm9200_command_handlers[] = { +   { +   .name = at91rm9200_device, +   .handler = at91rm9200_handle_device_command, +   

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Andreas Fritiofson
On Sat, Nov 21, 2009 at 9:31 PM, Øyvind Harboe oyvind.har...@zylin.com wrote: On Sat, Nov 21, 2009 at 7:14 PM, Zach Welch z...@superlucidity.net wrote: PATH_MAX should be defined and available (in limits.h).  Use it. Why not just allocate dynamically and avoid the problem at the root? That

Re: [Openocd-development] [PATCH 04/12] at91rm9200: use register_commands()

2009-11-21 Thread Zach Welch
On Sat, 2009-11-21 at 16:24 -0700, David Brownell wrote: On Saturday 21 November 2009, Zachary T Welch wrote: +static const struct command_registration at91rm9200_command_handlers[] = { + { + .name = at91rm9200_device, + .handler =

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Zach Welch
On Sun, 2009-11-22 at 00:52 +0100, Andreas Fritiofson wrote: On Sat, Nov 21, 2009 at 9:31 PM, Øyvind Harboe oyvind.har...@zylin.com wrote: On Sat, Nov 21, 2009 at 7:14 PM, Zach Welch z...@superlucidity.net wrote: PATH_MAX should be defined and available (in limits.h). Use it. Why not

Re: [Openocd-development] [PATCH 04/12] at91rm9200: use register_commands()

2009-11-21 Thread David Brownell
On Saturday 21 November 2009, Zach Welch wrote: Could we get one less level of indent throughout? There a couple of arguments for using this style at the top-level: - It's consistent with the other indenting.  The statement has not been completed, so the code should not return to the

Re: [Openocd-development] STM32: flash write_image has an alignment issue and flash protect/erase is broken

2009-11-21 Thread Johnny Halfmoon
Hi, Øyvind Harboe wrote: Could you include a debug_level 3 trace? The conclusion seems a bit premature based on the limited information above. Maybe the following example (output is pasted below) can illustrate the issue a bit better. First I try to flash a 20KB block, then a 21KB

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Andreas Fritiofson
On Sun, Nov 22, 2009 at 1:13 AM, Zach Welch z...@superlucidity.net wrote: Checkout your branch and run 'git rebase master'.  That will update your branch against the current master.  Then, do the same thing with '-i'. Select the patches to change and mark them with 'e', change the files, add

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Zach Welch
On Sun, 2009-11-22 at 01:56 +0100, Andreas Fritiofson wrote: On Sun, Nov 22, 2009 at 1:13 AM, Zach Welch z...@superlucidity.net wrote: Checkout your branch and run 'git rebase master'. That will update your branch against the current master. Then, do the same thing with '-i'. Select the

[Openocd-development] [PATCH 2/2] support for scripts in $HOME/.openocd

2009-11-21 Thread Andreas Fritiofson
Add $HOME/.openocd as the first default script search directory, allowing the user to override the standard scripts. Update the user guide with information on where OpenOCD expects to find configuration files and scripts. Also fixed some minor formatting issues. Add entry to NEWS as well.