EmbeddedPkg: Change use of EFI_D_* to DEBUG_*

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3739

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
Michael D Kinney
2021-11-16 19:21:20 -08:00
committed by mergify[bot]
parent c5b3a56e4f
commit a1878955b2
15 changed files with 170 additions and 179 deletions

View File

@ -161,7 +161,7 @@ HandleFlash (
} else if (EFI_ERROR (Status)) { } else if (EFI_ERROR (Status)) {
SEND_LITERAL ("FAILError flashing partition."); SEND_LITERAL ("FAILError flashing partition.");
mTextOut->OutputString (mTextOut, L"Error flashing partition.\r\n"); mTextOut->OutputString (mTextOut, L"Error flashing partition.\r\n");
DEBUG ((EFI_D_ERROR, "Couldn't flash image: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Couldn't flash image: %r\n", Status));
} else { } else {
mTextOut->OutputString (mTextOut, L"Done.\r\n"); mTextOut->OutputString (mTextOut, L"Done.\r\n");
SEND_LITERAL ("OKAY"); SEND_LITERAL ("OKAY");
@ -184,7 +184,7 @@ HandleErase (
Status = mPlatform->ErasePartition (PartitionName); Status = mPlatform->ErasePartition (PartitionName);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
SEND_LITERAL ("FAILCheck device console."); SEND_LITERAL ("FAILCheck device console.");
DEBUG ((EFI_D_ERROR, "Couldn't erase image: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Couldn't erase image: %r\n", Status));
} else { } else {
SEND_LITERAL ("OKAY"); SEND_LITERAL ("OKAY");
} }
@ -212,7 +212,7 @@ HandleBoot (
Status = BootAndroidBootImg (mNumDataBytes, mDataBuffer); Status = BootAndroidBootImg (mNumDataBytes, mDataBuffer);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Failed to boot downloaded image: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Failed to boot downloaded image: %r\n", Status));
} }
// We shouldn't get here // We shouldn't get here
} }
@ -286,13 +286,13 @@ AcceptCmd (
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
// Shouldn't get here // Shouldn't get here
DEBUG ((EFI_D_ERROR, "Fastboot: gRT->ResetSystem didn't work\n")); DEBUG ((DEBUG_ERROR, "Fastboot: gRT->ResetSystem didn't work\n"));
} else if (MATCH_CMD_LITERAL ("powerdown", Command)) { } else if (MATCH_CMD_LITERAL ("powerdown", Command)) {
SEND_LITERAL ("OKAY"); SEND_LITERAL ("OKAY");
gRT->ResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL); gRT->ResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL);
// Shouldn't get here // Shouldn't get here
DEBUG ((EFI_D_ERROR, "Fastboot: gRT->ResetSystem didn't work\n")); DEBUG ((DEBUG_ERROR, "Fastboot: gRT->ResetSystem didn't work\n"));
} else if (MATCH_CMD_LITERAL ("oem", Command)) { } else if (MATCH_CMD_LITERAL ("oem", Command)) {
// The "oem" command isn't in the specification, but it was observed in the // The "oem" command isn't in the specification, but it was observed in the
// wild, followed by a space, followed by the actual command. // wild, followed by a space, followed by the actual command.
@ -430,25 +430,25 @@ FastbootAppEntryPoint (
(VOID **) &mTransport (VOID **) &mTransport
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Fastboot: Couldn't open Fastboot Transport Protocol: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Fastboot: Couldn't open Fastboot Transport Protocol: %r\n", Status));
return Status; return Status;
} }
Status = gBS->LocateProtocol (&gAndroidFastbootPlatformProtocolGuid, NULL, (VOID **) &mPlatform); Status = gBS->LocateProtocol (&gAndroidFastbootPlatformProtocolGuid, NULL, (VOID **) &mPlatform);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Fastboot: Couldn't open Fastboot Platform Protocol: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Fastboot: Couldn't open Fastboot Platform Protocol: %r\n", Status));
return Status; return Status;
} }
Status = mPlatform->Init (); Status = mPlatform->Init ();
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Fastboot: Couldn't initialise Fastboot Platform Protocol: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Fastboot: Couldn't initialise Fastboot Platform Protocol: %r\n", Status));
return Status; return Status;
} }
Status = gBS->LocateProtocol (&gEfiSimpleTextOutProtocolGuid, NULL, (VOID **) &mTextOut); Status = gBS->LocateProtocol (&gEfiSimpleTextOutProtocolGuid, NULL, (VOID **) &mTextOut);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, DEBUG ((DEBUG_ERROR,
"Fastboot: Couldn't open Text Output Protocol: %r\n", Status "Fastboot: Couldn't open Text Output Protocol: %r\n", Status
)); ));
return Status; return Status;
@ -456,14 +456,14 @@ FastbootAppEntryPoint (
Status = gBS->LocateProtocol (&gEfiSimpleTextInProtocolGuid, NULL, (VOID **) &TextIn); Status = gBS->LocateProtocol (&gEfiSimpleTextInProtocolGuid, NULL, (VOID **) &TextIn);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Fastboot: Couldn't open Text Input Protocol: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Fastboot: Couldn't open Text Input Protocol: %r\n", Status));
return Status; return Status;
} }
// Disable watchdog // Disable watchdog
Status = gBS->SetWatchdogTimer (0, 0x10000, 0, NULL); Status = gBS->SetWatchdogTimer (0, 0x10000, 0, NULL);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Fastboot: Couldn't disable watchdog timer: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Fastboot: Couldn't disable watchdog timer: %r\n", Status));
} }
// Create event for receipt of data from the host // Create event for receipt of data from the host
@ -497,7 +497,7 @@ FastbootAppEntryPoint (
ReceiveEvent ReceiveEvent
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Fastboot: Couldn't start transport: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Fastboot: Couldn't start transport: %r\n", Status));
return Status; return Status;
} }
@ -521,7 +521,7 @@ FastbootAppEntryPoint (
mTransport->Stop (); mTransport->Stop ();
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Warning: Fastboot Transport Stop: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Warning: Fastboot Transport Stop: %r\n", Status));
} }
mPlatform->UnInit (); mPlatform->UnInit ();

View File

@ -162,14 +162,14 @@ BootAndroidBootImg (
StrSize (LoadOptions), StrSize (LoadOptions),
LoadOptions); LoadOptions);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Couldn't Boot Linux: %d\n", Status)); DEBUG ((DEBUG_ERROR, "Couldn't Boot Linux: %d\n", Status));
Status = EFI_DEVICE_ERROR; Status = EFI_DEVICE_ERROR;
goto FreeLoadOptions; goto FreeLoadOptions;
} }
// If we got here we do a confused face because BootLinuxFdt returned, // If we got here we do a confused face because BootLinuxFdt returned,
// reporting success. // reporting success.
DEBUG ((EFI_D_ERROR, "WARNING: BdsBootLinuxFdt returned EFI_SUCCESS.\n")); DEBUG ((DEBUG_ERROR, "WARNING: BdsBootLinuxFdt returned EFI_SUCCESS.\n"));
return EFI_SUCCESS; return EFI_SUCCESS;
FreeLoadOptions: FreeLoadOptions:

View File

@ -99,7 +99,7 @@ SubmitRecieveToken (
FragmentBuffer = AllocatePool (RX_FRAGMENT_SIZE); FragmentBuffer = AllocatePool (RX_FRAGMENT_SIZE);
ASSERT (FragmentBuffer != NULL); ASSERT (FragmentBuffer != NULL);
if (FragmentBuffer == NULL) { if (FragmentBuffer == NULL) {
DEBUG ((EFI_D_ERROR, "TCP Fastboot out of resources")); DEBUG ((DEBUG_ERROR, "TCP Fastboot out of resources"));
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -109,7 +109,7 @@ SubmitRecieveToken (
Status = mTcpConnection->Receive (mTcpConnection, &mReceiveToken[mNextSubmitIndex]); Status = mTcpConnection->Receive (mTcpConnection, &mReceiveToken[mNextSubmitIndex]);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "TCP Receive: %r\n", Status)); DEBUG ((DEBUG_ERROR, "TCP Receive: %r\n", Status));
FreePool (FragmentBuffer); FreePool (FragmentBuffer);
} }
@ -140,7 +140,7 @@ ConnectionClosed (
Status = mTcpListener->Accept (mTcpListener, &mAcceptToken); Status = mTcpListener->Accept (mTcpListener, &mAcceptToken);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "TCP Accept: %r\n", Status)); DEBUG ((DEBUG_ERROR, "TCP Accept: %r\n", Status));
} }
} }
@ -195,7 +195,7 @@ DataReceived (
NewEntry = AllocatePool (sizeof (FASTBOOT_TCP_PACKET_LIST)); NewEntry = AllocatePool (sizeof (FASTBOOT_TCP_PACKET_LIST));
if (NewEntry == NULL) { if (NewEntry == NULL) {
DEBUG ((EFI_D_ERROR, "TCP Fastboot: Out of resources\n")); DEBUG ((DEBUG_ERROR, "TCP Fastboot: Out of resources\n"));
return; return;
} }
@ -215,7 +215,7 @@ DataReceived (
NewEntry->Buffer = NULL; NewEntry->Buffer = NULL;
NewEntry->BufferSize = 0; NewEntry->BufferSize = 0;
DEBUG ((EFI_D_ERROR, "\nTCP Fastboot Receive error: %r\n", Status)); DEBUG ((DEBUG_ERROR, "\nTCP Fastboot Receive error: %r\n", Status));
} }
InsertTailList (&mPacketListHead, &NewEntry->Link); InsertTailList (&mPacketListHead, &NewEntry->Link);
@ -244,10 +244,10 @@ ConnectionAccepted (
Status = AcceptToken->CompletionToken.Status; Status = AcceptToken->CompletionToken.Status;
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "TCP Fastboot: Connection Error: %r\n", Status)); DEBUG ((DEBUG_ERROR, "TCP Fastboot: Connection Error: %r\n", Status));
return; return;
} }
DEBUG ((EFI_D_ERROR, "TCP Fastboot: Connection Received.\n")); DEBUG ((DEBUG_ERROR, "TCP Fastboot: Connection Received.\n"));
// //
// Accepting a new TCP connection creates a new instance of the TCP protocol. // Accepting a new TCP connection creates a new instance of the TCP protocol.
@ -263,7 +263,7 @@ ConnectionAccepted (
EFI_OPEN_PROTOCOL_GET_PROTOCOL EFI_OPEN_PROTOCOL_GET_PROTOCOL
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Open TCP Connection: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Open TCP Connection: %r\n", Status));
return; return;
} }
@ -335,7 +335,7 @@ TcpFastbootTransportStart (
&HandleBuffer &HandleBuffer
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Find TCP Service Binding: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Find TCP Service Binding: %r\n", Status));
return Status; return Status;
} }
@ -351,13 +351,13 @@ TcpFastbootTransportStart (
EFI_OPEN_PROTOCOL_GET_PROTOCOL EFI_OPEN_PROTOCOL_GET_PROTOCOL
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Open TCP Service Binding: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Open TCP Service Binding: %r\n", Status));
return Status; return Status;
} }
Status = mTcpServiceBinding->CreateChild (mTcpServiceBinding, &mTcpHandle); Status = mTcpServiceBinding->CreateChild (mTcpServiceBinding, &mTcpHandle);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "TCP ServiceBinding Create: %r\n", Status)); DEBUG ((DEBUG_ERROR, "TCP ServiceBinding Create: %r\n", Status));
return Status; return Status;
} }
@ -370,7 +370,7 @@ TcpFastbootTransportStart (
EFI_OPEN_PROTOCOL_GET_PROTOCOL EFI_OPEN_PROTOCOL_GET_PROTOCOL
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Open TCP Protocol: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Open TCP Protocol: %r\n", Status));
} }
// //
@ -423,7 +423,7 @@ TcpFastbootTransportStart (
} while (!Ip4ModeData.IsConfigured); } while (!Ip4ModeData.IsConfigured);
Status = mTcpListener->Configure (mTcpListener, &TcpConfigData); Status = mTcpListener->Configure (mTcpListener, &TcpConfigData);
} else if (EFI_ERROR (Status)) { } else if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "TCP Configure: %r\n", Status)); DEBUG ((DEBUG_ERROR, "TCP Configure: %r\n", Status));
return Status; return Status;
} }
@ -443,7 +443,7 @@ TcpFastbootTransportStart (
Status = mTcpListener->Accept (mTcpListener, &mAcceptToken); Status = mTcpListener->Accept (mTcpListener, &mAcceptToken);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "TCP Accept: %r\n", Status)); DEBUG ((DEBUG_ERROR, "TCP Accept: %r\n", Status));
return Status; return Status;
} }
@ -539,7 +539,7 @@ DataSent (
Status = mTransmitToken.CompletionToken.Status; Status = mTransmitToken.CompletionToken.Status;
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "TCP Fastboot transmit result: %r\n", Status)); DEBUG ((DEBUG_ERROR, "TCP Fastboot transmit result: %r\n", Status));
gBS->SignalEvent (*(EFI_EVENT *) Context); gBS->SignalEvent (*(EFI_EVENT *) Context);
} }
@ -584,7 +584,7 @@ TcpFastbootTransportSend (
Status = mTcpConnection->Transmit (mTcpConnection, &mTransmitToken); Status = mTcpConnection->Transmit (mTcpConnection, &mTransmitToken);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "TCP Transmit: %r\n", Status)); DEBUG ((DEBUG_ERROR, "TCP Transmit: %r\n", Status));
return Status; return Status;
} }
@ -642,7 +642,7 @@ TcpFastbootTransportEntryPoint (
(VOID **) &mTextOut (VOID **) &mTextOut
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Fastboot: Open Text Output Protocol: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Fastboot: Open Text Output Protocol: %r\n", Status));
return Status; return Status;
} }
@ -653,7 +653,7 @@ TcpFastbootTransportEntryPoint (
&mTransportProtocol &mTransportProtocol
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Fastboot: Install transport Protocol: %r\n", Status)); DEBUG ((DEBUG_ERROR, "Fastboot: Install transport Protocol: %r\n", Status));
} }
return Status; return Status;

View File

@ -208,7 +208,7 @@ FindCompatibleNodeReg (
} }
if ((*RegSize % 16) != 0) { if ((*RegSize % 16) != 0) {
DEBUG ((EFI_D_ERROR, DEBUG ((DEBUG_ERROR,
"%a: '%a' compatible node has invalid 'reg' property (size == 0x%x)\n", "%a: '%a' compatible node has invalid 'reg' property (size == 0x%x)\n",
__FUNCTION__, CompatibleString, *RegSize)); __FUNCTION__, CompatibleString, *RegSize));
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
@ -261,13 +261,13 @@ FindNextMemoryNodeReg (
// //
Status = GetNodeProperty (This, Next, "reg", Reg, RegSize); Status = GetNodeProperty (This, Next, "reg", Reg, RegSize);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_WARN, DEBUG ((DEBUG_WARN,
"%a: ignoring memory node with no 'reg' property\n", "%a: ignoring memory node with no 'reg' property\n",
__FUNCTION__)); __FUNCTION__));
continue; continue;
} }
if ((*RegSize % 16) != 0) { if ((*RegSize % 16) != 0) {
DEBUG ((EFI_D_WARN, DEBUG ((DEBUG_WARN,
"%a: ignoring memory node with invalid 'reg' property (size == 0x%x)\n", "%a: ignoring memory node with invalid 'reg' property (size == 0x%x)\n",
__FUNCTION__, *RegSize)); __FUNCTION__, *RegSize));
continue; continue;
@ -391,14 +391,14 @@ InitializeFdtClientDxe (
DeviceTreeBase = (VOID *)(UINTN)*(UINT64 *)GET_GUID_HOB_DATA (Hob); DeviceTreeBase = (VOID *)(UINTN)*(UINT64 *)GET_GUID_HOB_DATA (Hob);
if (fdt_check_header (DeviceTreeBase) != 0) { if (fdt_check_header (DeviceTreeBase) != 0) {
DEBUG ((EFI_D_ERROR, "%a: No DTB found @ 0x%p\n", __FUNCTION__, DEBUG ((DEBUG_ERROR, "%a: No DTB found @ 0x%p\n", __FUNCTION__,
DeviceTreeBase)); DeviceTreeBase));
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
mDeviceTreeBase = DeviceTreeBase; mDeviceTreeBase = DeviceTreeBase;
DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase)); DEBUG ((DEBUG_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase));
// //
// Register a protocol notify for the EDKII Platform Has Device Tree // Register a protocol notify for the EDKII Platform Has Device Tree

View File

@ -416,7 +416,7 @@ AddSingleStep (
} }
InvalidateInstructionCacheRange ((VOID *)mSingleStepPC, mSingleStepDataSize); InvalidateInstructionCacheRange ((VOID *)mSingleStepPC, mSingleStepDataSize);
//DEBUG((EFI_D_ERROR, "AddSingleStep at 0x%08x (was: 0x%08x is:0x%08x)\n", SystemContext.SystemContextArm->PC, mSingleStepData, *(UINT32 *)mSingleStepPC)); //DEBUG((DEBUG_ERROR, "AddSingleStep at 0x%08x (was: 0x%08x is:0x%08x)\n", SystemContext.SystemContextArm->PC, mSingleStepData, *(UINT32 *)mSingleStepPC));
} }
@ -437,7 +437,7 @@ RemoveSingleStep (
if (mSingleStepDataSize == sizeof (UINT16)) { if (mSingleStepDataSize == sizeof (UINT16)) {
*(UINT16 *)mSingleStepPC = (UINT16)mSingleStepData; *(UINT16 *)mSingleStepPC = (UINT16)mSingleStepData;
} else { } else {
//DEBUG((EFI_D_ERROR, "RemoveSingleStep at 0x%08x (was: 0x%08x is:0x%08x)\n", SystemContext.SystemContextArm->PC, *(UINT32 *)mSingleStepPC, mSingleStepData)); //DEBUG((DEBUG_ERROR, "RemoveSingleStep at 0x%08x (was: 0x%08x is:0x%08x)\n", SystemContext.SystemContextArm->PC, *(UINT32 *)mSingleStepPC, mSingleStepData));
*(UINT32 *)mSingleStepPC = mSingleStepData; *(UINT32 *)mSingleStepPC = mSingleStepData;
} }
InvalidateInstructionCacheRange ((VOID *)mSingleStepPC, mSingleStepDataSize); InvalidateInstructionCacheRange ((VOID *)mSingleStepPC, mSingleStepDataSize);
@ -556,7 +556,7 @@ SetBreakpoint (
*(UINT32 *)Address = GDB_ARM_BKPT; *(UINT32 *)Address = GDB_ARM_BKPT;
InvalidateInstructionCacheRange ((VOID *)Address, 4); InvalidateInstructionCacheRange ((VOID *)Address, 4);
//DEBUG((EFI_D_ERROR, "SetBreakpoint at 0x%08x (was: 0x%08x is:0x%08x)\n", Address, Breakpoint->Instruction, *(UINT32 *)Address)); //DEBUG((DEBUG_ERROR, "SetBreakpoint at 0x%08x (was: 0x%08x is:0x%08x)\n", Address, Breakpoint->Instruction, *(UINT32 *)Address));
} }
VOID VOID
@ -579,7 +579,7 @@ ClearBreakpoint (
*(UINT32 *)Address = Breakpoint->Instruction; *(UINT32 *)Address = Breakpoint->Instruction;
InvalidateInstructionCacheRange ((VOID *)Address, 4); InvalidateInstructionCacheRange ((VOID *)Address, 4);
//DEBUG((EFI_D_ERROR, "ClearBreakpoint at 0x%08x (was: 0x%08x is:0x%08x)\n", Address, GDB_ARM_BKPT, *(UINT32 *)Address)); //DEBUG((DEBUG_ERROR, "ClearBreakpoint at 0x%08x (was: 0x%08x is:0x%08x)\n", Address, GDB_ARM_BKPT, *(UINT32 *)Address));
FreePool (Breakpoint); FreePool (Breakpoint);
} }
@ -607,7 +607,7 @@ InsertBreakPoint (
break; break;
default : default :
DEBUG((EFI_D_ERROR, "Insert breakpoint default: %x\n", Type)); DEBUG((DEBUG_ERROR, "Insert breakpoint default: %x\n", Type));
SendError (GDB_EINVALIDBRKPOINTTYPE); SendError (GDB_EINVALIDBRKPOINTTYPE);
return; return;
} }
@ -694,4 +694,3 @@ ValidateException (
return TRUE; return TRUE;
} }

View File

@ -91,7 +91,7 @@ GdbStubEntry (
&Handles &Handles
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Debug Support Protocol not found\n")); DEBUG ((DEBUG_ERROR, "Debug Support Protocol not found\n"));
return Status; return Status;
} }
@ -116,7 +116,7 @@ GdbStubEntry (
FreePool (Handles); FreePool (Handles);
if (!IsaSupported) { if (!IsaSupported) {
DEBUG ((EFI_D_ERROR, "Debug Support Protocol does not support our ISA\n")); DEBUG ((DEBUG_ERROR, "Debug Support Protocol does not support our ISA\n"));
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
@ -124,8 +124,8 @@ GdbStubEntry (
Status = DebugSupport->GetMaximumProcessorIndex (DebugSupport, &gMaxProcessorIndex); Status = DebugSupport->GetMaximumProcessorIndex (DebugSupport, &gMaxProcessorIndex);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
DEBUG ((EFI_D_INFO, "Debug Support Protocol ISA %x\n", DebugSupport->Isa)); DEBUG ((DEBUG_INFO, "Debug Support Protocol ISA %x\n", DebugSupport->Isa));
DEBUG ((EFI_D_INFO, "Debug Support Protocol Processor Index %d\n", gMaxProcessorIndex)); DEBUG ((DEBUG_INFO, "Debug Support Protocol Processor Index %d\n", gMaxProcessorIndex));
// Call processor-specific init routine // Call processor-specific init routine
InitializeProcessor (); InitializeProcessor ();

View File

@ -108,7 +108,7 @@ LocateAndInstallAcpiFromFvConditional (
AcpiTableSize = ((EFI_ACPI_DESCRIPTION_HEADER *) AcpiTable)->Length; AcpiTableSize = ((EFI_ACPI_DESCRIPTION_HEADER *) AcpiTable)->Length;
ASSERT (SectionSize >= AcpiTableSize); ASSERT (SectionSize >= AcpiTableSize);
DEBUG ((EFI_D_ERROR, "- Found '%c%c%c%c' ACPI Table\n", DEBUG ((DEBUG_ERROR, "- Found '%c%c%c%c' ACPI Table\n",
(((EFI_ACPI_DESCRIPTION_HEADER *) AcpiTable)->Signature & 0xFF), (((EFI_ACPI_DESCRIPTION_HEADER *) AcpiTable)->Signature & 0xFF),
((((EFI_ACPI_DESCRIPTION_HEADER *) AcpiTable)->Signature >> 8) & 0xFF), ((((EFI_ACPI_DESCRIPTION_HEADER *) AcpiTable)->Signature >> 8) & 0xFF),
((((EFI_ACPI_DESCRIPTION_HEADER *) AcpiTable)->Signature >> 16) & 0xFF), ((((EFI_ACPI_DESCRIPTION_HEADER *) AcpiTable)->Signature >> 16) & 0xFF),

View File

@ -199,8 +199,8 @@ GdbGetChar (
Char = IoRead8 (gPort); Char = IoRead8 (gPort);
// Make this an EFI_D_INFO after we get everything debugged. // Make this an DEBUG_INFO after we get everything debugged.
DEBUG ((EFI_D_ERROR, "<%c<", Char)); DEBUG ((DEBUG_ERROR, "<%c<", Char));
return Char; return Char;
} }
@ -221,8 +221,8 @@ GdbPutChar (
{ {
UINT8 Data; UINT8 Data;
// Make this an EFI_D_INFO after we get everything debugged. // Make this an DEBUG_INFO after we get everything debugged.
DEBUG ((EFI_D_ERROR, ">%c>", Char)); DEBUG ((DEBUG_ERROR, ">%c>", Char));
// Wait for the serial port to be ready // Wait for the serial port to be ready
do { do {
@ -250,7 +250,3 @@ GdbPutString (
String++; String++;
} }
} }

View File

@ -361,7 +361,7 @@ FfsProcessSection (
// //
// GetInfo failed // GetInfo failed
// //
DEBUG ((EFI_D_ERROR, "Decompress GetInfo Failed - %r\n", Status)); DEBUG ((DEBUG_ERROR, "Decompress GetInfo Failed - %r\n", Status));
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
// //
@ -415,7 +415,7 @@ FfsProcessSection (
// //
// Decompress failed // Decompress failed
// //
DEBUG ((EFI_D_ERROR, "Decompress Failed - %r\n", Status)); DEBUG ((DEBUG_ERROR, "Decompress Failed - %r\n", Status));
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} else { } else {
return FfsProcessSection ( return FfsProcessSection (
@ -874,5 +874,3 @@ FfsProcessFvFile (
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -154,7 +154,7 @@ LoadDxeCoreFromFfsFile (
BuildModuleHob (&FvFileInfo.FileName, (EFI_PHYSICAL_ADDRESS)(UINTN)ImageAddress, EFI_SIZE_TO_PAGES ((UINT32) ImageSize) * EFI_PAGE_SIZE, EntryPoint); BuildModuleHob (&FvFileInfo.FileName, (EFI_PHYSICAL_ADDRESS)(UINTN)ImageAddress, EFI_SIZE_TO_PAGES ((UINT32) ImageSize) * EFI_PAGE_SIZE, EntryPoint);
DEBUG ((EFI_D_INFO | EFI_D_LOAD, "Loading DxeCore at 0x%10p EntryPoint=0x%10p\n", (VOID *)(UINTN)ImageAddress, (VOID *)(UINTN)EntryPoint)); DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Loading DxeCore at 0x%10p EntryPoint=0x%10p\n", (VOID *)(UINTN)ImageAddress, (VOID *)(UINTN)EntryPoint));
Hob = GetHobList (); Hob = GetHobList ();
if (StackSize == 0) { if (StackSize == 0) {
@ -191,7 +191,7 @@ LoadDxeCoreFromFfsFile (
} }
// Should never get here as DXE Core does not return // Should never get here as DXE Core does not return
DEBUG ((EFI_D_ERROR, "DxeCore returned\n")); DEBUG ((DEBUG_ERROR, "DxeCore returned\n"));
ASSERT (FALSE); ASSERT (FALSE);
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
@ -247,5 +247,3 @@ DecompressFirstFv (
return Status; return Status;
} }

View File

@ -74,8 +74,8 @@ CompareBuffer (
for (i = 0; i < (BufferSize >> 3); i++) { for (i = 0; i < (BufferSize >> 3); i++) {
if (*BufferA64 != *BufferB64) { if (*BufferA64 != *BufferB64) {
DEBUG ((EFI_D_ERROR, "CompareBuffer: Error at %i", i)); DEBUG ((DEBUG_ERROR, "CompareBuffer: Error at %i", i));
DEBUG ((EFI_D_ERROR, "(0x%lX) != (0x%lX)\n", *BufferA64, *BufferB64)); DEBUG ((DEBUG_ERROR, "(0x%lX) != (0x%lX)\n", *BufferA64, *BufferB64));
return FALSE; return FALSE;
} }
BufferA64++; BufferA64++;

View File

@ -21,7 +21,7 @@
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <Library/UefiBootServicesTableLib.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_READ 0
#define MMC_IOBLOCKS_WRITE 1 #define MMC_IOBLOCKS_WRITE 1

View File

@ -43,7 +43,7 @@ MmcGetCardStatus (
CmdArg = MmcHostInstance->CardInfo.RCA << 16; CmdArg = MmcHostInstance->CardInfo.RCA << 16;
Status = MmcHost->SendCommand (MmcHost, MMC_CMD13, CmdArg); Status = MmcHost->SendCommand (MmcHost, MMC_CMD13, CmdArg);
if (EFI_ERROR (Status)) { 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; return Status;
} }
@ -163,7 +163,7 @@ MmcTransferBlock (
Status = MmcHost->SendCommand (MmcHost, Cmd, CmdArg); Status = MmcHost->SendCommand (MmcHost, Cmd, CmdArg);
if (EFI_ERROR (Status)) { 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; return Status;
} }
@ -171,20 +171,20 @@ MmcTransferBlock (
// Read Data // Read Data
Status = MmcHost->ReadBlockData (MmcHost, Lba, BufferSize, Buffer); Status = MmcHost->ReadBlockData (MmcHost, Lba, BufferSize, Buffer);
if (EFI_ERROR (Status)) { 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); MmcStopTransmission (MmcHost);
return Status; return Status;
} }
Status = MmcNotifyState (MmcHostInstance, MmcProgrammingState); Status = MmcNotifyState (MmcHostInstance, MmcProgrammingState);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "%a() : Error MmcProgrammingState\n", __func__)); DEBUG ((DEBUG_ERROR, "%a() : Error MmcProgrammingState\n", __func__));
return Status; return Status;
} }
} else { } else {
// Write Data // Write Data
Status = MmcHost->WriteBlockData (MmcHost, Lba, BufferSize, Buffer); Status = MmcHost->WriteBlockData (MmcHost, Lba, BufferSize, Buffer);
if (EFI_ERROR (Status)) { 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); MmcStopTransmission (MmcHost);
return Status; return Status;
} }
@ -209,14 +209,14 @@ MmcTransferBlock (
if (BufferSize > This->Media->BlockSize) { if (BufferSize > This->Media->BlockSize) {
Status = MmcHost->SendCommand (MmcHost, MMC_CMD12, 0); Status = MmcHost->SendCommand (MmcHost, MMC_CMD12, 0);
if (EFI_ERROR (Status)) { 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); MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R1b, Response);
} }
Status = MmcNotifyState (MmcHostInstance, MmcTransferState); Status = MmcNotifyState (MmcHostInstance, MmcTransferState);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "MmcIoBlocks() : Error MmcTransferState\n")); DEBUG ((DEBUG_ERROR, "MmcIoBlocks() : Error MmcTransferState\n"));
return Status; return Status;
} }
return Status; return Status;
@ -318,7 +318,7 @@ MmcIoBlocks (
} }
if (0 == Timeout) { if (0 == Timeout) {
DEBUG ((EFI_D_ERROR, "The Card is busy\n")); DEBUG ((DEBUG_ERROR, "The Card is busy\n"));
return EFI_NOT_READY; return EFI_NOT_READY;
} }
@ -346,7 +346,7 @@ MmcIoBlocks (
} }
Status = MmcTransferBlock (This, Cmd, Transfer, MediaId, Lba, ConsumeSize, Buffer); Status = MmcTransferBlock (This, Cmd, Transfer, MediaId, Lba, ConsumeSize, Buffer);
if (EFI_ERROR (Status)) { 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; RemainingBlock -= BlockCount;

View File

@ -20,12 +20,12 @@ PrintCID (
IN UINT32* Cid IN UINT32* Cid
) )
{ {
DEBUG ((EFI_D_ERROR, "- PrintCID\n")); DEBUG ((DEBUG_ERROR, "- PrintCID\n"));
DEBUG ((EFI_D_ERROR, "\t- Manufacturing date: %d/%d\n", (Cid[0] >> 8) & 0xF, (Cid[0] >> 12) & 0xFF)); DEBUG ((DEBUG_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 ((DEBUG_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 ((DEBUG_ERROR, "\t- Product revision: %d\n", Cid[1] >> 24));
//DEBUG ((EFI_D_ERROR, "\t- Product name: %s\n", (char*)(Cid + 2))); //DEBUG ((DEBUG_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, "\t- OEM ID: %c%c\n", (Cid[3] >> 8) & 0xFF, (Cid[3] >> 16) & 0xFF));
} }
@ -37,31 +37,31 @@ PrintCSD (
UINTN Value; UINTN Value;
if (((Csd[2] >> 30) & 0x3) == 0) { 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) { } 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 { } 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 ((DEBUG_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 ((DEBUG_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 ((DEBUG_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- Maximum Write Data Block: %d\n",2 << (MMC_CSD_GET_WRITEBLLEN (Csd)-1)));
if (!MMC_CSD_GET_FILEFORMATGRP (Csd)) { if (!MMC_CSD_GET_FILEFORMATGRP (Csd)) {
Value = MMC_CSD_GET_FILEFORMAT (Csd); Value = MMC_CSD_GET_FILEFORMAT (Csd);
if (Value == 0) { 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) { } 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) { } 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 { } else {
DEBUG ((EFI_D_ERROR, "\t- Format (3): Others/Unknown\n")); DEBUG ((DEBUG_ERROR, "\t- Format (3): Others/Unknown\n"));
} }
} else { } else {
DEBUG ((EFI_D_ERROR, "\t- Format: Reserved\n")); DEBUG ((DEBUG_ERROR, "\t- Format: Reserved\n"));
} }
} }
@ -70,9 +70,9 @@ PrintRCA (
IN UINT32 Rca IN UINT32 Rca
) )
{ {
DEBUG ((EFI_D_ERROR, "- PrintRCA: 0x%X\n", Rca)); DEBUG ((DEBUG_ERROR, "- PrintRCA: 0x%X\n", Rca));
DEBUG ((EFI_D_ERROR, "\t- Status: 0x%X\n", Rca & 0xFFFF)); DEBUG ((DEBUG_ERROR, "\t- Status: 0x%X\n", Rca & 0xFFFF));
DEBUG ((EFI_D_ERROR, "\t- RCA: 0x%X\n", (Rca >> 16) & 0xFFFF)); DEBUG ((DEBUG_ERROR, "\t- RCA: 0x%X\n", (Rca >> 16) & 0xFFFF));
} }
VOID VOID
@ -102,18 +102,18 @@ PrintOCR (
Volts++; Volts++;
} }
DEBUG ((EFI_D_ERROR, "- PrintOCR Ocr (0x%X)\n",Ocr)); DEBUG ((DEBUG_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, "\t- Card operating voltage: %d.%d to %d.%d\n", MinV/10, MinV % 10, MaxV/10, MaxV % 10));
if (((Ocr >> 29) & 3) == 0) { if (((Ocr >> 29) & 3) == 0) {
DEBUG ((EFI_D_ERROR, "\t- AccessMode: Byte Mode\n")); DEBUG ((DEBUG_ERROR, "\t- AccessMode: Byte Mode\n"));
} else { } 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) { if (Ocr & MMC_OCR_POWERUP) {
DEBUG ((EFI_D_ERROR, "\t- PowerUp\n")); DEBUG ((DEBUG_ERROR, "\t- PowerUp\n"));
} else { } 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 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) { 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) { switch ((Response >> 9) & 0xF) {
case 0: case 0:
DEBUG ((EFI_D_INFO, "\t- State: Idle\n")); DEBUG ((DEBUG_INFO, "\t- State: Idle\n"));
break; break;
case 1: case 1:
DEBUG ((EFI_D_INFO, "\t- State: Ready\n")); DEBUG ((DEBUG_INFO, "\t- State: Ready\n"));
break; break;
case 2: case 2:
DEBUG ((EFI_D_INFO, "\t- State: Ident\n")); DEBUG ((DEBUG_INFO, "\t- State: Ident\n"));
break; break;
case 3: case 3:
DEBUG ((EFI_D_INFO, "\t- State: StandBy\n")); DEBUG ((DEBUG_INFO, "\t- State: StandBy\n"));
break; break;
case 4: case 4:
DEBUG ((EFI_D_INFO, "\t- State: Tran\n")); DEBUG ((DEBUG_INFO, "\t- State: Tran\n"));
break; break;
case 5: case 5:
DEBUG ((EFI_D_INFO, "\t- State: Data\n")); DEBUG ((DEBUG_INFO, "\t- State: Data\n"));
break; break;
case 6: case 6:
DEBUG ((EFI_D_INFO, "\t- State: Rcv\n")); DEBUG ((DEBUG_INFO, "\t- State: Rcv\n"));
break; break;
case 7: case 7:
DEBUG ((EFI_D_INFO, "\t- State: Prg\n")); DEBUG ((DEBUG_INFO, "\t- State: Prg\n"));
break; break;
case 8: case 8:
DEBUG ((EFI_D_INFO, "\t- State: Dis\n")); DEBUG ((DEBUG_INFO, "\t- State: Dis\n"));
break; break;
default: default:
DEBUG ((EFI_D_INFO, "\t- State: Reserved\n")); DEBUG ((DEBUG_INFO, "\t- State: Reserved\n"));
break; break;
} }
} }

View File

@ -81,16 +81,16 @@ EmmcGetDeviceState (
RCA = MmcHostInstance->CardInfo.RCA << RCA_SHIFT_OFFSET; RCA = MmcHostInstance->CardInfo.RCA << RCA_SHIFT_OFFSET;
Status = Host->SendCommand (Host, MMC_CMD13, RCA); Status = Host->SendCommand (Host, MMC_CMD13, RCA);
if (EFI_ERROR (Status)) { 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; return Status;
} }
Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R1, &Data); Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R1, &Data);
if (EFI_ERROR (Status)) { 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; return Status;
} }
if (Data & EMMC_SWITCH_ERROR) { 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; return EFI_DEVICE_ERROR;
} }
*State = DEVICE_STATE(Data); *State = DEVICE_STATE(Data);
@ -116,14 +116,14 @@ EmmcSetEXTCSD (
EMMC_CMD6_ARG_VALUE(Value) | EMMC_CMD6_ARG_CMD_SET(1); EMMC_CMD6_ARG_VALUE(Value) | EMMC_CMD6_ARG_CMD_SET(1);
Status = Host->SendCommand (Host, MMC_CMD6, Argument); Status = Host->SendCommand (Host, MMC_CMD6, Argument);
if (EFI_ERROR (Status)) { 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; return Status;
} }
// Make sure device exiting prog mode // Make sure device exiting prog mode
do { do {
Status = EmmcGetDeviceState (MmcHostInstance, &State); Status = EmmcGetDeviceState (MmcHostInstance, &State);
if (EFI_ERROR (Status)) { 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; return Status;
} }
} while (State == EMMC_PRG_STATE); } while (State == EMMC_PRG_STATE);
@ -150,13 +150,13 @@ EmmcIdentificationMode (
// Fetch card identity register // Fetch card identity register
Status = Host->SendCommand (Host, MMC_CMD2, 0); Status = Host->SendCommand (Host, MMC_CMD2, 0);
if (EFI_ERROR (Status)) { 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; return Status;
} }
Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R2, (UINT32 *)&(MmcHostInstance->CardInfo.CIDData)); Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R2, (UINT32 *)&(MmcHostInstance->CardInfo.CIDData));
if (EFI_ERROR (Status)) { 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; return Status;
} }
@ -165,41 +165,41 @@ EmmcIdentificationMode (
RCA = MmcHostInstance->CardInfo.RCA << RCA_SHIFT_OFFSET; RCA = MmcHostInstance->CardInfo.RCA << RCA_SHIFT_OFFSET;
Status = Host->SendCommand (Host, MMC_CMD3, RCA); Status = Host->SendCommand (Host, MMC_CMD3, RCA);
if (EFI_ERROR (Status)) { 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; return Status;
} }
// Fetch card specific data // Fetch card specific data
Status = Host->SendCommand (Host, MMC_CMD9, RCA); Status = Host->SendCommand (Host, MMC_CMD9, RCA);
if (EFI_ERROR (Status)) { 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; return Status;
} }
Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R2, (UINT32 *)&(MmcHostInstance->CardInfo.CSDData)); Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R2, (UINT32 *)&(MmcHostInstance->CardInfo.CSDData));
if (EFI_ERROR (Status)) { 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; return Status;
} }
// Select the card // Select the card
Status = Host->SendCommand (Host, MMC_CMD7, RCA); Status = Host->SendCommand (Host, MMC_CMD7, RCA);
if (EFI_ERROR (Status)) { 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)) { if (MMC_HOST_HAS_SETIOS(Host)) {
// Set 1-bit bus width // Set 1-bit bus width
Status = Host->SetIos (Host, 0, 1, EMMCBACKWARD); Status = Host->SetIos (Host, 0, 1, EMMCBACKWARD);
if (EFI_ERROR (Status)) { 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; return Status;
} }
// Set 1-bit bus width for EXTCSD // Set 1-bit bus width for EXTCSD
Status = EmmcSetEXTCSD (MmcHostInstance, EXTCSD_BUS_WIDTH, EMMC_BUS_WIDTH_1BIT); Status = EmmcSetEXTCSD (MmcHostInstance, EXTCSD_BUS_WIDTH, EMMC_BUS_WIDTH_1BIT);
if (EFI_ERROR (Status)) { 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; return Status;
} }
} }
@ -211,12 +211,12 @@ EmmcIdentificationMode (
} }
Status = Host->SendCommand (Host, MMC_CMD8, 0); Status = Host->SendCommand (Host, MMC_CMD8, 0);
if (EFI_ERROR (Status)) { 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); Status = Host->ReadBlockData (Host, 0, 512, (UINT32 *)MmcHostInstance->CardInfo.ECSDData);
if (EFI_ERROR (Status)) { 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; goto FreePageExit;
} }
@ -224,7 +224,7 @@ EmmcIdentificationMode (
do { do {
Status = EmmcGetDeviceState (MmcHostInstance, &State); Status = EmmcGetDeviceState (MmcHostInstance, &State);
if (EFI_ERROR (Status)) { 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; goto FreePageExit;
} }
} while (State == EMMC_DATA_STATE); } while (State == EMMC_DATA_STATE);
@ -353,14 +353,14 @@ InitializeSdMmcDevice (
CmdArg = MmcHostInstance->CardInfo.RCA << 16; CmdArg = MmcHostInstance->CardInfo.RCA << 16;
Status = MmcHost->SendCommand (MmcHost, MMC_CMD9, CmdArg); Status = MmcHost->SendCommand (MmcHost, MMC_CMD9, CmdArg);
if (EFI_ERROR (Status)) { 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; return Status;
} }
// Read Response // Read Response
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_CSD, Response); Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_CSD, Response);
if (EFI_ERROR (Status)) { 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; return Status;
} }
PrintCSD (Response); PrintCSD (Response);
@ -395,7 +395,7 @@ InitializeSdMmcDevice (
CmdArg = MmcHostInstance->CardInfo.RCA << 16; CmdArg = MmcHostInstance->CardInfo.RCA << 16;
Status = MmcHost->SendCommand (MmcHost, MMC_CMD7, CmdArg); Status = MmcHost->SendCommand (MmcHost, MMC_CMD7, CmdArg);
if (EFI_ERROR (Status)) { 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; return Status;
} }
@ -416,38 +416,38 @@ InitializeSdMmcDevice (
/* SCR */ /* SCR */
Status = MmcHost->SendCommand (MmcHost, MMC_ACMD51, 0); Status = MmcHost->SendCommand (MmcHost, MMC_ACMD51, 0);
if (EFI_ERROR (Status)) { 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; return Status;
} else { } else {
Status = MmcHost->ReadBlockData (MmcHost, 0, 8, Buffer); Status = MmcHost->ReadBlockData (MmcHost, 0, 8, Buffer);
if (EFI_ERROR (Status)) { 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; return Status;
} }
CopyMem (&Scr, Buffer, 8); CopyMem (&Scr, Buffer, 8);
if (Scr.SD_SPEC == 2) { if (Scr.SD_SPEC == 2) {
if (Scr.SD_SPEC3 == 1) { if (Scr.SD_SPEC3 == 1) {
if (Scr.SD_SPEC4 == 1) { if (Scr.SD_SPEC4 == 1) {
DEBUG ((EFI_D_INFO, "Found SD Card for Spec Version 4.xx\n")); DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 4.xx\n"));
} else { } else {
DEBUG ((EFI_D_INFO, "Found SD Card for Spec Version 3.0x\n")); DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 3.0x\n"));
} }
} else { } else {
if (Scr.SD_SPEC4 == 0) { if (Scr.SD_SPEC4 == 0) {
DEBUG ((EFI_D_INFO, "Found SD Card for Spec Version 2.0\n")); DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 2.0\n"));
} else { } else {
DEBUG ((EFI_D_ERROR, "Found invalid SD Card\n")); DEBUG ((DEBUG_ERROR, "Found invalid SD Card\n"));
} }
} }
} else { } else {
if ((Scr.SD_SPEC3 == 0) && (Scr.SD_SPEC4 == 0)) { if ((Scr.SD_SPEC3 == 0) && (Scr.SD_SPEC4 == 0)) {
if (Scr.SD_SPEC == 1) { if (Scr.SD_SPEC == 1) {
DEBUG ((EFI_D_INFO, "Found SD Card for Spec Version 1.10\n")); DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 1.10\n"));
} else { } else {
DEBUG ((EFI_D_INFO, "Found SD Card for Spec Version 1.0\n")); DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 1.0\n"));
} }
} else { } 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 // Initialize the MMC Host HW
Status = MmcNotifyState (MmcHostInstance, MmcHwInitializationState); Status = MmcNotifyState (MmcHostInstance, MmcHwInitializationState);
if (EFI_ERROR (Status)) { 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; return Status;
} }
} }
Status = MmcHost->SendCommand (MmcHost, MMC_CMD0, 0); Status = MmcHost->SendCommand (MmcHost, MMC_CMD0, 0);
if (EFI_ERROR (Status)) { 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; return Status;
} }
Status = MmcNotifyState (MmcHostInstance, MmcIdleState); Status = MmcNotifyState (MmcHostInstance, MmcIdleState);
if (EFI_ERROR (Status)) { 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; return Status;
} }
@ -568,14 +568,14 @@ MmcIdentificationMode (
break; break;
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, (UINT32 *)&OcrResponse); Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, (UINT32 *)&OcrResponse);
if (EFI_ERROR (Status)) { 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; return Status;
} }
Timeout--; Timeout--;
} while (!OcrResponse.Ocr.PowerUp && (Timeout > 0)); } while (!OcrResponse.Ocr.PowerUp && (Timeout > 0));
if (Status == EFI_SUCCESS) { if (Status == EFI_SUCCESS) {
if (!OcrResponse.Ocr.PowerUp) { 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; return EFI_DEVICE_ERROR;
} }
OcrResponse.Ocr.PowerUp = 0; OcrResponse.Ocr.PowerUp = 0;
@ -595,7 +595,7 @@ MmcIdentificationMode (
// Are we using SDIO ? // Are we using SDIO ?
Status = MmcHost->SendCommand (MmcHost, MMC_CMD5, 0); Status = MmcHost->SendCommand (MmcHost, MMC_CMD5, 0);
if (Status == EFI_SUCCESS) { 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; return EFI_UNSUPPORTED;
} }
@ -603,21 +603,21 @@ MmcIdentificationMode (
CmdArg = (0x0UL << 12 | BIT8 | 0xCEUL << 0); CmdArg = (0x0UL << 12 | BIT8 | 0xCEUL << 0);
Status = MmcHost->SendCommand (MmcHost, MMC_CMD8, CmdArg); Status = MmcHost->SendCommand (MmcHost, MMC_CMD8, CmdArg);
if (Status == EFI_SUCCESS) { 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; IsHCS = TRUE;
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R7, Response); Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R7, Response);
if (EFI_ERROR (Status)) { 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; return Status;
} }
PrintResponseR1 (Response[0]); PrintResponseR1 (Response[0]);
// Check if it is valid response // Check if it is valid response
if (Response[0] != CmdArg) { 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; return EFI_UNSUPPORTED;
} }
} else { } 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) // 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 // 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); Status = MmcHost->SendCommand (MmcHost, MMC_CMD55, 0);
if (Status == EFI_SUCCESS) { if (Status == EFI_SUCCESS) {
DEBUG ((EFI_D_INFO, "Card should be SD\n")); DEBUG ((DEBUG_INFO, "Card should be SD\n"));
if (IsHCS) { if (IsHCS) {
MmcHostInstance->CardInfo.CardType = SD_CARD_2; MmcHostInstance->CardInfo.CardType = SD_CARD_2;
} else { } else {
@ -642,20 +642,20 @@ MmcIdentificationMode (
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, Response); Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, Response);
if (EFI_ERROR (Status)) { 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; return Status;
} }
((UINT32 *) &(MmcHostInstance->CardInfo.OCRData))[0] = Response[0]; ((UINT32 *) &(MmcHostInstance->CardInfo.OCRData))[0] = Response[0];
} }
} else { } else {
DEBUG ((EFI_D_INFO, "Card should be MMC\n")); DEBUG ((DEBUG_INFO, "Card should be MMC\n"));
MmcHostInstance->CardInfo.CardType = MMC_CARD; MmcHostInstance->CardInfo.CardType = MMC_CARD;
Status = MmcHost->SendCommand (MmcHost, MMC_CMD1, 0x800000); Status = MmcHost->SendCommand (MmcHost, MMC_CMD1, 0x800000);
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, Response); Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, Response);
if (EFI_ERROR (Status)) { 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; return Status;
} }
((UINT32 *) &(MmcHostInstance->CardInfo.OCRData))[0] = Response[0]; ((UINT32 *) &(MmcHostInstance->CardInfo.OCRData))[0] = Response[0];
@ -669,7 +669,7 @@ MmcIdentificationMode (
} else { } else {
if ((MmcHostInstance->CardInfo.CardType == SD_CARD_2) && (MmcHostInstance->CardInfo.OCRData.AccessMode & BIT1)) { if ((MmcHostInstance->CardInfo.CardType == SD_CARD_2) && (MmcHostInstance->CardInfo.OCRData.AccessMode & BIT1)) {
MmcHostInstance->CardInfo.CardType = SD_CARD_2_HIGH; 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 break; // The MMC/SD card is ready. Continue the Identification Mode
} }
@ -680,7 +680,7 @@ MmcIdentificationMode (
} }
if (Timeout == 0) { if (Timeout == 0) {
DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(): No Card\n")); DEBUG ((DEBUG_ERROR, "MmcIdentificationMode(): No Card\n"));
return EFI_NO_MEDIA; return EFI_NO_MEDIA;
} else { } else {
PrintOCR (Response[0]); PrintOCR (Response[0]);
@ -688,18 +688,18 @@ MmcIdentificationMode (
Status = MmcNotifyState (MmcHostInstance, MmcReadyState); Status = MmcNotifyState (MmcHostInstance, MmcReadyState);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcReadyState\n")); DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Error MmcReadyState\n"));
return Status; return Status;
} }
Status = MmcHost->SendCommand (MmcHost, MMC_CMD2, 0); Status = MmcHost->SendCommand (MmcHost, MMC_CMD2, 0);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD2): Error\n")); DEBUG ((DEBUG_ERROR, "MmcIdentificationMode(MMC_CMD2): Error\n"));
return Status; return Status;
} }
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_CID, Response); Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_CID, Response);
if (EFI_ERROR (Status)) { 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; return Status;
} }
@ -707,7 +707,7 @@ MmcIdentificationMode (
Status = MmcHost->NotifyState (MmcHost, MmcIdentificationState); Status = MmcHost->NotifyState (MmcHost, MmcIdentificationState);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcIdentificationState\n")); DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Error MmcIdentificationState\n"));
return Status; return Status;
} }
@ -719,13 +719,13 @@ MmcIdentificationMode (
CmdArg = 1; CmdArg = 1;
Status = MmcHost->SendCommand (MmcHost, MMC_CMD3, CmdArg); Status = MmcHost->SendCommand (MmcHost, MMC_CMD3, CmdArg);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD3): Error\n")); DEBUG ((DEBUG_ERROR, "MmcIdentificationMode(MMC_CMD3): Error\n"));
return Status; return Status;
} }
Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_RCA, Response); Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_RCA, Response);
if (EFI_ERROR (Status)) { 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; return Status;
} }
PrintRCA (Response[0]); PrintRCA (Response[0]);
@ -738,7 +738,7 @@ MmcIdentificationMode (
} }
Status = MmcNotifyState (MmcHostInstance, MmcStandByState); Status = MmcNotifyState (MmcHostInstance, MmcStandByState);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcStandByState\n")); DEBUG ((DEBUG_ERROR, "MmcIdentificationMode() : Error MmcStandByState\n"));
return Status; return Status;
} }
@ -759,13 +759,13 @@ InitializeMmcDevice (
Status = MmcIdentificationMode (MmcHostInstance); Status = MmcIdentificationMode (MmcHostInstance);
if (EFI_ERROR (Status)) { 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; return Status;
} }
Status = MmcNotifyState (MmcHostInstance, MmcTransferState); Status = MmcNotifyState (MmcHostInstance, MmcTransferState);
if (EFI_ERROR (Status)) { 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; return Status;
} }
@ -781,7 +781,7 @@ InitializeMmcDevice (
// Set Block Length // Set Block Length
Status = MmcHost->SendCommand (MmcHost, MMC_CMD16, MmcHostInstance->BlockIo.Media->BlockSize); Status = MmcHost->SendCommand (MmcHost, MMC_CMD16, MmcHostInstance->BlockIo.Media->BlockSize);
if (EFI_ERROR (Status)) { 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)); MmcHostInstance->BlockIo.Media->BlockSize, Status));
return Status; return Status;
} }
@ -790,7 +790,7 @@ InitializeMmcDevice (
if (MmcHostInstance->CardInfo.CardType == MMC_CARD) { if (MmcHostInstance->CardInfo.CardType == MMC_CARD) {
Status = MmcHost->SendCommand (MmcHost, MMC_CMD23, BlockCount); Status = MmcHost->SendCommand (MmcHost, MMC_CMD23, BlockCount);
if (EFI_ERROR (Status)) { 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; return Status;
} }
} }