mirror of https://github.com/acidanthera/audk.git
IntelFrameworkModulePkg/LegacyBios: Get COM base from SerialIo parent
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
parent
aa7f11db4d
commit
faef695239
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
# This driver installs Legacy Bios Protocol to support CSM module work in EFI system.
|
# This driver installs Legacy Bios Protocol to support CSM module work in EFI system.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions
|
# are licensed and made available under the terms and conditions
|
||||||
|
@ -133,6 +133,7 @@
|
||||||
gEfiLegacyInterruptProtocolGuid ## CONSUMES
|
gEfiLegacyInterruptProtocolGuid ## CONSUMES
|
||||||
gEfiLegacyRegion2ProtocolGuid ## CONSUMES
|
gEfiLegacyRegion2ProtocolGuid ## CONSUMES
|
||||||
gEfiLegacyBiosProtocolGuid ## PRODUCES
|
gEfiLegacyBiosProtocolGuid ## PRODUCES
|
||||||
|
gEfiSerialIoProtocolGuid ## CONSUMES
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLegacyBiosCacheLegacyRegion ## CONSUMES
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLegacyBiosCacheLegacyRegion ## CONSUMES
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
|
@ -44,6 +44,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#include <Protocol/DevicePath.h>
|
#include <Protocol/DevicePath.h>
|
||||||
#include <Protocol/Legacy8259.h>
|
#include <Protocol/Legacy8259.h>
|
||||||
#include <Protocol/PciRootBridgeIo.h>
|
#include <Protocol/PciRootBridgeIo.h>
|
||||||
|
#include <Protocol/SerialIo.h>
|
||||||
|
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
|
|
|
@ -49,8 +49,7 @@ LegacyBiosBuildSioDataFromIsaIo (
|
||||||
UINTN EntryCount;
|
UINTN EntryCount;
|
||||||
EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;
|
EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;
|
||||||
EFI_BLOCK_IO_PROTOCOL *BlockIo;
|
EFI_BLOCK_IO_PROTOCOL *BlockIo;
|
||||||
|
EFI_SERIAL_IO_PROTOCOL *SerialIo;
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the list of ISA controllers in the system
|
// Get the list of ISA controllers in the system
|
||||||
|
@ -137,10 +136,16 @@ LegacyBiosBuildSioDataFromIsaIo (
|
||||||
// We want resource for legacy even if no 32-bit driver installed
|
// We want resource for legacy even if no 32-bit driver installed
|
||||||
//
|
//
|
||||||
for (ChildIndex = 0; ChildIndex < EntryCount; ChildIndex++) {
|
for (ChildIndex = 0; ChildIndex < EntryCount; ChildIndex++) {
|
||||||
SioSerial = &SioPtr->Serial[ResourceList->Device.UID];
|
if ((OpenInfoBuffer[ChildIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
|
||||||
SioSerial->Address = (UINT16) IoResource->StartRange;
|
Status = gBS->HandleProtocol (OpenInfoBuffer[ChildIndex].AgentHandle, &gEfiSerialIoProtocolGuid, (VOID **) &SerialIo);
|
||||||
SioSerial->Irq = (UINT8) InterruptResource->StartRange;
|
if (!EFI_ERROR (Status)) {
|
||||||
SioSerial->Mode = DEVICE_SERIAL_MODE_NORMAL | DEVICE_SERIAL_MODE_DUPLEX_HALF;
|
SioSerial = &SioPtr->Serial[ResourceList->Device.UID];
|
||||||
|
SioSerial->Address = (UINT16) IoResource->StartRange;
|
||||||
|
SioSerial->Irq = (UINT8) InterruptResource->StartRange;
|
||||||
|
SioSerial->Mode = DEVICE_SERIAL_MODE_NORMAL | DEVICE_SERIAL_MODE_DUPLEX_HALF;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FreePool (OpenInfoBuffer);
|
FreePool (OpenInfoBuffer);
|
||||||
|
|
Loading…
Reference in New Issue