From 990d09eac37d2effcfc5c0d0b5c99678f45e7d7f Mon Sep 17 00:00:00 2001 From: Kai Wang Date: Thu, 28 Nov 2019 10:16:29 +0800 Subject: [PATCH] riscv: Remove redundant command for virtual address access. --- src/target/riscv/riscv.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index f50802572..87057ab39 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -251,9 +251,8 @@ int riscv_command_timeout_sec = DEFAULT_COMMAND_TIMEOUT_SEC; int riscv_reset_timeout_sec = DEFAULT_RESET_TIMEOUT_SEC; bool riscv_prefer_sba; -bool riscv_no_virt2phys; -bool riscv_enable_virtual; +bool riscv_enable_virtual = true; typedef struct { uint16_t low, high; @@ -1483,7 +1482,7 @@ static int riscv_address_translate(struct target *target, static int riscv_virt2phys(struct target *target, target_addr_t virtual, target_addr_t *physical) { - if (riscv_no_virt2phys) + if (!riscv_enable_virtual) return ERROR_FAIL; int enabled; @@ -2449,16 +2448,6 @@ COMMAND_HANDLER(riscv_use_bscan_tunnel) return ERROR_OK; } -COMMAND_HANDLER(riscv_disable_virt2phys) -{ - if (CMD_ARGC != 1) { - LOG_ERROR("Command takes exactly 1 parameter"); - return ERROR_COMMAND_SYNTAX_ERROR; - } - COMMAND_PARSE_ON_OFF(CMD_ARGV[0], riscv_no_virt2phys); - return ERROR_OK; -} - static const struct command_registration riscv_exec_command_handlers[] = { { .name = "test_compliance", @@ -2594,13 +2583,6 @@ static const struct command_registration riscv_exec_command_handlers[] = { "(optional) to indicate Bscan Tunnel Type {0:(default) NESTED_TAP , " "1: DATA_REGISTER}" }, - { - .name = "disable_virt2phys", - .handler = riscv_disable_virt2phys, - .mode = COMMAND_ANY, - .usage = "riscv disable_virt2phys on|off", - .help = "Disable translation from virtual address to physical address." - }, COMMAND_REGISTRATION_DONE };