]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/PL011SerialPortLib: use untyped PCD for register base
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 17 Dec 2018 18:51:45 +0000 (19:51 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 20 Dec 2018 17:34:08 +0000 (18:34 +0100)
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>
ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c
ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf

index 212991d638593d2c8370ab2e93d1122f23192558..d576f79c3e6e045ef2f59ea3a827ebe7d1063bd7 100644 (file)
@@ -48,7 +48,7 @@ SerialPortInitialize (
   StopBits = (EFI_STOP_BITS_TYPE) FixedPcdGet8 (PcdUartDefaultStopBits);\r
 \r
   return PL011UartInitializePort (\r
-           (UINTN)FixedPcdGet64 (PcdSerialRegisterBase),\r
+           (UINTN)PcdGet64 (PcdSerialRegisterBase),\r
            PL011UartClockGetFreq(),\r
            &BaudRate,\r
            &ReceiveFifoDepth,\r
@@ -75,7 +75,7 @@ SerialPortWrite (
   IN UINTN     NumberOfBytes\r
   )\r
 {\r
-  return PL011UartWrite ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);\r
+  return PL011UartWrite ((UINTN)PcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);\r
 }\r
 \r
 /**\r
@@ -95,7 +95,7 @@ SerialPortRead (
   IN  UINTN     NumberOfBytes\r
 )\r
 {\r
-  return PL011UartRead ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);\r
+  return PL011UartRead ((UINTN)PcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);\r
 }\r
 \r
 /**\r
@@ -111,7 +111,7 @@ SerialPortPoll (
   VOID\r
   )\r
 {\r
-  return PL011UartPoll ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase));\r
+  return PL011UartPoll ((UINTN)PcdGet64 (PcdSerialRegisterBase));\r
 }\r
 /**\r
   Set new attributes to PL011.\r
@@ -156,7 +156,7 @@ SerialPortSetAttributes (
   )\r
 {\r
   return PL011UartInitializePort (\r
-           (UINTN)FixedPcdGet64 (PcdSerialRegisterBase),\r
+           (UINTN)PcdGet64 (PcdSerialRegisterBase),\r
            PL011UartClockGetFreq(),\r
            BaudRate,\r
            ReceiveFifoDepth,\r
@@ -198,7 +198,7 @@ SerialPortSetControl (
   IN UINT32  Control\r
   )\r
 {\r
-  return PL011UartSetControl ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Control);\r
+  return PL011UartSetControl ((UINTN)PcdGet64 (PcdSerialRegisterBase), Control);\r
 }\r
 \r
 /**\r
@@ -239,5 +239,5 @@ SerialPortGetControl (
   OUT UINT32  *Control\r
   )\r
 {\r
-  return PL011UartGetControl ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Control);\r
+  return PL011UartGetControl ((UINTN)PcdGet64 (PcdSerialRegisterBase), Control);\r
 }\r
index 5ce5b2f5304c3ab56d50eb9d00c707a6c4d253fc..bca7bed875c6fe0ca4a38befd9b76686baea3b7a 100644 (file)
   MdeModulePkg/MdeModulePkg.dec\r
   ArmPlatformPkg/ArmPlatformPkg.dec\r
 \r
-[FixedPcd]\r
+[Pcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase\r
+\r
+[FixedPcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity\r