summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
diff options
context:
space:
mode:
authorMichael Kinney <michael.d.kinney@intel.com>2015-04-27 19:44:40 +0000
committermdkinney <mdkinney@Edk2>2015-04-27 19:44:40 +0000
commitcd68e4a8de23e8992a98c281f6fda229ffad19c9 (patch)
tree5fca8329a9e1840d18fcd2d43a11e83df4bc7bc6 /MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
parentcfe41b57abb8ba26e4bd1c0b09c8b3506a7c55df (diff)
downloadedk2-platforms-cd68e4a8de23e8992a98c281f6fda229ffad19c9.tar.xz
MdePkg/BaseSerialPortLib16550: Support UARTs with a register stride greater than 1 byte.
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
Diffstat (limited to 'MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c')
-rw-r--r--MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
index abf4f8f26a..3209115a3f 100644
--- a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
+++ b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
@@ -2,7 +2,7 @@
16550 UART Serial Port library functions
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -77,9 +77,9 @@ SerialPortReadRegister (
)
{
if (PcdGetBool (PcdSerialUseMmio)) {
- return MmioRead8 (Base + Offset);
+ return MmioRead8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride));
} else {
- return IoRead8 (Base + Offset);
+ return IoRead8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride));
}
}
@@ -104,9 +104,9 @@ SerialPortWriteRegister (
)
{
if (PcdGetBool (PcdSerialUseMmio)) {
- return MmioWrite8 (Base + Offset, Value);
+ return MmioWrite8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride), Value);
} else {
- return IoWrite8 (Base + Offset, Value);
+ return IoWrite8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride), Value);
}
}