-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
target/riscv: added translation drivers
Existing flags: 'enable_virtual' and 'enable_virt2phys' were replaced with explicit translation drivers. Motivation: (1) Having 'enable_virtual' and 'enable_virt2phys' flags set simultaneously may cause double address translation which is unacceptable (2) Flags were global for all targets which is wrong too Signed-off-by: Farid Khaydari <[email protected]>
- Loading branch information
Showing
6 changed files
with
162 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
lappend _telnet_autocomplete_skip "riscv set_enable_virtual" | ||
proc {riscv set_enable_virtual} on_off { | ||
echo {DEPRECATED! use 'riscv virt2phys_mode' not 'riscv set_enable_virtual'} | ||
foreach t [target names] { | ||
if {[$t cget -type] ne "riscv"} { continue } | ||
switch -- [$t riscv virt2phys_mode] { | ||
off - | ||
hw { | ||
switch -- $on_off { | ||
on {$t riscv virt2phys_mode hw} | ||
off {$t riscv virt2phys_mode off} | ||
} | ||
} | ||
sw { | ||
if {$on_off eq "on"} { | ||
error {Can't enable virtual while translation driver is SW} | ||
} | ||
} | ||
} | ||
} | ||
return {} | ||
} | ||
|
||
lappend _telnet_autocomplete_skip "riscv set_enable_virt2phys" | ||
proc {riscv set_enable_virt2phys} on_off { | ||
echo {DEPRECATED! use 'riscv virt2phys_mode' not 'riscv set_enable_virt2phys'} | ||
foreach t [target names] { | ||
if {[$t cget -type] ne "riscv"} { continue } | ||
switch -- [riscv virt2phys_mode] { | ||
off - | ||
sw { | ||
switch -- $on_off { | ||
on {riscv virt2phys_mode sw} | ||
off {riscv virt2phys_mode off} | ||
} | ||
} | ||
hw { | ||
if {$on_off eq "on"} { | ||
error {Can't enable virt2phys while translation driver is HW} | ||
} | ||
} | ||
} | ||
} | ||
return {} | ||
} | ||
|
||
proc riscv {cmd args} { | ||
tailcall "riscv $cmd" {*}$args | ||
} |