TianoCore EDK2 master
Loading...
Searching...
No Matches
SdMmcPciHcPei.h
Go to the documentation of this file.
1
8#ifndef _SD_MMC_PCI_HOST_CONTROLLER_PEI_H_
9#define _SD_MMC_PCI_HOST_CONTROLLER_PEI_H_
10
11#include <PiPei.h>
12
13#include <Ppi/MasterBootMode.h>
15
17
18#include <Library/DebugLib.h>
19#include <Library/BaseLib.h>
21#include <Library/PciLib.h>
24
25#define SD_MMC_HC_PEI_SIGNATURE SIGNATURE_32 ('S', 'D', 'M', 'C')
26
27#define MAX_SD_MMC_HCS 8
28#define MAX_SD_MMC_SLOTS 6
29
30//
31// SD Host Controller SlotInfo Register Offset
32//
33#define SD_MMC_HC_PEI_SLOT_OFFSET 0x40
34
35typedef struct {
36 UINT8 FirstBar : 3; // bit 0:2
37 UINT8 Reserved : 1; // bit 3
38 UINT8 SlotNum : 3; // bit 4:6
39 UINT8 Reserved1 : 1; // bit 7
41
42typedef struct {
43 UINTN SlotNum;
44 UINTN MmioBarAddr[MAX_SD_MMC_SLOTS];
46
47typedef struct {
48 UINTN Signature;
49 EDKII_SD_MMC_HOST_CONTROLLER_PPI SdMmcHostControllerPpi;
51 UINTN TotalSdMmcHcs;
52 SD_MMC_HC_PEI_BAR MmioBar[MAX_SD_MMC_HCS];
54
55#define SD_MMC_HC_PEI_PRIVATE_DATA_FROM_THIS(a) CR (a, SD_MMC_HC_PEI_PRIVATE_DATA, SdMmcHostControllerPpi, SD_MMC_HC_PEI_SIGNATURE)
56
72EFIAPI
75 IN UINT8 ControllerId,
76 IN OUT UINTN **MmioBar,
77 OUT UINT8 *BarNum
78 );
79
80#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS EFIAPI GetSdMmcHcMmioBar(IN EDKII_SD_MMC_HOST_CONTROLLER_PPI *This, IN UINT8 ControllerId, IN OUT UINTN **MmioBar, OUT UINT8 *BarNum)
Definition: SdMmcPciHcPei.c:36
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29