#\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
/** @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
#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
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
// 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