From: Evan Lloyd Date: Wed, 15 Jun 2016 12:52:42 +0000 (+0100) Subject: ArmVirtPkg/FdtPL011SerialPortLib: Set the PL011 UART clock rate X-Git-Tag: edk2-stable201903~6850 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=090916d8bc8962d191e67cba24bfe46ad1cc892a;p=mirror_edk2.git ArmVirtPkg/FdtPL011SerialPortLib: Set the PL011 UART clock rate The interface to PL011UartInitializePort has changed in ArmPlatformPkg/Drivers/PL011Uart with the title: "ArmPlatformPkg: Add support to configure PL011 UART clock" This patch updates the calls to PL011UartInitializePort(), in line with that change, adding a parameter value using the PCD previously used directly by the driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sami Mujawar Signed-off-by: Evan Lloyd Reviewed-by: Laszlo Ersek --- diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c index 72b47652b6..c458abb622 100644 --- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c +++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c @@ -112,7 +112,13 @@ SerialPortGetBaseAddress ( Status = PL011UartInitializePort ( UartBase, - &BaudRate, &ReceiveFifoDepth, &Parity, &DataBits, &StopBits); + FixedPcdGet32 (PL011UartClkInHz), + &BaudRate, + &ReceiveFifoDepth, + &Parity, + &DataBits, + &StopBits + ); if (!EFI_ERROR (Status)) { return UartBase; } diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf index cb2766b378..bfd7142cc5 100644 --- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf +++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf @@ -44,3 +44,4 @@ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits + gArmPlatformTokenSpaceGuid.PL011UartClkInHz diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c index b73ab8f48a..48a0530dcc 100644 --- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c +++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c @@ -81,8 +81,14 @@ FdtPL011SerialPortLibInitialize ( StopBits = (EFI_STOP_BITS_TYPE) PcdGet8 (PcdUartDefaultStopBits); return PL011UartInitializePort ( - mSerialBaseAddress, &BaudRate, &ReceiveFifoDepth, - &Parity, &DataBits, &StopBits); + mSerialBaseAddress, + FixedPcdGet32 (PL011UartClkInHz), + &BaudRate, + &ReceiveFifoDepth, + &Parity, + &DataBits, + &StopBits + ); } /** diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf index 3bacd641f0..0b06797293 100644 --- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf +++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf @@ -43,6 +43,7 @@ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits + gArmPlatformTokenSpaceGuid.PL011UartClkInHz [Guids] gEarlyPL011BaseAddressGuid