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

Go to the source code of this file.

Functions

EFI_STATUS NvmeMmioRead (IN OUT VOID *MemBuffer, IN UINTN MmioAddr, IN UINTN Size)
 
EFI_STATUS NvmeMmioWrite (IN OUT UINTN MmioAddr, IN VOID *MemBuffer, IN UINTN Size)
 
UINT32 NvmeBaseMemPageOffset (IN UINTN BaseMemIndex)
 
EFI_STATUS NvmeWaitController (IN PEI_NVME_CONTROLLER_PRIVATE_DATA *Private, IN BOOLEAN WaitReady)
 
EFI_STATUS NvmeDisableController (IN PEI_NVME_CONTROLLER_PRIVATE_DATA *Private)
 
EFI_STATUS NvmeEnableController (IN PEI_NVME_CONTROLLER_PRIVATE_DATA *Private)
 
EFI_STATUS NvmeIdentifyController (IN PEI_NVME_CONTROLLER_PRIVATE_DATA *Private, IN VOID *Buffer)
 
EFI_STATUS NvmeIdentifyNamespace (IN PEI_NVME_CONTROLLER_PRIVATE_DATA *Private, IN UINT32 NamespaceId, IN VOID *Buffer)
 
VOID NvmeDumpControllerData (IN NVME_ADMIN_CONTROLLER_DATA *ControllerData)
 
EFI_STATUS NvmeCreateIoCompletionQueue (IN PEI_NVME_CONTROLLER_PRIVATE_DATA *Private)
 
EFI_STATUS NvmeCreateIoSubmissionQueue (IN PEI_NVME_CONTROLLER_PRIVATE_DATA *Private)
 
EFI_STATUS NvmeControllerInit (IN PEI_NVME_CONTROLLER_PRIVATE_DATA *Private)
 
VOID NvmeFreeDmaResource (IN PEI_NVME_CONTROLLER_PRIVATE_DATA *Private)
 

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 NvmExpressPeiHci.c.

Function Documentation

◆ NvmeBaseMemPageOffset()

UINT32 NvmeBaseMemPageOffset ( IN UINTN  BaseMemIndex)

Get the page offset for specific NVME based memory.

Parameters
[in]BaseMemIndexThe Index of BaseMem (0-based).
Return values
-The page count for specific BaseMem Index

Definition at line 126 of file NvmExpressPeiHci.c.

◆ NvmeControllerInit()

EFI_STATUS NvmeControllerInit ( IN PEI_NVME_CONTROLLER_PRIVATE_DATA Private)

Initialize the Nvm Express controller.

Parameters
[in]PrivateThe pointer to the PEI_NVME_CONTROLLER_PRIVATE_DATA data structure.
Return values
EFI_SUCCESSThe NVM Express Controller is initialized successfully.
OthersA device error occurred while initializing the controller.

Definition at line 553 of file NvmExpressPeiHci.c.

◆ NvmeCreateIoCompletionQueue()

EFI_STATUS NvmeCreateIoCompletionQueue ( IN PEI_NVME_CONTROLLER_PRIVATE_DATA Private)

Create IO completion queue.

Parameters
[in]PrivateThe pointer to the PEI_NVME_CONTROLLER_PRIVATE_DATA data structure.
Returns
EFI_SUCCESS Successfully create io completion queue.
others Fail to create io completion queue.

Definition at line 455 of file NvmExpressPeiHci.c.

◆ NvmeCreateIoSubmissionQueue()

EFI_STATUS NvmeCreateIoSubmissionQueue ( IN PEI_NVME_CONTROLLER_PRIVATE_DATA Private)

Create IO submission queue.

Parameters
[in]PrivateThe pointer to the PEI_NVME_CONTROLLER_PRIVATE_DATA data structure.
Returns
EFI_SUCCESS Successfully create io submission queue.
others Fail to create io submission queue.

Definition at line 503 of file NvmExpressPeiHci.c.

◆ NvmeDisableController()

EFI_STATUS NvmeDisableController ( IN PEI_NVME_CONTROLLER_PRIVATE_DATA Private)

Disable the Nvm Express controller.

Parameters
[in]PrivateThe pointer to the PEI_NVME_CONTROLLER_PRIVATE_DATA data structure.
Returns
EFI_SUCCESS Successfully disable the controller.
others Fail to disable the controller.

Definition at line 220 of file NvmExpressPeiHci.c.

◆ NvmeDumpControllerData()

VOID NvmeDumpControllerData ( IN NVME_ADMIN_CONTROLLER_DATA ControllerData)

Dump the Identify Controller data.

Parameters
[in]ControllerDataThe pointer to the NVME_ADMIN_CONTROLLER_DATA data structure.

Definition at line 418 of file NvmExpressPeiHci.c.

◆ NvmeEnableController()

EFI_STATUS NvmeEnableController ( IN PEI_NVME_CONTROLLER_PRIVATE_DATA Private)

Enable the Nvm Express controller.

Parameters
[in]PrivateThe pointer to the PEI_NVME_CONTROLLER_PRIVATE_DATA data structure.
Returns
EFI_SUCCESS Successfully enable the controller.
EFI_DEVICE_ERROR Fail to enable the controller.
EFI_TIMEOUT Fail to enable the controller in given time slot.

Definition at line 275 of file NvmExpressPeiHci.c.

◆ NvmeFreeDmaResource()

VOID NvmeFreeDmaResource ( IN PEI_NVME_CONTROLLER_PRIVATE_DATA Private)

Free the DMA resources allocated by an NVME controller.

Parameters
[in]PrivateThe pointer to the PEI_NVME_CONTROLLER_PRIVATE_DATA data structure.

Definition at line 708 of file NvmExpressPeiHci.c.

◆ NvmeIdentifyController()

EFI_STATUS NvmeIdentifyController ( IN PEI_NVME_CONTROLLER_PRIVATE_DATA Private,
IN VOID *  Buffer 
)

Get the Identify Controller data.

Parameters
[in]PrivateThe pointer to the PEI_NVME_CONTROLLER_PRIVATE_DATA data structure.
[in]BufferThe Buffer used to store the Identify Controller data.
Returns
EFI_SUCCESS Successfully get the Identify Controller data.
others Fail to get the Identify Controller data.

Definition at line 320 of file NvmExpressPeiHci.c.

◆ NvmeIdentifyNamespace()

EFI_STATUS NvmeIdentifyNamespace ( IN PEI_NVME_CONTROLLER_PRIVATE_DATA Private,
IN UINT32  NamespaceId,
IN VOID *  Buffer 
)

Get specified identify namespace data.

Parameters
[in]PrivateThe pointer to the PEI_NVME_CONTROLLER_PRIVATE_DATA data structure.
[in]NamespaceIdThe specified namespace identifier.
[in]BufferThe buffer used to store the identify namespace data.
Returns
EFI_SUCCESS Successfully get the identify namespace data.
EFI_DEVICE_ERROR Fail to get the identify namespace data.

Definition at line 373 of file NvmExpressPeiHci.c.

◆ NvmeMmioRead()

EFI_STATUS NvmeMmioRead ( IN OUT VOID *  MemBuffer,
IN UINTN  MmioAddr,
IN UINTN  Size 
)

Transfer MMIO Data to memory.

Parameters
[in,out]MemBufferDestination: Memory address.
[in]MmioAddrSource: MMIO address.
[in]SizeSize for read.
Return values
EFI_SUCCESSMMIO read sucessfully.

Definition at line 24 of file NvmExpressPeiHci.c.

◆ NvmeMmioWrite()

EFI_STATUS NvmeMmioWrite ( IN OUT UINTN  MmioAddr,
IN VOID *  MemBuffer,
IN UINTN  Size 
)

Transfer memory data to MMIO.

Parameters
[in,out]MmioAddrDestination: MMIO address.
[in]MemBufferSource: Memory address.
[in]SizeSize for write.
Return values
EFI_SUCCESSMMIO write sucessfully.

Definition at line 76 of file NvmExpressPeiHci.c.

◆ NvmeWaitController()

EFI_STATUS NvmeWaitController ( IN PEI_NVME_CONTROLLER_PRIVATE_DATA Private,
IN BOOLEAN  WaitReady 
)

Wait for NVME controller status to be ready or not.

Parameters
[in]PrivateThe pointer to the PEI_NVME_CONTROLLER_PRIVATE_DATA data structure.
[in]WaitReadyFlag for waitting status ready or not.
Returns
EFI_SUCCESS Successfully to wait specific status.
others Fail to wait for specific controller status.

Definition at line 165 of file NvmExpressPeiHci.c.