Skip to content

Commit

Permalink
Set PcdSerialClockRate from SerialPortInfo in UefiPayloadEntry
Browse files Browse the repository at this point in the history
Signed-off-by: Matt DeVillier <[email protected]>
  • Loading branch information
MrChromebox authored and mergify[bot] committed Sep 20, 2024
1 parent 3a3b12c commit c358009
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,4 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdImageProtectionPolicy ## SOMETIMES_CONSUMES

gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate ## PRODUCES

0 comments on commit c358009

Please sign in to comment.