mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-23 13:44:33 +02:00
UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode
Introduce a PCD to control the maximum SATP mode that MMU allowed to use. This PCD helps RISC-V platform set bare or minimum SATP mode during bring up to debug memory map issue. Signed-off-by: Tuan Phan <tphan@ventanamicro.com> Reviewed-by: Dhaval Sharma <dhaval@rivosinc.com> Reviewed-by: Andrei Warkentin <andrei.warkentin@intel.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
This commit is contained in:
parent
a445e1a42c
commit
772ec92577
@ -36,7 +36,7 @@
|
|||||||
#define PTE_PPN_SHIFT 10
|
#define PTE_PPN_SHIFT 10
|
||||||
#define RISCV_MMU_PAGE_SHIFT 12
|
#define RISCV_MMU_PAGE_SHIFT 12
|
||||||
|
|
||||||
STATIC UINTN mModeSupport[] = { SATP_MODE_SV57, SATP_MODE_SV48, SATP_MODE_SV39 };
|
STATIC UINTN mModeSupport[] = { SATP_MODE_SV57, SATP_MODE_SV48, SATP_MODE_SV39, SATP_MODE_OFF };
|
||||||
STATIC UINTN mMaxRootTableLevel;
|
STATIC UINTN mMaxRootTableLevel;
|
||||||
STATIC UINTN mBitPerLevel;
|
STATIC UINTN mBitPerLevel;
|
||||||
STATIC UINTN mTableEntryCount;
|
STATIC UINTN mTableEntryCount;
|
||||||
@ -590,6 +590,10 @@ RiscVMmuSetSatpMode (
|
|||||||
UINTN Index;
|
UINTN Index;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
|
if (SatpMode > PcdGet32 (PcdCpuRiscVMmuMaxSatpMode)) {
|
||||||
|
return EFI_DEVICE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
switch (SatpMode) {
|
switch (SatpMode) {
|
||||||
case SATP_MODE_OFF:
|
case SATP_MODE_OFF:
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
@ -25,3 +25,6 @@
|
|||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
BaseLib
|
BaseLib
|
||||||
|
|
||||||
|
[Pcd]
|
||||||
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuRiscVMmuMaxSatpMode ## CONSUMES
|
||||||
|
@ -396,6 +396,14 @@
|
|||||||
# @Prompt Access to non-SMRAM memory is restricted to reserved, runtime and ACPI NVS type after SmmReadyToLock.
|
# @Prompt Access to non-SMRAM memory is restricted to reserved, runtime and ACPI NVS type after SmmReadyToLock.
|
||||||
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmRestrictedMemoryAccess|TRUE|BOOLEAN|0x3213210F
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmRestrictedMemoryAccess|TRUE|BOOLEAN|0x3213210F
|
||||||
|
|
||||||
|
[PcdsFixedAtBuild.RISCV64]
|
||||||
|
## Indicate the maximum SATP mode allowed.
|
||||||
|
# 0 - Bare mode.
|
||||||
|
# 8 - 39bit mode.
|
||||||
|
# 9 - 48bit mode.
|
||||||
|
# 10 - 57bit mode.
|
||||||
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuRiscVMmuMaxSatpMode|10|UINT32|0x60000021
|
||||||
|
|
||||||
[PcdsDynamic, PcdsDynamicEx]
|
[PcdsDynamic, PcdsDynamicEx]
|
||||||
## Contains the pointer to a CPU S3 data buffer of structure ACPI_CPU_DATA.
|
## Contains the pointer to a CPU S3 data buffer of structure ACPI_CPU_DATA.
|
||||||
# @Prompt The pointer to a CPU S3 data buffer.
|
# @Prompt The pointer to a CPU S3 data buffer.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user