14#define EMMC_HC_SDMA_ADDR 0x00
15#define EMMC_HC_ARG2 0x00
16#define EMMC_HC_BLK_SIZE 0x04
17#define EMMC_HC_BLK_COUNT 0x06
18#define EMMC_HC_ARG1 0x08
19#define EMMC_HC_TRANS_MOD 0x0C
20#define EMMC_HC_COMMAND 0x0E
21#define EMMC_HC_RESPONSE 0x10
22#define EMMC_HC_BUF_DAT_PORT 0x20
23#define EMMC_HC_PRESENT_STATE 0x24
24#define EMMC_HC_HOST_CTRL1 0x28
25#define EMMC_HC_POWER_CTRL 0x29
26#define EMMC_HC_BLK_GAP_CTRL 0x2A
27#define EMMC_HC_WAKEUP_CTRL 0x2B
28#define EMMC_HC_CLOCK_CTRL 0x2C
29#define EMMC_HC_TIMEOUT_CTRL 0x2E
30#define EMMC_HC_SW_RST 0x2F
31#define EMMC_HC_NOR_INT_STS 0x30
32#define EMMC_HC_ERR_INT_STS 0x32
33#define EMMC_HC_NOR_INT_STS_EN 0x34
34#define EMMC_HC_ERR_INT_STS_EN 0x36
35#define EMMC_HC_NOR_INT_SIG_EN 0x38
36#define EMMC_HC_ERR_INT_SIG_EN 0x3A
37#define EMMC_HC_AUTO_CMD_ERR_STS 0x3C
38#define EMMC_HC_HOST_CTRL2 0x3E
39#define EMMC_HC_CAP 0x40
40#define EMMC_HC_MAX_CURRENT_CAP 0x48
41#define EMMC_HC_FORCE_EVT_AUTO_CMD 0x50
42#define EMMC_HC_FORCE_EVT_ERR_INT 0x52
43#define EMMC_HC_ADMA_ERR_STS 0x54
44#define EMMC_HC_ADMA_SYS_ADDR 0x58
45#define EMMC_HC_PRESET_VAL 0x60
46#define EMMC_HC_SHARED_BUS_CTRL 0xE0
47#define EMMC_HC_SLOT_INT_STS 0xFC
48#define EMMC_HC_CTRL_VER 0xFE
59} EMMC_HC_TRANSFER_MODE;
64#define ADMA_MAX_DATA_PER_LINE 0x10000
65#define EMMC_SDMA_BOUNDARY 512 * 1024
66#define EMMC_SDMA_ROUND_UP(x, n) (((x) + n) & ~(n - 1))
89 UINT32 CommandArgument;
107 UINT32 InTransferLength;
108 UINT32 OutTransferLength;
119 UINT32 Reserved1 : 10;
125 UINT32 TimeoutFreq : 6;
127 UINT32 TimeoutUnit : 1;
128 UINT32 BaseClkFreq : 8;
129 UINT32 MaxBlkLen : 2;
130 UINT32 BusWidth8 : 1;
132 UINT32 Reserved2 : 1;
133 UINT32 HighSpeed : 1;
136 UINT32 Voltage33 : 1;
137 UINT32 Voltage30 : 1;
138 UINT32 Voltage18 : 1;
139 UINT32 Reserved3 : 1;
146 UINT32 Reserved4 : 1;
147 UINT32 DriverTypeA : 1;
148 UINT32 DriverTypeC : 1;
149 UINT32 DriverTypeD : 1;
150 UINT32 DriverType4 : 1;
151 UINT32 TimerCount : 4;
152 UINT32 Reserved5 : 1;
153 UINT32 TuningSDR50 : 1;
154 UINT32 RetuningMod : 2;
155 UINT32 ClkMultiplier : 8;
156 UINT32 Reserved6 : 7;
EFI_STATUS EmmcPeimHcEnableInterrupt(IN UINTN Bar)
VOID EmmcPeimFreeTrb(IN EMMC_TRB *Trb)
EFI_STATUS EmmcPeimHcInitHost(IN UINTN Bar)
EFI_STATUS EmmcPeimSetBlkCount(IN EMMC_PEIM_HC_SLOT *Slot, IN UINT16 BlockCount)
EFI_STATUS EmmcPeimHcGetCapability(IN UINTN Bar, OUT EMMC_HC_SLOT_CAP *Capability)
EFI_STATUS EmmcPeimSwitch(IN EMMC_PEIM_HC_SLOT *Slot, IN UINT8 Access, IN UINT8 Index, IN UINT8 Value, IN UINT8 CmdSet)
EFI_STATUS EmmcPeimHcReset(IN UINTN Bar)
EFI_STATUS EmmcPeimHcCardDetect(IN UINTN Bar)
EFI_STATUS EmmcPeimRwMultiBlocks(IN EMMC_PEIM_HC_SLOT *Slot, IN EFI_LBA Lba, IN UINT32 BlockSize, IN VOID *Buffer, IN UINTN BufferSize, IN BOOLEAN IsRead)
EFI_STATUS EmmcPeimIdentification(IN EMMC_PEIM_HC_SLOT *Slot)