diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2018-12-17 19:51:45 +0100 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2018-12-20 18:34:08 +0100 |
commit | 5a9b3eb8e5fbbc0a49f80630039d58712aacfab8 (patch) | |
tree | e22d21929250c3b68c98cc20a6a2cee7935c21fd /ArmPlatformPkg/Library/PL011SerialPortLib | |
parent | 6f42f9a54bf0d796940bc9af6956157ef3e90c3e (diff) | |
download | edk2-5a9b3eb8e5fbbc0a49f80630039d58712aacfab8.zip edk2-5a9b3eb8e5fbbc0a49f80630039d58712aacfab8.tar.gz edk2-5a9b3eb8e5fbbc0a49f80630039d58712aacfab8.tar.bz2 |
ArmPlatformPkg/PL011SerialPortLib: use untyped PCD for register base
Use an untyped PCD reference for PcdSerialRegisterBase, so that the
library gets built without hardcoded values, permitting modules to
override the default serial port. This allows SerialDxe to use a
different serial port from the one used for DEBUG output (which
often gets occluded due to the console driver clearing the screen).
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPlatformPkg/Library/PL011SerialPortLib')
-rw-r--r-- | ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c | 14 | ||||
-rw-r--r-- | ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf | 4 |
2 files changed, 10 insertions, 8 deletions
diff --git a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c index 212991d..d576f79 100644 --- a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c +++ b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c @@ -48,7 +48,7 @@ SerialPortInitialize ( StopBits = (EFI_STOP_BITS_TYPE) FixedPcdGet8 (PcdUartDefaultStopBits);
return PL011UartInitializePort (
- (UINTN)FixedPcdGet64 (PcdSerialRegisterBase),
+ (UINTN)PcdGet64 (PcdSerialRegisterBase),
PL011UartClockGetFreq(),
&BaudRate,
&ReceiveFifoDepth,
@@ -75,7 +75,7 @@ SerialPortWrite ( IN UINTN NumberOfBytes
)
{
- return PL011UartWrite ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);
+ return PL011UartWrite ((UINTN)PcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);
}
/**
@@ -95,7 +95,7 @@ SerialPortRead ( IN UINTN NumberOfBytes
)
{
- return PL011UartRead ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);
+ return PL011UartRead ((UINTN)PcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);
}
/**
@@ -111,7 +111,7 @@ SerialPortPoll ( VOID
)
{
- return PL011UartPoll ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase));
+ return PL011UartPoll ((UINTN)PcdGet64 (PcdSerialRegisterBase));
}
/**
Set new attributes to PL011.
@@ -156,7 +156,7 @@ SerialPortSetAttributes ( )
{
return PL011UartInitializePort (
- (UINTN)FixedPcdGet64 (PcdSerialRegisterBase),
+ (UINTN)PcdGet64 (PcdSerialRegisterBase),
PL011UartClockGetFreq(),
BaudRate,
ReceiveFifoDepth,
@@ -198,7 +198,7 @@ SerialPortSetControl ( IN UINT32 Control
)
{
- return PL011UartSetControl ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Control);
+ return PL011UartSetControl ((UINTN)PcdGet64 (PcdSerialRegisterBase), Control);
}
/**
@@ -239,5 +239,5 @@ SerialPortGetControl ( OUT UINT32 *Control
)
{
- return PL011UartGetControl ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Control);
+ return PL011UartGetControl ((UINTN)PcdGet64 (PcdSerialRegisterBase), Control);
}
diff --git a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf index 5ce5b2f..bca7bed 100644 --- a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf +++ b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf @@ -36,8 +36,10 @@ MdeModulePkg/MdeModulePkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
-[FixedPcd]
+[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+
+[FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
|