summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg/Library/PL011SerialPortLib
diff options
context:
space:
mode:
authorEvan Lloyd <evan.lloyd@arm.com>2016-06-15 13:52:39 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-06-15 16:15:19 +0200
commitaadc64e6a15a4a71339c393a0eb01587cfbd5eb7 (patch)
tree308910a953c5227894895d4210ef922335283b8d /ArmPlatformPkg/Library/PL011SerialPortLib
parent9f08a052a3e48295b19da20995a6cab23d31e8cf (diff)
downloadedk2-aadc64e6a15a4a71339c393a0eb01587cfbd5eb7.tar.gz
edk2-aadc64e6a15a4a71339c393a0eb01587cfbd5eb7.tar.bz2
edk2-aadc64e6a15a4a71339c393a0eb01587cfbd5eb7.zip
ArmPlatformPkg: Update PL011 Serial PCDs to Fixed PCDs
The PCDs used in the PL011 UART Driver and Serial Port Library are inherently "fixed at build". This change updates the source to use Fixed PCDs for these values. This improves clarity and efficiency. 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> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
Diffstat (limited to 'ArmPlatformPkg/Library/PL011SerialPortLib')
-rw-r--r--ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c22
-rw-r--r--ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf4
2 files changed, 13 insertions, 13 deletions
diff --git a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c
index 3b5f1edf68..015f6fbb71 100644
--- a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c
+++ b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c
@@ -43,14 +43,14 @@ SerialPortInitialize (
UINT8 DataBits;
EFI_STOP_BITS_TYPE StopBits;
- BaudRate = (UINTN)PcdGet64 (PcdUartDefaultBaudRate);
+ BaudRate = (UINTN)FixedPcdGet64 (PcdUartDefaultBaudRate);
ReceiveFifoDepth = 0; // Use default FIFO depth
- Parity = (EFI_PARITY_TYPE)PcdGet8 (PcdUartDefaultParity);
- DataBits = PcdGet8 (PcdUartDefaultDataBits);
- StopBits = (EFI_STOP_BITS_TYPE) PcdGet8 (PcdUartDefaultStopBits);
+ Parity = (EFI_PARITY_TYPE)FixedPcdGet8 (PcdUartDefaultParity);
+ DataBits = FixedPcdGet8 (PcdUartDefaultDataBits);
+ StopBits = (EFI_STOP_BITS_TYPE) FixedPcdGet8 (PcdUartDefaultStopBits);
return PL011UartInitializePort (
- (UINTN)PcdGet64 (PcdSerialRegisterBase),
+ (UINTN)FixedPcdGet64 (PcdSerialRegisterBase),
&BaudRate,
&ReceiveFifoDepth,
&Parity,
@@ -76,7 +76,7 @@ SerialPortWrite (
IN UINTN NumberOfBytes
)
{
- return PL011UartWrite ((UINTN)PcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);
+ return PL011UartWrite ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);
}
/**
@@ -96,7 +96,7 @@ SerialPortRead (
IN UINTN NumberOfBytes
)
{
- return PL011UartRead ((UINTN)PcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);
+ return PL011UartRead ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);
}
/**
@@ -113,7 +113,7 @@ SerialPortPoll (
VOID
)
{
- return PL011UartPoll ((UINTN)PcdGet64 (PcdSerialRegisterBase));
+ return PL011UartPoll ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase));
}
/**
Set new attributes to PL011.
@@ -158,7 +158,7 @@ SerialPortSetAttributes (
)
{
return PL011UartInitializePort (
- (UINTN)PcdGet64 (PcdSerialRegisterBase),
+ (UINTN)FixedPcdGet64 (PcdSerialRegisterBase),
BaudRate,
ReceiveFifoDepth,
Parity,
@@ -199,7 +199,7 @@ SerialPortSetControl (
IN UINT32 Control
)
{
- return PL011UartSetControl ((UINTN)PcdGet64 (PcdSerialRegisterBase), Control);
+ return PL011UartSetControl ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Control);
}
/**
@@ -240,5 +240,5 @@ SerialPortGetControl (
OUT UINT32 *Control
)
{
- return PL011UartGetControl ((UINTN)PcdGet64 (PcdSerialRegisterBase), Control);
+ return PL011UartGetControl ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Control);
}
diff --git a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf
index 3a950d0788..653c0b2dfc 100644
--- a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf
+++ b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf
@@ -2,7 +2,7 @@
#
# Component description file for PL011SerialPortLib module
#
-# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>
+# Copyright (c) 2011-2016, ARM Ltd. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -35,7 +35,7 @@
MdeModulePkg/MdeModulePkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
-[Pcd]
+[FixedPcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits