[edk2-devel] [PATCH 3/3] PlatformHookLib: Set PcdSerialClockRate using HOB data

MrChromebox matt.devillier at gmail.com
Wed Oct 4 20:01:35 UTC 2023


Fixes serial output on platforms using coreboot and a non-default
clock rate such as AMD Picasso and newer Zen-based platforms.

Signed-off-by: Matt DeVillier <matt.devillier at gmail.com>
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 60a17b8fc2..e3d47ac2fa 100644
--- a/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c
+++ b/UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c
@@ -90,6 +90,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 7ac6bfa1b1..e2908cfbca 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
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109337): https://edk2.groups.io/g/devel/message/109337
Mute This Topic: https://groups.io/mt/101763377/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list