]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/BaseSerialPortLib16550: Support UARTs with a register stride greater than...
authorMichael Kinney <michael.d.kinney@intel.com>
Mon, 27 Apr 2015 19:44:40 +0000 (19:44 +0000)
committermdkinney <mdkinney@Edk2>
Mon, 27 Apr 2015 19:44:40 +0000 (19:44 +0000)
Add stride PCD to MdeModulePkg to support 16550 UARTs with a register stride that is not 1 byte.
The default value is 1 byte.
Quark SoC uses a stride of 4 bytes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17215 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/MdeModulePkg.uni

index abf4f8f26a8e58e9e5c414fdb1da3ccda20f59dc..3209115a3f88f5cc46433f4ad79ac30c8849dfa8 100644 (file)
@@ -2,7 +2,7 @@
   16550 UART Serial Port library functions\r
 \r
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, 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
@@ -77,9 +77,9 @@ SerialPortReadRegister (
   )\r
 {\r
   if (PcdGetBool (PcdSerialUseMmio)) {\r
-    return MmioRead8 (Base + Offset);\r
+    return MmioRead8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride));\r
   } else {\r
-    return IoRead8 (Base + Offset);\r
+    return IoRead8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride));\r
   }\r
 }\r
 \r
@@ -104,9 +104,9 @@ SerialPortWriteRegister (
   )\r
 {\r
   if (PcdGetBool (PcdSerialUseMmio)) {\r
-    return MmioWrite8 (Base + Offset, Value);\r
+    return MmioWrite8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride), Value);\r
   } else {\r
-    return IoWrite8 (Base + Offset, Value);\r
+    return IoWrite8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride), Value);\r
   }\r
 }\r
 \r
index ebbfa6e9a29cf82c6403d44e2c8d8d508fc8e063..bb42f89676de484f751817772bfa5b1835364870 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  SerialPortLib instance for 16550 UART.\r
 #\r
-#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2015, 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
@@ -18,7 +18,7 @@
   MODULE_UNI_FILE                = BaseSerialPortLib16550.uni\r
   FILE_GUID                      = 9E7C00CF-355A-4d4e-BF60-0428CFF95540\r
   MODULE_TYPE                    = BASE\r
-  VERSION_STRING                 = 1.0\r
+  VERSION_STRING                 = 1.1\r
   LIBRARY_CLASS                  = SerialPortLib\r
 \r
 [Packages]\r
@@ -42,6 +42,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate                ## CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialLineControl             ## CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl             ## CONSUMES\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate                  ## CONSUMES\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialPciDeviceInfo              ## CONSUMES\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialExtendedTxFifoSize         ## CONSUMES\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate               ## CONSUMES\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialPciDeviceInfo           ## CONSUMES\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialExtendedTxFifoSize      ## CONSUMES\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride          ## CONSUMES\r
index a6309b8866cdd8a8b86fc9d7a05fee1fbf33dc11..421c6977abeda7de8c5d8f4e05f277fbf5eedac4 100644 (file)
@@ -20,7 +20,7 @@
   PACKAGE_NAME                   = MdeModulePkg\r
   PACKAGE_UNI_FILE               = MdeModulePkg.uni\r
   PACKAGE_GUID                   = BA0D78D6-2CAF-414b-BD4D-B6762A894288\r
-  PACKAGE_VERSION                = 0.94\r
+  PACKAGE_VERSION                = 0.96\r
 \r
 [Includes]\r
   Include\r
   # @Prompt Serial Port Extended Transmit FIFO Size in Bytes\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialExtendedTxFifoSize|64|UINT32|0x00010068\r
   \r
+  ## The number of bytes between registers in serial device.  The default is 1 byte.\r
+  # @Prompt Serial Port Register Stride in Bytes\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride|1|UINT32|0x0001006B\r
+  \r
 [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]\r
   ## This PCD defines the Console output row. The default value is 25 according to UEFI spec.\r
   #  This PCD could be set to 0 then console output would be at max column and max row.\r
index 1aab112223d928e103a2ad90c3f6ba9225fcbafa..add9a51e565eda75e20ae3035f8993a7820acb20 100644 (file)
Binary files a/MdeModulePkg/MdeModulePkg.uni and b/MdeModulePkg/MdeModulePkg.uni differ