From 5b8adaa558dd0259ede5dad042d80ad2de5cd035 Mon Sep 17 00:00:00 2001 From: klu2 Date: Tue, 30 Dec 2008 08:26:28 +0000 Subject: [PATCH] Fix bug that Duet BDS fail to get PciExpressAddress from guid hob. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7155 6f19259b-4bc3-4df7-8a09-765794883524 --- DuetPkg/Library/DuetBdsLib/BdsPlatform.c | 29 +++++++++++------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/DuetPkg/Library/DuetBdsLib/BdsPlatform.c b/DuetPkg/Library/DuetBdsLib/BdsPlatform.c index 5dfa016bbd..f3fc396757 100644 --- a/DuetPkg/Library/DuetBdsLib/BdsPlatform.c +++ b/DuetPkg/Library/DuetBdsLib/BdsPlatform.c @@ -422,23 +422,16 @@ Returns: UINT32 Number; EFI_PEI_HOB_POINTERS GuidHob; - BufferSize = 0; - // - // Get Hob List from configuration table - // - GuidHob.Raw = GetHobList (); - // // Get PciExpressAddressInfo Hob // - GuidHob.Raw = GetNextGuidHob (&gEfiPciExpressBaseAddressGuid, GuidHob.Raw); - if (GuidHob.Raw == NULL) { - DEBUG ((EFI_D_ERROR, "Fail to get gEfiPciExpressBaseAddressGuid from GUID HOB\n")); - return 0; - } - PciExpressBaseAddressInfo = (EFI_PCI_EXPRESS_BASE_ADDRESS_INFORMATION *) GET_GUID_HOB_DATA (GuidHob.Guid); - if (PciExpressBaseAddressInfo == NULL) { - DEBUG ((EFI_D_ERROR, "Fail to get gEfiPciExpressBaseAddressGuid from GUID HOB\n")); + PciExpressBaseAddressInfo = NULL; + BufferSize = 0; + GuidHob.Raw = GetFirstGuidHob (&gEfiPciExpressBaseAddressGuid); + if (GuidHob.Raw != NULL) { + PciExpressBaseAddressInfo = GET_GUID_HOB_DATA (GuidHob.Guid); + BufferSize = GET_GUID_HOB_DATA_SIZE (GuidHob.Guid); + } else { return 0; } @@ -456,7 +449,7 @@ Returns: // // Do not find the PciExpress Base Address in the Hob // - return 0; + return 0; } VOID @@ -469,7 +462,9 @@ PatchPciRootBridgeDevicePath ( UINT64 PciExpressBase; PciExpressBase = GetPciExpressBaseAddressForRootBridge (HostBridgeNumber, RootBridgeNumber); - + + DEBUG ((EFI_D_INFO, "Get PciExpress Address from Hob: 0x%X\n", PciExpressBase)); + if (PciExpressBase != 0) { RootBridge->PciRootBridge.HID = EISA_PNP_ID(0x0A08); } @@ -514,6 +509,8 @@ Returns: &gPlatformRootBridges[0], &RootHandle ); + DEBUG ((EFI_D_INFO, "Pci Root bridge handle is 0x%X\n", RootHandle)); + if (EFI_ERROR (Status)) { return Status; } -- 2.39.2