summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/Library/FdtPL011SerialPortLib
diff options
context:
space:
mode:
authorEvan Lloyd <evan.lloyd@arm.com>2016-06-15 13:52:42 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-06-15 16:16:43 +0200
commit090916d8bc8962d191e67cba24bfe46ad1cc892a (patch)
treed577f24c99403acb52edf45328e84e9de98ad422 /ArmVirtPkg/Library/FdtPL011SerialPortLib
parentf63005282cc59f76b050c0be0813345cf7d54171 (diff)
downloadedk2-090916d8bc8962d191e67cba24bfe46ad1cc892a.tar.gz
edk2-090916d8bc8962d191e67cba24bfe46ad1cc892a.tar.bz2
edk2-090916d8bc8962d191e67cba24bfe46ad1cc892a.zip
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 <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'ArmVirtPkg/Library/FdtPL011SerialPortLib')
-rw-r--r--ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c8
-rw-r--r--ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf1
-rw-r--r--ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c10
-rw-r--r--ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.inf1
4 files changed, 17 insertions, 3 deletions
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