[edk2-devel] [PATCH v2 2/3] EmbeddedPkg: add PlatformDwMmc protocol
Loh, Tien Hock
tien.hock.loh at intel.com
Wed Jul 24 09:26:05 UTC 2019
From: Haojian Zhuang <haojian.zhuang at linaro.org>
Add PlatformDwMmc protocol. It's used to set properties of DwMmc
device in platform driver.
Cc: Leif Lindholm <leif.lindholm at linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel at linaro.org>
Cc: Chris Co <Christopher.Co at microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Haojian Zhuang <haojian.zhuang at linaro.org>
---
EmbeddedPkg/Include/Protocol/PlatformDwMmc.h | 79 ++++++++++++++++++++
1 file changed, 79 insertions(+)
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__ */
--
2.19.0
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#44301): https://edk2.groups.io/g/devel/message/44301
Mute This Topic: https://groups.io/mt/32582278/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list