Ring3: Fixed Uart bug.

This commit is contained in:
Mikhail Krichanov 2024-09-26 14:05:05 +03:00
parent cbfdf3c222
commit 0113d46aee
2 changed files with 7 additions and 8 deletions

View File

@ -29,11 +29,10 @@ DebugLibFdtPL011UartUserConstructor (
for (Index = 0; Index < SystemTable->NumberOfTableEntries; ++Index) { for (Index = 0; Index < SystemTable->NumberOfTableEntries; ++Index) {
if (CompareGuid (&gEarlyPL011BaseAddressGuid, &(SystemTable->ConfigurationTable[Index].VendorGuid))) { if (CompareGuid (&gEarlyPL011BaseAddressGuid, &(SystemTable->ConfigurationTable[Index].VendorGuid))) {
mDebugLibFdtPL011UartAddress = (UINTN)SystemTable->ConfigurationTable[Index].VendorTable; mDebugLibFdtPL011UartAddress = (UINTN)SystemTable->ConfigurationTable[Index].VendorTable;
return EFI_SUCCESS;
} }
} }
return EFI_NOT_FOUND; return EFI_SUCCESS;
} }
/** /**

View File

@ -39,6 +39,7 @@ InitializeRing3 (
UINTN Index; UINTN Index;
EFI_CONFIGURATION_TABLE *Conf; EFI_CONFIGURATION_TABLE *Conf;
EARLY_PL011_BASE_ADDRESS *UartBase; EARLY_PL011_BASE_ADDRESS *UartBase;
CONST VOID *Hob;
// //
// Set Ring3 EntryPoint and BootServices. // Set Ring3 EntryPoint and BootServices.
@ -77,19 +78,18 @@ InitializeRing3 (
Conf->VendorTable = gRing3Data->SystemTable.ConfigurationTable[Index].VendorTable; Conf->VendorTable = gRing3Data->SystemTable.ConfigurationTable[Index].VendorTable;
if (CompareGuid (&gEfiHobListGuid, &(Conf->VendorGuid))) {
UartBase = GET_GUID_HOB_DATA (Conf->VendorTable);
gUartBaseAddress = (UINTN)UartBase->DebugAddress;
}
++Conf; ++Conf;
} }
Hob = GetFirstGuidHob (&gEarlyPL011BaseAddressGuid);
UartBase = GET_GUID_HOB_DATA (Hob);
gUartBaseAddress = (UINTN)UartBase->DebugAddress;
CopyGuid (&(Conf->VendorGuid), &gEarlyPL011BaseAddressGuid); CopyGuid (&(Conf->VendorGuid), &gEarlyPL011BaseAddressGuid);
Conf->VendorTable = (VOID *)gUartBaseAddress; Conf->VendorTable = (VOID *)gUartBaseAddress;
++gRing3Data->SystemTable.NumberOfTableEntries; ++gRing3Data->SystemTable.NumberOfTableEntries;
DEBUG ((DEBUG_ERROR, "Core: gUartBaseAddress = %p\n", gUartBaseAddress)); DEBUG ((DEBUG_ERROR, "Core: gUartBaseAddress = 0x%p\n", gUartBaseAddress));
gRing3Data->SystemTable.ConfigurationTable = (EFI_CONFIGURATION_TABLE *)(UINTN)Physical; gRing3Data->SystemTable.ConfigurationTable = (EFI_CONFIGURATION_TABLE *)(UINTN)Physical;
} }