audk/ArmVirtPkg
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
..
CloudHvAcpiPlatformDxe ArmVirtPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
CloudHvPlatformHasAcpiDtDxe ArmVirtPkg: can't find gUefiOvmfPkgTokenSpaceGuid 2023-03-28 16:27:06 +00:00
Include ArmVirtPkg: store separate console and debug PL011 addresses in GUID HOB 2023-10-26 18:55:43 +00:00
KvmtoolCfgMgrDxe ArmVirtPkg: Fix KVM Guest Firmware 2022-08-02 17:07:08 +00:00
KvmtoolPlatformDxe ArmVirtPkg: Dispatch variable service if variable emulation is enabled 2023-05-29 15:14:00 +00:00
Library ArmVirtPkg: introduce DebugLibFdtPL011Uart Flash instance 2023-10-26 18:55:43 +00:00
MemoryInitPei ArmVirtPkg/ArmVirtQemu: use first 128 MiB as permanent PEI memory 2022-10-26 17:28:39 +00:00
PlatformCI ArmVirtPkg: ArmVirtQemu: Add Graphics and Input 2023-09-06 09:35:59 +00:00
PrePi ArmVirtPkg/PrePi: Allocate separate stack for Dxe phase 2023-05-29 15:14:00 +00:00
XenAcpiPlatformDxe ArmVirtPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
XenPlatformHasAcpiDtDxe ArmVirtPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
XenioFdtDxe ArmVirtPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
ArmVirt.dsc.inc ArmVirtPkg: introduce FdtSerialPortAddressLib 2023-10-26 18:55:43 +00:00
ArmVirtCloudHv.dsc ArmVirtPkg: handle virtual EL2 timer in DT 2023-09-19 20:27:55 +00:00
ArmVirtCloudHv.fdf ArmVirtPkg: remove EbcDxe from all platforms 2022-10-24 14:30:33 +00:00
ArmVirtKvmTool.dsc ArmVirtPkg: handle virtual EL2 timer in DT 2023-09-19 20:27:55 +00:00
ArmVirtKvmTool.fdf ArmVirtPkg: Kvmtool: Add RNG support using Arm TRNG interface 2022-11-06 16:32:28 +00:00
ArmVirtPkg.ci.yaml ArmVirtPkg.ci.yaml: Add debug macro exception 2023-09-19 01:20:27 +00:00
ArmVirtPkg.dec ArmVirtPkg: introduce FdtSerialPortAddressLib 2023-10-26 18:55:43 +00:00
ArmVirtQemu.dsc ArmVirtPkg: handle virtual EL2 timer in DT 2023-09-19 20:27:55 +00:00
ArmVirtQemu.fdf ArmVirtPkg/ArmVirtQemu: omit PCD PEIM unless TPM support is enabled 2022-10-26 17:28:39 +00:00
ArmVirtQemuFvMain.fdf.inc ArmVirt: add VirtioSerialDxe to ArmVirtQemu builds 2023-06-01 12:48:45 +00:00
ArmVirtQemuKernel.dsc ArmVirtPkg: handle virtual EL2 timer in DT 2023-09-19 20:27:55 +00:00
ArmVirtQemuKernel.fdf ArmVirtPkg: add FDF rule for self-relocating PrePi 2020-06-12 22:17:46 +00:00
ArmVirtRules.fdf.inc ArmVirtPkg: add FDF rule for self-relocating PrePi 2020-06-12 22:17:46 +00:00
ArmVirtXen.dsc ArmVirtPkg: handle virtual EL2 timer in DT 2023-09-19 20:27:55 +00:00
ArmVirtXen.fdf ArmVirtPkg: remove EbcDxe from all platforms 2022-10-24 14:30:33 +00:00
VarStore.fdf.inc ArmVirtPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00