summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Drivers
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-01 17:08:41 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-01 17:08:41 +0000
commit16d88c2d20ccd9f8ea52967b578ece82174ea762 (patch)
tree396c179773cb020167359aee051b6831a03d2f47 /ArmPlatformPkg/Drivers
parent66f47f9fc00e3770d0502305387389c91e2025de (diff)
downloadedk2-platforms-16d88c2d20ccd9f8ea52967b578ece82174ea762.tar.xz
EmbeddedPkg/MmcDxe: Add 'This' pointer attribute to protocol function
This attribute allows the EFI_MMC_HOST_PROTOCOL interface to manage multiple instances in one driver. EmbeddedPkg/MmcDxe: Add Revision attribute to the EFI_MMC_HOST_PROTOCOL Note: The ARM PL180 and Omap35xx MMC host drivers has been updated. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12255 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Drivers')
-rw-r--r--ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c
index 03500af88c..b79845dccb 100644
--- a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c
+++ b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c
@@ -46,7 +46,7 @@ MciInitialize (
BOOLEAN
MciIsCardPresent (
- VOID
+ IN EFI_MMC_HOST_PROTOCOL *This
)
{
return (MmioRead32(FixedPcdGet32(PcdPL180SysMciRegAddress)) & 1);
@@ -54,7 +54,7 @@ MciIsCardPresent (
BOOLEAN
MciIsReadOnly (
- VOID
+ IN EFI_MMC_HOST_PROTOCOL *This
)
{
return (MmioRead32(FixedPcdGet32(PcdPL180SysMciRegAddress)) & 2);
@@ -92,22 +92,23 @@ MciPrepareDataPath (
)
{
// Set Data Length & Data Timer
- MmioWrite32(MCI_DATA_TIMER_REG,0xFFFFFFF);
- MmioWrite32(MCI_DATA_LENGTH_REG,MMCI0_BLOCKLEN);
+ MmioWrite32 (MCI_DATA_TIMER_REG,0xFFFFFFF);
+ MmioWrite32 (MCI_DATA_LENGTH_REG,MMCI0_BLOCKLEN);
#ifndef USE_STREAM
//Note: we are using a hardcoded BlockLen (=512). If we decide to use a variable size, we could
// compute the pow2 of BlockLen with the above function GetPow2BlockLen()
- MmioWrite32(MCI_DATA_CTL_REG, MCI_DATACTL_ENABLE | MCI_DATACTL_DMA_ENABLE | TransferDirection | (MMCI0_POW2_BLOCKLEN << 4));
+ MmioWrite32 (MCI_DATA_CTL_REG, MCI_DATACTL_ENABLE | MCI_DATACTL_DMA_ENABLE | TransferDirection | (MMCI0_POW2_BLOCKLEN << 4));
#else
- MmioWrite32(MCI_DATA_CTL_REG, MCI_DATACTL_ENABLE | MCI_DATACTL_DMA_ENABLE | TransferDirection | MCI_DATACTL_STREAM_TRANS);
+ MmioWrite32 (MCI_DATA_CTL_REG, MCI_DATACTL_ENABLE | MCI_DATACTL_DMA_ENABLE | TransferDirection | MCI_DATACTL_STREAM_TRANS);
#endif
}
EFI_STATUS
MciSendCommand (
- IN MMC_CMD MmcCmd,
- IN UINT32 Argument
+ IN EFI_MMC_HOST_PROTOCOL *This,
+ IN MMC_CMD MmcCmd,
+ IN UINT32 Argument
)
{
UINT32 Status;
@@ -190,7 +191,7 @@ MciSendCommand (
}
Exit:
- //Disable Command Path
+ // Disable Command Path
CmdCtrlReg = MmioRead32(MCI_COMMAND_REG);
MmioWrite32(MCI_COMMAND_REG, (CmdCtrlReg & ~MCI_CPSM_ENABLED));
return RetVal;
@@ -198,8 +199,9 @@ Exit:
EFI_STATUS
MciReceiveResponse (
- IN MMC_RESPONSE_TYPE Type,
- IN UINT32* Buffer
+ IN EFI_MMC_HOST_PROTOCOL *This,
+ IN MMC_RESPONSE_TYPE Type,
+ IN UINT32* Buffer
)
{
if (Buffer == NULL) {
@@ -223,9 +225,10 @@ MciReceiveResponse (
EFI_STATUS
MciReadBlockData (
- IN EFI_LBA Lba,
- IN UINTN Length,
- IN UINT32* Buffer
+ IN EFI_MMC_HOST_PROTOCOL *This,
+ IN EFI_LBA Lba,
+ IN UINTN Length,
+ IN UINT32* Buffer
)
{
UINTN Loop;
@@ -298,9 +301,10 @@ MciReadBlockData (
EFI_STATUS
MciWriteBlockData (
- IN EFI_LBA Lba,
- IN UINTN Length,
- IN UINT32* Buffer
+ IN EFI_MMC_HOST_PROTOCOL *This,
+ IN EFI_LBA Lba,
+ IN UINTN Length,
+ IN UINT32* Buffer
)
{
UINTN Loop;
@@ -396,7 +400,8 @@ Exit:
EFI_STATUS
MciNotifyState (
- IN MMC_STATE State
+ IN EFI_MMC_HOST_PROTOCOL *This,
+ IN MMC_STATE State
)
{
UINT32 Data32;
@@ -490,7 +495,8 @@ EFI_GUID mPL180MciDevicePathGuid = EFI_CALLER_ID_GUID;
EFI_STATUS
MciBuildDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL **DevicePath
+ IN EFI_MMC_HOST_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL **DevicePath
)
{
EFI_DEVICE_PATH_PROTOCOL *NewDevicePathNode;
@@ -503,6 +509,7 @@ MciBuildDevicePath (
}
EFI_MMC_HOST_PROTOCOL gMciHost = {
+ MMC_HOST_PROTOCOL_REVISION,
MciIsCardPresent,
MciIsReadOnly,
MciBuildDevicePath,