From 6867be612e4246cf99de2938223ce86137e28653 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Mon, 31 Jul 2023 11:46:07 -0500 Subject: [PATCH] UefiPayloadPkg/PLatformHookLib: Set PcdSerialClockRate using HOB data Fixes serial output on platforms using coreboot and a non-default clock rate such as AMD Picasso and newer. Signed-off-by: Matt DeVillier Change-Id: I91290397852176754e9a34ec6e5829044f41d15a --- UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c | 5 +++++ UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf | 1 + 2 files changed, 6 insertions(+) diff --git a/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c b/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c index efaab326bb687..e1a422270ddc8 100644 --- a/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c +++ b/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c @@ -94,6 +94,11 @@ PlatformHookSerialPortInitialize ( return Status; } + Status = PcdSet32S (PcdSerialClockRate, SerialPortInfo->ClockRate); + if (RETURN_ERROR (Status)) { + return Status; + } + return RETURN_SUCCESS; } diff --git a/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf b/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf index 7ac6bfa1b1b08..e2908cfbca249 100644 --- a/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf +++ b/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf @@ -38,3 +38,4 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase ## PRODUCES gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate ## PRODUCES gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride ## PRODUCES + gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate ## PRODUCES