Re: [Openocd-development] arm-jtag-ew fixes: Rebased patches

2011-10-08 Thread Andreas Fritiofson
On Fri, Oct 7, 2011 at 12:03 AM, Andreas Fritiofson 
andreas.fritiof...@gmail.com wrote:



 On Thu, Sep 22, 2011 at 9:15 PM, Simon Barner bar...@gmx.de wrote:

 Dear list,

 I finally found some time to rebase my patches and to split
 them into smaller pieces (as suggested by Ųyvind Harboe).

 Please refer to the commit messages for the purpose
 of the individual patches.

 I would really appreciate if you could review them and
 consider them for inclusion into the OpenOCD main branch.

 If the patches are not in the expected format, or if you
 have further suggestions, please don't hesitate to contact me.

 Best regards,
  Simon


 Looks sane to me, but I don't have the relevant hardware. I'm going to
 merge these if there's no complaint in a day or two.

 /Andreas


Merged w/ slightly reformatted comments, thanks!

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


Re: [Openocd-development] arm-jtag-ew fixes: Rebased patches

2011-10-06 Thread Andreas Fritiofson
On Thu, Sep 22, 2011 at 9:15 PM, Simon Barner bar...@gmx.de wrote:

 Dear list,

 I finally found some time to rebase my patches and to split
 them into smaller pieces (as suggested by Ųyvind Harboe).

 Please refer to the commit messages for the purpose
 of the individual patches.

 I would really appreciate if you could review them and
 consider them for inclusion into the OpenOCD main branch.

 If the patches are not in the expected format, or if you
 have further suggestions, please don't hesitate to contact me.

 Best regards,
  Simon


Looks sane to me, but I don't have the relevant hardware. I'm going to merge
these if there's no complaint in a day or two.

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


[Openocd-development] arm-jtag-ew fixes: Rebased patches

2011-09-22 Thread Simon Barner
Dear list,

I finally found some time to rebase my patches and to split
them into smaller pieces (as suggested by Øyvind Harboe).

Please refer to the commit messages for the purpose
of the individual patches.

I would really appreciate if you could review them and
consider them for inclusion into the OpenOCD main branch.

If the patches are not in the expected format, or if you
have further suggestions, please don't hesitate to contact me.

Best regards,
 Simon
From 990646d220fdd85fd59f2c86c20fc16c8fc8e825 Mon Sep 17 00:00:00 2001
From: Simon Barner bar...@gmx.de
Date: Fri, 16 Sep 2011 21:06:02 +0200
Subject: - Fix setting interface speed (1/2):CMD_SET_TCK_FREQUENCY
 message length is 5, not 4
- Ticket: #34

---
 src/jtag/drivers/arm-jtag-ew.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/jtag/drivers/arm-jtag-ew.c b/src/jtag/drivers/arm-jtag-ew.c
index 44eaeff..f39730f 100644
--- a/src/jtag/drivers/arm-jtag-ew.c
+++ b/src/jtag/drivers/arm-jtag-ew.c
@@ -186,7 +186,7 @@ static int armjtagew_speed(int speed)
 usb_out_buffer[0] = CMD_SET_TCK_FREQUENCY;
buf_set_u32(usb_out_buffer + 1, 0, 32, speed);
 
-result = armjtagew_usb_message(armjtagew_handle, 4, 4);
+result = armjtagew_usb_message(armjtagew_handle, 5, 4);
 
 if (result  0)
 {
-- 
1.7.5.1

From 9c8d710a63ced3e6cdd1df851fe1125e58d45e8b Mon Sep 17 00:00:00 2001
From: Simon Barner bar...@gmx.de
Date: Fri, 16 Sep 2011 21:08:10 +0200
Subject: - Fix setting interface speed (2/2)   Interface expects speed in Hz,
 not kHz
- Ticket #34

---
 src/jtag/drivers/arm-jtag-ew.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/jtag/drivers/arm-jtag-ew.c b/src/jtag/drivers/arm-jtag-ew.c
index f39730f..bf60c77 100644
--- a/src/jtag/drivers/arm-jtag-ew.c
+++ b/src/jtag/drivers/arm-jtag-ew.c
@@ -184,7 +184,7 @@ static int armjtagew_speed(int speed)
 
 
 usb_out_buffer[0] = CMD_SET_TCK_FREQUENCY;
-   buf_set_u32(usb_out_buffer + 1, 0, 32, speed);
+   buf_set_u32(usb_out_buffer + 1, 0, 32, speed*1000);
 
 result = armjtagew_usb_message(armjtagew_handle, 5, 4);
 
@@ -196,7 +196,7 @@ static int armjtagew_speed(int speed)
 
usb_out_buffer[0] = CMD_GET_TCK_FREQUENCY;
 result = armjtagew_usb_message(armjtagew_handle, 1, 4);
-   speed_real = (int)buf_get_u32(usb_in_buffer,0,32);
+   speed_real = (int)buf_get_u32(usb_in_buffer,0,32) / 1000;
if (result  0)
{
 LOG_ERROR(ARM-JTAG-EW getting speed failed (%d), result);
-- 
1.7.5.1

From e96b8edd16d0eabd6a74464ea9e41a4f3c9c5889 Mon Sep 17 00:00:00 2001
From: Simon Barner bar...@gmx.de
Date: Fri, 16 Sep 2011 21:10:23 +0200
Subject: - Provide armjtagew_speed_div() in order to fix interactive use of
 `adapter_khz'

---
 src/jtag/drivers/arm-jtag-ew.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/jtag/drivers/arm-jtag-ew.c b/src/jtag/drivers/arm-jtag-ew.c
index bf60c77..2d6a400 100644
--- a/src/jtag/drivers/arm-jtag-ew.c
+++ b/src/jtag/drivers/arm-jtag-ew.c
@@ -218,6 +218,14 @@ static int armjtagew_khz(int khz, int *jtag_speed)
return ERROR_OK;
 }
 
+static int armjtagew_speed_div(int speed, int* khz)
+{
+   *khz = speed;
+
+   return ERROR_OK;
+}
+
+
 static int armjtagew_init(void)
 {
int check_cnt;
@@ -518,6 +526,7 @@ struct jtag_interface armjtagew_interface = {
 
.execute_queue = armjtagew_execute_queue,
.speed = armjtagew_speed,
+   .speed_div = armjtagew_speed_div,
.khz = armjtagew_khz,
.init = armjtagew_init,
.quit = armjtagew_quit,
-- 
1.7.5.1

From 875a487be67f867b2e289efa8cfea79c45103b4b Mon Sep 17 00:00:00 2001
From: Simon Barner bar...@gmx.de
Date: Fri, 16 Sep 2011 21:11:40 +0200
Subject: - Declare interface as `jtag_only'

---
 src/jtag/drivers/arm-jtag-ew.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/jtag/drivers/arm-jtag-ew.c b/src/jtag/drivers/arm-jtag-ew.c
index 2d6a400..7c19423 100644
--- a/src/jtag/drivers/arm-jtag-ew.c
+++ b/src/jtag/drivers/arm-jtag-ew.c
@@ -523,7 +523,8 @@ static const struct command_registration 
armjtagew_command_handlers[] = {
 struct jtag_interface armjtagew_interface = {
.name = arm-jtag-ew,
.commands = armjtagew_command_handlers,
-
+   .transports = jtag_only,
+
.execute_queue = armjtagew_execute_queue,
.speed = armjtagew_speed,
.speed_div = armjtagew_speed_div,
-- 
1.7.5.1

From 1db210c2452e33d4d3a397d3898ced4d16521b3b Mon Sep 17 00:00:00 2001
From: Simon Barner bar...@gmx.de
Date: Fri, 16 Sep 2011 21:12:47 +0200
Subject: - Emit a warning if interface firmware version != 1.6

---
 src/jtag/drivers/arm-jtag-ew.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/jtag/drivers/arm-jtag-ew.c b/src/jtag/drivers/arm-jtag-ew.c
index 7c19423..f936219 100644
--- a/src/jtag/drivers/arm-jtag-ew.c
+++ b/src/jtag/drivers/arm-jtag-ew.c
@@