MdeModulePkg RamDiskDxe: Report ACPI NFIT for reserved memory RAM disks
The RamDiskDxe now will report RAM disks with reserved memory type to NFIT in the ACPI table. This commit will also make sure that an NVDIMM root device exists in the \SB scope before reporting any RAM disk to NFIT. To properly report the NVDIMM root device, one will need to append the following content in the [Rule.Common.DXE_DRIVER] field in platform FDF files: RAW ACPI Optional |.acpi RAW ASL Optional |.aml Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
This commit is contained in:
@@ -28,14 +28,19 @@
|
||||
#include <Library/FileExplorerLib.h>
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Library/PrintLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/DxeServicesLib.h>
|
||||
#include <Protocol/RamDisk.h>
|
||||
#include <Protocol/BlockIo.h>
|
||||
#include <Protocol/BlockIo2.h>
|
||||
#include <Protocol/HiiConfigAccess.h>
|
||||
#include <Protocol/SimpleFileSystem.h>
|
||||
#include <Protocol/AcpiTable.h>
|
||||
#include <Protocol/AcpiSystemDescriptionTable.h>
|
||||
#include <Guid/MdeModuleHii.h>
|
||||
#include <Guid/RamDiskHii.h>
|
||||
#include <Guid/FileInfo.h>
|
||||
#include <IndustryStandard/Acpi61.h>
|
||||
|
||||
#include "RamDiskNVData.h"
|
||||
|
||||
@@ -68,6 +73,12 @@
|
||||
extern LIST_ENTRY RegisteredRamDisks;
|
||||
extern UINTN ListEntryNum;
|
||||
|
||||
//
|
||||
// Pointers to the EFI_ACPI_TABLE_PROTOCOL and EFI_ACPI_SDT_PROTOCOL.
|
||||
//
|
||||
extern EFI_ACPI_TABLE_PROTOCOL *mAcpiTableProtocol;
|
||||
extern EFI_ACPI_SDT_PROTOCOL *mAcpiSdtProtocol;
|
||||
|
||||
//
|
||||
// RAM Disk create method.
|
||||
//
|
||||
@@ -96,6 +107,7 @@ typedef struct {
|
||||
EFI_GUID TypeGuid;
|
||||
UINT16 InstanceNumber;
|
||||
RAM_DISK_CREATE_METHOD CreateMethod;
|
||||
BOOLEAN InNfit;
|
||||
|
||||
LIST_ENTRY ThisInstance;
|
||||
} RAM_DISK_PRIVATE_DATA;
|
||||
@@ -630,4 +642,20 @@ OpenFileByDevicePath(
|
||||
IN UINT64 Attributes
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Publish the RAM disk NVDIMM Firmware Interface Table (NFIT) to the ACPI
|
||||
table.
|
||||
|
||||
@param[in] PrivateData Points to RAM disk private data.
|
||||
|
||||
@retval EFI_SUCCESS The RAM disk NFIT has been published.
|
||||
@retval others The RAM disk NFIT has not been published.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
RamDiskPublishNfit (
|
||||
IN RAM_DISK_PRIVATE_DATA *PrivateData
|
||||
);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user