[Openocd-development] openocd patch: c527ebb bugfixes: tinker a bit with the targets command

2011-10-31 Thread gerrit
This is an automated email from Gerrit.

?yvind Harboe (oyvindhar...@gmail.com) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/141

-- gerrit

commit c527ebb4f303816a2fa2211379443590ce8659c2
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Thu Oct 27 23:51:50 2011 +0200

bugfixes: tinker a bit with the targets command

return error when target can not be found instead of ERROR_OK,
split fn.

Change-Id: I27bf3a05a6f4c8895dbf4299c8270b2117e4b3dd
Signed-off-by: Øyvind Harboe oyvind.har...@zylin.com

diff --git a/src/target/target.c b/src/target/target.c
index bd15620..18841f2 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -1861,26 +1861,36 @@ int target_write_u8(struct target *target, uint32_t 
address, uint8_t value)
return retval;
 }
 
+static int find_target(struct command_context *cmd_ctx, const char *name)
+{
+   struct target *target = get_target(name);
+   if (target == NULL) {
+   LOG_ERROR(Target: %s is unknown, try one of:\n, name);
+   return ERROR_FAIL;
+   }
+   if (!target-tap-enabled) {
+   LOG_USER(Target: TAP %s is disabled, 
+can't be the current target\n,
+target-tap-dotted_name);
+   return ERROR_FAIL;
+   }
+
+   cmd_ctx-current_target = target-target_number;
+   return ERROR_OK;
+}
+
+
 COMMAND_HANDLER(handle_targets_command)
 {
+   int retval = ERROR_OK;
if (CMD_ARGC == 1)
{
-   struct target *target = get_target(CMD_ARGV[0]);
-   if (target == NULL) {
-   command_print(CMD_CTX,Target: %s is unknown, try one 
of:\n, CMD_ARGV[0]);
-   goto DumpTargets;
-   }
-   if (!target-tap-enabled) {
-   command_print(CMD_CTX,Target: TAP %s is disabled, 
-   can't be the current target\n,
-   target-tap-dotted_name);
-   return ERROR_FAIL;
+   retval = find_target(CMD_CTX, CMD_ARGV[0]);
+   if (retval == ERROR_OK) {
+   /* we're done! */
+   return retval;
}
-
-   CMD_CTX-current_target = target-target_number;
-   return ERROR_OK;
}
-DumpTargets:;
 
struct target *target = all_targets;
command_print(CMD_CTX, TargetName Type   Endian 
TapNameState   );
@@ -1899,19 +1909,20 @@ DumpTargets:;
marker = '*';
 
/* keep columns lined up to match the headers above */
-   command_print(CMD_CTX, %2d%c %-18s %-10s %-6s %-18s %s,
- target-target_number,
- marker,
- target_name(target),
- target_type_name(target),
- 
Jim_Nvp_value2name_simple(nvp_target_endian,
-   
target-endianness)-name,
- target-tap-dotted_name,
- state);
+   command_print(CMD_CTX, 
+   %2d%c %-18s %-10s %-6s %-18s %s,
+   target-target_number,
+   marker,
+   target_name(target),
+   target_type_name(target),
+   Jim_Nvp_value2name_simple(nvp_target_endian,
+   target-endianness)-name,
+   target-tap-dotted_name,
+   state);
target = target-next;
}
 
-   return ERROR_OK;
+   return retval;
 }
 
 /* every 300ms we check for reset  powerdropout and issue a reset halt if 
so. */

-- 
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Gerrit mail subject

2011-10-31 Thread Alain Mouette


Em 28-10-2011 05:35, Jon Povey escreveu:

In fact I would get rid of [Openocd-development] too. There are headers
for sorting mail, other mailing lists I use don't have this, and are
more usable for that IMO.


-1
What about making it much shorter, like: [oocd-dev]

Alain
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] openocd patch: 91a30ac warnings: null pointer check fix

2011-10-31 Thread gerrit
This is an automated email from Gerrit.

?yvind Harboe (oyvindhar...@gmail.com) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/142

-- gerrit

commit 91a30acedbbd5477e7a22aba4785d7eb5e6b81b2
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Mon Oct 31 21:21:35 2011 +0100

warnings: null pointer check fix

rewrite broken null pointer check code by reducing scope
of variable.

Change-Id: I8254f6849b187e5c9cd083053cdc11973c6fe339
Signed-off-by: Øyvind Harboe oyvind.har...@zylin.com

diff --git a/src/target/target_request.c b/src/target/target_request.c
index 3cdca5e..1fedfb2 100644
--- a/src/target/target_request.c
+++ b/src/target/target_request.c
@@ -194,11 +194,9 @@ static int add_debug_msg_receiver(struct command_context 
*cmd_ctx, struct target
 static struct debug_msg_receiver* find_debug_msg_receiver(struct 
command_context *cmd_ctx, struct target *target)
 {
int do_all_targets = 0;
-   struct debug_msg_receiver **p = target-dbgmsg;
 
/* if no target has been specified search all of them */
-   if (target == NULL)
-   {
+   if (target == NULL) {
/* if no targets haven been specified */
if (all_targets == NULL)
return NULL;
@@ -207,8 +205,9 @@ static struct debug_msg_receiver* 
find_debug_msg_receiver(struct command_context
do_all_targets = 1;
}
 
-   do
-   {
+   /* so we target != null */
+   struct debug_msg_receiver **p = target-dbgmsg;
+   do {
while (*p)
{
if ((*p)-cmd_ctx == cmd_ctx)

-- 
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] openocd patch: 87ad830 warning fix: add self-consitency check to remove warning

2011-10-31 Thread gerrit
This is an automated email from Gerrit.

?yvind Harboe (oyvindhar...@gmail.com) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/143

-- gerrit

commit 87ad830a0b9f6e2d8104f93f3e074b92aba4ef5f
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Mon Oct 31 21:26:28 2011 +0100

warning fix: add self-consitency check to remove warning

verify promise of code that more code can be pasted with an
assert at the end condition of the code passage that builds
string.

Change-Id: I76a4e5f91b9142fff932e1493cb43c29eb6a0f80
Signed-off-by: Øyvind Harboe oyvind.har...@zylin.com

diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index 8a59fd3..f3732f1 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -198,6 +198,8 @@ int gdb_thread_packet(struct connection *connection, char 
*packet, int packet_si
tmp_str_ptr += sprintf( tmp_str_ptr,  : %s, 
detail-extra_info_str );
}
 
+   assert(strlen(tmp_str) == (size_t) (tmp_str_ptr - 
tmp_str));
+
char * hex_str = (char*) malloc( strlen(tmp_str)*2 +1 );
str_to_hex( hex_str, tmp_str );
 

-- 
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] openocd patch: 3be0092 warning fix: remove senseless assignment before bailing out of fn w/error

2011-10-31 Thread gerrit
This is an automated email from Gerrit.

?yvind Harboe (oyvindhar...@gmail.com) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/144

-- gerrit

commit 3be00928f3d407c4476590dcadd3c707ba915c3b
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Mon Oct 31 21:52:10 2011 +0100

warning fix: remove senseless assignment before bailing out of fn w/error

Change-Id: I822f3adce0eccb880007673d60c7eccf7d36b398
Signed-off-by: Øyvind Harboe oyvind.har...@zylin.com

diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c
index 6b43479..7160f8e 100644
--- a/src/target/mips32_pracc.c
+++ b/src/target/mips32_pracc.c
@@ -183,7 +183,6 @@ static int mips32_pracc_exec_read(struct 
mips32_pracc_context *ctx, uint32_t add
/* TODO: send JMP 0xFF20 instruction. Hopefully processor 
jump back
 * to start of debug vector */
 
-   data = 0;
LOG_ERROR(Error reading unexpected address 0x%8.8 PRIx32 , 
address);
return ERROR_JTAG_DEVICE_ERROR;
}

-- 
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] openocd patch: ac49319 str9x: explain compiler that a local variable will always be initialized

2011-10-31 Thread gerrit
This is an automated email from Gerrit.

?yvind Harboe (oyvindhar...@gmail.com) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/145

-- gerrit

commit ac49319f38c6d8bd7d3a236b4b677e1e7470b0c7
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Mon Oct 31 22:03:49 2011 +0100

str9x: explain compiler that a local variable will always be initialized

Change-Id: I9ddb2793b4cdbf6acea6f69973531491e4ebcc5b
Signed-off-by: Øyvind Harboe oyvind.har...@zylin.com

diff --git a/src/flash/nor/str9x.c b/src/flash/nor/str9x.c
index 61a438f..63cfd18 100644
--- a/src/flash/nor/str9x.c
+++ b/src/flash/nor/str9x.c
@@ -280,6 +280,9 @@ static int str9x_erase(struct flash_bank *bank, int first, 
int last)
total_timeout = 1000;
}
 
+   /* this is so the compiler can *know* */
+   assert(total_timeout  0);
+
for (i = first; i = last; i++)
{
int retval;

-- 
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Gerrit mail subject

2011-10-31 Thread Mathias K.
Hello,

Am 31.10.2011 06:10, schrieb Peter Stuge:
 Mathias K. wrote:
 can you remove the magic incomplete number too?

 In this case the 1533d9d. This number is useless in the subject:

 I disagree. This is an abbreviated commit hash, which identifies the
 commit that was pushed. There's also Gerrit's identifiers, but losing
 the commit hash would be impractical.

 Okay, is it possible to change the commit message on a commit with the
 same commit hash?
 
 No, besides contents the hash also depends on commit time and commit
 message. That's exactly why the hash is useful, to identify the
 particular commit that is refered to.
 

Please explain what we can do with this id in the subject in this mailinglist.
Anyway, can you give gerrit a real name e.g. CIA like some ICQ bots?


Regards,

Mathias

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Gerrit mail subject

2011-10-31 Thread Mathias K.
Hello,

 Em 28-10-2011 05:35, Jon Povey escreveu:
 In fact I would get rid of [Openocd-development] too. There are headers
 for sorting mail, other mailing lists I use don't have this, and are
 more usable for that IMO.
 
 -1
 What about making it much shorter, like: [oocd-dev]

the subject is part of the header and any prefix is redundant because the 
list-id is also part of
the header.

Subject: Re: [Openocd-development] Gerrit mail subject
List-Id: openocd-development.lists.berlios.de

If you want to see it right then visit the lkml.


Regards,

Mathias


___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] openocd patch: 459b9f8 flash: add Stellaris Blizzard class

2011-10-31 Thread gerrit
This is an automated email from Gerrit.

Spencer Oliver (s...@spen-soft.co.uk) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/146

-- gerrit

commit 459b9f8334c55ae38f5d1bb1110dc242a1947b5b
Author: Spencer Oliver s...@spen-soft.co.uk
Date:   Mon Oct 31 22:20:06 2011 +

flash: add Stellaris Blizzard class

Change-Id: I83f0d6edf3ab31d9fa86682f20cec77dc47ba2f6
Signed-off-by: Spencer Oliver s...@spen-soft.co.uk

diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c
index 4a21028..39c189c 100644
--- a/src/flash/nor/stellaris.c
+++ b/src/flash/nor/stellaris.c
@@ -377,7 +377,7 @@ static char * StellarisClassname[7] =
Unknown,
DustDevil,
Tempest,
-   Unknown,
+   Blizzard,
Firestorm
 };
 

-- 
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] Can't halt Calao USB A9263 with OpenOCD 0.5.0

2011-10-31 Thread Thomas Petazzoni
Hello,

(Resending to the list @berlios.de since the list
@lists.sourceforge.net doesn't seem to work)

I am trying to use OpenOCD 0.5.0 on the Calao USB A9263 board. This
board is based on the AT91SAM9263 SoC and uses a built-in FTDI 2232 to
provide USB access to the JTAG interface.

The problem is that OpenOCD is not able to halt the target (I'm trying
to halt while the board runs U-Boot, so there is no Linux running doing
some crazy power management stuff). Here is what I get on the telnet
interface:

$ telnet localhost 
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
 halt  
Halt timed out, wake up GDB.
timed out while waiting for target halted
in procedure 'halt'
 halt  
Halt timed out, wake up GDB.
timed out while waiting for target halted
in procedure 'halt'

Here is what I see on OpenOCD output:

$ ../src/openocd -f ./interface/calao-usb-a9263.cfg 
Open On-Chip Debugger 0.5.0 (2011-10-31-11:55)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter_nsrst_delay: 200
jtag_ntrst_delay: 200
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
adapter_nsrst_delay: 300
jtag_ntrst_delay: 200
RCLK - adaptive
1
Info : RCLK (adaptive clock speed) not supported - fallback to 3 kHz
Info : JTAG tap: at91sam9263.cpu tap/device found: 0x0792603f (mfg:
0x01f, part: 0x7926, ver: 0x0) Info : Embedded ICE version 15
Error: unknown EmbeddedICE version (comms ctrl: 0xfffe)
Info : at91sam9263.cpu: hardware has 2 breakpoint/watchpoint units
Info : accepting 'telnet' connection from 
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted
in procedure 'halt'
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted
in procedure 'halt'

And here is the config file I'm using (interface/calao-usb-a9263.cfg) :

$ cat interface/calao-usb-a9263.cfg 
#
# CALAO Systems USB-A9263
#
# http://www.calao-systems.com/
#

interface ft2232
ft2232_layout jtagkey
ft2232_device_desc USB-A9263
ft2232_vid_pid 0x0403 0x6010
adapter_nsrst_delay 200
jtag_ntrst_delay 200
script target/at91sam9263.cfg

In case it is useful, I have attached the output of openocd started in
debug mode.

Do you have any clue of what's going on ?

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
$ ../src/openocd -d -f ./interface/calao-usb-a9263.cfg 
Open On-Chip Debugger 0.5.0 (2011-10-31-11:55)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.berlios.de/doc/doxygen/bugs.html
User : 11 3 command.c:557 command_print(): debug_level: 3
Debug: 12 3 configuration.c:45 add_script_search_dir(): adding /home/thomas/.openocd
Debug: 13 3 configuration.c:45 add_script_search_dir(): adding /usr/local/share/openocd/site
Debug: 14 3 configuration.c:45 add_script_search_dir(): adding /usr/local/share/openocd/scripts
Debug: 15 3 configuration.c:87 find_file(): found ./interface/calao-usb-a9263.cfg
Debug: 16 3 command.c:151 script_debug(): command - ocd_command ocd_command type ocd_interface ft2232
Debug: 17 3 command.c:151 script_debug(): command - interface ocd_interface ft2232
Debug: 19 3 command.c:364 register_command_handler(): registering 'ocd_ft2232_device_desc'...
Debug: 20 3 command.c:364 register_command_handler(): registering 'ocd_ft2232_serial'...
Debug: 21 3 command.c:364 register_command_handler(): registering 'ocd_ft2232_layout'...
Debug: 22 4 command.c:364 register_command_handler(): registering 'ocd_ft2232_vid_pid'...
Debug: 23 4 command.c:364 register_command_handler(): registering 'ocd_ft2232_latency'...
Info : 24 4 transport.c:123 allow_transports(): only one transport option; autoselect 'jtag'
Debug: 25 4 command.c:364 register_command_handler(): registering 'ocd_jtag_flush_queue_sleep'...
Debug: 26 4 command.c:364 register_command_handler(): registering 'ocd_jtag_rclk'...
Debug: 27 4 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_delay'...
Debug: 28 4 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_assert_width'...
Debug: 29 4 command.c:364 register_command_handler(): registering 'ocd_scan_chain'...
Debug: 30 4 command.c:364 register_command_handler(): registering 'ocd_jtag_reset'...
Debug: 31 4 command.c:364 register_command_handler(): registering 'ocd_runtest'...
Debug: 32 4 command.c:364 register_command_handler(): registering 'ocd_irscan'...
Debug: 33 4 command.c:364 register_command_handler(): registering 'ocd_verify_ircapture'...
Debug: 34 4 command.c:364 register_command_handler(): registering 'ocd_verify_jtag'...
Debug: 35 4 command.c:364 register_command_handler(): registering 'ocd_tms_sequence'...
Debug: 36 4 command.c:364 register_command_handler(): registering 'ocd_wait_srst_deassert'...
Debug: 37 4 command.c:364