]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelFrameworkModulePkg/LegacyBios: Get COM base from SerialIo parent
authorRuiyu Ni <ruiyu.ni@intel.com>
Sun, 12 Jun 2016 07:07:17 +0000 (15:07 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Tue, 14 Jun 2016 01:45:40 +0000 (09:45 +0800)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacySio.c

index f8cc4f3fc4109ae98542116adcaacc9bae561fb3..9090c912aaa852494f733c51814aa72ce7efa2ee 100644 (file)
@@ -3,7 +3,7 @@
 #\r
 # This driver installs Legacy Bios Protocol to support CSM module work in EFI system.\r
 #\r
-# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2016, 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\r
   gEfiLegacyInterruptProtocolGuid               ## CONSUMES\r
   gEfiLegacyRegion2ProtocolGuid                 ## CONSUMES\r
   gEfiLegacyBiosProtocolGuid                    ## PRODUCES\r
+  gEfiSerialIoProtocolGuid                      ## CONSUMES\r
 \r
 [Pcd]\r
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLegacyBiosCacheLegacyRegion  ## CONSUMES\r
index fcc0190d1e8975d21c3a6a7aaa29cd094b449f82..3869e067182c3380b192bb3771adfbca6260202f 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, 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\r
@@ -44,6 +44,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/Legacy8259.h>\r
 #include <Protocol/PciRootBridgeIo.h>\r
+#include <Protocol/SerialIo.h>\r
 \r
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
index 9844d64fd62516c1c009d1319889081000b04f5c..a27a477eaa0eea20dd3ae66a1fde792ff997610d 100644 (file)
@@ -49,8 +49,7 @@ LegacyBiosBuildSioDataFromIsaIo (
   UINTN                               EntryCount;\r
   EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;\r
   EFI_BLOCK_IO_PROTOCOL               *BlockIo;\r
-\r
-\r
+  EFI_SERIAL_IO_PROTOCOL              *SerialIo;\r
 \r
   //\r
   // Get the list of ISA controllers in the system\r
@@ -137,10 +136,16 @@ LegacyBiosBuildSioDataFromIsaIo (
         // We want resource for legacy even if no 32-bit driver installed\r
         //\r
         for (ChildIndex = 0; ChildIndex < EntryCount; ChildIndex++) {\r
-          SioSerial           = &SioPtr->Serial[ResourceList->Device.UID];\r
-          SioSerial->Address  = (UINT16) IoResource->StartRange;\r
-          SioSerial->Irq      = (UINT8) InterruptResource->StartRange;\r
-          SioSerial->Mode     = DEVICE_SERIAL_MODE_NORMAL | DEVICE_SERIAL_MODE_DUPLEX_HALF;\r
+          if ((OpenInfoBuffer[ChildIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
+            Status = gBS->HandleProtocol (OpenInfoBuffer[ChildIndex].AgentHandle, &gEfiSerialIoProtocolGuid, (VOID **) &SerialIo);\r
+            if (!EFI_ERROR (Status)) {\r
+              SioSerial           = &SioPtr->Serial[ResourceList->Device.UID];\r
+              SioSerial->Address  = (UINT16) IoResource->StartRange;\r
+              SioSerial->Irq      = (UINT8) InterruptResource->StartRange;\r
+              SioSerial->Mode     = DEVICE_SERIAL_MODE_NORMAL | DEVICE_SERIAL_MODE_DUPLEX_HALF;\r
+              break;\r
+            }\r
+          }\r
         }\r
 \r
         FreePool (OpenInfoBuffer);\r