riscv: Remove redundant command for virtual address access.

This commit is contained in:
Kai Wang 2019-11-28 10:16:29 +08:00
parent 9ee2cc061c
commit 990d09eac3
1 changed files with 2 additions and 20 deletions

View File

@ -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
};