diff options
author | Matt DeVillier <matt.devillier@gmail.com> | 2023-07-31 11:40:32 -0500 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-09-20 03:13:11 +0000 |
commit | c3580093520809cbfe2abd0e702d53707b7782a9 (patch) | |
tree | e6d8b5c7d9547be34975c11a6e85bce2b2bf9d46 /UefiPayloadPkg | |
parent | 3a3b12cbdae2e89b0e365eb01c378891d0d9037c (diff) | |
download | edk2-c3580093520809cbfe2abd0e702d53707b7782a9.tar.gz edk2-c3580093520809cbfe2abd0e702d53707b7782a9.tar.bz2 edk2-c3580093520809cbfe2abd0e702d53707b7782a9.zip |
Set PcdSerialClockRate from SerialPortInfo in UefiPayloadEntry
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Diffstat (limited to 'UefiPayloadPkg')
-rw-r--r-- | UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 8 | ||||
-rw-r--r-- | UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c index 030a5baed9..abda59312d 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c @@ -432,6 +432,14 @@ _ModuleEntryPoint ( UniversalSerialPort->RegisterBase = SerialPortInfo.BaseAddr;
UniversalSerialPort->BaudRate = SerialPortInfo.Baud;
UniversalSerialPort->RegisterStride = (UINT8)SerialPortInfo.RegWidth;
+ // Set PCD here (vs in PlatformHookLib.c) to avoid adding a new field to UniversalSerialPort struct
+ if (SerialPortInfo.InputHertz > 0) {
+ Status = PcdSet32S (PcdSerialClockRate, SerialPortInfo.InputHertz);
+ if (RETURN_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "Failed to set PcdSerialClockRate; Status = %r\n", Status));
+ return Status;
+ }
+ }
}
// The library constructors might depend on serial port, so call it after serial port hob
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf index a3ff4b86ea..e84ef664d3 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf @@ -96,3 +96,4 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdImageProtectionPolicy ## SOMETIMES_CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate ## PRODUCES
|