2 The NvmExpressPei driver is used to manage non-volatile memory subsystem
3 which follows NVM Express specification at PEI phase.
5 Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #ifndef _NVM_EXPRESS_PEI_PASSTHRU_H_
12 #define _NVM_EXPRESS_PEI_PASSTHRU_H_
14 #define NVME_CONTROLLER_NSID 0
19 #define NORMAL_CMD 0x00
20 #define FUSED_FIRST_CMD 0x01
21 #define FUSED_SECOND_CMD 0x02
28 #define CDW10_VALID 0x01
29 #define CDW11_VALID 0x02
30 #define CDW12_VALID 0x04
31 #define CDW13_VALID 0x08
32 #define CDW14_VALID 0x10
33 #define CDW15_VALID 0x20
41 } EDKII_PEI_NVM_EXPRESS_COMMAND
;
48 } EDKII_PEI_NVM_EXPRESS_COMPLETION
;
51 UINT64 CommandTimeout
;
53 UINT32 TransferLength
;
55 UINT32 MetadataLength
;
57 EDKII_PEI_NVM_EXPRESS_COMMAND
*NvmeCmd
;
58 EDKII_PEI_NVM_EXPRESS_COMPLETION
*NvmeCompletion
;
59 } EDKII_PEI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET
;
63 Sends an NVM Express Command Packet to an NVM Express controller or namespace. This function only
64 supports blocking execution of the command.
66 @param[in] Private The pointer to the NVME_CONTEXT Data structure.
67 @param[in] NamespaceId Is a 32 bit Namespace ID to which the Express HCI command packet will
69 A Value of 0 denotes the NVM Express controller, a Value of all 0FFh in
70 the namespace ID specifies that the command packet should be sent to all
72 @param[in,out] Packet A pointer to the EDKII PEI NVM Express PassThru Command Packet to send
73 to the NVMe namespace specified by NamespaceId.
75 @retval EFI_SUCCESS The EDKII PEI NVM Express Command Packet was sent by the host.
76 TransferLength bytes were transferred to, or from DataBuffer.
77 @retval EFI_NOT_READY The EDKII PEI NVM Express Command Packet could not be sent because
78 the controller is not ready. The caller may retry again later.
79 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the EDKII PEI NVM
80 Express Command Packet.
81 @retval EFI_INVALID_PARAMETER Namespace, or the contents of EDKII_PEI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET
83 The EDKII PEI NVM Express Command Packet was not sent, so no
84 additional status information is available.
85 @retval EFI_UNSUPPORTED The command described by the EDKII PEI NVM Express Command Packet
86 is not supported by the host adapter.
87 The EDKII PEI NVM Express Command Packet was not sent, so no
88 additional status information is available.
89 @retval EFI_TIMEOUT A timeout occurred while waiting for the EDKII PEI NVM Express Command
95 IN PEI_NVME_CONTROLLER_PRIVATE_DATA
*Private
,
96 IN UINT32 NamespaceId
,
97 IN OUT EDKII_PEI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET
*Packet