Add stride PCD to MdeModulePkg to support 16550 UARTs with a register stride
that is not 1 byte. Quark SoC uses a stride of 4 bytes.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off by: Michael Kinney
<michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>
Index: Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
===================================================================
--- Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c (revision
17201)
+++ Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c (working copy)
@@ -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 @@
)
{
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 @@
)
{
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);
}
}
Index: Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
===================================================================
--- Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf (revision
17201)
+++ Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf (working copy)
@@ -1,7 +1,7 @@
## @file
# SerialPortLib instance for 16550 UART.
#
-# 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
@@ -18,7 +18,7 @@
MODULE_UNI_FILE = BaseSerialPortLib16550.uni
FILE_GUID = 9E7C00CF-355A-4d4e-BF60-0428CFF95540
MODULE_TYPE = BASE
- VERSION_STRING = 1.0
+ VERSION_STRING = 1.1
LIBRARY_CLASS = SerialPortLib
[Packages]
@@ -42,6 +42,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialLineControl ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl ## CONSUMES
- gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate ##
CONSUMES
- gEfiMdeModulePkgTokenSpaceGuid.PcdSerialPciDeviceInfo ##
CONSUMES
- gEfiMdeModulePkgTokenSpaceGuid.PcdSerialExtendedTxFifoSize ##
CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSerialPciDeviceInfo ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSerialExtendedTxFifoSize ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride ## CONSUMES
Index: MdeModulePkg.dec
===================================================================
--- MdeModulePkg.dec (revision 17201)
+++ MdeModulePkg.dec (working copy)
@@ -20,7 +20,7 @@
PACKAGE_NAME = MdeModulePkg
PACKAGE_UNI_FILE = MdeModulePkg.uni
PACKAGE_GUID = BA0D78D6-2CAF-414b-BD4D-B6762A894288
- PACKAGE_VERSION = 0.94
+ PACKAGE_VERSION = 0.96
[Includes]
Include
@@ -916,6 +916,10 @@
# @Prompt Serial Port Extended Transmit FIFO Size in Bytes
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialExtendedTxFifoSize|64|UINT32|0x00010068
+ ## The number of bytes between registers in serial device. The default is 1
byte.
+ # @Prompt Serial Port Register Stride in Bytes
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride|1|UINT32|0x0001006B
+
[PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
## This PCD defines the Console output row. The default value is 25
according to UEFI spec.
# This PCD could be set to 0 then console output would be at max column and
max row.
Index: MdeModulePkg.uni
===================================================================
--- MdeModulePkg.uni (revision 17201)
+++ MdeModulePkg.uni (working copy)
@@ -566,6 +566,14 @@
+ # s t r i n g S T R _ g E f i M d e M o d u l e P k g T o k e n S p a c e G
u i d _ P c d S e r i a l R e g i s t e r S t r i d e _ P R O M P T # l a n
g u a g e e n - U S " S e r i a l P o r t R e g i s t e r S t r i d e
i n B y t e s "
+
+
+
+ # s t r i n g S T R _ g E f i M d e M o d u l e P k g T o k e n S p a c e G
u i d _ P c d S e r i a l R e g i s t e r S t r i d e _ H E L P # l a n g u
a g e e n - U S " T h e n u m b e r o f b y t e s b e t w e e n r
e g i s t e r s i n s e r i a l d e v i c e . T h e d e f a u l t
i s 1 b y t e . "
+
+
+
# s t r i n g S T R _ g E f i M d e M o d u l e P k g T o k e n S p a c e G
u i d _ P c d F l a s h N v S t o r a g e V a r i a b l e B a s e _ P R O M P T
# l a n g u a g e e n - U S " B a s e a d d r e s s o f f l a s h
N V v a r i a b l e r a n g e "
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel