diff mbox series

[edk2,v2,2/3] EmbeddedPkg: add PlatformDwMmc protocol

Message ID 1534318611-11461-3-git-send-email-haojian.zhuang@linaro.org
State New
Headers show
Series add DwMmcHcDxe driver | expand

Commit Message

Haojian Zhuang Aug. 15, 2018, 7:36 a.m. UTC
Add PlatformDwMmc protocol. It's used to set properties of DwMmc
device in platform driver.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Chris Co <Christopher.Co@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>

---
 EmbeddedPkg/Include/Protocol/PlatformDwMmc.h | 79 ++++++++++++++++++++
 1 file changed, 79 insertions(+)

-- 
2.7.4

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/EmbeddedPkg/Include/Protocol/PlatformDwMmc.h b/EmbeddedPkg/Include/Protocol/PlatformDwMmc.h
new file mode 100644
index 000000000000..54a44928a7e1
--- /dev/null
+++ b/EmbeddedPkg/Include/Protocol/PlatformDwMmc.h
@@ -0,0 +1,79 @@ 
+/** @file
+
+  Copyright (c) 2018, Linaro. All rights reserved.
+
+  This program and the accompanying materials are licensed and made available
+  under the terms and conditions of the BSD License which accompanies this
+  distribution.  The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PLATFORM_DW_MMC_H__
+#define __PLATFORM_DW_MMC_H__
+
+typedef enum {
+  RemovableSlot,
+  EmbeddedSlot,
+  SharedBusSlot,
+  UnknownSlot
+} EFI_SD_MMC_SLOT_TYPE;
+
+typedef enum {
+  UnknownCardType,
+  SdCardType,
+  SdioCardType,
+  MmcCardType,
+  EmmcCardType
+} SD_MMC_CARD_TYPE;
+
+typedef struct {
+  UINT32        DefaultSpeed:1;    // bit 0
+  UINT32        HighSpeed:1;       // bit 1
+  UINT32        Sdr12:1;           // bit 2
+  UINT32        Sdr25:1;           // bit 3
+  UINT32        Sdr50:1;           // bit 4
+  UINT32        Sdr104:1;          // bit 5
+  UINT32        Ddr50:1;           // bit 6
+  UINT32        SysBus64:1;        // bit 7
+  UINT32        BusWidth:4;        // bit 11:8
+  UINT32        SlotType:2;        // bit 13:12
+  UINT32        CardType:3;        // bit 16:14
+  UINT32        Voltage18:1;       // bit 17
+  UINT32        Voltage30:1;       // bit 18
+  UINT32        Voltage33:1;       // bit 19
+  UINT32        BaseClkFreq;
+  EFI_HANDLE    Controller;
+} DW_MMC_HC_SLOT_CAP;
+
+//
+// Protocol interface structure
+//
+typedef struct _PLATFORM_DW_MMC_PROTOCOL       PLATFORM_DW_MMC_PROTOCOL;
+
+typedef
+EFI_STATUS
+(EFIAPI *PLATFORM_DW_MMC_GET_CAPABILITY) (
+  IN     EFI_HANDLE             Controller,
+  IN     UINT8                  Slot,
+     OUT DW_MMC_HC_SLOT_CAP     *Capability
+  );
+
+typedef
+BOOLEAN
+(EFIAPI *PLATFORM_DW_MMC_CARD_DETECT) (
+  IN EFI_HANDLE                 Controller,
+  IN UINT8                      Slot
+  );
+
+struct _PLATFORM_DW_MMC_PROTOCOL {
+  PLATFORM_DW_MMC_GET_CAPABILITY               GetCapability;
+  PLATFORM_DW_MMC_CARD_DETECT                  CardDetect;
+};
+
+extern EFI_GUID gPlatformDwMmcProtocolGuid;
+
+#endif /* __PLATFORM_DW_MMC_H__ */