]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
MdePkg/BaseSerialPortLib16550: Support UARTs with a register stride greater than...
[mirror_edk2.git] / MdeModulePkg / Library / BaseSerialPortLib16550 / BaseSerialPortLib16550.c
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