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>__archive__
parent
33e7696cfa
commit
d236a48e8f
|
@ -1381,12 +1381,16 @@ static int cortex_a8_read_memory(struct target *target, uint32_t address,
|
||||||
{
|
{
|
||||||
int enabled = 0;
|
int enabled = 0;
|
||||||
uint32_t virt, phys;
|
uint32_t virt, phys;
|
||||||
|
int retval;
|
||||||
|
|
||||||
/* cortex_a8 handles unaligned memory access */
|
/* cortex_a8 handles unaligned memory access */
|
||||||
|
|
||||||
// ??? dap_ap_select(swjdp, swjdp_memoryap);
|
// ??? dap_ap_select(swjdp, swjdp_memoryap);
|
||||||
LOG_DEBUG("Reading memory at address 0x%x; size %d; count %d", address, size, count);
|
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)
|
if(enabled)
|
||||||
{
|
{
|
||||||
virt = address;
|
virt = address;
|
||||||
|
@ -1484,11 +1488,14 @@ static int cortex_a8_write_memory(struct target *target, uint32_t address,
|
||||||
{
|
{
|
||||||
int enabled = 0;
|
int enabled = 0;
|
||||||
uint32_t virt, phys;
|
uint32_t virt, phys;
|
||||||
|
int retval;
|
||||||
|
|
||||||
// ??? dap_ap_select(swjdp, swjdp_memoryap);
|
// ??? dap_ap_select(swjdp, swjdp_memoryap);
|
||||||
|
|
||||||
LOG_DEBUG("Writing memory to address 0x%x; size %d; count %d", address, size, count);
|
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)
|
if(enabled)
|
||||||
{
|
{
|
||||||
virt = address;
|
virt = address;
|
||||||
|
|
Loading…
Reference in New Issue