ArmPlatformPkg: 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: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
Michael D Kinney 2021-11-16 19:21:14 -08:00 committed by mergify[bot]
parent a4a582e180
commit 1d2482e1e3
7 changed files with 21 additions and 22 deletions

View File

@ -201,7 +201,7 @@ NorFlashUnlockAndEraseSingleBlock (
} while ((Index < NOR_FLASH_ERASE_RETRY) && (Status == EFI_WRITE_PROTECTED)); } while ((Index < NOR_FLASH_ERASE_RETRY) && (Status == EFI_WRITE_PROTECTED));
if (Index == NOR_FLASH_ERASE_RETRY) { if (Index == NOR_FLASH_ERASE_RETRY) {
DEBUG((EFI_D_ERROR,"EraseSingleBlock(BlockAddress=0x%08x: Block Locked Error (try to erase %d times)\n", BlockAddress,Index)); DEBUG((DEBUG_ERROR,"EraseSingleBlock(BlockAddress=0x%08x: Block Locked Error (try to erase %d times)\n", BlockAddress,Index));
} }
if (!EfiAtRuntime ()) { if (!EfiAtRuntime ()) {
@ -249,7 +249,7 @@ NorFlashWriteFullBlock (
Status = NorFlashUnlockAndEraseSingleBlock (Instance, BlockAddress); Status = NorFlashUnlockAndEraseSingleBlock (Instance, BlockAddress);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
DEBUG((EFI_D_ERROR, "WriteSingleBlock: ERROR - Failed to Unlock and Erase the single block at 0x%X\n", BlockAddress)); DEBUG((DEBUG_ERROR, "WriteSingleBlock: ERROR - Failed to Unlock and Erase the single block at 0x%X\n", BlockAddress));
goto EXIT; goto EXIT;
} }
@ -310,7 +310,7 @@ EXIT:
} }
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
DEBUG((EFI_D_ERROR, "NOR FLASH Programming [WriteSingleBlock] failed at address 0x%08x. Exit Status = \"%r\".\n", WordAddress, Status)); DEBUG((DEBUG_ERROR, "NOR FLASH Programming [WriteSingleBlock] failed at address 0x%08x. Exit Status = \"%r\".\n", WordAddress, Status));
} }
return Status; return Status;
} }
@ -329,13 +329,13 @@ NorFlashInitialise (
Status = NorFlashPlatformInitialization (); Status = NorFlashPlatformInitialization ();
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
DEBUG((EFI_D_ERROR,"NorFlashInitialise: Fail to initialize Nor Flash devices\n")); DEBUG((DEBUG_ERROR,"NorFlashInitialise: Fail to initialize Nor Flash devices\n"));
return Status; return Status;
} }
Status = NorFlashPlatformGetDevices (&NorFlashDevices, &mNorFlashDeviceCount); Status = NorFlashPlatformGetDevices (&NorFlashDevices, &mNorFlashDeviceCount);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
DEBUG((EFI_D_ERROR,"NorFlashInitialise: Fail to get Nor Flash devices\n")); DEBUG((DEBUG_ERROR,"NorFlashInitialise: Fail to get Nor Flash devices\n"));
return Status; return Status;
} }
@ -366,7 +366,7 @@ NorFlashInitialise (
&mNorFlashInstances[Index] &mNorFlashInstances[Index]
); );
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
DEBUG((EFI_D_ERROR,"NorFlashInitialise: Fail to create instance for NorFlash[%d]\n",Index)); DEBUG((DEBUG_ERROR,"NorFlashInitialise: Fail to create instance for NorFlash[%d]\n",Index));
} }
} }

View File

@ -187,14 +187,14 @@ ValidateFvHeader (
|| (FwVolHeader->FvLength != FvLength) || (FwVolHeader->FvLength != FvLength)
) )
{ {
DEBUG ((EFI_D_INFO, "%a: No Firmware Volume header present\n", DEBUG ((DEBUG_INFO, "%a: No Firmware Volume header present\n",
__FUNCTION__)); __FUNCTION__));
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
// Check the Firmware Volume Guid // Check the Firmware Volume Guid
if( CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiSystemNvDataFvGuid) == FALSE ) { if( CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiSystemNvDataFvGuid) == FALSE ) {
DEBUG ((EFI_D_INFO, "%a: Firmware Volume Guid non-compatible\n", DEBUG ((DEBUG_INFO, "%a: Firmware Volume Guid non-compatible\n",
__FUNCTION__)); __FUNCTION__));
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
@ -202,7 +202,7 @@ ValidateFvHeader (
// Verify the header checksum // Verify the header checksum
Checksum = CalculateSum16((UINT16*)FwVolHeader, FwVolHeader->HeaderLength); Checksum = CalculateSum16((UINT16*)FwVolHeader, FwVolHeader->HeaderLength);
if (Checksum != 0) { if (Checksum != 0) {
DEBUG ((EFI_D_INFO, "%a: FV checksum is invalid (Checksum:0x%X)\n", DEBUG ((DEBUG_INFO, "%a: FV checksum is invalid (Checksum:0x%X)\n",
__FUNCTION__, Checksum)); __FUNCTION__, Checksum));
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
@ -212,14 +212,14 @@ ValidateFvHeader (
// Check the Variable Store Guid // Check the Variable Store Guid
if (!CompareGuid (&VariableStoreHeader->Signature, &gEfiVariableGuid) && if (!CompareGuid (&VariableStoreHeader->Signature, &gEfiVariableGuid) &&
!CompareGuid (&VariableStoreHeader->Signature, &gEfiAuthenticatedVariableGuid)) { !CompareGuid (&VariableStoreHeader->Signature, &gEfiAuthenticatedVariableGuid)) {
DEBUG ((EFI_D_INFO, "%a: Variable Store Guid non-compatible\n", DEBUG ((DEBUG_INFO, "%a: Variable Store Guid non-compatible\n",
__FUNCTION__)); __FUNCTION__));
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
VariableStoreLength = PcdGet32 (PcdFlashNvStorageVariableSize) - FwVolHeader->HeaderLength; VariableStoreLength = PcdGet32 (PcdFlashNvStorageVariableSize) - FwVolHeader->HeaderLength;
if (VariableStoreHeader->Size != VariableStoreLength) { if (VariableStoreHeader->Size != VariableStoreLength) {
DEBUG ((EFI_D_INFO, "%a: Variable Store Length does not match\n", DEBUG ((DEBUG_INFO, "%a: Variable Store Length does not match\n",
__FUNCTION__)); __FUNCTION__));
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
@ -386,7 +386,7 @@ FvbGetBlockSize (
DEBUG ((DEBUG_BLKIO, "FvbGetBlockSize(Lba=%ld, BlockSize=0x%x, LastBlock=%ld)\n", Lba, Instance->Media.BlockSize, Instance->Media.LastBlock)); DEBUG ((DEBUG_BLKIO, "FvbGetBlockSize(Lba=%ld, BlockSize=0x%x, LastBlock=%ld)\n", Lba, Instance->Media.BlockSize, Instance->Media.LastBlock));
if (Lba > Instance->Media.LastBlock) { if (Lba > Instance->Media.LastBlock) {
DEBUG ((EFI_D_ERROR, "FvbGetBlockSize: ERROR - Parameter LBA %ld is beyond the last Lba (%ld).\n", Lba, Instance->Media.LastBlock)); DEBUG ((DEBUG_ERROR, "FvbGetBlockSize: ERROR - Parameter LBA %ld is beyond the last Lba (%ld).\n", Lba, Instance->Media.LastBlock));
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
} else { } else {
// This is easy because in this platform each NorFlash device has equal sized blocks. // This is easy because in this platform each NorFlash device has equal sized blocks.
@ -472,7 +472,7 @@ FvbRead (
if ((Offset >= BlockSize) || if ((Offset >= BlockSize) ||
(*NumBytes > BlockSize) || (*NumBytes > BlockSize) ||
((Offset + *NumBytes) > BlockSize)) { ((Offset + *NumBytes) > BlockSize)) {
DEBUG ((EFI_D_ERROR, "FvbRead: ERROR - EFI_BAD_BUFFER_SIZE: (Offset=0x%x + NumBytes=0x%x) > BlockSize=0x%x\n", Offset, *NumBytes, BlockSize )); DEBUG ((DEBUG_ERROR, "FvbRead: ERROR - EFI_BAD_BUFFER_SIZE: (Offset=0x%x + NumBytes=0x%x) > BlockSize=0x%x\n", Offset, *NumBytes, BlockSize ));
return EFI_BAD_BUFFER_SIZE; return EFI_BAD_BUFFER_SIZE;
} }
@ -635,7 +635,7 @@ FvbEraseBlocks (
// Detect WriteDisabled state // Detect WriteDisabled state
if (Instance->Media.ReadOnly == TRUE) { if (Instance->Media.ReadOnly == TRUE) {
// Firmware volume is in WriteDisabled state // Firmware volume is in WriteDisabled state
DEBUG ((EFI_D_ERROR, "FvbEraseBlocks: ERROR - Device is in WriteDisabled state.\n")); DEBUG ((DEBUG_ERROR, "FvbEraseBlocks: ERROR - Device is in WriteDisabled state.\n"));
return EFI_ACCESS_DENIED; return EFI_ACCESS_DENIED;
} }
@ -665,7 +665,7 @@ FvbEraseBlocks (
)); ));
if ((NumOfLba == 0) || ((Instance->StartLba + StartingLba + NumOfLba - 1) > Instance->Media.LastBlock)) { if ((NumOfLba == 0) || ((Instance->StartLba + StartingLba + NumOfLba - 1) > Instance->Media.LastBlock)) {
VA_END (Args); VA_END (Args);
DEBUG ((EFI_D_ERROR, "FvbEraseBlocks: ERROR - Lba range goes past the last Lba.\n")); DEBUG ((DEBUG_ERROR, "FvbEraseBlocks: ERROR - Lba range goes past the last Lba.\n"));
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
goto EXIT; goto EXIT;
} }
@ -737,4 +737,3 @@ FvbVirtualNotifyEvent (
EfiConvertPointer (0x0, (VOID**)&mFlashNvStorageVariableBase); EfiConvertPointer (0x0, (VOID**)&mFlashNvStorageVariableBase);
return; return;
} }

View File

@ -47,7 +47,7 @@ PL061Locate (
return EFI_SUCCESS; return EFI_SUCCESS;
} }
} }
DEBUG ((EFI_D_ERROR, "%a, failed to locate gpio %d\n", __func__, Gpio)); DEBUG ((DEBUG_ERROR, "%a, failed to locate gpio %d\n", __func__, Gpio));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -375,7 +375,7 @@ PL061InstallProtocol (
// Create the mPL061PlatformGpio // Create the mPL061PlatformGpio
mPL061PlatformGpio = (PLATFORM_GPIO_CONTROLLER *)AllocateZeroPool (sizeof (PLATFORM_GPIO_CONTROLLER) + sizeof (GPIO_CONTROLLER)); mPL061PlatformGpio = (PLATFORM_GPIO_CONTROLLER *)AllocateZeroPool (sizeof (PLATFORM_GPIO_CONTROLLER) + sizeof (GPIO_CONTROLLER));
if (mPL061PlatformGpio == NULL) { if (mPL061PlatformGpio == NULL) {
DEBUG ((EFI_D_ERROR, "%a: failed to allocate PLATFORM_GPIO_CONTROLLER\n", __func__)); DEBUG ((DEBUG_ERROR, "%a: failed to allocate PLATFORM_GPIO_CONTROLLER\n", __func__));
return EFI_BAD_BUFFER_SIZE; return EFI_BAD_BUFFER_SIZE;
} }

View File

@ -26,7 +26,7 @@ LcdIdentify (
VOID VOID
) )
{ {
DEBUG ((EFI_D_WARN, "Probing ID registers at 0x%lx for a PL111\n", DEBUG ((DEBUG_WARN, "Probing ID registers at 0x%lx for a PL111\n",
PL111_REG_CLCD_PERIPH_ID_0)); PL111_REG_CLCD_PERIPH_ID_0));
// Check if this is a PL111 // Check if this is a PL111

View File

@ -35,7 +35,7 @@ InitMmu (
// DRAM (even at the top of DRAM as it is the first permanent memory allocation) // DRAM (even at the top of DRAM as it is the first permanent memory allocation)
Status = ArmConfigureMmu (MemoryTable, &TranslationTableBase, &TranslationTableSize); Status = ArmConfigureMmu (MemoryTable, &TranslationTableBase, &TranslationTableSize);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Error: Failed to enable MMU\n")); DEBUG ((DEBUG_ERROR, "Error: Failed to enable MMU\n"));
} }
} }

View File

@ -95,7 +95,7 @@ InitializeMemory (
UINTN FdTop; UINTN FdTop;
UINTN UefiMemoryBase; UINTN UefiMemoryBase;
DEBUG ((EFI_D_LOAD | EFI_D_INFO, "Memory Init PEIM Loaded\n")); DEBUG ((DEBUG_LOAD | DEBUG_INFO, "Memory Init PEIM Loaded\n"));
// Ensure PcdSystemMemorySize has been set // Ensure PcdSystemMemorySize has been set
ASSERT (PcdGet64 (PcdSystemMemorySize) != 0); ASSERT (PcdGet64 (PcdSystemMemorySize) != 0);

View File

@ -79,7 +79,7 @@ InitializePlatformPeim (
EFI_STATUS Status; EFI_STATUS Status;
EFI_BOOT_MODE BootMode; EFI_BOOT_MODE BootMode;
DEBUG ((EFI_D_LOAD | EFI_D_INFO, "Platform PEIM Loaded\n")); DEBUG ((DEBUG_LOAD | DEBUG_INFO, "Platform PEIM Loaded\n"));
Status = PeiServicesSetBootMode (ArmPlatformGetBootMode ()); Status = PeiServicesSetBootMode (ArmPlatformGetBootMode ());
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);