Revision: 17607
http://sourceforge.net/p/edk2/code/17607
Author: niruiyu
Date: 2015-06-10 04:18:50 +0000 (Wed, 10 Jun 2015)
Log Message:
-----------
IntelFrameworkModulePkg/IsaSerialDxe: Use PcdSerialClockRate instead of hard
code value
So that the driver can work on a certain hardware when a platform module
dynamically changes the PCD value.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <[email protected]>
Cc: Feng Tian <[email protected]>
Modified Paths:
--------------
trunk/edk2/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf
trunk/edk2/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c
trunk/edk2/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.h
Modified:
trunk/edk2/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf
===================================================================
--- trunk/edk2/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf
2015-06-10 04:18:05 UTC (rev 17606)
+++ trunk/edk2/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf
2015-06-10 04:18:50 UTC (rev 17607)
@@ -4,7 +4,7 @@
# Produces the Serial I/O protocol for standard UARTS using ISA I/O. This
driver
# supports the 8250, 16450, 16550 and 16550A UART types.
#
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 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
@@ -42,6 +42,7 @@
[Packages]
MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
IntelFrameworkPkg/IntelFrameworkPkg.dec
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
@@ -69,10 +70,11 @@
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSerialUseHalfHandshake|FALSE
## CONSUMES
[Pcd]
- gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200 ## CONSUMES
- gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8 ## CONSUMES
- gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1 ## CONSUMES
- gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1 ## CONSUMES
+ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200 ## CONSUMES
+ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8 ## CONSUMES
+ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1 ## CONSUMES
+ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1 ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate|1843200 ## CONSUMES
[UserExtensions.TianoCore."ExtraFiles"]
IsaSerialDxeExtra.uni
Modified: trunk/edk2/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c
===================================================================
--- trunk/edk2/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c
2015-06-10 04:18:05 UTC (rev 17606)
+++ trunk/edk2/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c
2015-06-10 04:18:50 UTC (rev 17607)
@@ -1,7 +1,7 @@
/** @file
Serial driver for standard UARTS on an ISA bus.
-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
@@ -1393,7 +1393,7 @@
// Compute divisor use to program the baud rate using a round determination
//
Divisor = (UINT32) DivU64x32Remainder (
- SERIAL_PORT_INPUT_CLOCK,
+ PcdGet32 (PcdSerialClockRate),
((UINT32) BaudRate * 16),
&Remained
);
@@ -1410,7 +1410,7 @@
//
// Compute the actual baud rate that the serial port will be programmed for.
//
- BaudRate = SERIAL_PORT_INPUT_CLOCK / Divisor / 16;
+ BaudRate = PcdGet32 (PcdSerialClockRate) / Divisor / 16;
//
// Put serial port on Divisor Latch Mode
Modified: trunk/edk2/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.h
===================================================================
--- trunk/edk2/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.h
2015-06-10 04:18:05 UTC (rev 17606)
+++ trunk/edk2/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.h
2015-06-10 04:18:50 UTC (rev 17607)
@@ -1,7 +1,7 @@
/** @file
Include for Serial Driver
-Copyright (c) 2006 - 2011, 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
@@ -128,13 +128,7 @@
EFI_SERIAL_OUTPUT_BUFFER_EMPTY | \
EFI_SERIAL_INPUT_BUFFER_EMPTY)
-
//
-// (24000000/13)MHz input clock
-//
-#define SERIAL_PORT_INPUT_CLOCK 1843200
-
-//
// 115200 baud with rounding errors
//
#define SERIAL_PORT_MAX_BAUD_RATE 115400
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits