/* Platform hook to retrieve the 16550 UART base address from the platform Device tree and store it in PcdSerialRegisterBase. */
RETURN_STATUS EFIAPI PlatformHookSerialPortInitialize(VOID)
/* Platform hook to retrieve the 16550 UART base address from the platform Device tree and store it in PcdSerialRegisterBase. */
RETURN_STATUS EFIAPI PlatformHookSerialPortInitialize(VOID)
{
  RETURN_STATUS  Status;
  VOID           *DeviceTreeBase;
  UINT64         SerialConsoleAddress;
  if (PcdGet64 (PcdSerialRegisterBase) != 0) {
    return RETURN_SUCCESS;
  }
  DeviceTreeBase = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress);
  if (DeviceTreeBase == NULL) {
    return RETURN_NOT_FOUND;
  }
  Status = FdtSerialGetConsolePort (DeviceTreeBase, &SerialConsoleAddress);
  if (RETURN_ERROR (Status)) {
    return Status;
  }
  return (EFI_STATUS)PcdSet64S (PcdSerialRegisterBase, SerialConsoleAddress);
}