MdeModulePkg PciBusDxe: Follow the P2P Bridge spec to detect if a P2P bridge supports 64-bit prefetchable base and limit addresses.

Signed-off-by: rsun3
Reviewed-by: mdkinney


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12975 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
rsun3 2012-01-31 09:00:27 +00:00
parent 5e0ff25bdf
commit 07bcff9dbf
1 changed files with 15 additions and 4 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
PCI emumeration support functions implementation for PCI Bus module. PCI emumeration support functions implementation for PCI Bus module.
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2012, 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 of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -459,6 +459,9 @@ GatherPpbInfo (
UINT8 Value; UINT8 Value;
EFI_PCI_IO_PROTOCOL *PciIo; EFI_PCI_IO_PROTOCOL *PciIo;
UINT8 Temp; UINT8 Temp;
UINT32 PMemBaseLimit;
UINT16 PrefetchableMemoryBase;
UINT16 PrefetchableMemoryLimit;
PciIoDevice = CreatePciIoDevice ( PciIoDevice = CreatePciIoDevice (
Bridge, Bridge,
@ -552,14 +555,22 @@ GatherPpbInfo (
PciIoDevice, PciIoDevice,
0x24, 0x24,
NULL, NULL,
NULL &PMemBaseLimit
); );
// //
// Test if it supports 64 memory or not // Test if it supports 64 memory or not
// //
if (!EFI_ERROR (Status)) { // The bottom 4 bits of both the Prefetchable Memory Base and Prefetchable Memory Limit
// registers:
// 0 - the bridge supports only 32 bit addresses.
// 1 - the bridge supports 64-bit addresses.
//
PrefetchableMemoryBase = PMemBaseLimit & 0xffff;
PrefetchableMemoryLimit = PMemBaseLimit >> 16;
if (!EFI_ERROR (Status) &&
(PrefetchableMemoryBase & 0x000f) == 0x0001 &&
(PrefetchableMemoryLimit & 0x000f) == 0x0001) {
Status = BarExisted ( Status = BarExisted (
PciIoDevice, PciIoDevice,
0x28, 0x28,