Re: [Openocd-development] New patch to review for openocd: 7067428 Revert "Evaluate 'script' in the global scope"

2011-10-24 Thread Jie Zhang
On Fri, Oct 21, 2011 at 1:36 PM, Freddie Chopin  wrote:
> On 2011-10-21 19:09, Øyvind Harboe (Code Review) wrote:
>> Please look up the discussion of why this code was modified to use
>> uplevel and amend the commit with an explanation of why we should use
>> the proposed behaviour instead.
>
> I cannot comment on Gerrit...
>
> The discussion -
> https://lists.berlios.de/pipermail/openocd-development/2011-August/020462.html
> - not easy to find (links to list are links to NEW and EMPTY sourceforge
> forum) so I had to google that up. There is absolutely no discussion or
> reasoning there, this change was introduced "just because" and based on "why
> not?".
>
> Or maybe there's another discussion I cannot find.
>
This is the first email of the discussion:

https://lists.berlios.de/pipermail/openocd-development/2011-July/020359.html


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


[Openocd-development] New patch to review for openocd: afa2909 armv7a: make local functions static

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

Andreas Fritiofson (andreas.fritiof...@gmail.com) just uploaded a new patch set 
to Gerrit, which you can find at http://openocd.zylin.com/118

-- gerrit

commit afa2909e9c3552d713f7ff460b79d62bbdf74a1e
Author: Andreas Fritiofson 
Date:   Tue Oct 25 00:36:24 2011 +0200

armv7a: make local functions static

Also fix a spelling error and remove the declaration for a non-existent
function from the header.

Change-Id: I13177e2d81aa167c05c1cc766f06924211e6d735
Signed-off-by: Andreas Fritiofson 

diff --git a/src/target/armv7a.c b/src/target/armv7a.c
index 0bac27f..d74b99b 100644
--- a/src/target/armv7a.c
+++ b/src/target/armv7a.c
@@ -87,7 +87,7 @@ done:
/* (void) */ dpm->finish(dpm);
 }
 
-int armv7a_read_ttbcr(struct target *target)
+static int armv7a_read_ttbcr(struct target *target)
 {
struct armv7a_common *armv7a = target_to_armv7a(target);
struct arm_dpm *dpm = armv7a->armv4_5_common.dpm;
@@ -454,7 +454,7 @@ static int armv7a_handle_l2x_cache_info_command(struct 
command_context *cmd_ctx,
 }
 
 
-int armv7a_l2x_cache_init(struct target *target, uint32_t base, uint32_t way)
+static int armv7a_l2x_cache_init(struct target *target, uint32_t base, 
uint32_t way)
 {
struct armv7a_l2x_cache *l2x_cache;
struct target_list *head = target->head;
@@ -542,7 +542,7 @@ int armv7a_handle_cache_info_command(struct command_context 
*cmd_ctx,
 
 
 /*  retrieve core id cluster id  */
-int arnv7a_read_mpidr(struct target *target)
+static int armv7a_read_mpidr(struct target *target)
 {
 int retval = ERROR_FAIL;
struct armv7a_common *armv7a = target_to_armv7a(target);
@@ -711,7 +711,7 @@ int armv7a_identify_cache(struct target *target)
 
 done:
dpm->finish(dpm);
-arnv7a_read_mpidr(target);
+   armv7a_read_mpidr(target);
return retval;
 
 }
diff --git a/src/target/armv7a.h b/src/target/armv7a.h
index dde1f23..6f54ce6 100644
--- a/src/target/armv7a.h
+++ b/src/target/armv7a.h
@@ -167,8 +167,6 @@ target_to_armv7a(struct target *target)
 
 int armv7a_arch_state(struct target *target);
 int armv7a_identify_cache(struct target *target);
-struct reg_cache *armv7a_build_reg_cache(struct target *target,
-   struct armv7a_common *armv7a_common);
 int armv7a_init_arch_info(struct target *target, struct armv7a_common *armv7a);
 int armv7a_mmu_translate_va_pa(struct target *target, uint32_t va,
uint32_t *val,int meminfo);

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


[Openocd-development] New patch to review for openocd: 1c43b43 armv7a: fix scan-build warnings

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

Andreas Fritiofson (andreas.fritiof...@gmail.com) just uploaded a new patch set 
to Gerrit, which you can find at http://openocd.zylin.com/119

-- gerrit

commit 1c43b43377ed5e0e09a40b09b556b6194dc23958
Author: Andreas Fritiofson 
Date:   Tue Oct 25 00:47:21 2011 +0200

armv7a: fix scan-build warnings

"Value stored to 'retval' is never read": Check and propagate error
"Dereference of null pointer": Probably bogus, maybe triggered by the null
check on armv7a, so remove the check since it can't be null anyway.

Change-Id: I3bc44e52af1589ff40e6a42deda0ce7f3a25e397
Signed-off-by: Andreas Fritiofson 

diff --git a/src/target/armv7a.c b/src/target/armv7a.c
index d74b99b..67c563e 100644
--- a/src/target/armv7a.c
+++ b/src/target/armv7a.c
@@ -147,6 +147,8 @@ int armv7a_mmu_translate_va(struct target *target,  
uint32_t va, uint32_t *val)
retval = dpm->instr_read_data_r0(dpm,
ARMV4_5_MRC(15, 0, 0, 2, 0, ttb),
&ttb);
+   if (retval != ERROR_OK)
+   return retval;
retval = armv7a->armv7a_mmu.read_physical_memory(target,
(ttb & 0xc000) | ((va & 0xfff0) >> 18),
4, 1, (uint8_t*)&first_lvl_descriptor);
@@ -461,8 +463,6 @@ static int armv7a_l2x_cache_init(struct target *target, 
uint32_t base, uint32_t
struct target *curr;
 
struct armv7a_common *armv7a = target_to_armv7a(target);
-   if (armv7a == NULL)
-   LOG_ERROR("not an armv7a target");
l2x_cache = calloc(1, sizeof(struct armv7a_l2x_cache));
l2x_cache->base = base;
l2x_cache->way = way;
@@ -616,6 +616,7 @@ int armv7a_identify_cache(struct target *target)
2, 0,   /* op1, op2 */
0, 0,   /* CRn, CRm */
&cache_selected);
+   if (retval!=ERROR_OK) goto done;
/* select instruction cache*/
/*  MCR p15, 2,, c0, c0, 0; Write CSSELR */
/*  [0]  : 1 instruction cache selection , 0 data cache selection */

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


[Openocd-development] New patch to review for openocd: 5143927 armv7m: improve error handling

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

Andreas Fritiofson (andreas.fritiof...@gmail.com) just uploaded a new patch set 
to Gerrit, which you can find at http://openocd.zylin.com/117

-- gerrit

commit 51439275a222ebd5abd759995289689bae3d10c9
Author: Andreas Fritiofson 
Date:   Tue Oct 25 00:03:42 2011 +0200

armv7m: improve error handling

Propagate errors unchanged.
Free allocated working area in the error return path.
Remove duplicated cleanup code by rewriting the logic.
As a side-effect, fixes a scan-build warning.

Change-Id: I80e3c0015be672778f916e998c8c2e4f23d7588c
Signed-off-by: Andreas Fritiofson 

diff --git a/src/target/armv7m.c b/src/target/armv7m.c
index 39a89b9..d9e63d7 100644
--- a/src/target/armv7m.c
+++ b/src/target/armv7m.c
@@ -626,17 +626,16 @@ int armv7m_checksum_memory(struct target *target,
 
uint32_t i;
 
-   if (target_alloc_working_area(target, sizeof(cortex_m3_crc_code), 
&crc_algorithm) != ERROR_OK)
-   {
-   return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
-   }
+   retval = target_alloc_working_area(target, sizeof(cortex_m3_crc_code), 
&crc_algorithm);
+   if (retval != ERROR_OK)
+   return retval;
 
/* convert flash writing code into a buffer in target endianness */
-   for (i = 0; i < ARRAY_SIZE(cortex_m3_crc_code); i++)
-   if ((retval = target_write_u16(target, crc_algorithm->address + 
i*sizeof(uint16_t), cortex_m3_crc_code[i])) != ERROR_OK)
-   {
-   return retval;
-   }
+   for (i = 0; i < ARRAY_SIZE(cortex_m3_crc_code); i++) {
+   retval = target_write_u16(target, crc_algorithm->address + 
i*sizeof(uint16_t), cortex_m3_crc_code[i]);
+   if (retval != ERROR_OK)
+   goto cleanup;
+   }
 
armv7m_info.common_magic = ARMV7M_COMMON_MAGIC;
armv7m_info.core_mode = ARMV7M_MODE_ANY;
@@ -649,24 +648,22 @@ int armv7m_checksum_memory(struct target *target,
 
int timeout = 2 * (1 + (count / (1024 * 1024)));
 
-   if ((retval = target_run_algorithm(target, 0, NULL, 2, reg_params,
-   crc_algorithm->address, crc_algorithm->address + 
(sizeof(cortex_m3_crc_code)-6), timeout, &armv7m_info)) != ERROR_OK)
-   {
-   LOG_ERROR("error executing cortex_m3 crc algorithm");
-   destroy_reg_param(®_params[0]);
-   destroy_reg_param(®_params[1]);
-   target_free_working_area(target, crc_algorithm);
-   return retval;
-   }
+   retval = target_run_algorithm(target, 0, NULL, 2, reg_params, 
crc_algorithm->address,
+ crc_algorithm->address + 
(sizeof(cortex_m3_crc_code) - 6),
+ timeout, &armv7m_info);
 
-   *checksum = buf_get_u32(reg_params[0].value, 0, 32);
+   if (retval == ERROR_OK)
+   *checksum = buf_get_u32(reg_params[0].value, 0, 32);
+   else
+   LOG_ERROR("error executing cortex_m3 crc algorithm");
 
destroy_reg_param(®_params[0]);
destroy_reg_param(®_params[1]);
 
+cleanup:
target_free_working_area(target, crc_algorithm);
 
-   return ERROR_OK;
+   return retval;
 }
 
 /** Checks whether a memory region is zeroed. */
@@ -711,17 +708,12 @@ int armv7m_blank_check_memory(struct target *target,
init_reg_param(®_params[2], "r2", 32, PARAM_IN_OUT);
buf_set_u32(reg_params[2].value, 0, 32, 0xff);
 
-   if ((retval = target_run_algorithm(target, 0, NULL, 3, reg_params,
-   erase_check_algorithm->address, 
erase_check_algorithm->address + (sizeof(erase_check_code)-2), 1, 
&armv7m_info)) != ERROR_OK)
-   {
-   destroy_reg_param(®_params[0]);
-   destroy_reg_param(®_params[1]);
-   destroy_reg_param(®_params[2]);
-   target_free_working_area(target, erase_check_algorithm);
-   return 0;
-   }
+   retval = target_run_algorithm(target, 0, NULL, 3, reg_params, 
erase_check_algorithm->address,
+ erase_check_algorithm->address + 
(sizeof(erase_check_code) - 2),
+ 1, &armv7m_info);
 
-   *blank = buf_get_u32(reg_params[2].value, 0, 32);
+   if (retval == ERROR_OK)
+   *blank = buf_get_u32(reg_params[2].value, 0, 32);
 
destroy_reg_param(®_params[0]);
destroy_reg_param(®_params[1]);
@@ -729,7 +721,7 @@ int armv7m_blank_check_memory(struct target *target,
 
target_free_working_area(target, erase_check_algorithm);
 
-   return ERROR_OK;
+   return retval;
 }
 
 int armv7m_maybe_skip_bkpt_inst(struct target *target, bool *inst_found)

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


Re: [Openocd-development] Amontec - Out of business?

2011-10-24 Thread Christopher Harvey

On Mon, 24 Oct 2011 14:53:33 -0600, Ananda Regmi wrote:

Attila,

I wouldn't mind giving them some time as long as they keep
communicating with me. I am hitting a blank wall on Amontec's side. I
have tried sending emails to their sales, customer service, their CEO
and I don't get any thing back.

Yegor,



When I ordered my JTagKey2 I didn't receive any notification of 
shipment. I emailed them and Laurent got back to me within 24h saying 
that it was shipped. This was about 4 months ago. It took a couple of 
weeks for it to actually arrive. In the meantime you should check out 20 
pin jtag connector cables since my JTagaKey2 didn't come with onebut 
otherwise it's a fine product.

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


Re: [Openocd-development] Amontec - Out of business?

2011-10-24 Thread Ananda Regmi
Attila,

I wouldn't mind giving them some time as long as they keep communicating
with me. I am hitting a blank wall on Amontec's side. I have tried sending
emails to their sales, customer service, their CEO and I don't get any thing
back.

Yegor,

Thanks for your reply. I searched through this mail list, it seems like
Laurent is active in this list. Unless he is out in vacation or in a
similar situation, I can't imagine he hasn't seen this email yet. I will
wait for couple of more days for him to come in touch with me. If I don't
hear anything, I don't have any other option than to check if their is a way
to cancel the credit card payment.

It's not that I need it right away. I just need to know when will I get it.
Why is it so difficult to tell your customer when the product they have
already paid for would be shipped?

-Ananda

On Sun, Oct 23, 2011 at 6:21 AM, Yegor Yefremov
wrote:

> On Sat, Oct 22, 2011 at 12:10 AM, Ananda Regmi 
> wrote:
> > Hello,
> > Does anybody here know if Amontec - makers of JTAG Tiny - company went
> out
> > of business or something?
> > I know, this is an off topic question. But I have exhausted all my
> options
> > before posting it here. Since, Amontec's SDK kit supports OpenOCD, I
> figured
> > some of you might know their status.
> > Here's the reason I asked. I bought a JTAG tiny from them like 3-4 weeks
> > ago. The payment went through and I haven't heard back from them. I have
> > tried to send multiple emails and I don't get any response back. If they
> are
> > indeed out of business, I will have to buy another JTAG dongle. But, if
> they
> > are still in business, I guess I don't have any other option than to warn
> > people to not to deal with them. Well, I will wait for some of you to
> > respond before I do that.
>
> I've also bought one debugger from Amontec and I found the service
> very disappointing. I've got my device after 2 month. I also got
> almost no answers to my e-mails or phone calls. Then I wrote to this
> list and got answer from Laurent, after that I got my device within
> some weeks.
>
> Yegor
>
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] jimtcl compile error

2011-10-24 Thread billium
I am trying to update openocd but it fails to build:

In function `Jim_Nvp_name2value_obj':
jim-nvp.c:(.text+0xc7): undefined reference to `Jim_String'

This is repeated four times for other instances of Jim_String.

I am using amd64 on Gentoo, with the 999 ebuild which pulls from git.
Anybody come across this or know what I am doing wrong?

Incidentally there is a member of the the Nashoba Valley Photo Club
(NVPC) called Jim 

Many Thanks

Billy


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


[Openocd-development] Very cool output

2011-10-24 Thread Øyvind Harboe
Nice?

Unused code and bugs... For instance, not used retval means missing check
and error propagation => real bug.

http://openocd.zylin.com/jenkins/job/openocd-gerrit/70/warningsResult/?


-- 
Øyvind Harboe - Can Zylin Consulting help on your project?
US toll free 1-866-980-3434
http://www.zylin.com/
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] New patch to review for openocd: 23da86b warning: silence gcc by initializing local variables

2011-10-24 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/116

-- gerrit

commit 23da86bf203065c8157c5985cdc9bfcb08ce9a4f
Author: Øyvind Harboe 
Date:   Mon Oct 24 18:11:43 2011 +0200

warning: silence gcc by initializing local variables

GCC doesn't understand that these are in fact initialized if they are
used.

Change-Id: I01988adb0547f785b48d869ddbe44cc17dca4739
Signed-off-by: Øyvind Harboe 

diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c
index 7f89f2e..9ea7b5a 100644
--- a/src/target/arm_adi_v5.c
+++ b/src/target/arm_adi_v5.c
@@ -1352,7 +1352,7 @@ static int dap_info_command(struct command_context 
*cmd_ctx,
struct adiv5_dap *dap, int ap)
 {
int retval;
-   uint32_t dbgbase, apid;
+   uint32_t dbgbase = 0, apid = 0; /* Silence gcc by initializing */
int romtable_present = 0;
uint8_t mem_ap;
uint32_t ap_old;

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