From: Øyvind H. <go...@us...> - 2010-06-22 14:35:20
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 4fa3cc7746d661f048f39a53c39b692369426e24 (commit) via d236a48e8fd93504bf219fa9113a3af157ba5e1b (commit) via 33e7696cfaca149e83a471212394484054ff05b6 (commit) via 8b82171f75df84c1eb51e4824852079cb601df80 (commit) from f44eeba16f3e9bebfbc78fd0841124d8b2556246 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4fa3cc7746d661f048f39a53c39b692369426e24 Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Jun 22 12:49:56 2010 +0200 am3517 evm: use physical write to memory while target is running Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/tcl/board/am3517evm.cfg b/tcl/board/am3517evm.cfg index a639fa6..db76255 100644 --- a/tcl/board/am3517evm.cfg +++ b/tcl/board/am3517evm.cfg @@ -76,20 +76,20 @@ proc omap3_dbginit {target} { # General Cortex A8 debug initialisation cortex_a8 dbginit # Enable DBGU signal for OMAP353x - $target mww 0x5401d030 0x00002000 + $target mww phys 0x5401d030 0x00002000 } # be absolutely certain the JTAG clock will work with the worst-case # 16.8MHz/2 = 8.4MHz core clock, even before a bootloader kicks in. # OK to speed up *after* PLL and clock tree setup. -$_TARGETNAME configure -event "reset-start" { adapter_khz 10; halt; halt } +$_TARGETNAME configure -event "reset-start" { adapter_khz 10} # Assume SRST is unavailable (e.g. TI-14 JTAG), so we must assert reset # ourselves using PRM_RSTCTRL. RST_GS (2) is a warm reset, like ICEpick # would issue. RST_DPLL3 (4) is a cold reset. set PRM_RSTCTRL 0x48307250 -$_TARGETNAME configure -event reset-assert "$_TARGETNAME mww $PRM_RSTCTRL 2" +$_TARGETNAME configure -event reset-assert "$_TARGETNAME mww phys $PRM_RSTCTRL 2" $_TARGETNAME configure -event reset-assert-post "omap3_dbginit $_TARGETNAME; adapter_khz 1000" commit d236a48e8fd93504bf219fa9113a3af157ba5e1b Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Jun 22 12:47:30 2010 +0200 cortex a8: only physical read/write's are available when target is running Memory read/writes to virtual memory, requires that the CPU is halted. Use 'phys' option to write to memory while target is running. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index ea07579..afe5b6c 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -1381,12 +1381,16 @@ static int cortex_a8_read_memory(struct target *target, uint32_t address, { int enabled = 0; uint32_t virt, phys; + int retval; /* cortex_a8 handles unaligned memory access */ // ??? dap_ap_select(swjdp, swjdp_memoryap); LOG_DEBUG("Reading memory at address 0x%x; size %d; count %d", address, size, count); - cortex_a8_mmu(target, &enabled); + retval = cortex_a8_mmu(target, &enabled); + if (retval != ERROR_OK) + return retval; + if(enabled) { virt = address; @@ -1484,11 +1488,14 @@ static int cortex_a8_write_memory(struct target *target, uint32_t address, { int enabled = 0; uint32_t virt, phys; + int retval; // ??? dap_ap_select(swjdp, swjdp_memoryap); LOG_DEBUG("Writing memory to address 0x%x; size %d; count %d", address, size, count); - cortex_a8_mmu(target, &enabled); + retval = cortex_a8_mmu(target, &enabled); + if (retval != ERROR_OK) + return retval; if(enabled) { virt = address; commit 33e7696cfaca149e83a471212394484054ff05b6 Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Jun 22 12:35:00 2010 +0200 target: $_TARGET mdw now has a phys option just like the mdw command Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/target.c b/src/target/target.c index d6efe5b..3bf6824 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4021,23 +4021,36 @@ static int jim_target_md(Jim_Interp *interp, int argc, Jim_Obj *const *argv) Jim_GetOptInfo goi; Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1); - /* danger! goi.argc will be modified below! */ - argc = goi.argc; - - if ((argc != 1) && (argc != 2)) + if ((goi.argc < 1) || (goi.argc > 3)) { Jim_SetResult_sprintf(goi.interp, - "usage: %s <address> [<count>]", cmd_name); + "usage: %s [phys] <address> [<count>]", cmd_name); return JIM_ERR; } + int (*fn)(struct target *target, + uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); + fn=target_read_memory; + + int e; + if (strcmp(Jim_GetString(argv[1], NULL), "phys") == 0) + { + /* consume it */ + struct Jim_Obj *obj; + e = Jim_GetOpt_Obj(&goi, &obj); + if (e != JIM_OK) + return e; + + fn=target_read_phys_memory; + } + jim_wide a; - int e = Jim_GetOpt_Wide(&goi, &a); + e = Jim_GetOpt_Wide(&goi, &a); if (e != JIM_OK) { return JIM_ERR; } jim_wide c; - if (argc == 2) { + if (goi.argc == 1) { e = Jim_GetOpt_Wide(&goi, &c); if (e != JIM_OK) { return JIM_ERR; @@ -4045,6 +4058,13 @@ static int jim_target_md(Jim_Interp *interp, int argc, Jim_Obj *const *argv) } else { c = 1; } + + /* all args must be consumed */ + if (goi.argc != 0) + { + return JIM_ERR; + } + jim_wide b = 1; /* shut up gcc */ if (strcasecmp(cmd_name, "mdw") == 0) b = 4; @@ -4068,7 +4088,7 @@ static int jim_target_md(Jim_Interp *interp, int argc, Jim_Obj *const *argv) if (y > 16) { y = 16; } - e = target_read_memory(target, a, b, y / b, target_buf); + e = fn(target, a, b, y / b, target_buf); if (e != ERROR_OK) { Jim_SetResult_sprintf(interp, "error reading target @ 0x%08lx", (int)(a)); return JIM_ERR; commit 8b82171f75df84c1eb51e4824852079cb601df80 Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Jun 22 11:49:00 2010 +0200 target: mwX on target object now supporst phys argument $_TARGETNAME mww phys 0x10 0xdeadbeef => write 0xdeadbeef to physical address 0x10 Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/target.c b/src/target/target.c index 7513346..d6efe5b 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -3950,19 +3950,30 @@ static int jim_target_mw(Jim_Interp *interp, int argc, Jim_Obj *const *argv) Jim_GetOptInfo goi; Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1); - /* danger! goi.argc will be modified below! */ - argc = goi.argc; - - if (argc != 2 && argc != 3) + if (goi.argc < 2 || goi.argc > 4) { Jim_SetResult_sprintf(goi.interp, - "usage: %s <address> <data> [<count>]", cmd_name); + "usage: %s [phys] <address> <data> [<count>]", cmd_name); return JIM_ERR; } + target_write_fn fn; + fn = target_write_memory_fast; + + int e; + if (strcmp(Jim_GetString(argv[1], NULL), "phys") == 0) + { + /* consume it */ + struct Jim_Obj *obj; + e = Jim_GetOpt_Obj(&goi, &obj); + if (e != JIM_OK) + return e; + + fn = target_write_phys_memory; + } jim_wide a; - int e = Jim_GetOpt_Wide(&goi, &a); + e = Jim_GetOpt_Wide(&goi, &a); if (e != JIM_OK) return e; @@ -3972,13 +3983,19 @@ static int jim_target_mw(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return e; jim_wide c = 1; - if (argc == 3) + if (goi.argc == 1) { e = Jim_GetOpt_Wide(&goi, &c); if (e != JIM_OK) return e; } + /* all args must be consumed */ + if (goi.argc != 0) + { + return JIM_ERR; + } + struct target *target = Jim_CmdPrivData(goi.interp); unsigned data_size; if (strcasecmp(cmd_name, "mww") == 0) { @@ -3994,7 +4011,7 @@ static int jim_target_mw(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return JIM_ERR; } - return (target_fill_mem(target, a, target_write_memory_fast, data_size, b, c) == ERROR_OK) ? JIM_OK : JIM_ERR; + return (target_fill_mem(target, a, fn, data_size, b, c) == ERROR_OK) ? JIM_OK : JIM_ERR; } static int jim_target_md(Jim_Interp *interp, int argc, Jim_Obj *const *argv) ----------------------------------------------------------------------- Summary of changes: src/target/cortex_a8.c | 11 ++++++- src/target/target.c | 69 ++++++++++++++++++++++++++++++++++++----------- tcl/board/am3517evm.cfg | 6 ++-- 3 files changed, 65 insertions(+), 21 deletions(-) hooks/post-receive -- Main OpenOCD repository |