Skip to content

Commit

Permalink
UefiPayloadPkg/PLatformHookLib: Set PcdSerialClockRate using HOB data
Browse files Browse the repository at this point in the history
Fixes serial output on platforms using coreboot and a non-default clock
rate such as AMD Picasso and newer.

Signed-off-by: Matt DeVillier <[email protected]>
  • Loading branch information
MrChromebox committed Sep 19, 2024
1 parent 9528582 commit b6b5afe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ PlatformHookSerialPortInitialize (
return Status;
}

if (SerialPortInfo->Header.Revision >= 2) {
Status = PcdSet32S (PcdSerialClockRate, SerialPortInfo->ClockRate);
if (RETURN_ERROR (Status)) {
return Status;
}
}

return RETURN_SUCCESS;
}

Expand Down
1 change: 1 addition & 0 deletions UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase ## PRODUCES
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate ## PRODUCES
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride ## PRODUCES
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate ## PRODUCES

0 comments on commit b6b5afe

Please sign in to comment.