14#define SD_HC_SDMA_ADDR 0x00
15#define SD_HC_ARG2 0x00
16#define SD_HC_BLK_SIZE 0x04
17#define SD_HC_BLK_COUNT 0x06
18#define SD_HC_ARG1 0x08
19#define SD_HC_TRANS_MOD 0x0C
20#define SD_HC_COMMAND 0x0E
21#define SD_HC_RESPONSE 0x10
22#define SD_HC_BUF_DAT_PORT 0x20
23#define SD_HC_PRESENT_STATE 0x24
24#define SD_HC_HOST_CTRL1 0x28
25#define SD_HC_POWER_CTRL 0x29
26#define SD_HC_BLK_GAP_CTRL 0x2A
27#define SD_HC_WAKEUP_CTRL 0x2B
28#define SD_HC_CLOCK_CTRL 0x2C
29#define SD_HC_TIMEOUT_CTRL 0x2E
30#define SD_HC_SW_RST 0x2F
31#define SD_HC_NOR_INT_STS 0x30
32#define SD_HC_ERR_INT_STS 0x32
33#define SD_HC_NOR_INT_STS_EN 0x34
34#define SD_HC_ERR_INT_STS_EN 0x36
35#define SD_HC_NOR_INT_SIG_EN 0x38
36#define SD_HC_ERR_INT_SIG_EN 0x3A
37#define SD_HC_AUTO_CMD_ERR_STS 0x3C
38#define SD_HC_HOST_CTRL2 0x3E
40#define SD_HC_MAX_CURRENT_CAP 0x48
41#define SD_HC_FORCE_EVT_AUTO_CMD 0x50
42#define SD_HC_FORCE_EVT_ERR_INT 0x52
43#define SD_HC_ADMA_ERR_STS 0x54
44#define SD_HC_ADMA_SYS_ADDR 0x58
45#define SD_HC_PRESET_VAL 0x60
46#define SD_HC_SHARED_BUS_CTRL 0xE0
47#define SD_HC_SLOT_INT_STS 0xFC
48#define SD_HC_CTRL_VER 0xFE
64#define ADMA_MAX_DATA_PER_LINE 0x10000
65#define SD_SDMA_BOUNDARY 512 * 1024
66#define SD_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;
261 IN UINT8 CommandSystem,
262 IN UINT8 DriveStrength,
265 OUT UINT8 *SwitchResp
EFI_STATUS SdPeimHcCardDetect(IN UINTN Bar)
EFI_STATUS SdPeimHcInitHost(IN UINTN Bar)
EFI_STATUS SdPeimHcEnableInterrupt(IN UINTN Bar)
EFI_STATUS SdPeimRwMultiBlocks(IN SD_PEIM_HC_SLOT *Slot, IN EFI_LBA Lba, IN UINT32 BlockSize, IN VOID *Buffer, IN UINTN BufferSize, IN BOOLEAN IsRead)
EFI_STATUS SdPeimHcReset(IN UINTN Bar)
EFI_STATUS SdPeimIdentification(IN SD_PEIM_HC_SLOT *Slot)
VOID SdPeimFreeTrb(IN SD_TRB *Trb)
EFI_STATUS SdPeimRwSingleBlock(IN SD_PEIM_HC_SLOT *Slot, IN EFI_LBA Lba, IN UINT32 BlockSize, IN VOID *Buffer, IN UINTN BufferSize, IN BOOLEAN IsRead)
EFI_STATUS SdPeimSwitch(IN SD_PEIM_HC_SLOT *Slot, IN UINT8 AccessMode, IN UINT8 CommandSystem, IN UINT8 DriveStrength, IN UINT8 PowerLimit, IN BOOLEAN Mode, OUT UINT8 *SwitchResp)
EFI_STATUS SdPeimHcGetCapability(IN UINTN Bar, OUT SD_HC_SLOT_CAP *Capability)