summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTuan Phan <tphan@ventanamicro.com>2023-07-14 12:08:23 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-07-15 14:10:18 +0000
commitcc13dcc57675695d51efe0d61d772155c601a35b (patch)
tree7ba255191e27b5f27c0c78479efc25bd19f90237
parent33d0a3cc926c39bf27e29b0f8c7ac0266504afe6 (diff)
downloadedk2-cc13dcc57675695d51efe0d61d772155c601a35b.tar.gz
edk2-cc13dcc57675695d51efe0d61d772155c601a35b.tar.bz2
edk2-cc13dcc57675695d51efe0d61d772155c601a35b.zip
OvmfPkg: RiscVVirt: Remove satp bare mode setting
There is no point to set satp to bare mode as that should be the default mode when booting edk2. Signed-off-by: Tuan Phan <tphan@ventanamicro.com> Reviewed-by: Andrei Warkentin <andrei.warkentin@intel.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
-rw-r--r--OvmfPkg/RiscVVirt/Sec/Memory.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/OvmfPkg/RiscVVirt/Sec/Memory.c b/OvmfPkg/RiscVVirt/Sec/Memory.c
index 0e2690c736..aad71ee5dc 100644
--- a/OvmfPkg/RiscVVirt/Sec/Memory.c
+++ b/OvmfPkg/RiscVVirt/Sec/Memory.c
@@ -86,21 +86,6 @@ AddMemoryRangeHob (
}
/**
- Configure MMU
-**/
-STATIC
-VOID
-InitMmu (
- )
-{
- //
- // Set supervisor translation mode to Bare mode
- //
- RiscVSetSupervisorAddressTranslationRegister ((UINT64)SATP_MODE_OFF << 60);
- DEBUG ((DEBUG_INFO, "%a: Set Supervisor address mode to bare-metal mode.\n", __func__));
-}
-
-/**
Publish system RAM and reserve memory regions.
**/
@@ -327,7 +312,8 @@ MemoryPeimInitialization (
AddReservedMemoryMap (FdtPointer);
- InitMmu ();
+ /* Make sure SEC is booting with bare mode */
+ ASSERT ((RiscVGetSupervisorAddressTranslationRegister () & SATP64_MODE) == (SATP_MODE_OFF << SATP64_MODE_SHIFT));
BuildMemoryTypeInformationHob ();