1 | /** @file
|
---|
2 |
|
---|
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
|
---|
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
5 |
|
---|
6 | **/
|
---|
7 |
|
---|
8 | #ifndef _EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI_H_
|
---|
9 | #define _EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI_H_
|
---|
10 |
|
---|
11 | #include <Protocol/DevicePath.h>
|
---|
12 |
|
---|
13 | ///
|
---|
14 | /// Global ID for the EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI.
|
---|
15 | ///
|
---|
16 | #define EDKII_NVME_EXPRESS_HOST_CONTROLLER_PPI_GUID \
|
---|
17 | { \
|
---|
18 | 0xcae3aa63, 0x676f, 0x4da3, { 0xbd, 0x50, 0x6c, 0xc5, 0xed, 0xde, 0x9a, 0xad } \
|
---|
19 | }
|
---|
20 |
|
---|
21 | //
|
---|
22 | // Forward declaration for the EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI.
|
---|
23 | //
|
---|
24 | typedef struct _EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | Get the MMIO base address of NVM Express host controller.
|
---|
28 |
|
---|
29 | @param[in] This The PPI instance pointer.
|
---|
30 | @param[in] ControllerId The ID of the NVM Express host controller.
|
---|
31 | @param[out] MmioBar The MMIO base address of the controller.
|
---|
32 |
|
---|
33 | @retval EFI_SUCCESS The operation succeeds.
|
---|
34 | @retval EFI_INVALID_PARAMETER The parameters are invalid.
|
---|
35 | @retval EFI_NOT_FOUND The specified NVM Express host controller not
|
---|
36 | found.
|
---|
37 |
|
---|
38 | **/
|
---|
39 | typedef
|
---|
40 | EFI_STATUS
|
---|
41 | (EFIAPI *EDKII_NVM_EXPRESS_HC_GET_MMIO_BAR) (
|
---|
42 | IN EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI *This,
|
---|
43 | IN UINT8 ControllerId,
|
---|
44 | OUT UINTN *MmioBar
|
---|
45 | );
|
---|
46 |
|
---|
47 | /**
|
---|
48 | Get the device path of NVM Express host controller.
|
---|
49 |
|
---|
50 | @param[in] This The PPI instance pointer.
|
---|
51 | @param[in] ControllerId The ID of the NVM Express host controller.
|
---|
52 | @param[out] DevicePathLength The length of the device path in bytes specified
|
---|
53 | by DevicePath.
|
---|
54 | @param[out] DevicePath The device path of NVM Express host controller.
|
---|
55 | This field re-uses EFI Device Path Protocol as
|
---|
56 | defined by Section 10.2 EFI Device Path Protocol
|
---|
57 | of UEFI 2.7 Specification.
|
---|
58 |
|
---|
59 | @retval EFI_SUCCESS The operation succeeds.
|
---|
60 | @retval EFI_INVALID_PARAMETER The parameters are invalid.
|
---|
61 | @retval EFI_NOT_FOUND The specified NVM Express host controller not
|
---|
62 | found.
|
---|
63 | @retval EFI_OUT_OF_RESOURCES The operation fails due to lack of resources.
|
---|
64 |
|
---|
65 | **/
|
---|
66 | typedef
|
---|
67 | EFI_STATUS
|
---|
68 | (EFIAPI *EDKII_NVM_EXPRESS_HC_GET_DEVICE_PATH) (
|
---|
69 | IN EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI *This,
|
---|
70 | IN UINT8 ControllerId,
|
---|
71 | OUT UINTN *DevicePathLength,
|
---|
72 | OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
|
---|
73 | );
|
---|
74 |
|
---|
75 | //
|
---|
76 | // This PPI contains a set of services to interact with the NVM Express host
|
---|
77 | // controller.
|
---|
78 | //
|
---|
79 | struct _EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI {
|
---|
80 | EDKII_NVM_EXPRESS_HC_GET_MMIO_BAR GetNvmeHcMmioBar;
|
---|
81 | EDKII_NVM_EXPRESS_HC_GET_DEVICE_PATH GetNvmeHcDevicePath;
|
---|
82 | };
|
---|
83 |
|
---|
84 | extern EFI_GUID gEdkiiPeiNvmExpressHostControllerPpiGuid;
|
---|
85 |
|
---|
86 | #endif
|
---|