summaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2010-06-22 12:47:30 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-06-22 12:47:30 +0200
commitd236a48e8fd93504bf219fa9113a3af157ba5e1b (patch)
tree7410ca2540467067d1e93fdfb231930e353d8f88 /src/target
parent33e7696cfaca149e83a471212394484054ff05b6 (diff)
downloadopenocd+libswd-d236a48e8fd93504bf219fa9113a3af157ba5e1b.tar.gz
openocd+libswd-d236a48e8fd93504bf219fa9113a3af157ba5e1b.tar.bz2
openocd+libswd-d236a48e8fd93504bf219fa9113a3af157ba5e1b.tar.xz
openocd+libswd-d236a48e8fd93504bf219fa9113a3af157ba5e1b.zip
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 <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/target')
-rw-r--r--src/target/cortex_a8.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c
index ea07579b..afe5b6cb 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;