summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg/Universal/MmcDxe
diff options
context:
space:
mode:
Diffstat (limited to 'EmbeddedPkg/Universal/MmcDxe')
-rw-r--r--EmbeddedPkg/Universal/MmcDxe/Diagnostics.c4
-rw-r--r--EmbeddedPkg/Universal/MmcDxe/Mmc.h2
-rw-r--r--EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c18
-rw-r--r--EmbeddedPkg/Universal/MmcDxe/MmcDebug.c78
-rwxr-xr-xEmbeddedPkg/Universal/MmcDxe/MmcIdentification.c126
5 files changed, 114 insertions, 114 deletions
diff --git a/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c b/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c
index 49b0690430..54ab95dbd3 100644
--- a/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c
+++ b/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c
@@ -74,8 +74,8 @@ CompareBuffer (
for (i = 0; i < (BufferSize >> 3); i++) {
if (*BufferA64 != *BufferB64) {
- DEBUG ((EFI_D_ERROR, "CompareBuffer: Error at %i", i));
- DEBUG ((EFI_D_ERROR, "(0x%lX) != (0x%lX)\n", *BufferA64, *BufferB64));
+ DEBUG ((DEBUG_ERROR, "CompareBuffer: Error at %i", i));
+ DEBUG ((DEBUG_ERROR, "(0x%lX) != (0x%lX)\n", *BufferA64, *BufferB64));
return FALSE;
}
BufferA64++;
diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
index df3b3cde9f..ad9804bb9a 100644
--- a/EmbeddedPkg/Universal/MmcDxe/Mmc.h
+++ b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
@@ -21,7 +21,7 @@
#include <Library/DebugLib.h>
#include <Library/UefiBootServicesTableLib.h>
-#define MMC_TRACE(txt) DEBUG((EFI_D_BLKIO, "MMC: " txt "\n"))
+#define MMC_TRACE(txt) DEBUG((DEBUG_BLKIO, "MMC: " txt "\n"))
#define MMC_IOBLOCKS_READ 0
#define MMC_IOBLOCKS_WRITE 1
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
index 2a5d72d4da..7614ecdf0a 100644
--- a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
+++ b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
@@ -43,7 +43,7 @@ MmcGetCardStatus (
CmdArg = MmcHostInstance->CardInfo.RCA << 16;
Status = MmcHost->SendCommand (MmcHost, MMC_CMD13, CmdArg);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcGetCardStatus(MMC_CMD13): Error and Status = %r\n", Status));
+ DEBUG ((DEBUG_ERROR, "MmcGetCardStatus(MMC_CMD13): Error and Status = %r\n", Status));
return Status;
}
@@ -163,7 +163,7 @@ MmcTransferBlock (
Status = MmcHost->SendCommand (MmcHost, Cmd, CmdArg);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "%a(MMC_CMD%d): Error %r\n", __func__, Cmd, Status));
+ DEBUG ((DEBUG_ERROR, "%a(MMC_CMD%d): Error %r\n", __func__, Cmd, Status));
return Status;
}
@@ -171,20 +171,20 @@ MmcTransferBlock (
// Read Data
Status = MmcHost->ReadBlockData (MmcHost, Lba, BufferSize, Buffer);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_BLKIO, "%a(): Error Read Block Data and Status = %r\n", __func__, Status));
+ DEBUG ((DEBUG_BLKIO, "%a(): Error Read Block Data and Status = %r\n", __func__, Status));
MmcStopTransmission (MmcHost);
return Status;
}
Status = MmcNotifyState (MmcHostInstance, MmcProgrammingState);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "%a() : Error MmcProgrammingState\n", __func__));
+ DEBUG ((DEBUG_ERROR, "%a() : Error MmcProgrammingState\n", __func__));
return Status;
}
} else {
// Write Data
Status = MmcHost->WriteBlockData (MmcHost, Lba, BufferSize, Buffer);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_BLKIO, "%a(): Error Write Block Data and Status = %r\n", __func__, Status));
+ DEBUG ((DEBUG_BLKIO, "%a(): Error Write Block Data and Status = %r\n", __func__, Status));
MmcStopTransmission (MmcHost);
return Status;
}
@@ -209,14 +209,14 @@ MmcTransferBlock (
if (BufferSize > This->Media->BlockSize) {
Status = MmcHost->SendCommand (MmcHost, MMC_CMD12, 0);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_BLKIO, "%a(): Error and Status:%r\n", __func__, Status));
+ DEBUG ((DEBUG_BLKIO, "%a(): Error and Status:%r\n", __func__, Status));
}
MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R1b, Response);
}
Status = MmcNotifyState (MmcHostInstance, MmcTransferState);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIoBlocks() : Error MmcTransferState\n"));
+ DEBUG ((DEBUG_ERROR, "MmcIoBlocks() : Error MmcTransferState\n"));
return Status;
}
return Status;
@@ -318,7 +318,7 @@ MmcIoBlocks (
}
if (0 == Timeout) {
- DEBUG ((EFI_D_ERROR, "The Card is busy\n"));
+ DEBUG ((DEBUG_ERROR, "The Card is busy\n"));
return EFI_NOT_READY;
}
@@ -346,7 +346,7 @@ MmcIoBlocks (
}
Status = MmcTransferBlock (This, Cmd, Transfer, MediaId, Lba, ConsumeSize, Buffer);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "%a(): Failed to transfer block and Status:%r\n", __func__, Status));
+ DEBUG ((DEBUG_ERROR, "%a(): Failed to transfer block and Status:%r\n", __func__, Status));
}
RemainingBlock -= BlockCount;
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcDebug.c b/EmbeddedPkg/Universal/MmcDxe/MmcDebug.c
index 36b45e6e69..3f23a13c8b 100644
--- a/EmbeddedPkg/Universal/MmcDxe/MmcDebug.c
+++ b/EmbeddedPkg/Universal/MmcDxe/MmcDebug.c
@@ -20,12 +20,12 @@ PrintCID (
IN UINT32* Cid
)
{
- DEBUG ((EFI_D_ERROR, "- PrintCID\n"));
- DEBUG ((EFI_D_ERROR, "\t- Manufacturing date: %d/%d\n", (Cid[0] >> 8) & 0xF, (Cid[0] >> 12) & 0xFF));
- DEBUG ((EFI_D_ERROR, "\t- Product serial number: 0x%X%X\n", Cid[1] & 0xFFFFFF, (Cid[0] >> 24) & 0xFF));
- DEBUG ((EFI_D_ERROR, "\t- Product revision: %d\n", Cid[1] >> 24));
- //DEBUG ((EFI_D_ERROR, "\t- Product name: %s\n", (char*)(Cid + 2)));
- DEBUG ((EFI_D_ERROR, "\t- OEM ID: %c%c\n", (Cid[3] >> 8) & 0xFF, (Cid[3] >> 16) & 0xFF));
+ DEBUG ((DEBUG_ERROR, "- PrintCID\n"));
+ DEBUG ((DEBUG_ERROR, "\t- Manufacturing date: %d/%d\n", (Cid[0] >> 8) & 0xF, (Cid[0] >> 12) & 0xFF));
+ DEBUG ((DEBUG_ERROR, "\t- Product serial number: 0x%X%X\n", Cid[1] & 0xFFFFFF, (Cid[0] >> 24) & 0xFF));
+ DEBUG ((DEBUG_ERROR, "\t- Product revision: %d\n", Cid[1] >> 24));
+ //DEBUG ((DEBUG_ERROR, "\t- Product name: %s\n", (char*)(Cid + 2)));
+ DEBUG ((DEBUG_ERROR, "\t- OEM ID: %c%c\n", (Cid[3] >> 8) & 0xFF, (Cid[3] >> 16) & 0xFF));
}
@@ -37,31 +37,31 @@ PrintCSD (
UINTN Value;
if (((Csd[2] >> 30) & 0x3) == 0) {
- DEBUG ((EFI_D_ERROR, "- PrintCSD Version 1.01-1.10/Version 2.00/Standard Capacity\n"));
+ DEBUG ((DEBUG_ERROR, "- PrintCSD Version 1.01-1.10/Version 2.00/Standard Capacity\n"));
} else if (((Csd[2] >> 30) & 0x3) == 1) {
- DEBUG ((EFI_D_ERROR, "- PrintCSD Version 2.00/High Capacity\n"));
+ DEBUG ((DEBUG_ERROR, "- PrintCSD Version 2.00/High Capacity\n"));
} else {
- DEBUG ((EFI_D_ERROR, "- PrintCSD Version Higher than v3.3\n"));
+ DEBUG ((DEBUG_ERROR, "- PrintCSD Version Higher than v3.3\n"));
}
- DEBUG ((EFI_D_ERROR, "\t- Supported card command class: 0x%X\n", MMC_CSD_GET_CCC (Csd)));
- DEBUG ((EFI_D_ERROR, "\t- Speed: %a %a\n",mStrValue[(MMC_CSD_GET_TRANSPEED (Csd) >> 3) & 0xF],mStrUnit[MMC_CSD_GET_TRANSPEED (Csd) & 7]));
- DEBUG ((EFI_D_ERROR, "\t- Maximum Read Data Block: %d\n",2 << (MMC_CSD_GET_READBLLEN (Csd)-1)));
- DEBUG ((EFI_D_ERROR, "\t- Maximum Write Data Block: %d\n",2 << (MMC_CSD_GET_WRITEBLLEN (Csd)-1)));
+ DEBUG ((DEBUG_ERROR, "\t- Supported card command class: 0x%X\n", MMC_CSD_GET_CCC (Csd)));
+ DEBUG ((DEBUG_ERROR, "\t- Speed: %a %a\n",mStrValue[(MMC_CSD_GET_TRANSPEED (Csd) >> 3) & 0xF],mStrUnit[MMC_CSD_GET_TRANSPEED (Csd) & 7]));
+ DEBUG ((DEBUG_ERROR, "\t- Maximum Read Data Block: %d\n",2 << (MMC_CSD_GET_READBLLEN (Csd)-1)));
+ DEBUG ((DEBUG_ERROR, "\t- Maximum Write Data Block: %d\n",2 << (MMC_CSD_GET_WRITEBLLEN (Csd)-1)));
if (!MMC_CSD_GET_FILEFORMATGRP (Csd)) {
Value = MMC_CSD_GET_FILEFORMAT (Csd);
if (Value == 0) {
- DEBUG ((EFI_D_ERROR, "\t- Format (0): Hard disk-like file system with partition table\n"));
+ DEBUG ((DEBUG_ERROR, "\t- Format (0): Hard disk-like file system with partition table\n"));
} else if (Value == 1) {
- DEBUG ((EFI_D_ERROR, "\t- Format (1): DOS FAT (floppy-like) with boot sector only (no partition table)\n"));
+ DEBUG ((DEBUG_ERROR, "\t- Format (1): DOS FAT (floppy-like) with boot sector only (no partition table)\n"));
} else if (Value == 2) {
- DEBUG ((EFI_D_ERROR, "\t- Format (2): Universal File Format\n"));
+ DEBUG ((DEBUG_ERROR, "\t- Format (2): Universal File Format\n"));
} else {
- DEBUG ((EFI_D_ERROR, "\t- Format (3): Others/Unknown\n"));
+ DEBUG ((DEBUG_ERROR, "\t- Format (3): Others/Unknown\n"));
}
} else {
- DEBUG ((EFI_D_ERROR, "\t- Format: Reserved\n"));
+ DEBUG ((DEBUG_ERROR, "\t- Format: Reserved\n"));
}
}
@@ -70,9 +70,9 @@ PrintRCA (
IN UINT32 Rca
)
{
- DEBUG ((EFI_D_ERROR, "- PrintRCA: 0x%X\n", Rca));
- DEBUG ((EFI_D_ERROR, "\t- Status: 0x%X\n", Rca & 0xFFFF));
- DEBUG ((EFI_D_ERROR, "\t- RCA: 0x%X\n", (Rca >> 16) & 0xFFFF));
+ DEBUG ((DEBUG_ERROR, "- PrintRCA: 0x%X\n", Rca));
+ DEBUG ((DEBUG_ERROR, "\t- Status: 0x%X\n", Rca & 0xFFFF));
+ DEBUG ((DEBUG_ERROR, "\t- RCA: 0x%X\n", (Rca >> 16) & 0xFFFF));
}
VOID
@@ -102,18 +102,18 @@ PrintOCR (
Volts++;
}
- DEBUG ((EFI_D_ERROR, "- PrintOCR Ocr (0x%X)\n",Ocr));
- DEBUG ((EFI_D_ERROR, "\t- Card operating voltage: %d.%d to %d.%d\n", MinV/10, MinV % 10, MaxV/10, MaxV % 10));
+ DEBUG ((DEBUG_ERROR, "- PrintOCR Ocr (0x%X)\n",Ocr));
+ DEBUG ((DEBUG_ERROR, "\t- Card operating voltage: %d.%d to %d.%d\n", MinV/10, MinV % 10, MaxV/10, MaxV % 10));
if (((Ocr >> 29) & 3) == 0) {
- DEBUG ((EFI_D_ERROR, "\t- AccessMode: Byte Mode\n"));
+ DEBUG ((DEBUG_ERROR, "\t- AccessMode: Byte Mode\n"));
} else {
- DEBUG ((EFI_D_ERROR, "\t- AccessMode: Block Mode (0x%X)\n", ((Ocr >> 29) & 3)));
+ DEBUG ((DEBUG_ERROR, "\t- AccessMode: Block Mode (0x%X)\n", ((Ocr >> 29) & 3)));
}
if (Ocr & MMC_OCR_POWERUP) {
- DEBUG ((EFI_D_ERROR, "\t- PowerUp\n"));
+ DEBUG ((DEBUG_ERROR, "\t- PowerUp\n"));
} else {
- DEBUG ((EFI_D_ERROR, "\t- Voltage Not Supported\n"));
+ DEBUG ((DEBUG_ERROR, "\t- Voltage Not Supported\n"));
}
}
@@ -122,41 +122,41 @@ PrintResponseR1 (
IN UINT32 Response
)
{
- DEBUG ((EFI_D_INFO, "Response: 0x%X\n", Response));
+ DEBUG ((DEBUG_INFO, "Response: 0x%X\n", Response));
if (Response & MMC_R0_READY_FOR_DATA) {
- DEBUG ((EFI_D_INFO, "\t- READY_FOR_DATA\n"));
+ DEBUG ((DEBUG_INFO, "\t- READY_FOR_DATA\n"));
}
switch ((Response >> 9) & 0xF) {
case 0:
- DEBUG ((EFI_D_INFO, "\t- State: Idle\n"));
+ DEBUG ((DEBUG_INFO, "\t- State: Idle\n"));
break;
case 1:
- DEBUG ((EFI_D_INFO, "\t- State: Ready\n"));
+ DEBUG ((DEBUG_INFO, "\t- State: Ready\n"));
break;
case 2:
- DEBUG ((EFI_D_INFO, "\t- State: Ident\n"));
+ DEBUG ((DEBUG_INFO, "\t- State: Ident\n"));
break;
case 3:
- DEBUG ((EFI_D_INFO, "\t- State: StandBy\n"));
+ DEBUG ((DEBUG_INFO, "\t- State: StandBy\n"));
break;
case 4:
- DEBUG ((EFI_D_INFO, "\t- State: Tran\n"));
+ DEBUG ((DEBUG_INFO, "\t- State: Tran\n"));
break;
case 5:
- DEBUG ((EFI_D_INFO, "\t- State: Data\n"));
+ DEBUG ((DEBUG_INFO, "\t- State: Data\n"));
break;
case 6:
- DEBUG ((EFI_D_INFO, "\t- State: Rcv\n"));
+ DEBUG ((DEBUG_INFO, "\t- State: Rcv\n"));
break;
case 7:
- DEBUG ((EFI_D_INFO, "\t- State: Prg\n"));
+ DEBUG ((DEBUG_INFO, "\t- State: Prg\n"));
break;
case 8:
- DEBUG ((EFI_D_INFO, "\t- State: Dis\n"));
+ DEBUG ((DEBUG_INFO, "\t- State: Dis\n"));
break;
default:
- DEBUG ((EFI_D_INFO, "\t- State: Reserved\n"));
+ DEBUG ((DEBUG_INFO, "\t- State: Reserved\n"));
break;
}
}
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
index 4dc0be125c..0df948426f 100755
--- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
+++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
@@ -81,16 +81,16 @@ EmmcGetDeviceState (
RCA = MmcHostInstance->CardInfo.RCA << RCA_SHIFT_OFFSET;
Status = Host->SendCommand (Host, MMC_CMD13, RCA);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcGetDeviceState(): Failed to get card status, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcGetDeviceState(): Failed to get card status, Status=%r.\n", Status));
return Status;
}
Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R1, &Data);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcGetDeviceState(): Failed to get response of CMD13, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcGetDeviceState(): Failed to get response of CMD13, Status=%r.\n", Status));
return Status;
}
if (Data & EMMC_SWITCH_ERROR) {
- DEBUG ((EFI_D_ERROR, "EmmcGetDeviceState(): Failed to switch expected mode, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcGetDeviceState(): Failed to switch expected mode, Status=%r.\n", Status));
return EFI_DEVICE_ERROR;
}
*State = DEVICE_STATE(Data);
@@ -116,14 +116,14 @@ EmmcSetEXTCSD (
EMMC_CMD6_ARG_VALUE(Value) | EMMC_CMD6_ARG_CMD_SET(1);
Status = Host->SendCommand (Host, MMC_CMD6, Argument);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcSetEXTCSD(): Failed to send CMD6, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcSetEXTCSD(): Failed to send CMD6, Status=%r.\n", Status));
return Status;
}
// Make sure device exiting prog mode
do {
Status = EmmcGetDeviceState (MmcHostInstance, &State);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcSetEXTCSD(): Failed to get device state, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcSetEXTCSD(): Failed to get device state, Status=%r.\n", Status));
return Status;
}
} while (State == EMMC_PRG_STATE);
@@ -150,13 +150,13 @@ EmmcIdentificationMode (
// Fetch card identity register
Status = Host->SendCommand (Host, MMC_CMD2, 0);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Failed to send CMD2, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcIdentificationMode(): Failed to send CMD2, Status=%r.\n", Status));
return Status;
}
Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R2, (UINT32 *)&(MmcHostInstance->CardInfo.CIDData));
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): CID retrieval error, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcIdentificationMode(): CID retrieval error, Status=%r.\n", Status));
return Status;
}
@@ -165,41 +165,41 @@ EmmcIdentificationMode (
RCA = MmcHostInstance->CardInfo.RCA << RCA_SHIFT_OFFSET;
Status = Host->SendCommand (Host, MMC_CMD3, RCA);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): RCA set error, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcIdentificationMode(): RCA set error, Status=%r.\n", Status));
return Status;
}
// Fetch card specific data
Status = Host->SendCommand (Host, MMC_CMD9, RCA);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Failed to send CMD9, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcIdentificationMode(): Failed to send CMD9, Status=%r.\n", Status));
return Status;
}
Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R2, (UINT32 *)&(MmcHostInstance->CardInfo.CSDData));
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): CSD retrieval error, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcIdentificationMode(): CSD retrieval error, Status=%r.\n", Status));
return Status;
}
// Select the card
Status = Host->SendCommand (Host, MMC_CMD7, RCA);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Card selection error, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcIdentificationMode(): Card selection error, Status=%r.\n", Status));
}
if (MMC_HOST_HAS_SETIOS(Host)) {
// Set 1-bit bus width
Status = Host->SetIos (Host, 0, 1, EMMCBACKWARD);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Set 1-bit bus width error, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcIdentificationMode(): Set 1-bit bus width error, Status=%r.\n", Status));
return Status;
}
// Set 1-bit bus width for EXTCSD
Status = EmmcSetEXTCSD (MmcHostInstance, EXTCSD_BUS_WIDTH, EMMC_BUS_WIDTH_1BIT);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Set extcsd bus width error, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcIdentificationMode(): Set extcsd bus width error, Status=%r.\n", Status));
return Status;
}
}
@@ -211,12 +211,12 @@ EmmcIdentificationMode (
}
Status = Host->SendCommand (Host, MMC_CMD8, 0);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): ECSD fetch error, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcIdentificationMode(): ECSD fetch error, Status=%r.\n", Status));
}
Status = Host->ReadBlockData (Host, 0, 512, (UINT32 *)MmcHostInstance->CardInfo.ECSDData);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): ECSD read error, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcIdentificationMode(): ECSD read error, Status=%r.\n", Status));
goto FreePageExit;
}
@@ -224,7 +224,7 @@ EmmcIdentificationMode (
do {
Status = EmmcGetDeviceState (MmcHostInstance, &State);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Failed to get device state, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "EmmcIdentificationMode(): Failed to get device state, Status=%r.\n", Status));
goto FreePageExit;
}
} while (State == EMMC_DATA_STATE);
@@ -353,14 +353,14 @@ InitializeSdMmcDevice (
CmdArg = MmcHostInstance->CardInfo.RCA << 16;
Status = MmcHost->SendCommand (MmcHost, MMC_CMD9, CmdArg);
if (EFI_ERROR (Status)) {
- DEBUG((EFI_D_ERROR, "InitializeSdMmcDevice(MMC_CMD9): Error, Status=%r\n", Status));
+ DEBUG((DEBUG_ERROR, "InitializeSdMmcDevice(MMC_CMD9): Error, Status=%r\n", Status));
return Status;
}
// Read Response
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_CSD, Response);
if (EFI_ERROR (Status)) {
- DEBUG((EFI_D_ERROR, "InitializeSdMmcDevice(): Failed to receive CSD, Status=%r\n", Status));
+ DEBUG((DEBUG_ERROR, "InitializeSdMmcDevice(): Failed to receive CSD, Status=%r\n", Status));
return Status;
}
PrintCSD (Response);
@@ -395,7 +395,7 @@ InitializeSdMmcDevice (
CmdArg = MmcHostInstance->CardInfo.RCA << 16;
Status = MmcHost->SendCommand (MmcHost, MMC_CMD7, CmdArg);
if (EFI_ERROR (Status)) {
- DEBUG((EFI_D_ERROR, "InitializeSdMmcDevice(MMC_CMD7): Error and Status = %r\n", Status));
+ DEBUG((DEBUG_ERROR, "InitializeSdMmcDevice(MMC_CMD7): Error and Status = %r\n", Status));
return Status;
}
@@ -416,38 +416,38 @@ InitializeSdMmcDevice (
/* SCR */
Status = MmcHost->SendCommand (MmcHost, MMC_ACMD51, 0);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "%a(MMC_ACMD51): Error and Status = %r\n", __func__, Status));
+ DEBUG ((DEBUG_ERROR, "%a(MMC_ACMD51): Error and Status = %r\n", __func__, Status));
return Status;
} else {
Status = MmcHost->ReadBlockData (MmcHost, 0, 8, Buffer);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "%a(MMC_ACMD51): ReadBlockData Error and Status = %r\n", __func__, Status));
+ DEBUG ((DEBUG_ERROR, "%a(MMC_ACMD51): ReadBlockData Error and Status = %r\n", __func__, Status));
return Status;
}
CopyMem (&Scr, Buffer, 8);
if (Scr.SD_SPEC == 2) {
if (Scr.SD_SPEC3 == 1) {
- if (Scr.SD_SPEC4 == 1) {
- DEBUG ((EFI_D_INFO, "Found SD Card for Spec Version 4.xx\n"));
- } else {
- DEBUG ((EFI_D_INFO, "Found SD Card for Spec Version 3.0x\n"));
- }
+ if (Scr.SD_SPEC4 == 1) {
+ DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 4.xx\n"));
+ } else {
+ DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 3.0x\n"));
+ }
} else {
- if (Scr.SD_SPEC4 == 0) {
- DEBUG ((EFI_D_INFO, "Found SD Card for Spec Version 2.0\n"));
- } else {
- DEBUG ((EFI_D_ERROR, "Found invalid SD Card\n"));
- }
+ if (Scr.SD_SPEC4 == 0) {
+ DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 2.0\n"));
+ } else {
+ DEBUG ((DEBUG_ERROR, "Found invalid SD Card\n"));
+ }
}
} else {
if ((Scr.SD_SPEC3 == 0) && (Scr.SD_SPEC4 == 0)) {
if (Scr.SD_SPEC == 1) {
- DEBUG ((EFI_D_INFO, "Found SD Card for Spec Version 1.10\n"));
- } else {
- DEBUG ((EFI_D_INFO, "Found SD Card for Spec Version 1.0\n"));
- }
+ DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 1.10\n"));
+ } else {
+ DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 1.0\n"));
+ }
} else {
- DEBUG ((EFI_D_ERROR, "Found invalid SD Card\n"));
+ DEBUG ((DEBUG_ERROR, "Found invalid SD Card\n"));
}
}
}
@@ -543,19 +543,19 @@ MmcIdentificationMode (
// Initialize the MMC Host HW
Status = MmcNotifyState (MmcHostInstance, MmcHwInitializationState);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcHwInitializationState, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Error MmcHwInitializationState, Status=%r.\n", Status));
return Status;
}
}
Status = MmcHost->SendCommand (MmcHost, MMC_CMD0, 0);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD0): Error, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode(MMC_CMD0): Error, Status=%r.\n", Status));
return Status;
}
Status = MmcNotifyState (MmcHostInstance, MmcIdleState);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcIdleState, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Error MmcIdleState, Status=%r.\n", Status));
return Status;
}
@@ -568,14 +568,14 @@ MmcIdentificationMode (
break;
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, (UINT32 *)&OcrResponse);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive OCR, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Failed to receive OCR, Status=%r.\n", Status));
return Status;
}
Timeout--;
} while (!OcrResponse.Ocr.PowerUp && (Timeout > 0));
if (Status == EFI_SUCCESS) {
if (!OcrResponse.Ocr.PowerUp) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD1): Card initialisation failure, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode(MMC_CMD1): Card initialisation failure, Status=%r.\n", Status));
return EFI_DEVICE_ERROR;
}
OcrResponse.Ocr.PowerUp = 0;
@@ -595,7 +595,7 @@ MmcIdentificationMode (
// Are we using SDIO ?
Status = MmcHost->SendCommand (MmcHost, MMC_CMD5, 0);
if (Status == EFI_SUCCESS) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD5): Error - SDIO not supported, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode(MMC_CMD5): Error - SDIO not supported, Status=%r.\n", Status));
return EFI_UNSUPPORTED;
}
@@ -603,21 +603,21 @@ MmcIdentificationMode (
CmdArg = (0x0UL << 12 | BIT8 | 0xCEUL << 0);
Status = MmcHost->SendCommand (MmcHost, MMC_CMD8, CmdArg);
if (Status == EFI_SUCCESS) {
- DEBUG ((EFI_D_ERROR, "Card is SD2.0 => Supports high capacity\n"));
+ DEBUG ((DEBUG_ERROR, "Card is SD2.0 => Supports high capacity\n"));
IsHCS = TRUE;
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R7, Response);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive response to CMD8, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Failed to receive response to CMD8, Status=%r.\n", Status));
return Status;
}
PrintResponseR1 (Response[0]);
// Check if it is valid response
if (Response[0] != CmdArg) {
- DEBUG ((EFI_D_ERROR, "The Card is not usable\n"));
+ DEBUG ((DEBUG_ERROR, "The Card is not usable\n"));
return EFI_UNSUPPORTED;
}
} else {
- DEBUG ((EFI_D_ERROR, "Not a SD2.0 Card\n"));
+ DEBUG ((DEBUG_ERROR, "Not a SD2.0 Card\n"));
}
// We need to wait for the MMC or SD card is ready => (gCardInfo.OCRData.PowerUp == 1)
@@ -626,7 +626,7 @@ MmcIdentificationMode (
// SD Card or MMC Card ? CMD55 indicates to the card that the next command is an application specific command
Status = MmcHost->SendCommand (MmcHost, MMC_CMD55, 0);
if (Status == EFI_SUCCESS) {
- DEBUG ((EFI_D_INFO, "Card should be SD\n"));
+ DEBUG ((DEBUG_INFO, "Card should be SD\n"));
if (IsHCS) {
MmcHostInstance->CardInfo.CardType = SD_CARD_2;
} else {
@@ -642,20 +642,20 @@ MmcIdentificationMode (
if (!EFI_ERROR (Status)) {
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, Response);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive OCR, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Failed to receive OCR, Status=%r.\n", Status));
return Status;
}
((UINT32 *) &(MmcHostInstance->CardInfo.OCRData))[0] = Response[0];
}
} else {
- DEBUG ((EFI_D_INFO, "Card should be MMC\n"));
+ DEBUG ((DEBUG_INFO, "Card should be MMC\n"));
MmcHostInstance->CardInfo.CardType = MMC_CARD;
Status = MmcHost->SendCommand (MmcHost, MMC_CMD1, 0x800000);
if (!EFI_ERROR (Status)) {
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, Response);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive OCR, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Failed to receive OCR, Status=%r.\n", Status));
return Status;
}
((UINT32 *) &(MmcHostInstance->CardInfo.OCRData))[0] = Response[0];
@@ -669,7 +669,7 @@ MmcIdentificationMode (
} else {
if ((MmcHostInstance->CardInfo.CardType == SD_CARD_2) && (MmcHostInstance->CardInfo.OCRData.AccessMode & BIT1)) {
MmcHostInstance->CardInfo.CardType = SD_CARD_2_HIGH;
- DEBUG ((EFI_D_ERROR, "High capacity card.\n"));
+ DEBUG ((DEBUG_ERROR, "High capacity card.\n"));
}
break; // The MMC/SD card is ready. Continue the Identification Mode
}
@@ -680,7 +680,7 @@ MmcIdentificationMode (
}
if (Timeout == 0) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(): No Card\n"));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode(): No Card\n"));
return EFI_NO_MEDIA;
} else {
PrintOCR (Response[0]);
@@ -688,18 +688,18 @@ MmcIdentificationMode (
Status = MmcNotifyState (MmcHostInstance, MmcReadyState);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcReadyState\n"));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Error MmcReadyState\n"));
return Status;
}
Status = MmcHost->SendCommand (MmcHost, MMC_CMD2, 0);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD2): Error\n"));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode(MMC_CMD2): Error\n"));
return Status;
}
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_CID, Response);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive CID, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Failed to receive CID, Status=%r.\n", Status));
return Status;
}
@@ -707,7 +707,7 @@ MmcIdentificationMode (
Status = MmcHost->NotifyState (MmcHost, MmcIdentificationState);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcIdentificationState\n"));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Error MmcIdentificationState\n"));
return Status;
}
@@ -719,13 +719,13 @@ MmcIdentificationMode (
CmdArg = 1;
Status = MmcHost->SendCommand (MmcHost, MMC_CMD3, CmdArg);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD3): Error\n"));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode(MMC_CMD3): Error\n"));
return Status;
}
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_RCA, Response);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive RCA, Status=%r.\n", Status));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Failed to receive RCA, Status=%r.\n", Status));
return Status;
}
PrintRCA (Response[0]);
@@ -738,7 +738,7 @@ MmcIdentificationMode (
}
Status = MmcNotifyState (MmcHostInstance, MmcStandByState);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcStandByState\n"));
+ DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Error MmcStandByState\n"));
return Status;
}
@@ -759,13 +759,13 @@ InitializeMmcDevice (
Status = MmcIdentificationMode (MmcHostInstance);
if (EFI_ERROR (Status)) {
- DEBUG((EFI_D_ERROR, "InitializeMmcDevice(): Error in Identification Mode, Status=%r\n", Status));
+ DEBUG((DEBUG_ERROR, "InitializeMmcDevice(): Error in Identification Mode, Status=%r\n", Status));
return Status;
}
Status = MmcNotifyState (MmcHostInstance, MmcTransferState);
if (EFI_ERROR (Status)) {
- DEBUG((EFI_D_ERROR, "InitializeMmcDevice(): Error MmcTransferState, Status=%r\n", Status));
+ DEBUG((DEBUG_ERROR, "InitializeMmcDevice(): Error MmcTransferState, Status=%r\n", Status));
return Status;
}
@@ -781,7 +781,7 @@ InitializeMmcDevice (
// Set Block Length
Status = MmcHost->SendCommand (MmcHost, MMC_CMD16, MmcHostInstance->BlockIo.Media->BlockSize);
if (EFI_ERROR (Status)) {
- DEBUG((EFI_D_ERROR, "InitializeMmcDevice(MMC_CMD16): Error MmcHostInstance->BlockIo.Media->BlockSize: %d and Error = %r\n",
+ DEBUG((DEBUG_ERROR, "InitializeMmcDevice(MMC_CMD16): Error MmcHostInstance->BlockIo.Media->BlockSize: %d and Error = %r\n",
MmcHostInstance->BlockIo.Media->BlockSize, Status));
return Status;
}
@@ -790,7 +790,7 @@ InitializeMmcDevice (
if (MmcHostInstance->CardInfo.CardType == MMC_CARD) {
Status = MmcHost->SendCommand (MmcHost, MMC_CMD23, BlockCount);
if (EFI_ERROR (Status)) {
- DEBUG((EFI_D_ERROR, "InitializeMmcDevice(MMC_CMD23): Error, Status=%r\n", Status));
+ DEBUG((DEBUG_ERROR, "InitializeMmcDevice(MMC_CMD23): Error, Status=%r\n", Status));
return Status;
}
}