[Openocd-development] [PATCH] tx27stk5: add board init support for KaRo TX27 CPU module

2011-11-01 Thread Mark Vels
This patch adds support for a KaRo TX27 CPU module on a StarterkitV base board.
The register settings have been extracted from a RedBoot distribution
that is distributed along with the hardware by KaRo.

This setup has been tested with a JTAGKey. The testing has been focussed
on loading a program into memory and start execution. 
Although the flash seems to be correctly detected, no effort has been put
in testing the NAND programming yet.

Signed-off-by: Mark Vels mark.v...@team-embedded.nl

 create mode 100644 tcl/board/tx27_stk5.cfg

diff --git a/tcl/board/tx27_stk5.cfg b/tcl/board/tx27_stk5.cfg
new file mode 100644
index 000..2a1c8b8
--- /dev/null
+++ b/tcl/board/tx27_stk5.cfg
@@ -0,0 +1,60 @@
+source [find target/imx27.cfg]
+
+$_TARGETNAME configure -event gdb-attach { reset init }
+$_TARGETNAME configure -event reset-init { tx27_init }
+
+proc tx27_init { } {
+   # This setup puts RAM at 0xA000
+   # init_aipi (AIPI1.PSR0, AIPI2.PSR0, AIPI1.PSR1 and AIPI2.PSR1)
+   mww 0x1000 0x20040304
+   mww 0x1002 0x
+   mww 0x1004 0xDFFBFCFB
+   mww 0x10020004 0x
+
+   sleep 100
+
+   #init_max ( PORT0.MPR, #PORT0.AMPR, #PORT1.MPR, #PORT1.AMPR, 
#PORT2.MPR, #PORT2.AMPR)
+   mww 0x1003F000 0x00302145
+   mww 0x1003F004 0x00302145
+   mww 0x1003F100 0x00302145
+   mww 0x1003F104 0x00302145
+   mww 0x1003F200 0x00302145
+   mww 0x1003F204 0x00302145
+
+   #init_drive_strength (#DSCR3, #DSCR5, #DSCR6, #DSCR7, #DSCR8 )
+   mww 0x10027828 0x
+   mww 0x10027830 0x
+   mww 0x10027834 0x
+   mww 0x10027838 0x5005
+   mww 0x1002783C 0x1555
+
+   #init_sdram_speed
+   #mww 0xD8001010 0x0004
+   mww 0xD8001010 0x0024
+
+   mww 0xD8001004 0x00395729
+
+   mww 0xD8001000 0x9212
+   mww 0xA400 0x0
+
+   mww 0xD8001000 0xA212
+   mww 0xA000 0x0
+   mww 0xA000 0x0
+
+   mww 0xD8001000 0xB212
+   mdb 0xA000
+   mdb 0xA033
+
+   mww 0xD8001000 0x82126485
+
+   # =
+   # Sync mode (AHB Clk = 133MHz ; BCLK = 44.3MHz)
+   # =
+   mww 0xD8002000 0x23524E80
+   mww 0xD8002004 0x1D03
+   mww 0xD8002008 0x00720900
+
+   nand probe 0
+}
+
+nand device tx27.nand imx27 $_TARGETNAME hwecc
-- 
1.7.0.4

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


Re: [Openocd-development] [PATCH] tx27stk5: add board init support for KaRo TX27 CPU module

2011-11-01 Thread Øyvind Harboe
Please post to Gerrit for review. See latest HACKING doc for details.

Thanks!


-- 
Ø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] openocd patch: 4aa8779 target: fix null pointer exception

2011-11-01 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/148

-- gerrit

commit 4aa87793756ce82541d1c142e63b30c1c0fcc4a6
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Tue Nov 1 22:00:46 2011 +0100

target: fix null pointer exception

check if no target is selected and return error.

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

diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c
index ef9b839..f023211 100644
--- a/src/target/armv4_5.c
+++ b/src/target/armv4_5.c
@@ -946,7 +946,13 @@ static int jim_mcrmrc(Jim_Interp *interp, int argc, 
Jim_Obj *const *argv)
 COMMAND_HANDLER(handle_arm_semihosting_command)
 {
struct target *target = get_current_target(CMD_CTX);
-   struct arm *arm = target ? target_to_arm(target) : NULL;
+
+   if (target == NULL) {
+   LOG_ERROR(No target selected);
+   return ERROR_FAIL;
+   }
+
+   struct arm *arm = target_to_arm(target);
 
if (!is_arm(arm)) {
command_print(CMD_CTX, current target isn't an ARM);

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


[Openocd-development] openocd patch: 9416d08 fix warning: remove assigned to variable

2011-11-01 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/149

-- gerrit

commit 9416d087f9555d3b28ca7688ba95992dc1e24cc4
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Tue Nov 1 22:10:54 2011 +0100

fix warning: remove assigned to variable

variable is subsequently not used

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

diff --git a/src/flash/nor/pic32mx.c b/src/flash/nor/pic32mx.c
index 69321ac..65d93ad 100644
--- a/src/flash/nor/pic32mx.c
+++ b/src/flash/nor/pic32mx.c
@@ -724,7 +724,7 @@ static int pic32mx_info(struct flash_bank *bank, char *buf, 
int buf_size)
 
buf += printed;
buf_size -= printed;
-   printed = snprintf(buf, buf_size,  Ver: 0x%02x,
+   snprintf(buf, buf_size,  Ver: 0x%02x,
(unsigned)((device_id  28)  0xf));
 
return ERROR_OK;

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


[Openocd-development] openocd patch: 6bcdf46 cfg: add Blizzard class to stellaris.cfg

2011-11-01 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/150

-- gerrit

commit 6bcdf461c1b4f0c6a72aaa15a909d828547f2e92
Author: Spencer Oliver s...@spen-soft.co.uk
Date:   Tue Nov 1 21:12:58 2011 +

cfg: add Blizzard class to stellaris.cfg

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

diff --git a/tcl/target/stellaris.cfg b/tcl/target/stellaris.cfg
index 7fef4ec..3ab5c0b 100644
--- a/tcl/target/stellaris.cfg
+++ b/tcl/target/stellaris.cfg
@@ -153,11 +153,12 @@ $_TARGETNAME configure -event reset-start {
   set device_class [expr (([mrw 0x400fe000]  16)  0xff)]
}
 
-   if {$device_class == 0 || $device_class == 1 || $device_class == 3} {
-   # Sandstorm, Fury and DustDevil are able to use NVIC SYSRESETREQ
+   if {$device_class == 0 || $device_class == 1 ||
+   $device_class == 3 || $device_class == 5} {
+   # Sandstorm, Fury, DustDevil and Blizzard are able to use NVIC 
SYSRESETREQ
cortex_m3 reset_config sysresetreq
} else {
-   # Tempest and newer default to using NVIC VECTRESET
+   # Tempest and Firestorm default to using NVIC VECTRESET
# peripherals will need reseting manually, see proc 
reset_peripherals
cortex_m3 reset_config vectreset
 

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


[Openocd-development] openocd patch: 701fc7b cfg: add Stellaris LM4F232 Evaluation Kit config

2011-11-01 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/151

-- gerrit

commit 701fc7bac5ff533a887c07a00c661a6a734b804d
Author: Spencer Oliver s...@spen-soft.co.uk
Date:   Tue Nov 1 21:13:54 2011 +

cfg: add Stellaris LM4F232 Evaluation Kit config

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

diff --git a/tcl/board/ek-lm4f232.cfg b/tcl/board/ek-lm4f232.cfg
new file mode 100644
index 000..6e3f8e3
--- /dev/null
+++ b/tcl/board/ek-lm4f232.cfg
@@ -0,0 +1,13 @@
+#
+# TI Stellaris LM4F232 Evaluation Kits
+#
+# http://www.ti.com/tool/ek-lm4f232
+#
+
+# NOTE:  using the bundled FT2232 JTAG/SWD/SWO interface is optional!
+# so is using in JTAG mode, as done here.
+source [find interface/luminary-icdi.cfg]
+
+set WORKAREASIZE 0x8000
+set CHIPNAME lm4f23x
+source [find target/stellaris.cfg]

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


[Openocd-development] openocd patch: 96c3cbf cortex_m: add missing error checking

2011-11-01 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/152

-- gerrit

commit 96c3cbfab96ef837464189de0cbc66ce3400172a
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Tue Nov 1 22:53:54 2011 +0100

cortex_m: add missing error checking

found by clang.

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

diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index 8000b9a..2a283cd 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -124,16 +124,20 @@ static int cortexm3_dap_write_coreregister_u32(struct 
adiv5_dap *swjdp,
if (retval != ERROR_OK)
return retval;
retval = dap_queue_ap_write(swjdp, AP_REG_BD0 | (DCB_DCRDR  0xC), 
value);
-   // XXX check retval
+   if (retval != ERROR_OK)
+   return retval;
 
/* mem_ap_write_u32(swjdp, DCB_DCRSR, i | DCRSR_WnR); */
retval = dap_setup_accessport(swjdp, CSW_32BIT | CSW_ADDRINC_OFF, 
DCB_DCRSR  0xFFF0);
if (retval != ERROR_OK)
return retval;
retval = dap_queue_ap_write(swjdp, AP_REG_BD0 | (DCB_DCRSR  0xC), 
regnum | DCRSR_WnR);
-   // XXX check retval
+   if (retval != ERROR_OK)
+   return retval;
 
retval = dap_run(swjdp);
+   if (retval != ERROR_OK)
+   return retval;
 
/* restore DCB_DCRDR - this needs to be in a seperate
 * transaction otherwise the emulated DCC channel breaks */

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


[Openocd-development] openocd patch: 20f3092 cortex_a: add missing error propagation

2011-11-01 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/153

-- gerrit

commit 20f3092a5c78c284fa4da3fe1816610c8cdaab13
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Tue Nov 1 22:56:28 2011 +0100

cortex_a: add missing error propagation

found by clang.

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

diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c
index 2370d95..8a1ca3b 100755
--- a/src/target/cortex_a.c
+++ b/src/target/cortex_a.c
@@ -1021,6 +1021,8 @@ static int cortex_a8_internal_restore(struct target 
*target, int current,
 /* called it now before restoring context because it uses cpu
 * register r0 for restoring cp15 control register */
retval = cortex_a8_restore_cp15_control_reg(target);
+   if (retval != ERROR_OK)
+   return retval;
retval = cortex_a8_restore_context(target, handle_breakpoints);
if (retval != ERROR_OK)
return retval;
@@ -1147,7 +1149,9 @@ static int cortex_a8_resume(struct target *target, int 
current,
cortex_a8_internal_restore(target, current, address, 
handle_breakpoints, debug_execution);
if (target-smp)
{   target-gdb_service-core[0] = -1;
-   retval += cortex_a8_restore_smp(target, handle_breakpoints);
+   retval = cortex_a8_restore_smp(target, handle_breakpoints);
+   if (retval != ERROR_OK)
+   return retval;
}
cortex_a8_internal_restart(target);
 

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


[Openocd-development] openocd patch: 4a81c9d usbtoxxx: remove warning by reducing scope of variable

2011-11-01 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/154

-- gerrit

commit 4a81c9d741a4743a09c01ca3aac8167ac245ce53
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Tue Nov 1 22:59:17 2011 +0100

usbtoxxx: remove warning by reducing scope of variable

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

diff --git a/src/jtag/drivers/versaloon/usbtoxxx/usbtoxxx.c 
b/src/jtag/drivers/versaloon/usbtoxxx/usbtoxxx.c
index 64e31a6..f92f38c 100644
--- a/src/jtag/drivers/versaloon/usbtoxxx/usbtoxxx.c
+++ b/src/jtag/drivers/versaloon/usbtoxxx/usbtoxxx.c
@@ -199,9 +199,9 @@ RESULT usbtoxxx_execute_command(void)
}
if (!processed)
{
-   struct versaloon_want_pos_t *tmp, *free_tmp;
+   struct versaloon_want_pos_t *tmp;

-   free_tmp = tmp = versaloon_pending[i].pos;
+   tmp = versaloon_pending[i].pos;
while (tmp != NULL)
{
if ((tmp-buff != NULL)  (tmp-size  
0))
@@ -209,6 +209,7 @@ RESULT usbtoxxx_execute_command(void)
memcpy(tmp-buff, versaloon_buf 
+ usbtoxxx_buffer_index
+ tmp-offset, 
tmp-size);
}
+   struct versaloon_want_pos_t *free_tmp;
free_tmp = tmp;
tmp = tmp-next;
free(free_tmp);

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


Re: [Openocd-development] openocd patch: 96c3cbf cortex_m: add missing error checking

2011-11-01 Thread Tomek CEDRO
Hey does this code is related anyhow to arm_adi_v5 or this is totally
alternative solution?

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] openocd patch: 9ed9423 arm11: print next address to debug

2011-11-01 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/155

-- gerrit

commit 9ed94239e8e1113c0aeb249cc6882be0d994282d
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Tue Nov 1 23:20:49 2011 +0100

arm11: print next address to debug

fixes clang warning. Basically the next address pointer is not
used for anything in the fn, except to be examined in debug.

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

diff --git a/src/target/arm11.c b/src/target/arm11.c
index 2d65835..b922b19 100644
--- a/src/target/arm11.c
+++ b/src/target/arm11.c
@@ -605,14 +605,14 @@ static int arm11_step(struct target *target, int current,
if ((next_instruction  0xFFF00070) == 0xe1200070)
{
address = arm11_nextpc(arm11, 0, address + 4);
-   LOG_DEBUG(Skipping BKPT);
+   LOG_DEBUG(Skipping BKPT %08 PRIx32, address);
}
/* skip over Wait for interrupt / Standby */
/* mcr  15, 0, r?, cr7, cr0, {4} */
else if ((next_instruction  0x0FFF) == 0xee070f90)
{
address = arm11_nextpc(arm11, 0, address + 4);
-   LOG_DEBUG(Skipping WFI);
+   LOG_DEBUG(Skipping WFI %08 PRIx32, address);
}
/* ignore B to self */
else if ((next_instruction  0xFEFF) == 0xeafe)

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


[Openocd-development] openocd patch: 09b1704 dsp5680xx: add missing and broken error propagation

2011-11-01 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/156

-- gerrit

commit 09b17046aaca462496d634508567e3a543719c17
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Tue Nov 1 23:28:10 2011 +0100

dsp5680xx: add missing and broken error propagation

found by clang.

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

diff --git a/src/target/dsp5680xx.c b/src/target/dsp5680xx.c
index 116f609..bf406c7 100644
--- a/src/target/dsp5680xx.c
+++ b/src/target/dsp5680xx.c
@@ -538,7 +538,7 @@ static int eonce_enter_debug_mode_without_reset(struct 
target * target, uint16_t
   }
   if(eonce_status!=NULL)
 *eonce_status = data_read_from_dr;
-  return ERROR_OK;
+  return retval;
 }
 
 #define TIME_DIV_FREESCALE 0.3
@@ -606,6 +606,7 @@ static int eonce_enter_debug_mode(struct target * target, 
uint16_t * eonce_statu
   err_check_propagate(retval);
   instr_16 = 0x1;
   retval = dsp5680xx_drscan(target,(uint8_t *)  instr_16,(uint8_t *)  
read_16,8);
+   err_check_propagate(retval);
   instr_16 = 0x20;
   retval = dsp5680xx_drscan(target,(uint8_t *)  instr_16,(uint8_t *)  
read_16,8);
   jtag_add_sleep(TIME_DIV_FREESCALE*100*1000);
@@ -1446,7 +1447,7 @@ int dsp5680xx_f_erase(struct target * target, int first, 
int last){
   if(do_mass_erase){
 //Mass erase
 retval = mass_erase(target,hfm_ustat);
-err_check_propagate(retval);
+   err_check_propagate(retval);
 last = HFM_SECTOR_COUNT-1;
   }else{
 for(int i = first;i=last;i++){
@@ -1704,8 +1705,10 @@ int dsp5680xx_f_unlock(struct target * target){
   err_check_propagate(retval);
   instr_16 = 0x1;
   retval = dsp5680xx_drscan(target,(uint8_t *)  instr_16,(uint8_t *)  
read_16,8);
+   err_check_propagate(retval);
   instr_16 = 0x20;
   retval = dsp5680xx_drscan(target,(uint8_t *)  instr_16,(uint8_t *)  
read_16,8);
+   err_check_propagate(retval);
   jtag_add_sleep(TIME_DIV_FREESCALE*100*1000);
   jtag_add_reset(0,0);
   jtag_add_sleep(TIME_DIV_FREESCALE*300*1000);

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