aboutsummaryrefslogtreecommitdiff
path: root/Include/Protocol/PlatformDwMmc.h
blob: bf315c4ab486590049c180c0c198879b3a915bb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/** @file

  Copyright (c) 2017, 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__ */