summaryrefslogtreecommitdiff
path: root/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
diff options
context:
space:
mode:
authorTuan Phan <tphan@ventanamicro.com>2023-07-14 12:08:24 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-07-15 14:10:18 +0000
commitf220dcbba86bfc1222180c61bbd31dd6023433db (patch)
tree8664b8b0e32903c179710e7f7018bc45722d1d7f /UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
parentcc13dcc57675695d51efe0d61d772155c601a35b (diff)
downloadedk2-f220dcbba86bfc1222180c61bbd31dd6023433db.zip
edk2-f220dcbba86bfc1222180c61bbd31dd6023433db.tar.gz
edk2-f220dcbba86bfc1222180c61bbd31dd6023433db.tar.bz2
UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode
During CpuDxe initialization, MMU will be setup with the highest mode that HW supports. Signed-off-by: Tuan Phan <tphan@ventanamicro.com> Reviewed-by: Andrei Warkentin <andrei.warkentin@intel.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Diffstat (limited to 'UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c')
-rw-r--r--UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c b/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
index 25fe3f5..2af3b62 100644
--- a/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
+++ b/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
@@ -296,8 +296,7 @@ CpuSetMemoryAttributes (
IN UINT64 Attributes
)
{
- DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n", __func__));
- return EFI_SUCCESS;
+ return RiscVSetMemoryAttributes (BaseAddress, Length, Attributes);
}
/**
@@ -341,6 +340,12 @@ InitializeCpu (
DisableInterrupts ();
//
+ // Enable MMU
+ //
+ Status = RiscVConfigureMmu ();
+ ASSERT_EFI_ERROR (Status);
+
+ //
// Install Boot protocol
//
Status = gBS->InstallProtocolInterface (