summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciLib.c
diff options
context:
space:
mode:
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2007-09-28 04:40:49 +0000
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2007-09-28 04:40:49 +0000
commitff62de37300f4c1af964367a9ea0fca0f79570e8 (patch)
tree2dc57be38b04e3325c0e9f71ac3b16b8be82a95d /IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciLib.c
parent73c7e13392ea74bc55786f59a7fe89ba938014ca (diff)
downloadedk2-platforms-ff62de37300f4c1af964367a9ea0fca0f79570e8.tar.xz
PCI Bus Driver Enhancement
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3960 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciLib.c')
-rw-r--r--IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciLib.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciLib.c b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciLib.c
index 7a4684d96d..0812bf0363 100644
--- a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciLib.c
+++ b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciLib.c
@@ -1258,8 +1258,6 @@ Returns:
SecondBus = 0;
Register = 0;
- ResetAllPpbBusReg (Bridge, StartBusNumber);
-
for (Device = 0; Device <= PCI_MAX_DEVICE; Device++) {
for (Func = 0; Func <= PCI_MAX_FUNC; Func++) {
@@ -1278,6 +1276,8 @@ Returns:
(IS_PCI_BRIDGE (&Pci) ||
IS_CARDBUS_BRIDGE (&Pci))) {
+ DEBUG((EFI_D_ERROR, "Found DEV(%02d,%02d,%02d)\n", StartBusNumber, Device, Func ));
+
//
// Get the bridge information
//
@@ -1294,6 +1294,14 @@ Returns:
return Status;
}
+ //
+ // Add feature to support customized secondary bus number
+ //
+ if (*SubBusNumber == 0) {
+ *SubBusNumber = *PaddedBusRange;
+ *PaddedBusRange = 0;
+ }
+
(*SubBusNumber)++;
SecondBus = (*SubBusNumber);
@@ -1350,6 +1358,7 @@ Returns:
EfiPciBeforeChildBusEnumeration
);
+ DEBUG((EFI_D_ERROR, "Scan PPB(%02d,%02d,%02d)\n", PciDevice->BusNumber, PciDevice->DeviceNumber,PciDevice->FunctionNumber ));
Status = PciScanBus (
PciDevice,
(UINT8) (SecondBus),
@@ -1446,8 +1455,6 @@ Returns:
Attributes = (EFI_HPC_PADDING_ATTRIBUTES) 0;
BusRange = 0;
- ResetAllPpbBusReg (Bridge, StartBusNumber);
-
for (Device = 0; Device <= PCI_MAX_DEVICE; Device++) {
for (Func = 0; Func <= PCI_MAX_FUNC; Func++) {
@@ -1473,6 +1480,8 @@ Returns:
continue;
}
+ DEBUG((EFI_D_ERROR, "Found DEV(%02d,%02d,%02d)\n", StartBusNumber, Device, Func ));
+
//
// Get the PCI device information
//
@@ -1534,7 +1543,6 @@ Returns:
PciDevice->FunctionNumber,
EfiPciBeforeChildBusEnumeration
);
- continue;
}
}
}
@@ -1583,6 +1591,14 @@ Returns:
}
}
+ //
+ // Add feature to support customized secondary bus number
+ //
+ if (*SubBusNumber == 0) {
+ *SubBusNumber = *PaddedBusRange;
+ *PaddedBusRange = 0;
+ }
+
(*SubBusNumber)++;
SecondBus = *SubBusNumber;
@@ -1629,6 +1645,7 @@ Returns:
EfiPciBeforeChildBusEnumeration
);
+ DEBUG((EFI_D_ERROR, "Scan PPB(%02d,%02d,%02d)\n", PciDevice->BusNumber, PciDevice->DeviceNumber,PciDevice->FunctionNumber ));
Status = PciScanBus (
PciDevice,
(UINT8) (SecondBus),
@@ -1851,6 +1868,7 @@ Returns:
//
NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginBusAllocation);
+ DEBUG((EFI_D_ERROR, "PCI Bus First Scanning\n"));
RootBridgeHandle = NULL;
while (PciResAlloc->GetNextRootBridge (PciResAlloc, &RootBridgeHandle) == EFI_SUCCESS) {
@@ -1901,6 +1919,7 @@ Returns:
//
NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginBusAllocation);
+ DEBUG((EFI_D_ERROR, "PCI Bus Second Scanning\n"));
RootBridgeHandle = NULL;
while (PciResAlloc->GetNextRootBridge (PciResAlloc, &RootBridgeHandle) == EFI_SUCCESS) {