]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c
PcAtChipsetPkg: Fix spelling errors
[mirror_edk2.git] / PcAtChipsetPkg / Library / SerialIoLib / SerialPortLib.c
index dcb43fac6234002aaf818e80616fcfc159211362..25c4cefc1381bac9907a89e1e440e81179e4f971 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   UART Serial Port library functions\r
 \r
-  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\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
+  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -58,11 +52,11 @@ UINT8   gBreakSet = 0;
 \r
 /**\r
   Initialize the serial device hardware.\r
-  \r
+\r
   If no initialization is required, then return RETURN_SUCCESS.\r
   If the serial device was successfully initialized, then return RETURN_SUCCESS.\r
   If the serial device could not be initialized, then return RETURN_DEVICE_ERROR.\r
-  \r
+\r
   @retval RETURN_SUCCESS        The serial device was initialized.\r
   @retval RETURN_DEVICE_ERROR   The serail device could not be initialized.\r
 \r
@@ -86,36 +80,36 @@ SerialPortInitialize (
   // Calculate divisor for baud generator\r
   //\r
   Divisor = 115200 / gBps;\r
-  \r
+\r
   //\r
   // Set communications format\r
   //\r
   OutputData = (UINT8) ((DLAB << 7) | (gBreakSet << 6) | (gParity << 3) | (gStop << 2) | Data);\r
-  IoWrite8 ((UINTN) (gUartBase + LCR_OFFSET), OutputData);\r
+  IoWrite8 (gUartBase + LCR_OFFSET, OutputData);\r
 \r
   //\r
   // Configure baud rate\r
   //\r
-  IoWrite8 ((UINTN) (gUartBase + BAUD_HIGH_OFFSET), (UINT8) (Divisor >> 8));\r
-  IoWrite8 ((UINTN) (gUartBase + BAUD_LOW_OFFSET), (UINT8) (Divisor & 0xff));\r
+  IoWrite8 (gUartBase + BAUD_HIGH_OFFSET, (UINT8) (Divisor >> 8));\r
+  IoWrite8 (gUartBase + BAUD_LOW_OFFSET, (UINT8) (Divisor & 0xff));\r
 \r
   //\r
   // Switch back to bank 0\r
   //\r
-  OutputData = (UINT8) ((~DLAB << 7) | (gBreakSet << 6) | (gParity << 3) | (gStop << 2) | Data);\r
-  IoWrite8 ((UINTN) (gUartBase + LCR_OFFSET), OutputData);\r
+  OutputData = (UINT8) ( (gBreakSet << 6) | (gParity << 3) | (gStop << 2) | Data);\r
+  IoWrite8 (gUartBase + LCR_OFFSET, OutputData);\r
 \r
   return RETURN_SUCCESS;\r
 }\r
 \r
 /**\r
-  Write data from buffer to serial device. \r
\r
-  Writes NumberOfBytes data bytes from Buffer to the serial device.  \r
+  Write data from buffer to serial device.\r
+\r
+  Writes NumberOfBytes data bytes from Buffer to the serial device.\r
   The number of bytes actually written to the serial device is returned.\r
   If the return value is less than NumberOfBytes, then the write operation failed.\r
 \r
-  If Buffer is NULL, then ASSERT(). \r
+  If Buffer is NULL, then ASSERT().\r
 \r
   If NumberOfBytes is zero, then return 0.\r
 \r
@@ -123,7 +117,7 @@ SerialPortInitialize (
   @param  NumberOfBytes    Number of bytes to written to the serial device.\r
 \r
   @retval 0                NumberOfBytes is 0.\r
-  @retval >0               The number of bytes written to the serial device.  \r
+  @retval >0               The number of bytes written to the serial device.\r
                            If this value is less than NumberOfBytes, then the write operation failed.\r
 \r
 **/\r
@@ -164,7 +158,7 @@ SerialPortWrite (
   @param  NumberOfBytes    Number of bytes to read from the serial device.\r
 \r
   @retval 0                NumberOfBytes is 0.\r
-  @retval >0               The number of bytes read from the serial device.  \r
+  @retval >0               The number of bytes read from the serial device.\r
                            If this value is less than NumberOfBytes, then the read operation failed.\r
 \r
 **/\r
@@ -201,7 +195,7 @@ SerialPortRead (
 /**\r
   Polls a serial device to see if there is any data waiting to be read.\r
 \r
-  Polls aserial device to see if there is any data waiting to be read.\r
+  Polls a serial device to see if there is any data waiting to be read.\r
   If there is data waiting to be read from the serial device, then TRUE is returned.\r
   If there is no data waiting to be read from the serial device, then FALSE is returned.\r
 \r
@@ -345,13 +339,13 @@ SerialPortGetControl (
 }\r
 \r
 /**\r
-  Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,\r
+  Sets the baud rate, receive FIFO depth, transmit/receive time out, parity,\r
   data bits, and stop bits on a serial device.\r
 \r
   @param BaudRate           The requested baud rate. A BaudRate value of 0 will use the\r
                             device's default interface speed.\r
                             On output, the value actually set.\r
-  @param ReveiveFifoDepth   The requested depth of the FIFO on the receive side of the\r
+  @param ReceiveFifoDepth   The requested depth of the FIFO on the receive side of the\r
                             serial interface. A ReceiveFifoDepth value of 0 will use\r
                             the device's default FIFO depth.\r
                             On output, the value actually set.\r
@@ -364,7 +358,7 @@ SerialPortGetControl (
                             DefaultParity will use the device's default parity value.\r
                             On output, the value actually set.\r
   @param DataBits           The number of data bits to use on the serial device. A DataBits\r
-                            vaule of 0 will use the device's default data bit setting.\r
+                            value of 0 will use the device's default data bit setting.\r
                             On output, the value actually set.\r
   @param StopBits           The number of stop bits to use on this serial device. A StopBits\r
                             value of DefaultStopBits will use the device's default number of\r
@@ -470,19 +464,19 @@ SerialPortSetAttributes (
   // Set communications format\r
   //\r
   OutputData = (UINT8) ((DLAB << 7) | (gBreakSet << 6) | (LcrParity << 3) | (LcrStop << 2) | LcrData);\r
-  IoWrite8 ((UINTN) (gUartBase + LCR_OFFSET), OutputData);\r
+  IoWrite8 (gUartBase + LCR_OFFSET, OutputData);\r
 \r
   //\r
   // Configure baud rate\r
   //\r
-  IoWrite8 ((UINTN) (gUartBase + BAUD_HIGH_OFFSET), (UINT8) (Divisor >> 8));\r
-  IoWrite8 ((UINTN) (gUartBase + BAUD_LOW_OFFSET), (UINT8) (Divisor & 0xff));\r
+  IoWrite8 (gUartBase + BAUD_HIGH_OFFSET, (UINT8) (Divisor >> 8));\r
+  IoWrite8 (gUartBase + BAUD_LOW_OFFSET, (UINT8) (Divisor & 0xff));\r
 \r
   //\r
   // Switch back to bank 0\r
   //\r
-  OutputData = (UINT8) ((~DLAB << 7) | (gBreakSet << 6) | (LcrParity << 3) | (LcrStop << 2) | LcrData);\r
-  IoWrite8 ((UINTN) (gUartBase + LCR_OFFSET), OutputData);\r
+  OutputData = (UINT8) ((gBreakSet << 6) | (LcrParity << 3) | (LcrStop << 2) | LcrData);\r
+  IoWrite8 (gUartBase + LCR_OFFSET, OutputData);\r
 \r
   return RETURN_SUCCESS;\r
 }\r