summaryrefslogtreecommitdiff
path: root/OptionRomPkg
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2009-09-15 07:50:48 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2009-09-15 07:50:48 +0000
commit6fe852082f747292ecdb51560f890eb6ac8036fa (patch)
tree8288cbedac89ff118ffb140b7b509d346911524b /OptionRomPkg
parente7b2c17aad3953d1c314c1e82cb5c6cad97885cd (diff)
downloadedk2-platforms-6fe852082f747292ecdb51560f890eb6ac8036fa.tar.xz
1. updated PCI/AGP Devices to check RemainingDevicePath in Supported() and Start() functions. The main changes are:
a. Add check validation of RemainingDevicePath in Supported() b. In Star() function, if RemaingDevicePath is the End of Device Path Node, don't create child device and return EFI_SUCCESS. 2. fixed one device path issue in ScsiBus driver. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9264 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OptionRomPkg')
-rw-r--r--OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.c116
1 files changed, 77 insertions, 39 deletions
diff --git a/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.c b/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.c
index 21bb4afee0..789b23358d 100644
--- a/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.c
+++ b/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.c
@@ -11,7 +11,7 @@
documentation on UGA for details on how to write a UGA driver that is able
to function both in the EFI pre-boot environment and from the OS runtime.
- Copyright (c) 2006, Intel Corporation
+ Copyright (c) 2006 - 2009, Intel Corporation
All rights reserved. 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
@@ -125,6 +125,7 @@ CirrusLogic5430ControllerDriverSupported (
EFI_STATUS Status;
EFI_PCI_IO_PROTOCOL *PciIo;
PCI_TYPE00 Pci;
+ EFI_DEV_PATH *Node;
//
// Open the PCI I/O Protocol
@@ -168,16 +169,33 @@ CirrusLogic5430ControllerDriverSupported (
//
// See if this is a 5430 or a 5446 PCI controller
//
- if (Pci.Hdr.DeviceId == CIRRUS_LOGIC_5430_DEVICE_ID) {
- Status = EFI_SUCCESS;
- }
-
- if (Pci.Hdr.DeviceId == CIRRUS_LOGIC_5430_ALTERNATE_DEVICE_ID) {
- Status = EFI_SUCCESS;
- }
-
- if (Pci.Hdr.DeviceId == CIRRUS_LOGIC_5446_DEVICE_ID) {
+ if (Pci.Hdr.DeviceId == CIRRUS_LOGIC_5430_DEVICE_ID ||
+ Pci.Hdr.DeviceId == CIRRUS_LOGIC_5430_ALTERNATE_DEVICE_ID ||
+ Pci.Hdr.DeviceId == CIRRUS_LOGIC_5446_DEVICE_ID) {
+
Status = EFI_SUCCESS;
+ //
+ // If this is an Intel 945 graphics controller,
+ // go further check RemainingDevicePath validation
+ //
+ if (RemainingDevicePath != NULL) {
+ Node = (EFI_DEV_PATH *) RemainingDevicePath;
+ //
+ // Check if RemainingDevicePath is the End of Device Path Node,
+ // if yes, return EFI_SUCCESS
+ //
+ if (!IsDevicePathEnd (Node)) {
+ //
+ // If RemainingDevicePath isn't the End of Device Path Node,
+ // check its validation
+ //
+ if (Node->DevPath.Type != ACPI_DEVICE_PATH ||
+ Node->DevPath.SubType != ACPI_ADR_DP ||
+ DevicePathNodeLength(&Node->DevPath) != sizeof(ACPI_ADR_DEVICE_PATH)) {
+ Status = EFI_UNSUPPORTED;
+ }
+ }
+ }
}
}
@@ -299,20 +317,32 @@ CirrusLogic5430ControllerDriverStart (
ParentDevicePath,
(EFI_DEVICE_PATH_PROTOCOL *) &AcpiDeviceNode
);
- } else {
+ } else if (!IsDevicePathEnd (RemainingDevicePath)) {
+ //
+ // If RemainingDevicePath isn't the End of Device Path Node,
+ // only scan the specified device by RemainingDevicePath
+ //
Private->GopDevicePath = AppendDevicePathNode (ParentDevicePath, RemainingDevicePath);
+ } else {
+ //
+ // If RemainingDevicePath is the End of Device Path Node,
+ // don't create child device and return EFI_SUCCESS
+ //
+ Private->GopDevicePath = NULL;
+ }
+
+ if (Private->GopDevicePath != NULL) {
+ //
+ // Creat child handle and device path protocol firstly
+ //
+ Private->Handle = NULL;
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &Private->Handle,
+ &gEfiDevicePathProtocolGuid,
+ Private->GopDevicePath,
+ NULL
+ );
}
-
- //
- // Creat child handle and device path protocol firstly
- //
- Private->Handle = NULL;
- Status = gBS->InstallMultipleProtocolInterfaces (
- &Private->Handle,
- &gEfiDevicePathProtocolGuid,
- Private->GopDevicePath,
- NULL
- );
}
//
@@ -341,23 +371,31 @@ CirrusLogic5430ControllerDriverStart (
);
} else if (FeaturePcdGet (PcdSupportGop)) {
- //
- // Start the GOP software stack.
- //
- Status = CirrusLogic5430GraphicsOutputConstructor (Private);
- ASSERT_EFI_ERROR (Status);
-
- Status = gBS->InstallMultipleProtocolInterfaces (
- &Private->Handle,
- &gEfiGraphicsOutputProtocolGuid,
- &Private->GraphicsOutput,
- &gEfiEdidDiscoveredProtocolGuid,
- &Private->EdidDiscovered,
- &gEfiEdidActiveProtocolGuid,
- &Private->EdidActive,
- NULL
- );
-
+ if (Private->GopDevicePath == NULL) {
+ //
+ // If RemainingDevicePath is the End of Device Path Node,
+ // don't create child device and return EFI_SUCCESS
+ //
+ Status = EFI_SUCCESS;
+ } else {
+
+ //
+ // Start the GOP software stack.
+ //
+ Status = CirrusLogic5430GraphicsOutputConstructor (Private);
+ ASSERT_EFI_ERROR (Status);
+
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &Private->Handle,
+ &gEfiGraphicsOutputProtocolGuid,
+ &Private->GraphicsOutput,
+ &gEfiEdidDiscoveredProtocolGuid,
+ &Private->EdidDiscovered,
+ &gEfiEdidActiveProtocolGuid,
+ &Private->EdidActive,
+ NULL
+ );
+ }
} else {
//
// This driver must support eithor GOP or UGA or both.