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
UINT8 DataBits;\r
EFI_STOP_BITS_TYPE StopBits;\r
\r
- BaudRate = (UINTN)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
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
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
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
)\r
{\r
return PL011UartInitializePort (\r
- (UINTN)FixedPcdGet64 (PcdSerialRegisterBase),\r
- FixedPcdGet32 (PL011UartClkInHz),\r
+ (UINTN)PcdGet64 (PcdSerialRegisterBase),\r
+ PL011UartClockGetFreq (),\r
BaudRate,\r
ReceiveFifoDepth,\r
Parity,\r
IN UINT32 Control\r
)\r
{\r
- return PL011UartSetControl ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Control);\r
+ return PL011UartSetControl ((UINTN)PcdGet64 (PcdSerialRegisterBase), Control);\r
}\r
\r
/**\r
OUT UINT32 *Control\r
)\r
{\r
- return PL011UartGetControl ((UINTN)FixedPcdGet64 (PcdSerialRegisterBase), Control);\r
+ return PL011UartGetControl ((UINTN)PcdGet64 (PcdSerialRegisterBase), Control);\r
}\r