Re: [Openocd-development] [PATCH] CORTEX A8: Fix broken CPU identification

2011-02-14 Thread Nick Pelling

Hi Daniel,

At 16:43 11/02/2011 +0100, Daniel Bäder wrote:
S3CPC100 from Samsung is also detected as imx51 
with this patch.  Without this patch it works.


May I ask which S5PC100 platform are you working with?

Thanks, Nick Pelling 


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


Re: [Openocd-development] [PATCH] CORTEX A8: Fix broken CPU identification

2011-02-11 Thread Daniel Bäder

Am 30.12.2010 13:51, schrieb Antonio Borneo:

On Thu, Dec 30, 2010 at 11:54 AM, Marek Vasutmarek.va...@gmail.com  wrote:

  } broken_cpus[] = {
-   { 0x8000, 0x04770002, 0x6000, imx51 },
+   { 0x8000, 0x04770002, 0x1ba00477, 0x6000, imx51 },


Hi Marek,
your patch goes in the right direction, but I think there is a mistake.

You compare the JTAG idcode with 0x1ba00477.
This value belongs to ARM debug port, not to TI or Freescale devices.


S3CPC100 from Samsung is also detected as imx51 with this patch.  Without this 
patch it works.

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


Re: [Openocd-development] [PATCH] CORTEX A8: Fix broken CPU identification

2011-02-11 Thread Kuba Irzabek

W dniu 2010-12-30 08:34, Marek Vasut pisze:

On Thursday 30 December 2010 08:27:52 Øyvind Harboe wrote:

Merged.

Thanks!

Took it for a spin on AM3517 and that target is no longer
incorrectly identified as an imx51.


That target still needs work though:

oyvind@titan:~/workspace/openocd$ openocd -c interface ZY1000;
zy1000_server 127.0.0.1;jtag_khz 50 -f board/am3517evm.cfg
Open On-Chip Debugger 0.5.0-dev-00682-g0136977 (2010-12-30-08:23)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
Warn : Adapter driver 'ZY1000' did not declare which transports it
allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
50 kHz
10 kHz
trst_only separate trst_push_pull
jtag_speed 6000 =  JTAG clk=10 kHz
Info : clock speed 10 kHz
Info : JTAG tap: am35x.jrc tap/device found: 0x0b7ae02f (mfg: 0x017,
part: 0xb7ae, ver: 0x0)
Info : JTAG tap: am35x.dap enabled
Info : am35x.cpu: hardware has 6 breakpoints, 2 watchpoints
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x2800042, MEM_AP_TAR 0x54011140
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x2800042, MEM_AP_TAR 0x54011140
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x2800042, MEM_AP_TAR 0x54011140
Error: JTAG-DP STICKY ERROR


These errors here, right ... need to investigate. Any pointers possibly ?
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Hello,

Maybe the access to 0x5401 1140 error above has something to do with 
power domains? The registers accessed without error (in cortex_a8.c) are 
placed in debug power domain, and e.g. the breakpoint control registers 
(first address in 0x5401 1140) are in core power domain.


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


Re: [Openocd-development] [PATCH] CORTEX A8: Fix broken CPU identification

2010-12-30 Thread Antonio Borneo
On Thu, Dec 30, 2010 at 11:54 AM, Marek Vasut marek.va...@gmail.com wrote:
  } broken_cpus[] = {
 -       { 0x8000, 0x04770002, 0x6000, imx51 },
 +       { 0x8000, 0x04770002, 0x1ba00477, 0x6000, imx51 },

Hi Marek,
your patch goes in the right direction, but I think there is a mistake.

You compare the JTAG idcode with 0x1ba00477.
This value belongs to ARM debug port, not to TI or Freescale devices.

Please check ARM documentation
http://infocenter.arm.com/help/topic/com.arm.doc.ddi0314h/DDI0314H_coresight_components_trm.pdf
at pages 2-27 and 2-28 regarding the IDCODE.
Also, grep 00477 in openocd code, and you will find many devices
with same JTAG idcode or just different version.

So, even with your patch, we can still confuse some device with the
broken imx51.

In the same document from ARM, in table 2-6 page 2-26, there is the
list of DAP registers.
One register could be interesting for your purpose, TARGETID, that I
expect has a unique idcode from the device manufacturer.
But, the document reports it is available in SW-DP only, not in JTAG-DP.

I have no idea what could be the right check to run.

Best Regards,
Antonio Borneo
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] [PATCH] CORTEX A8: Fix broken CPU identification

2010-12-29 Thread Marek Vasut
This patch fixes the issue where the OMAP CPU (and possibly others) was mistaken
for iMX51 and therefore had misadjusted debug base.

Signed-off-by: Marek Vasut marek.va...@gmail.com
---
 src/target/arm_adi_v5.c |   20 +---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c
index 69a3ce7..7df0d4f 100644
--- a/src/target/arm_adi_v5.c
+++ b/src/target/arm_adi_v5.c
@@ -1013,10 +1013,11 @@ is_dap_cid_ok(uint32_t cid3, uint32_t cid2, uint32_t 
cid1, uint32_t cid0)
 struct broken_cpu {
uint32_tdbgbase;
uint32_tapid;
+   uint32_tidcode;
uint32_tcorrect_dbgbase;
char*model;
 } broken_cpus[] = {
-   { 0x8000, 0x04770002, 0x6000, imx51 },
+   { 0x8000, 0x04770002, 0x1ba00477, 0x6000, imx51 },
 };
 
 int dap_get_debugbase(struct adiv5_dap *dap, int apsel,
@@ -1025,7 +1026,7 @@ int dap_get_debugbase(struct adiv5_dap *dap, int apsel,
uint32_t apselold;
int retval;
unsigned int i;
-   uint32_t dbgbase, apid;
+   uint32_t dbgbase, apid, idcode;
 
/* AP address is in bits 31:24 of DP_SELECT */
if (apsel = 256)
@@ -1044,10 +1045,23 @@ int dap_get_debugbase(struct adiv5_dap *dap, int apsel,
if (retval != ERROR_OK)
return retval;
 
+   /* Excavate the device ID code */
+   struct jtag_tap *tap = dap-jtag_info-tap;
+   while (tap != NULL) {
+   if (tap-hasidcode) {
+   idcode = tap-idcode;
+   break;
+   }
+   tap = tap-next_tap;
+   }
+   if (tap == NULL || !tap-hasidcode)
+   return ERROR_OK;
+
/* Some CPUs are messed up, so fixup if needed. */
for (i = 0; i  sizeof(broken_cpus)/sizeof(struct broken_cpu); i++)
if (broken_cpus[i].dbgbase == dbgbase 
-   broken_cpus[i].apid == apid) {
+   broken_cpus[i].apid == apid 
+   broken_cpus[i].idcode == idcode) {
LOG_WARNING(Found broken CPU (%s), trying to fixup 
ROM Table location from 0x%08x to 0x%08x,
broken_cpus[i].model, dbgbase,
-- 
1.7.2.3

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


Re: [Openocd-development] [PATCH] CORTEX A8: Fix broken CPU identification

2010-12-29 Thread Øyvind Harboe
Merged.

Thanks!

Took it for a spin on AM3517 and that target is no longer
incorrectly identified as an imx51.


That target still needs work though:

oyv...@titan:~/workspace/openocd$ openocd -c interface ZY1000;
zy1000_server 127.0.0.1;jtag_khz 50 -f board/am3517evm.cfg
Open On-Chip Debugger 0.5.0-dev-00682-g0136977 (2010-12-30-08:23)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
Warn : Adapter driver 'ZY1000' did not declare which transports it
allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
50 kHz
10 kHz
trst_only separate trst_push_pull
jtag_speed 6000 = JTAG clk=10 kHz
Info : clock speed 10 kHz
Info : JTAG tap: am35x.jrc tap/device found: 0x0b7ae02f (mfg: 0x017,
part: 0xb7ae, ver: 0x0)
Info : JTAG tap: am35x.dap enabled
Info : am35x.cpu: hardware has 6 breakpoints, 2 watchpoints
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x2800042, MEM_AP_TAR 0x54011140
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x2800042, MEM_AP_TAR 0x54011140
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x2800042, MEM_AP_TAR 0x54011140
Error: JTAG-DP STICKY ERROR



-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 87 40 27

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] [PATCH] CORTEX A8: Fix broken CPU identification

2010-12-29 Thread Marek Vasut
On Thursday 30 December 2010 08:27:52 Øyvind Harboe wrote:
 Merged.
 
 Thanks!
 
 Took it for a spin on AM3517 and that target is no longer
 incorrectly identified as an imx51.
 
 
 That target still needs work though:
 
 oyv...@titan:~/workspace/openocd$ openocd -c interface ZY1000;
 zy1000_server 127.0.0.1;jtag_khz 50 -f board/am3517evm.cfg
 Open On-Chip Debugger 0.5.0-dev-00682-g0136977 (2010-12-30-08:23)
 Licensed under GNU GPL v2
 For bug reports, read
   http://openocd.berlios.de/doc/doxygen/bugs.html
 Warn : Adapter driver 'ZY1000' did not declare which transports it
 allows; assuming legacy JTAG-only
 Info : only one transport option; autoselect 'jtag'
 50 kHz
 10 kHz
 trst_only separate trst_push_pull
 jtag_speed 6000 = JTAG clk=10 kHz
 Info : clock speed 10 kHz
 Info : JTAG tap: am35x.jrc tap/device found: 0x0b7ae02f (mfg: 0x017,
 part: 0xb7ae, ver: 0x0)
 Info : JTAG tap: am35x.dap enabled
 Info : am35x.cpu: hardware has 6 breakpoints, 2 watchpoints
 Error: JTAG-DP STICKY ERROR
 Error: MEM_AP_CSW 0x2800042, MEM_AP_TAR 0x54011140
 Error: JTAG-DP STICKY ERROR
 Error: MEM_AP_CSW 0x2800042, MEM_AP_TAR 0x54011140
 Error: JTAG-DP STICKY ERROR
 Error: MEM_AP_CSW 0x2800042, MEM_AP_TAR 0x54011140
 Error: JTAG-DP STICKY ERROR

These errors here, right ... need to investigate. Any pointers possibly ?
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development