audk/ArmVirtPkg/Library
Laszlo Ersek b7e6d97973 ArmVirtPkg: introduce DebugLibFdtPL011Uart Flash instance
Introduce three new DebugLib instances, forked from
MdePkg/Library/BaseDebugLibSerialPort. All three instances rely on
PL011UartLib rather than SerialPortLib so that they can customize the
PL011 UART that the debug messages are written to. All three instances
direct the debug output to the first such PL011 UART that *differs* from
the one specified in the Device Tree's /chosen node's "stdout-path"
property.

From these, DebugLibFdtPL011UartFlash mirrors EarlyFdtPL011SerialPortLib:
it parses the initial Device Tree, and initializes the UART -- a UART
different from EarlyFdtPL011SerialPortLib's -- for every message written.
Suitable for SEC, PEI_CORE, PEIM.

(Note that OVMF uses a similar set of dedicated DebugLib instances
(PlatformDebugLibIoPort) for logging to the (x86-only) isa-debugcon device
from various firmware phases.)

The contexts in which these DebugLib instances run are identical to those
in which the corresponding SerialPortLib instances run. The particular
original dependency chain is

  BaseDebugLibSerialPort (SEC, PEI_CORE, PEIM)
    EarlyFdtPL011SerialPortLib
      PcdDeviceTreeInitialBaseAddress
      FdtSerialPortAddressLib
      PL011UartLib

and the new dependency chain is

  DebugLibFdtPL011UartFlash (SEC, PEI_CORE, PEIM)
    PcdDeviceTreeInitialBaseAddress
    FdtSerialPortAddressLib
    PL011UartLib

Note that EarlyFdtPL011SerialPortLib remains in use (just not via
BaseDebugLibSerialPort), namely for direct SerialPortLib calls from SEC,
PEI_CORE, PEIM. See for example commit 56035d1c8b
("ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot",
2022-10-25).

The ArmVirtPkg DSC files will be switched to the new library instances in
a separate patch.

This patch is worth viewing with "git show --find-copies-harder".

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-7-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]
2023-10-26 18:55:43 +00:00
..
ArmPlatformLibQemu ArmVirtPkg/ArmPlatformLibQemu: Make IdMap.S BTI compatible 2023-03-30 11:05:22 +00:00
ArmVirtDxeHobLib ArmVirtPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmVirtGicArchLib ArmVirtPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
ArmVirtMemoryInitPeiLib ArmVirtPkg/QemuVirtMemInfoLib: use HOB not PCD to record the memory size 2022-10-26 17:28:39 +00:00
ArmVirtPL031FdtClientLib ArmVirtPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
ArmVirtPciHostBridgeUtilityLib ArmVirtPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmVirtPsciResetSystemLib ArmVirtPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
ArmVirtPsciResetSystemPeiLib ArmVirtPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
ArmVirtTimerFdtClientLib ArmVirtPkg: handle virtual EL2 timer in DT 2023-09-19 20:27:55 +00:00
CloudHvVirtMemInfoLib ArmVirtPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
DebugLibFdtPL011Uart ArmVirtPkg: introduce DebugLibFdtPL011Uart Flash instance 2023-10-26 18:55:43 +00:00
Fdt16550SerialPortHookLib ArmVirtPkg/Fdt16550SerialPortHookLib: rebase to FdtSerialPortAddressLib 2023-10-26 18:55:43 +00:00
FdtPL011SerialPortLib ArmVirtPkg: store separate console and debug PL011 addresses in GUID HOB 2023-10-26 18:55:43 +00:00
FdtSerialPortAddressLib ArmVirtPkg: introduce FdtSerialPortAddressLib 2023-10-26 18:55:43 +00:00
KvmtoolPlatformPeiLib ArmVirtPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
KvmtoolRtcFdtClientLib ArmVirtPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
KvmtoolVirtMemInfoLib ArmVirtPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
NorFlashKvmtoolLib ArmVirtPkg: Fallback to variable emulation if no CFI is found 2023-05-29 15:14:00 +00:00
NorFlashQemuLib ArmVirtPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
PlatformBootManagerLib ArmVirtPkg: use PcdTerminalTypeGuidBuffer for VirtioSerial console 2023-09-07 15:47:58 +00:00
PlatformPeiLib ArmVirtPkg: store separate console and debug PL011 addresses in GUID HOB 2023-10-26 18:55:43 +00:00
QemuVirtMemInfoLib ArmVirtPkg/ArmVirtQemu: Use read-only memory region type for code flash 2023-05-29 16:51:01 +00:00
XenArmGenericTimerVirtCounterLib ArmVirtPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
XenVirtMemInfoLib ArmVirtPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00