[Openocd-development] [PATCH] Supply 11-bit BYPASS instruction for PXA3xx

2009-11-30 Thread Marek Vasut
Hi, patch is attached, please consider applying. The pxa3xx uses different 
BYPASS instruction (0x7ff) than pxa2xx and ixp4xx, which use 0x7f.

Signed-off-by: Marek Vasut marek.va...@gmail.com
From 9c99c68059b213db828bcba73b512a980dc782d4 Mon Sep 17 00:00:00 2001
From: Marek Vasut marek.va...@gmail.com
Date: Tue, 1 Dec 2009 01:15:21 +0100
Subject: [PATCH] Supply 11-bit BYPASS instruction for PXA3xx

---
 src/target/xscale.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/target/xscale.c b/src/target/xscale.c
index fdc269a..636e208 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -1500,7 +1500,11 @@ static int xscale_assert_reset(struct target *target)
 	xscale_write_dcsr(target, 1, 0);
 
 	/* select BYPASS, because having DCSR selected caused problems on the PXA27x */
-	xscale_jtag_set_instr(target-tap, 0x7f);
+	if (xscale-xscale_variant == XSCALE_IXP4XX_PXA2XX)
+		xscale_jtag_set_instr(target-tap, 0x7f);
+	else	/* pxa3xx has 11-bit bypass instruction */
+	xscale_jtag_set_instr(target-tap, 0x7ff);
+
 	jtag_execute_queue();
 
 	/* assert reset */
-- 
1.6.5

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


Re: [Openocd-development] [PATCH] Supply 11-bit BYPASS instruction for PXA3xx

2009-11-30 Thread Marek Vasut
Dne Út 1. prosince 2009 01:17:57 Marek Vasut napsal(a):
 Hi, patch is attached, please consider applying. The pxa3xx uses different
 BYPASS instruction (0x7ff) than pxa2xx and ixp4xx, which use 0x7f.
 
 Signed-off-by: Marek Vasut marek.va...@gmail.com
 
Argh, the following patch doesn't have a stupid formating issue.
From cb7d451c8874c35f328b230ecaefd0454b40efcf Mon Sep 17 00:00:00 2001
From: Marek Vasut marek.va...@gmail.com
Date: Tue, 1 Dec 2009 01:15:21 +0100
Subject: [PATCH] Supply 11-bit BYPASS instruction for PXA3xx

---
 src/target/xscale.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/target/xscale.c b/src/target/xscale.c
index fdc269a..35039fb 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -1500,7 +1500,11 @@ static int xscale_assert_reset(struct target *target)
 	xscale_write_dcsr(target, 1, 0);
 
 	/* select BYPASS, because having DCSR selected caused problems on the PXA27x */
-	xscale_jtag_set_instr(target-tap, 0x7f);
+	if (xscale-xscale_variant == XSCALE_IXP4XX_PXA2XX)
+		xscale_jtag_set_instr(target-tap, 0x7f);
+	else	/* pxa3xx has 11-bit bypass instruction */
+		xscale_jtag_set_instr(target-tap, 0x7ff);
+
 	jtag_execute_queue();
 
 	/* assert reset */
-- 
1.6.5

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


Re: [Openocd-development] [PATCH] Supply 11-bit BYPASS instruction for PXA3xx

2009-11-30 Thread David Brownell
On Monday 30 November 2009, Marek Vasut wrote:
  Hi, patch is attached, please consider applying. The pxa3xx uses different
  BYPASS instruction (0x7ff) than pxa2xx and ixp4xx, which use 0x7f.

Can you try a simpler patch, and just pass ~0 (all ones) instead of
the constant 0x7f?

I'd expect that would work, since the current code already handles
two different IR lengths.  Or if it doesn't, that's a lurking bug...

Needing an if/else/... branch for each IR length is ugly and error prone.
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development