]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Protocol/SdMmcOverride.h
MdeModulePkg/S3SmmInitDone.h: Fix copyright coding style error.
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / SdMmcOverride.h
1 /** @file
2 Protocol to describe overrides required to support non-standard SDHCI
3 implementations
4
5 Copyright (c) 2017 - 2018, Linaro, Ltd. All rights reserved.<BR>
6
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef __SD_MMC_OVERRIDE_H__
18 #define __SD_MMC_OVERRIDE_H__
19
20 #include <Protocol/SdMmcPassThru.h>
21
22 #define EDKII_SD_MMC_OVERRIDE_PROTOCOL_GUID \
23 { 0xeaf9e3c1, 0xc9cd, 0x46db, { 0xa5, 0xe5, 0x5a, 0x12, 0x4c, 0x83, 0x23, 0x23 } }
24
25 #define EDKII_SD_MMC_OVERRIDE_PROTOCOL_VERSION 0x1
26
27 typedef struct _EDKII_SD_MMC_OVERRIDE EDKII_SD_MMC_OVERRIDE;
28
29 typedef enum {
30 EdkiiSdMmcResetPre,
31 EdkiiSdMmcResetPost,
32 EdkiiSdMmcInitHostPre,
33 EdkiiSdMmcInitHostPost,
34 } EDKII_SD_MMC_PHASE_TYPE;
35
36 /**
37
38 Override function for SDHCI capability bits
39
40 @param[in] ControllerHandle The EFI_HANDLE of the controller.
41 @param[in] Slot The 0 based slot index.
42 @param[in,out] SdMmcHcSlotCapability The SDHCI capability structure.
43
44 @retval EFI_SUCCESS The override function completed successfully.
45 @retval EFI_NOT_FOUND The specified controller or slot does not exist.
46 @retval EFI_INVALID_PARAMETER SdMmcHcSlotCapability is NULL
47
48 **/
49 typedef
50 EFI_STATUS
51 (EFIAPI * EDKII_SD_MMC_CAPABILITY) (
52 IN EFI_HANDLE ControllerHandle,
53 IN UINT8 Slot,
54 IN OUT VOID *SdMmcHcSlotCapability
55 );
56
57 /**
58
59 Override function for SDHCI controller operations
60
61 @param[in] ControllerHandle The EFI_HANDLE of the controller.
62 @param[in] Slot The 0 based slot index.
63 @param[in] PhaseType The type of operation and whether the
64 hook is invoked right before (pre) or
65 right after (post)
66
67 @retval EFI_SUCCESS The override function completed successfully.
68 @retval EFI_NOT_FOUND The specified controller or slot does not exist.
69 @retval EFI_INVALID_PARAMETER PhaseType is invalid
70
71 **/
72 typedef
73 EFI_STATUS
74 (EFIAPI * EDKII_SD_MMC_NOTIFY_PHASE) (
75 IN EFI_HANDLE ControllerHandle,
76 IN UINT8 Slot,
77 IN EDKII_SD_MMC_PHASE_TYPE PhaseType
78 );
79
80 struct _EDKII_SD_MMC_OVERRIDE {
81 //
82 // Protocol version of this implementation
83 //
84 UINTN Version;
85 //
86 // Callback to override SD/MMC host controller capability bits
87 //
88 EDKII_SD_MMC_CAPABILITY Capability;
89 //
90 // Callback to invoke SD/MMC override hooks
91 //
92 EDKII_SD_MMC_NOTIFY_PHASE NotifyPhase;
93 };
94
95 extern EFI_GUID gEdkiiSdMmcOverrideProtocolGuid;
96
97 #endif