[Openocd-development] SWD interface patches, constructive criticism needed.

2009-11-14 Thread Andrew Rogers
SWD is not finished yet, a long way to go. Adding the actual hardware drivers is a almost the last thing on my list. I want to get the framework in place first. What I have done is to get a SWD interface listed when you use 'openocd -c interface_list'. There's a new struct (interface_base_t)

Re: [Openocd-development] Embedding OpenOCD on low end microcontroller.

2009-11-14 Thread R.Doss
Hallo Martin, The question is: It is possible to setup a embedded Linux on your ARM7? Openocd can run unter Linux. I am not sure it is simple to run on your board. Linux need more RAM as the most ARM7 board have. This is better a task with an ARM9 Board. Rene Martín Sebastián Baudino

Re: [Openocd-development] SWD interface patches, constructive criticism needed.

2009-11-14 Thread Zach Welch
On Sat, 2009-11-14 at 08:22 +, Andrew Rogers wrote: SWD is not finished yet, a long way to go. Adding the actual hardware drivers is a almost the last thing on my list. I want to get the framework in place first. What I have done is to get a SWD interface listed when you use 'openocd -c

[Openocd-development] [PATCH 0/3] remove vestigial helpers

2009-11-14 Thread Zachary T Welch
Hi all, I discovered that my series that upgraded types missed a few spots where scan_field_s was still referenced. Since it was odd that this code should continue to compile, I investigated and discovered that the routines were not referenced (but didn't access the struct anyway). The

[Openocd-development] [PATCH 1/3] struct scan_field_s - struct scan_field

2009-11-14 Thread Zachary T Welch
Remove obsolete suffix from struct scan_field. Somehow, these definitions did not get updated but did not cause any errors. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/helper/binarybuffer.c |2 +- src/helper/binarybuffer.h |4 ++-- src/target/arm_jtag.c | 24

[Openocd-development] [PATCH 2/3] remove unused buf_to_u32_handler

2009-11-14 Thread Zachary T Welch
Purge an unused routine from the tree and remove a layering violation. If this code is needed, it should reappear somwhere in src/jtag/, where struct scan_field gets defined. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/helper/binarybuffer.c |9 -

[Openocd-development] [PATCH 3/3] remove unused arm_jtag_buf_to_* helpers

2009-11-14 Thread Zachary T Welch
Removes unused arm_jtag_buf_* helpers from arm_jtag.[ch]. These could reappear if patches are provided to conver the tree to use them, but this code should not be in the master tree until that series is ready. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/target/arm_jtag.c |

Re: [Openocd-development] [PATCH 0/3] remove vestigial helpers

2009-11-14 Thread Dean Glazeski
Another one that is still in the tree is command_context_s. Any reason that still has the '_s'? // Dean Glazeski On Sat, Nov 14, 2009 at 9:09 AM, Zachary T Welch z...@superlucidity.netwrote: Hi all, I discovered that my series that upgraded types missed a few spots where scan_field_s was

Re: [Openocd-development] [PATCH 0/3] remove vestigial helpers

2009-11-14 Thread Zach Welch
I pushed patches to fix the structures in command.h late, due to needing to rebase the entire series on my command_handler series. They went into the tree around 18 hours ago. --Z On Sat, 2009-11-14 at 09:20 -0600, Dean Glazeski wrote: Another one that is still in the tree is

[Openocd-development] Command Syntax Errors While in Configuration Mode

2009-11-14 Thread Dean Glazeski
Hi all, While testing some of my new commands, it appears that OpenOCD will just fail with no error messages if there is a command syntax error while in the configuration stage. I think it's because I return an error code instead of ERROR_OK. I'm not sure how the command handler is called, so I

Re: [Openocd-development] Command Syntax Errors While in Configuration Mode

2009-11-14 Thread Zach Welch
On Sat, 2009-11-14 at 10:58 -0600, Dean Glazeski wrote: Hi all, While testing some of my new commands, it appears that OpenOCD will just fail with no error messages if there is a command syntax error while in the configuration stage. I think it's because I return an error code instead of

[Openocd-development] MWW Problem

2009-11-14 Thread Dean Glazeski
Hi all, It appears that with Zach's recent command handler work the MWW command broke. The reason is because of how the args pointer is modified (incremented in this case) as the function executes. It then uses the CMD_NAME macro and this retrieves 'phys' instead of 'mww'. In addition, it

Re: [Openocd-development] MWW Problem

2009-11-14 Thread Zach Welch
On Sat, 2009-11-14 at 12:45 -0600, Dean Glazeski wrote: Hi all, It appears that with Zach's recent command handler work the MWW command broke. The reason is because of how the args pointer is modified (incremented in this case) as the function executes. It then uses the CMD_NAME macro and

[Openocd-development] [PATCH 0/11] improve binarybuffers routines

2009-11-14 Thread Zachary T Welch
Hi all, This series updates the binarybuffers helpers. While the changes have been split almost per-function, they could be split further if desired. Overall, I expect a modest improvements for operations that use these, because they now use memset or memcpy when appropriate. Otherwise, they

[Openocd-development] [PATCH 02/11] remove unused buf_to_u32_handler

2009-11-14 Thread Zachary T Welch
Purge an unused routine from the tree and remove a layering violation. If this code is needed, it should reappear somwhere in src/jtag/, where struct scan_field gets defined. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/helper/binarybuffer.c |9 -

[Openocd-development] [PATCH 01/11] struct scan_field_s - struct scan_field

2009-11-14 Thread Zachary T Welch
Remove obsolete suffix from struct scan_field. Somehow, these definitions did not get updated but did not cause any errors. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/helper/binarybuffer.c |2 +- src/helper/binarybuffer.h |4 ++-- src/target/arm_jtag.c | 24

[Openocd-development] [PATCH 07/11] improve buf_cmp and buf_cmp_mask helpers

2009-11-14 Thread Zachary T Welch
Rewrite buf_cmp to use memcpy for bulk of comparison. Add static helper to perform comparison of trailing byte, which uses another static helper to perform a maksed comparison. The masked comparison helper is used by the buf_cmp_mask to simplify its loop. Improve types to use void *, unsigned,

[Openocd-development] [PATCH 04/11] binarybuffer: fix whitespace related issues

2009-11-14 Thread Zachary T Welch
Add inter-operator whitespace. Improve existing documentation. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/helper/binarybuffer.c |6 +++--- src/helper/binarybuffer.h | 35 +++ 2 files changed, 18 insertions(+), 23 deletions(-) diff --git

[Openocd-development] [PATCH 03/11] remove unused arm_jtag_buf_to_* helpers

2009-11-14 Thread Zachary T Welch
Removes unused arm_jtag_buf_* helpers from arm_jtag.[ch]. These could reappear if patches are provided to conver the tree to use them, but this code should not be in the master tree until that series is ready. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/target/arm_jtag.c |

[Openocd-development] [PATCH 08/11] improve buf_cpy helper

2009-11-14 Thread Zachary T Welch
Use memcpy for bulk of copy, improve final byte handling. Improve types by using void * for buffers and unsigned for size. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/helper/binarybuffer.c | 17 + src/helper/binarybuffer.h |3 ++- 2 files changed, 11

[Openocd-development] [PATCH 06/11] improve str_to_buf and buf_to_str helpers

2009-11-14 Thread Zachary T Welch
Improve types: use void * and unsigned. Move all variables to point of first use. Move radix guessing logic to new str_radix_guess helper. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/helper/binarybuffer.c | 126 +++--

[Openocd-development] [PATCH 09/11] improve buf_set_ones

2009-11-14 Thread Zachary T Welch
Use memset instead of loop. Improve types, using void * and unsigned. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/helper/binarybuffer.c | 18 +- src/helper/binarybuffer.h |3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git

[Openocd-development] [PATCH 10/11] improve buf_set_buf helper

2009-11-14 Thread Zachary T Welch
Use void * and unsigned types for buffer and their sizes. Allows it to be used with more than uint8_t * without casts. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/helper/binarybuffer.c |9 ++--- src/helper/binarybuffer.h |4 ++-- 2 files changed, 8 insertions(+), 5

[Openocd-development] [PATCH 11/11] improve inline binarybuffer helpers

2009-11-14 Thread Zachary T Welch
Use void*, unsigned, and bool types with inline helpers. Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/helper/binarybuffer.h | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/helper/binarybuffer.h b/src/helper/binarybuffer.h index

[Openocd-development] [PATCH 05/11] bitbuffer: move variables to point of first use

2009-11-14 Thread Zachary T Welch
Signed-off-by: Zachary T Welch z...@superlucidity.net --- src/helper/binarybuffer.c | 31 +++ src/helper/binarybuffer.h |6 ++ 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/src/helper/binarybuffer.c b/src/helper/binarybuffer.c index

Re: [Openocd-development] [PATCH 0/11] improve binarybuffers routines

2009-11-14 Thread Zach Welch
On Sat, 2009-11-14 at 11:14 -0800, Zachary T Welch wrote: Hi all, This series updates the binarybuffers helpers. While the changes have been split almost per-function, they could be split further if desired. Overall, I expect a modest improvements for operations that use these, because

Re: [Openocd-development] MWW Problem

2009-11-14 Thread Krzysztof Dziuba
Hello, Zach Welch pisze: On Sat, 2009-11-14 at 12:45 -0600, Dean Glazeski wrote: Hi all, It appears that with Zach's recent command handler work the MWW command broke. The reason is because of how the args pointer is modified (incremented in this case) as the function executes. It then uses

[Openocd-development] [patch] remove annoying $URL$ startup message

2009-11-14 Thread David Brownell
It's completely unused; the obnoxious DANGER!!! comments don't even explain what it was intended to do. --- Do any code historians know what this was supposed to do? Whatever the intent was, it hasn't been achieved for quite a long time... unless that intent was annoy! src/openocd.c | 17

Re: [Openocd-development] [PATCH 05/11] bitbuffer: move variables to point of first use

2009-11-14 Thread David Brownell
For the record, I still prefer to see declarations grouped at the beginning of their block, after a left bracket. That way they're always easy to find. So you won't see me adding patches like this ... ___ Openocd-development mailing list

Re: [Openocd-development] [patch] remove annoying $URL$ startup message

2009-11-14 Thread Øyvind Harboe
On Sat, Nov 14, 2009 at 9:03 PM, David Brownell davi...@pacbell.net wrote: It's completely unused; the obnoxious DANGER!!! comments don't even explain what it was intended to do. Anachronism. Keyword expansion and patch problems with svn... -- Øyvind Harboe http://www.zylin.com/zy1000.html

Re: [Openocd-development] [PATCH 05/11] bitbuffer: move variables to point of first use

2009-11-14 Thread Øyvind Harboe
On Sat, Nov 14, 2009 at 8:49 PM, David Brownell davi...@pacbell.net wrote: For the record, I still prefer to see declarations grouped at the beginning of their block, after a left bracket. That way they're always easy to find. What Zach is doing here is to reduce the scope of a variable.

Re: [Openocd-development] Embedding OpenOCD on low end microcontroller.

2009-11-14 Thread Michel Catudal
David Brownell a crit: On Friday 13 November 2009, Martn Sebastin Baudino wrote: But now I'm been asked to look at the code and see if it is possible to actually embed it on an STR7 board, which we use to automatically test other boards. Our goal would be (for now) to just flash

Re: [Openocd-development] [PATCH 08/11] improve buf_cpy helper

2009-11-14 Thread Zach Welch
On Sat, 2009-11-14 at 12:56 -0700, David Brownell wrote: On Saturday 14 November 2009, Zachary T Welch wrote: - for (unsigned i = 0, num_bytes = CEIL(size, 8); i num_bytes; i++) - to[i] = from[i]; + // copy entire buffer + memcpy(_to, from, CEIL(size, 8));

Re: [Openocd-development] MWW Problem

2009-11-14 Thread Zach Welch
On Sat, 2009-11-14 at 20:59 +0100, Krzysztof Dziuba wrote: Hello, Zach Welch pisze: On Sat, 2009-11-14 at 12:45 -0600, Dean Glazeski wrote: Hi all, It appears that with Zach's recent command handler work the MWW command broke. The reason is because of how the args pointer is

Re: [Openocd-development] [PUSHED 3/3] remove vestigial helpers

2009-11-14 Thread Zach Welch
On Sat, 2009-11-14 at 07:09 -0800, Zachary T Welch wrote: Hi all, I discovered that my series that upgraded types missed a few spots where scan_field_s was still referenced. Since it was odd that this code should continue to compile, I investigated and discovered that the routines were not

Re: [Openocd-development] Embedding OpenOCD on low end mi crocontroller.

2009-11-14 Thread David Brownell
On Saturday 14 November 2009, Michel Catudal wrote: There are some low cost AVR32 and ARM boards allready made that can run embedded Linux. http://shop.embedded-projects.net/product_info.php/language/en/amp;ref/2/info/p12 The grasshopper is only €85, the atmel board is around $89

[Openocd-development] [patch 0/4] various fixes ...

2009-11-14 Thread David Brownell
I'll send these out for comment, and merge tomorrow if nobody objects. - Make the examined flag be per-target. This is a bugfix, but the bug wouldn't have been seen without multiple CPU targets. - Two arm7/arm9 memory utils aren't actually arm7/arm9-specific; they're generic for

[Openocd-development] [patch 1/4] target: make examined flag be per-target

2009-11-14 Thread David Brownell
Previously this flag was stored in target_type, so that for example if there were two ARM7TDMI targets in a scan chain, both would claim to have been examined although only the first one actually had its examine() method called. Move this state to where it should have been in the first place, and

[Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-14 Thread David Brownell
Three changes: remove ARM11_HANDLER() in favor of normal structure initialization syntax; fix goofy indentation in that structure; and don't needlessly export arm11_register_commands(), it's only called through that method table. --- src/target/arm11.c | 88

Re: [Openocd-development] [PATCH 08/11] improve buf_cpy helper

2009-11-14 Thread David Brownell
On Saturday 14 November 2009, Zach Welch wrote: On Sat, 2009-11-14 at 12:56 -0700, David Brownell wrote: On Saturday 14 November 2009, Zachary T Welch wrote: - for (unsigned i = 0, num_bytes = CEIL(size, 8); i num_bytes; i++) - to[i] = from[i]; + // copy

[Openocd-development] [patch 4/4] ARM11: use now-generic memory utils

2009-11-14 Thread David Brownell
Now the ARM11 cores can use the renamed arm_checksum_memory() and arm_blank_check_memory() routines ... do so. Sanity checked with flash erase_check of both NOR banks on an OMAP2420 ... the algorithm code dumped four lines of of poll status after each of almost 520 block (yes, *very* annoying)