]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c
ArmPlatformPkg: Apply uncrustify changes
[mirror_edk2.git] / ArmPlatformPkg / Library / PL011SerialPortLib / PL011SerialPortLib.c
index 571d0618c379a79dff6630fb606ba14281de73c4..ae329c3f839b9d8833c01237ae898063ddbdf65f 100644 (file)
@@ -5,13 +5,7 @@
   Copyright (c) 2012 - 2016, ARM Ltd. All rights reserved.<BR>\r
   Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
 \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
 \r
 #include <Library/IoLib.h>\r
 #include <Library/PcdLib.h>\r
+#include <Library/PL011UartClockLib.h>\r
+#include <Library/PL011UartLib.h>\r
 #include <Library/SerialPortLib.h>\r
 \r
-#include <Drivers/PL011Uart.h>\r
-\r
 /** Initialise the serial device hardware with default settings.\r
 \r
   @retval RETURN_SUCCESS            The serial device was initialised.\r
@@ -41,15 +35,15 @@ SerialPortInitialize (
   UINT8               DataBits;\r
   EFI_STOP_BITS_TYPE  StopBits;\r
 \r
-  BaudRate = FixedPcdGet64 (PcdUartDefaultBaudRate);\r
+  BaudRate         = FixedPcdGet64 (PcdUartDefaultBaudRate);\r
   ReceiveFifoDepth = 0;         // Use default FIFO depth\r
-  Parity = (EFI_PARITY_TYPE)FixedPcdGet8 (PcdUartDefaultParity);\r
-  DataBits = FixedPcdGet8 (PcdUartDefaultDataBits);\r
-  StopBits = (EFI_STOP_BITS_TYPE) FixedPcdGet8 (PcdUartDefaultStopBits);\r
+  Parity           = (EFI_PARITY_TYPE)FixedPcdGet8 (PcdUartDefaultParity);\r
+  DataBits         = FixedPcdGet8 (PcdUartDefaultDataBits);\r
+  StopBits         = (EFI_STOP_BITS_TYPE)FixedPcdGet8 (PcdUartDefaultStopBits);\r
 \r
   return PL011UartInitializePort (\r
-           (UINTN)FixedPcdGet64 (PcdSerialRegisterBase),\r
-           FixedPcdGet32 (PL011UartClkInHz),\r
+           (UINTN)PcdGet64 (PcdSerialRegisterBase),\r
+           PL011UartClockGetFreq (),\r
            &BaudRate,\r
            &ReceiveFifoDepth,\r
            &Parity,\r
@@ -71,11 +65,11 @@ SerialPortInitialize (
 UINTN\r
 EFIAPI\r
 SerialPortWrite (\r
-  IN UINT8     *Buffer,\r
-  IN UINTN     NumberOfBytes\r
+  IN UINT8  *Buffer,\r
+  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
@@ -91,11 +85,11 @@ SerialPortWrite (
 UINTN\r
 EFIAPI\r
 SerialPortRead (\r
-  OUT UINT8     *Buffer,\r
-  IN  UINTN     NumberOfBytes\r
-)\r
+  OUT UINT8  *Buffer,\r
+  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,8 +105,9 @@ SerialPortPoll (
   VOID\r
   )\r
 {\r
-  return PL011UartPoll ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase));\r
+  return PL011UartPoll ((UINTN)PcdGet64 (PcdSerialRegisterBase));\r
 }\r
+\r
 /**\r
   Set new attributes to PL011.\r
 \r
@@ -156,8 +151,8 @@ SerialPortSetAttributes (
   )\r
 {\r
   return PL011UartInitializePort (\r
-           (UINTN)FixedPcdGet64 (PcdSerialRegisterBase),\r
-           FixedPcdGet32 (PL011UartClkInHz),\r
+           (UINTN)PcdGet64 (PcdSerialRegisterBase),\r
+           PL011UartClockGetFreq (),\r
            BaudRate,\r
            ReceiveFifoDepth,\r
            Parity,\r
@@ -198,7 +193,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 +234,5 @@ SerialPortGetControl (
   OUT UINT32  *Control\r
   )\r
 {\r
-  return PL011UartGetControl ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Control);\r
+  return PL011UartGetControl ((UINTN)PcdGet64 (PcdSerialRegisterBase), Control);\r
 }\r