]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelFrameworkModulePkg/IsaSerialDxe: Use PcdSerialClockRate instead of hard code...
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 10 Jun 2015 04:18:50 +0000 (04:18 +0000)
committerniruiyu <niruiyu@Edk2>
Wed, 10 Jun 2015 04:18:50 +0000 (04:18 +0000)
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 <ruiyu.ni@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17607 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf
IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c
IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.h

index 064d4a0e9c1c31a021e4195d94c8cd2b9adc3397..4abaac9ff8b1450f5af2388acf6828d9fb070429 100644 (file)
@@ -4,7 +4,7 @@
 # Produces the Serial I/O protocol for standard UARTS using ISA I/O. This driver\r
 # supports the 8250, 16450, 16550 and 16550A UART types.\r
 #\r
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
@@ -42,6 +42,7 @@
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
   IntelFrameworkPkg/IntelFrameworkPkg.dec\r
   IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
 \r
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSerialUseHalfHandshake|FALSE   ## CONSUMES\r
 \r
 [Pcd]\r
-  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200  ## CONSUMES\r
-  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8       ## CONSUMES\r
-  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1         ## CONSUMES\r
-  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1       ## CONSUMES\r
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200    ## CONSUMES\r
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8         ## CONSUMES\r
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1           ## CONSUMES\r
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1         ## CONSUMES\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate|1843200 ## CONSUMES\r
 \r
 [UserExtensions.TianoCore."ExtraFiles"]\r
   IsaSerialDxeExtra.uni\r
index 15d2bab824b43dfa9442d2f982d1fec396e80b17..57ee669d140682e922f5b0d632eef765e4e411a7 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Serial driver for standard UARTS on an ISA bus.\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
@@ -1393,7 +1393,7 @@ IsaSerialSetAttributes (
   // Compute divisor use to program the baud rate using a round determination\r
   //\r
   Divisor = (UINT32) DivU64x32Remainder (\r
-                       SERIAL_PORT_INPUT_CLOCK,\r
+                       PcdGet32 (PcdSerialClockRate),\r
                        ((UINT32) BaudRate * 16),\r
                        &Remained\r
                        );\r
@@ -1410,7 +1410,7 @@ IsaSerialSetAttributes (
   //\r
   // Compute the actual baud rate that the serial port will be programmed for.\r
   //\r
-  BaudRate = SERIAL_PORT_INPUT_CLOCK / Divisor / 16;\r
+  BaudRate = PcdGet32 (PcdSerialClockRate) / Divisor / 16;\r
 \r
   //\r
   // Put serial port on Divisor Latch Mode\r
index c8d9cb1983e655eaff7b19abc35c262adfcb5ec4..9d50ca9e27e67722899ea140e0cbf3a420ae022b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Include for Serial Driver\r
   \r
-Copyright (c) 2006 - 2011, 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
@@ -128,12 +128,6 @@ typedef struct {
                                                  EFI_SERIAL_OUTPUT_BUFFER_EMPTY          | \\r
                                                  EFI_SERIAL_INPUT_BUFFER_EMPTY)\r
 \r
-\r
-//\r
-// (24000000/13)MHz input clock\r
-//\r
-#define SERIAL_PORT_INPUT_CLOCK 1843200\r
-\r
 //\r
 // 115200 baud with rounding errors\r
 //\r