target: armv8: Ensure target is halted for virt2phys

Othewise the error reported as

    Timeout waiting for dpm prepare

Change-Id: Ieed2fdcd94ae4e877a749df3eec07a01dbf80b10
Closes: https://sourceforge.net/p/openocd/tickets/201/
Found-by: Matthias Welwarsky <matthias@welwarsky.de>
Signed-off-by: Guido Günther <guido.gunther@puri.sm>
Reviewed-on: http://openocd.zylin.com/4647
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
bscan_tunnel
Guido Günther 2018-08-10 12:01:17 +02:00 committed by Matthias Welwarsky
parent 704d7ac2d0
commit 2a3b709aa5
1 changed files with 5 additions and 0 deletions

View File

@ -936,6 +936,11 @@ int armv8_mmu_translate_va_pa(struct target *target, target_addr_t va,
"Secure", "Not Secure" "Secure", "Not Secure"
}; };
if (target->state != TARGET_HALTED) {
LOG_WARNING("target %s not halted", target_name(target));
return ERROR_TARGET_NOT_HALTED;
}
retval = dpm->prepare(dpm); retval = dpm->prepare(dpm);
if (retval != ERROR_OK) if (retval != ERROR_OK)
return retval; return retval;