From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by mx.groups.io with SMTP id smtpd.web11.3955.1588590966535940880 for ; Mon, 04 May 2020 04:16:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=PmtVLLJm; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.218.65, mailfrom: pete@akeo.ie) Received: by mail-ej1-f65.google.com with SMTP id b20so1834223ejg.11 for ; Mon, 04 May 2020 04:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jNe5RqnvgfwpMD8CMVhNaP0gfhWk6Tk4UzNtxEfmIWw=; b=PmtVLLJmGMiokWuKRN4MUeSF+qt0Iw5tNCre+BihRs1hH19jk/kU1WeE7awBI2MOJ2 GhPa100vJu6uueuE/ChILi0CYNJXpSAEfxacDMBk0u8NzY+ovwsbNTkylDYnRXmBqsHI 2sc63+Jfvli7B1jUrFGbbC05GI0uofhI0+IDX2pGIqbPXXQTqutq4QaRM6qimTHlyVuw 2FZzrR6bgRO1Y/UnDppdFduNtspLV00H3afOzhrNi54Y7m6Bs2Jcadg5URN7zYmVNOeQ exmDNa9yTaWxzPnyaaPD+1J0GbIHWrUlfJ5RhIavl6N1vvt6JjmWcOiYQBJ2BuApYcmS 6y6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jNe5RqnvgfwpMD8CMVhNaP0gfhWk6Tk4UzNtxEfmIWw=; b=WeJistWppwGpdVULbwV7AeggcAxbvAW1owK2kLHLFq/oiIi3jtE7fsiltDrBzFUbTx UpRgap8DkHf2tO9ba5GQgqkWA4eGPr8oIS7xIgyxJs4oQLq1szne2GSb4Wr8A39r+cRr qOAMvEPkdqIqQXvHDiB7lmn7V1s5dZAHphooNQNDHE3+GkFdAcX6tY70f+6/iR55bylh uW4qpfUcC5oW7x2KVQ2+9WTrMey2i3UN7l4eVJp/GrLw3uqUlwr2RyornXbeiTlsn+r/ K8VlYeDvQSnYcrgE6v7f1gursfugm0EUoAAKQOg8WjvpbEHnCwEsS4+/HG2cITBAe+VJ omgA== X-Gm-Message-State: AGi0Pubw2pd7X1evNGjEswvvajGsaq2d1YjSQrDQWjBEAjzpo0bsyFwV 6lMSWKTQOzmnekKrV35agxNkTxYUcVA= X-Google-Smtp-Source: APiQypIs/Z61879SRdQ+s2fn+VTXWrNQ5cJPTBjPHeEQTtAacWWaSbjT5naJo8Yl7UZql6xsmeFukg== X-Received: by 2002:a17:906:310e:: with SMTP id 14mr14750741ejx.177.1588590964268; Mon, 04 May 2020 04:16:04 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([84.203.75.87]) by smtp.gmail.com with ESMTPSA id gf12sm1470894ejb.62.2020.05.04.04.16.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2020 04:16:03 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@arm.com, leif@nuviainc.com, awarkentin@vmware.com, Andrei Warkentin Subject: [edk2-platforms][PATCH 2/3] Platform/RPi/DualSerialPortLib: Fix miniUART serial divisor computation Date: Mon, 4 May 2020 12:15:47 +0100 Message-Id: <20200504111548.11112-3-pete@akeo.ie> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200504111548.11112-1-pete@akeo.ie> References: <20200504111548.11112-1-pete@akeo.ie> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Andrei Warkentin Fix for https://github.com/raspberrypi/firmware/issues/1376. For the Pi 3, to properly configure miniUART, we need the core clock, which can be vary between VideoCore firmare release or config.txt options. Unfortunately, it's painful to get - it's only available via the mailbox interface. Additionally, SerialLib is a very limited environment, even when linked in a DXE-mode component, because as part of a DebugLib implementation it ends being the base prerequisite of everything. That means a "normal" mailbox implementation like the one from RpiFirmwareDxe (with dependencies on DmaLib) is out of the question. Using a basic implementation such as the one in PlatformLib doesn't work either because it operates in both environments with MMU on (DXE phase) and MMU off (SEC/PrePi). Ideally, we read the value via mbox exactly once at boot (PlatformLib), and then somehow stash it. A GUID Hob sounds appropriate, yet when SerialPortLib operates in DXE components, we can't use the HobLib to *locate* the Hob list itself (remember, SerialPortLib initializes before any of HobLib's dependencies, like UeflLib...). FORTUNATELY, there is a way out - we can use PrePeiGetHobList to cut through to the HOB list pointer stashed by PrePi without dealing with any of the libraries meant for DXE. Once we have the Hob list pointer, we can use the regular DXE HobLib routines safely (so long as they are the ones taking a HobList pointer as a parameter). So we can link DualSerialPortLib with whatever HobLib that is appropriate for the environment - just need to also link in PrePiHobListPointerLib. gSerialLibCoreClockFreq is always externally set when DualSerialPortLib run as part of PrePi. So - if gSerialLibCoreClockFreq is not set, then we must be in the DXE phase and can fetch the Hob list via PrePeiGetHobList. The GUID Hob is registered as part of a Pi-customized PlatformPeiLib. For the Pi 4, the situation is a bit different, as the system clock used to compute the baud rate is not derived directly from the core clock, but instead from a fixed clock (current 1 GHz) to which a 12.12 fixed point divisor is applied. But even though we don't use it, we still initialize gSerialLibCoreClockFreq a.k.a. the VPU core frequency, as this can be useful to have. As a result of the above, the PcdSerialClockRate values in the .dsc are also updated, so that it can be used as a fallback to the default core frequency in case of the Pi 3, and as the fixed frequency to which the fixed point divisor is applied in case of the Pi 4. Co-authored-by: Pete Batard Co-authored-by: Andrei Warkentin Signed-off-by: Pete Batard --- Platform/RaspberryPi/Include/Guid/DualSerialPortLibHobGuid.h | 22 ++++ Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.c | 106 +++++++++++++++++--- Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.inf | 6 ++ Platform/RaspberryPi/Library/PlatformLib/AArch64/RaspberryPiHelper.S | 23 +++++ Platform/RaspberryPi/Library/PlatformPeiLib/PlatformPeiLib.c | 33 ++++++ Platform/RaspberryPi/Library/PlatformPeiLib/PlatformPeiLib.inf | 47 +++++++++ Platform/RaspberryPi/RPi3/RPi3.dsc | 8 +- Platform/RaspberryPi/RPi4/RPi4.dsc | 9 +- Platform/RaspberryPi/RaspberryPi.dec | 1 + 9 files changed, 234 insertions(+), 21 deletions(-) diff --git a/Platform/RaspberryPi/Include/Guid/DualSerialPortLibHobGuid.h b/Platform/RaspberryPi/Include/Guid/DualSerialPortLibHobGuid.h new file mode 100644 index 000000000000..82864eb33268 --- /dev/null +++ b/Platform/RaspberryPi/Include/Guid/DualSerialPortLibHobGuid.h @@ -0,0 +1,22 @@ +/** @file +* +* Copyright (c) 2020, Pete Batard +* Copyright (c) 2020, Andrei Warkentin +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#ifndef _DUAL_SERIAL_PORT_LIB_HOB_GUID_H_ +#define _DUAL_SERIAL_PORT_LIB_HOB_GUID_H_ + +#define DUAL_SERIAL_PORT_LIB_HOB_GUID \ + { 0x1CB0EB5B, 0x4F73, 0x4308, { 0xA3, 0x33, 0x1D, 0x95, 0xBE, 0x5F, 0x30, 0xB5 } } + +extern GUID gDualSerialPortLibHobGuid; + +typedef struct { + UINT32 CoreClockFreq; +} DUAL_SERIAL_PORT_LIB_VARS; + +#endif /* _DUAL_SERIAL_PORT_LIB_HOB_GUID_H_ */ diff --git a/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.c b/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.c index 05e12f383785..77b5f586b6c5 100644 --- a/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.c +++ b/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.c @@ -1,6 +1,7 @@ /** @file 16550 and PL011 Serial Port library functions for Raspberry Pi + Copyright (c) 2020, Andrei Warkentin Copyright (c) 2020, Pete Batard Copyright (c) 2018, AMD Incorporated. All rights reserved.
Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
@@ -12,7 +13,8 @@ **/ -#include +#include +#include #include #include #include @@ -21,9 +23,21 @@ #include #include #include +// +// The order of the following includes should not be altered +// +#include +#include +#include -BOOLEAN UsePl011Uart = FALSE; -BOOLEAN UsePl011UartSet = FALSE; +STATIC BOOLEAN UsePl011Uart = FALSE; +STATIC BOOLEAN UsePl011UartSet = FALSE; +UINT32 gSerialLibCoreClockFreq = 0; +// +// Set by ArmPlatformPeiBootAction to skip PrePeiGetHobList, +// as it won't be initialized and could return garbage. +// +UINT32 gSerialLibCoreSkipHob = 0; #define PL011_UART_REGISTER_BASE BCM2836_PL011_UART_BASE_ADDRESS #define MINI_UART_REGISTER_BASE (BCM2836_MINI_UART_BASE_ADDRESS + 0x40) @@ -152,26 +166,86 @@ SerialPortGetDivisor ( UINT32 SerialBaudRate ) { - UINT64 BaseClockRate; - UINT32 Divisor; + UINT64 BaseSerialClockFreq; + UINT32 Divisor; + +#if (RPI_MODEL == 3) + VOID *HobList; + EFI_HOB_GUID_TYPE *GuidHob; + DUAL_SERIAL_PORT_LIB_VARS *Vars; + + // + // For the Pi 3, the base serial clock is the VPU core clock. + // + // Unfortunately, it's painful to get - it's only available via + // the mailbox interface. Additionally, SerialLib is a very + // limited environment, even when linked in a DXE-mode component, because + // as part of a DebugLib implementation it ends being the base prerequisite + // of /everything/. That means a "normal" mailbox implementation like + // the one im RpiFirmwareDxe (with dependencies on DmaLib) is out + // of the question. Using a basic implementation such as the one + // in PlatformLib doesn't work either because operate in both + // environments with MMU on (DXE phase) and MMU off (SEC/PrePi). + // + // Ideally, we read the value via mbox exactly once (PlatformLib), + // then somehow stash it. A GUID Hob sounds pretty nice, but + // we can't use the DXE HobLib to *locate* the Hob list itself + // (remember, SerialPortLib initializes before any of HobLib's + // dependencies, like UeflLib). + // + // FORTUNATELY, there is a way out - we can use PrePeiGetHobList + // to cut through to the HOB list pointer stashed by PrePi without. + // Once we have the Hob list pointer, we can use the DXE HobLib routines + // safely (so long as they are the ones taking a HobList pointer + // as a parameter). + // + // gSerialLibCoreClockFreq is always externally set when we run + // as part of PrePi. So - if gSerialLibCoreClockFreq is not set, + // then we must be in the DXE phase and can fetch the Hob list + // via our little hack. + // + if (gSerialLibCoreClockFreq == 0 && !gSerialLibCoreSkipHob) { + HobList = PrePeiGetHobList (); + if (HobList != NULL) { + GuidHob = (EFI_HOB_GUID_TYPE *) GetNextGuidHob (&gDualSerialPortLibHobGuid, + HobList); + if (GuidHob != NULL) { + Vars = (DUAL_SERIAL_PORT_LIB_VARS *) GET_GUID_HOB_DATA (GuidHob); + gSerialLibCoreClockFreq = Vars->CoreClockFreq; + gSerialLibCoreSkipHob = 1; + } + } + } // - // On the Raspberry Pi, the clock to use for the 16650-compatible UART - // is the base clock divided by the 12.12 fixed point VPU clock divisor. + // Fall back to PCD if we have a nonsensical value. + // + if (gSerialLibCoreClockFreq < 10000000) { + gSerialLibCoreClockFreq = PcdGet32 (PcdSerialClockRate); + } + BaseSerialClockFreq = (UINT64) gSerialLibCoreClockFreq; +#else // - BaseClockRate = (UINT64)PcdGet32 (PcdSerialClockRate) * 4; - Divisor = MmioRead32(BCM2836_CM_BASE + BCM2836_CM_VPU_CLOCK_DIVISOR) & 0xFFFFFF; - if (Divisor != 0) - BaseClockRate = (BaseClockRate << 12) / Divisor; + // For the Pi 4, the base serial clock is not derived from the VPU + // core clock, but from a fixed clock (currently 1 GHz) to which a + // variable 12.12 fixed point clock divisor is applied. + // + BaseSerialClockFreq = (UINT64) PcdGet32 (PcdSerialClockRate); + Divisor = MmioRead32 (BCM2836_CM_BASE + BCM2836_CM_VPU_CLOCK_DIVISOR) & 0xFFFFFF; + if (Divisor != 0) { + BaseSerialClockFreq = (BaseSerialClockFreq << 12) / Divisor; + } +#endif // - // Now calculate divisor for baud generator - // Ref_Clk_Rate / Baud_Rate / 16 + // As per the BCM2xxx datasheets: + // baudrate = system_clock_freq / (8 * (divisor + 1)). // - Divisor = (UINT32)BaseClockRate / (SerialBaudRate * 16); - if (((UINT32)BaseClockRate % (SerialBaudRate * 16)) >= SerialBaudRate * 8) { - Divisor++; + Divisor = (UINT32)BaseSerialClockFreq / (SerialBaudRate * 8); + if (Divisor != 0) { + Divisor--; } + return Divisor; } diff --git a/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.inf b/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.inf index af1e6b026fe6..7430eede18db 100644 --- a/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.inf +++ b/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.inf @@ -22,17 +22,23 @@ [Packages] EmbeddedPkg/EmbeddedPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec + Platform/RaspberryPi/RaspberryPi.dec Silicon/Broadcom/Bcm283x/Bcm283x.dec [LibraryClasses] IoLib + HobLib PcdLib PL011UartClockLib PL011UartLib + PrePiHobListPointerLib [Sources] DualSerialPortLib.c +[Guids] + gDualSerialPortLibHobGuid + [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterAccessWidth ## SOMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio ## CONSUMES diff --git a/Platform/RaspberryPi/Library/PlatformLib/AArch64/RaspberryPiHelper.S b/Platform/RaspberryPi/Library/PlatformLib/AArch64/RaspberryPiHelper.S index 91dfe1bb981e..83a3511d3507 100644 --- a/Platform/RaspberryPi/Library/PlatformLib/AArch64/RaspberryPiHelper.S +++ b/Platform/RaspberryPi/Library/PlatformLib/AArch64/RaspberryPiHelper.S @@ -85,6 +85,16 @@ ASM_FUNC (ArmPlatformPeiBootAction) adr x2, mBoardRevision str w0, [x2] + run .Lclkinfo_buffer + + ldr w0, .Lfrequency + adr x2, gSerialLibCoreClockFreq + str w0, [x2] + adr x2, gSerialLibCoreSkipHob + // + // Any non-zero value will do. + // + str w0, [x2] ret .align 4 @@ -127,6 +137,19 @@ ASM_FUNC (ArmPlatformPeiBootAction) .long 0 // end tag .set .Lrevinfo_size, . - .Lrevinfo_buffer + .align 4 +.Lclkinfo_buffer: + .long .Lclkinfo_size + .long 0x0 + .long RPI_MBOX_GET_CLOCK_RATE + .long 8 // buf size + .long 4 // input len + .long 4 // clock id: 0x04 = Core/VPU +.Lfrequency: + .long 0 // frequency + .long 0 // end tag + .set .Lclkinfo_size, . - .Lclkinfo_buffer + //UINTN //ArmPlatformGetPrimaryCoreMpId ( // VOID diff --git a/Platform/RaspberryPi/Library/PlatformPeiLib/PlatformPeiLib.c b/Platform/RaspberryPi/Library/PlatformPeiLib/PlatformPeiLib.c new file mode 100644 index 000000000000..367a32bd4ca7 --- /dev/null +++ b/Platform/RaspberryPi/Library/PlatformPeiLib/PlatformPeiLib.c @@ -0,0 +1,33 @@ +/** @file +* +* Copyright (c) 2011-2014, ARM Limited. All rights reserved. +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#include + +#include +#include +#include +#include +#include + +extern UINT32 gSerialLibCoreClockFreq, gSerialLibCoreSkipHob; + +static DUAL_SERIAL_PORT_LIB_VARS mUartLibVars; + +EFI_STATUS +EFIAPI +PlatformPeim ( + VOID + ) +{ + BuildFvHob (PcdGet64 (PcdFvBaseAddress), PcdGet32 (PcdFvSize)); + + mUartLibVars.CoreClockFreq = gSerialLibCoreClockFreq; + BuildGuidDataHob (&gDualSerialPortLibHobGuid, &mUartLibVars, sizeof(mUartLibVars)); + + return EFI_SUCCESS; +} diff --git a/Platform/RaspberryPi/Library/PlatformPeiLib/PlatformPeiLib.inf b/Platform/RaspberryPi/Library/PlatformPeiLib/PlatformPeiLib.inf new file mode 100644 index 000000000000..8e2bab14a89a --- /dev/null +++ b/Platform/RaspberryPi/Library/PlatformPeiLib/PlatformPeiLib.inf @@ -0,0 +1,47 @@ +#/** @file +# +# Copyright (c) 2011-2012, ARM Limited. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +#**/ + +[Defines] + INF_VERSION = 0x0001001A + BASE_NAME = ArmPlatformPeiLib + FILE_GUID = 49d37060-70b5-11e0-aa2d-0002a5d5c51b + MODULE_TYPE = SEC + VERSION_STRING = 1.0 + LIBRARY_CLASS = PlatformPeiLib + +[Sources] + PlatformPeiLib.c + +[Packages] + ArmPkg/ArmPkg.dec + ArmPlatformPkg/ArmPlatformPkg.dec + MdePkg/MdePkg.dec + EmbeddedPkg/EmbeddedPkg.dec + MdeModulePkg/MdeModulePkg.dec + Platform/RaspberryPi/RaspberryPi.dec + +[LibraryClasses] + ArmPlatformLib + DebugLib + HobLib + +[Guids] + gDualSerialPortLibHobGuid + +[Ppis] + gEfiPeiMasterBootModePpiGuid # PPI ALWAYS_PRODUCED + gEfiPeiBootInRecoveryModePpiGuid # PPI SOMETIMES_PRODUCED + +[FixedPcd] + gArmTokenSpaceGuid.PcdFdBaseAddress + gArmTokenSpaceGuid.PcdFdSize + gArmTokenSpaceGuid.PcdFvBaseAddress + gArmTokenSpaceGuid.PcdFvSize + +[Depex] + TRUE diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3/RPi3.dsc index 563fb891b841..efebf1f823b3 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -77,6 +77,10 @@ [LibraryClasses.common] UefiLib|MdePkg/Library/UefiLib/UefiLib.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf + # + # PrePiHobListPointerLib is necessary for DualSerialPortLib. + # + PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf @@ -174,7 +178,7 @@ [LibraryClasses.common.SEC] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf MemoryInitPeiLib|Platform/RaspberryPi/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf - PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf + PlatformPeiLib|Platform/RaspberryPi/Library/PlatformPeiLib/PlatformPeiLib.inf ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf LzmaDecompressLib|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf @@ -409,7 +413,7 @@ [PcdsFixedAtBuild.common] gArmPlatformTokenSpaceGuid.PL011UartClkInHz|48000000 gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride|4 - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate|500000000 + gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate|250000000 gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl|0x27 gEfiMdeModulePkgTokenSpaceGuid.PcdSerialExtendedTxFifoSize|8 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200 diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4/RPi4.dsc index 4deccd9d3ecc..4dc9b493cf79 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -75,6 +75,10 @@ [LibraryClasses.common] UefiLib|MdePkg/Library/UefiLib/UefiLib.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf + # + # PrePiHobListPointerLib is necessary for DualSerialPortLib. + # + PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf @@ -182,12 +186,11 @@ [LibraryClasses.common.SEC] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf MemoryInitPeiLib|Platform/RaspberryPi/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf - PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf + PlatformPeiLib|Platform/RaspberryPi/Library/PlatformPeiLib/PlatformPeiLib.inf ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf LzmaDecompressLib|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf - PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf [LibraryClasses.common.DXE_CORE] @@ -420,7 +423,7 @@ [PcdsFixedAtBuild.common] gArmPlatformTokenSpaceGuid.PL011UartClkInHz|48000000 gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride|4 - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate|500000000 + gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate|1000000000 gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl|0x27 gEfiMdeModulePkgTokenSpaceGuid.PcdSerialExtendedTxFifoSize|8 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200 diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/RaspberryPi.dec index 66ef6186644b..a915387fc822 100644 --- a/Platform/RaspberryPi/RaspberryPi.dec +++ b/Platform/RaspberryPi/RaspberryPi.dec @@ -26,6 +26,7 @@ [Guids] gRaspberryPiTokenSpaceGuid = {0xCD7CC258, 0x31DB, 0x11E6, {0x9F, 0xD3, 0x63, 0xB0, 0xB8, 0xEE, 0xD6, 0xB5}} gRaspberryPiEventResetGuid = {0xCD7CC258, 0x31DB, 0x11E6, {0x9F, 0xD3, 0x63, 0xB4, 0xB4, 0xE4, 0xD4, 0xB4}} gConfigDxeFormSetGuid = {0xCD7CC258, 0x31DB, 0x22E6, {0x9F, 0x22, 0x63, 0xB0, 0xB8, 0xEE, 0xD6, 0xB5}} + gDualSerialPortLibHobGuid = { 0x1CB0EB5B, 0x4F73, 0x4308, { 0xA3, 0x33, 0x1D, 0x95, 0xBE, 0x5F, 0x30, 0xB5 } } [PcdsFixedAtBuild.common] # -- 2.21.0.windows.1