ArmVirtPkg: store separate console and debug PL011 addresses in GUID HOB

PlatformPeiLib produces the EarlyPL011BaseAddress GUID HOB, and
FdtPL011SerialPortLib consumes it. Extend the HOB such that it also carry
the base address of the PL011 UART meant for DebugLib usage -- namely the
first UART that is *not* designated by the /chosen node's "stdout-path"
property. Implement this policy in PlatformPeiLib.

Note that as far as the SerialPortLib+console UART is concerned, this
patch makes no difference. That selection remains consistent with the
pre-patch state, and therefore consistent with EarlyFdtPL011SerialPortLib.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231008153912.175941-6-lersek@redhat.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4577
[lersek@redhat.com: add TianoCore BZ reference]
This commit is contained in:
Laszlo Ersek
2023-10-08 17:39:08 +02:00
committed by mergify[bot]
parent 66046aeb6d
commit 115b59d9c6
4 changed files with 61 additions and 17 deletions

View File

@@ -46,7 +46,7 @@ SerialPortInitialize (
{
VOID *Hob;
RETURN_STATUS Status;
CONST UINT64 *UartBase;
CONST EARLY_PL011_BASE_ADDRESS *UartBase;
UINTN SerialBaseAddress;
UINT64 BaudRate;
UINT32 ReceiveFifoDepth;
@@ -70,7 +70,7 @@ SerialPortInitialize (
UartBase = GET_GUID_HOB_DATA (Hob);
SerialBaseAddress = (UINTN)*UartBase;
SerialBaseAddress = (UINTN)UartBase->ConsoleAddress;
if (SerialBaseAddress == 0) {
Status = RETURN_NOT_FOUND;
goto Failed;