PCI Bus Driver Enhancement
[people/mcb30/edk2.git] / edk2 / IntelFrameworkModulePkg / Bus / Pci / PciBusDxe / PciEnumeratorSupport.c
index 432c6f7..4c9c800 100644 (file)
@@ -2161,7 +2161,7 @@ Returns:
 }\r
 \r
 EFI_STATUS\r
-ResetAllPpbBusReg (\r
+ResetAllPpbBusNumber (\r
   IN PCI_IO_DEVICE                      *Bridge,\r
   IN UINT8                              StartBusNumber\r
   )\r
@@ -2188,6 +2188,7 @@ Returns:
   UINT32                          Register;\r
   UINT8                           Func;\r
   UINT64                          Address;\r
+  UINT8                           SecondaryBus;\r
   EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;\r
 \r
   PciRootBridgeIo = Bridge->PciRootBridgeIo;\r
@@ -2207,6 +2208,7 @@ Returns:
                 );\r
 \r
       if (!EFI_ERROR (Status) && (IS_PCI_BRIDGE (&Pci))) {\r
+\r
         Register  = 0;\r
         Address   = EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0x18);\r
         Status   = PciRootBridgeIoRead (\r
@@ -2217,6 +2219,12 @@ Returns:
                                         1,\r
                                         &Register\r
                                         );\r
+        SecondaryBus = (UINT8)(Register >> 8);\r
+\r
+        if (SecondaryBus != 0) {\r
+          ResetAllPpbBusNumber (Bridge, SecondaryBus);\r
+        }\r
+\r
         //\r
         // Reset register 18h, 19h, 1Ah on PCI Bridge\r
         //\r