TianoCore EDK2 master
Loading...
Searching...
No Matches
NvmExpressPei.c File Reference
#include "NvmExpressPei.h"

Go to the source code of this file.

Functions

EFI_STATUS EnumerateNvmeDevNamespace (IN OUT PEI_NVME_CONTROLLER_PRIVATE_DATA *Private, IN UINT32 NamespaceId)
 
EFI_STATUS NvmeDiscoverNamespaces (IN OUT PEI_NVME_CONTROLLER_PRIVATE_DATA *Private)
 
EFI_STATUS EFIAPI NvmePeimEndOfPei (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
 
EFI_STATUS NvmeInitPrivateData (IN UINTN MmioBase, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN UINTN DevicePathLength)
 
EFI_STATUS NvmeInitControllerDataFromPciDevice (EDKII_PCI_DEVICE_PPI *PciDevice)
 
EFI_STATUS EFIAPI NvmePciDevicePpiInstallationCallback (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
 
EFI_STATUS NvmeInitControllerFromHostControllerPpi (IN EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI *NvmeHcPpi)
 
EFI_STATUS EFIAPI NvmeHostControllerPpiInstallationCallback (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
 
EFI_STATUS EFIAPI NvmExpressPeimEntry (IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
 

Variables

EFI_PEI_PPI_DESCRIPTOR mNvmeBlkIoPpiListTemplate
 
EFI_PEI_PPI_DESCRIPTOR mNvmeBlkIo2PpiListTemplate
 
EFI_PEI_PPI_DESCRIPTOR mNvmeStorageSecurityPpiListTemplate
 
EFI_PEI_PPI_DESCRIPTOR mNvmePassThruPpiListTemplate
 
EFI_PEI_NOTIFY_DESCRIPTOR mNvmeEndOfPeiNotifyListTemplate
 
EFI_PEI_NOTIFY_DESCRIPTOR mNvmeHostControllerNotify
 
EFI_PEI_NOTIFY_DESCRIPTOR mPciDevicePpiNotify
 

Detailed Description

The NvmExpressPei driver is used to manage non-volatile memory subsystem which follows NVM Express specification at PEI phase.

Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file NvmExpressPei.c.

Function Documentation

◆ EnumerateNvmeDevNamespace()

EFI_STATUS EnumerateNvmeDevNamespace ( IN OUT PEI_NVME_CONTROLLER_PRIVATE_DATA Private,
IN UINT32  NamespaceId 
)

Check if the specified Nvm Express device namespace is active, and then get the Identify Namespace data.

Parameters
[in,out]PrivateThe pointer to the PEI_NVME_CONTROLLER_PRIVATE_DATA data structure.
[in]NamespaceIdThe specified namespace identifier.
Return values
EFI_SUCCESSThe specified namespace in the device is successfully enumerated.
Returns
Others Error occurs when enumerating the namespace.

Definition at line 67 of file NvmExpressPei.c.

◆ NvmeDiscoverNamespaces()

EFI_STATUS NvmeDiscoverNamespaces ( IN OUT PEI_NVME_CONTROLLER_PRIVATE_DATA Private)

Discover all Nvm Express device active namespaces.

Parameters
[in,out]PrivateThe pointer to the PEI_NVME_CONTROLLER_PRIVATE_DATA data structure.
Return values
EFI_SUCCESSAll the namespaces in the device are successfully enumerated.
Returns
EFI_NOT_FOUND No active namespaces can be found.

Definition at line 169 of file NvmExpressPei.c.

◆ NvmeHostControllerPpiInstallationCallback()

EFI_STATUS EFIAPI NvmeHostControllerPpiInstallationCallback ( IN EFI_PEI_SERVICES **  PeiServices,
IN EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor,
IN VOID *  Ppi 
)

Callback for EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI installation.

Parameters
[in]PeiServicesPointer to PEI Services Table.
[in]NotifyDescriptorPointer to the descriptor for the Notification event that caused this function to execute.
[in]PpiPointer to the PPI data associated with this function.
Return values
EFI_SUCCESSThe function completes successfully
OthersCannot initialize Nvme controller from given EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI

Definition at line 682 of file NvmExpressPei.c.

◆ NvmeInitControllerDataFromPciDevice()

EFI_STATUS NvmeInitControllerDataFromPciDevice ( EDKII_PCI_DEVICE_PPI PciDevice)

Initialize Nvme controller from fiven PCI_DEVICE_PPI.

Parameters
[in]PciDevicePointer to the PCI Device PPI instance.
Return values
EFI_SUCCESSThe function completes successfully
OthersCannot initialize Nvme controller for given device

Definition at line 452 of file NvmExpressPei.c.

◆ NvmeInitControllerFromHostControllerPpi()

EFI_STATUS NvmeInitControllerFromHostControllerPpi ( IN EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI NvmeHcPpi)

Initialize Nvme controller from EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI instance.

Parameters
[in]NvmeHcPpiPointer to the Nvme Host Controller PPI instance.
Return values
EFI_SUCCESSPPI successfully installed.

Definition at line 603 of file NvmExpressPei.c.

◆ NvmeInitPrivateData()

EFI_STATUS NvmeInitPrivateData ( IN UINTN  MmioBase,
IN EFI_DEVICE_PATH_PROTOCOL DevicePath,
IN UINTN  DevicePathLength 
)

Initialize and install PrivateData PPIs.

Parameters
[in]MmioBaseMMIO base address of specific Nvme controller
[in]DevicePathA pointer to the EFI_DEVICE_PATH_PROTOCOL structure.
[in]DevicePathLengthLength of the device path.
Return values
EFI_SUCCESSNvme controller initialized and PPIs installed
othersFailed to initialize Nvme controller

Definition at line 238 of file NvmExpressPei.c.

◆ NvmePciDevicePpiInstallationCallback()

EFI_STATUS EFIAPI NvmePciDevicePpiInstallationCallback ( IN EFI_PEI_SERVICES **  PeiServices,
IN EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor,
IN VOID *  Ppi 
)

Callback for EDKII_PCI_DEVICE_PPI installation.

Parameters
[in]PeiServicesPointer to PEI Services Table.
[in]NotifyDescriptorPointer to the descriptor for the Notification event that caused this function to execute.
[in]PpiPointer to the PPI data associated with this function.
Return values
EFI_SUCCESSThe function completes successfully
OthersCannot initialize Nvme controller from given PCI_DEVICE_PPI

Definition at line 582 of file NvmExpressPei.c.

◆ NvmePeimEndOfPei()

EFI_STATUS EFIAPI NvmePeimEndOfPei ( IN EFI_PEI_SERVICES **  PeiServices,
IN EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor,
IN VOID *  Ppi 
)

One notified function to cleanup the allocated resources at the end of PEI.

Parameters
[in]PeiServicesPointer to PEI Services Table.
[in]NotifyDescriptorPointer to the descriptor for the Notification event that caused this function to execute.
[in]PpiPointer to the PPI data associated with this function.
Return values
EFI_SUCCESSThe function completes successfully

Definition at line 212 of file NvmExpressPei.c.

◆ NvmExpressPeimEntry()

EFI_STATUS EFIAPI NvmExpressPeimEntry ( IN EFI_PEI_FILE_HANDLE  FileHandle,
IN CONST EFI_PEI_SERVICES **  PeiServices 
)

Entry point of the PEIM.

Parameters
[in]FileHandleHandle of the file being invoked.
[in]PeiServicesDescribes the list of possible PEI Services.
Return values
EFI_SUCCESSPPI successfully installed.

Definition at line 710 of file NvmExpressPei.c.

Variable Documentation

◆ mNvmeBlkIo2PpiListTemplate

EFI_PEI_PPI_DESCRIPTOR mNvmeBlkIo2PpiListTemplate
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiPeiVirtualBlockIo2PpiGuid,
}
#define NULL
Definition: Base.h:319

Definition at line 19 of file NvmExpressPei.c.

◆ mNvmeBlkIoPpiListTemplate

EFI_PEI_PPI_DESCRIPTOR mNvmeBlkIoPpiListTemplate
Initial value:
= {
EFI_PEI_PPI_DESCRIPTOR_PPI,
&gEfiPeiVirtualBlockIoPpiGuid,
}

Definition at line 13 of file NvmExpressPei.c.

◆ mNvmeEndOfPeiNotifyListTemplate

EFI_PEI_NOTIFY_DESCRIPTOR mNvmeEndOfPeiNotifyListTemplate
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiEndOfPeiSignalPpiGuid,
}
EFI_STATUS EFIAPI NvmePeimEndOfPei(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)

Definition at line 37 of file NvmExpressPei.c.

◆ mNvmeHostControllerNotify

EFI_PEI_NOTIFY_DESCRIPTOR mNvmeHostControllerNotify
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEdkiiPeiNvmExpressHostControllerPpiGuid,
}
EFI_STATUS EFIAPI NvmeHostControllerPpiInstallationCallback(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)

Definition at line 43 of file NvmExpressPei.c.

◆ mNvmePassThruPpiListTemplate

EFI_PEI_PPI_DESCRIPTOR mNvmePassThruPpiListTemplate
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEdkiiPeiNvmExpressPassThruPpiGuid,
}

Definition at line 31 of file NvmExpressPei.c.

◆ mNvmeStorageSecurityPpiListTemplate

EFI_PEI_PPI_DESCRIPTOR mNvmeStorageSecurityPpiListTemplate
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEdkiiPeiStorageSecurityCommandPpiGuid,
}

Definition at line 25 of file NvmExpressPei.c.

◆ mPciDevicePpiNotify

EFI_PEI_NOTIFY_DESCRIPTOR mPciDevicePpiNotify
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEdkiiPeiPciDevicePpiGuid,
}
EFI_STATUS EFIAPI NvmePciDevicePpiInstallationCallback(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)

Definition at line 49 of file NvmExpressPei.c.