[SeaBIOS] [PATCH] pci: add RedHat PCI BRIDGE capability

Jing Liu jing2.liu at linux.intel.com
Tue Aug 7 09:20:17 CEST 2018


Add a device-specific capability for the RedHat PCI BRIDGE
to enable reserving additional resources.

Signed-off-by: Jing Liu <jing2.liu at linux.intel.com>
---
 src/fw/pciinit.c | 9 ++++++---
 src/hw/pci_ids.h | 1 +
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c
index 3a2f747..0265e9d 100644
--- a/src/fw/pciinit.c
+++ b/src/fw/pciinit.c
@@ -525,9 +525,12 @@ static void pci_bios_init_platform(void)
 
 static u8 pci_find_resource_reserve_capability(u16 bdf)
 {
-    if (pci_config_readw(bdf, PCI_VENDOR_ID) == PCI_VENDOR_ID_REDHAT &&
-        pci_config_readw(bdf, PCI_DEVICE_ID) ==
-                PCI_DEVICE_ID_REDHAT_ROOT_PORT) {
+    u16 vendor_id = pci_config_readw(bdf, PCI_VENDOR_ID);
+    u16 device_id = pci_config_readw(bdf, PCI_DEVICE_ID);
+
+    if (vendor_id == PCI_VENDOR_ID_REDHAT &&
+        (device_id == PCI_DEVICE_ID_REDHAT_ROOT_PORT ||
+         device_id == PCI_DEVICE_ID_REDHAT_BRIDGE)) {
         u8 cap = 0;
         do {
             cap = pci_find_capability(bdf, PCI_CAP_ID_VNDR, cap);
diff --git a/src/hw/pci_ids.h b/src/hw/pci_ids.h
index 38fa2ca..1096461 100644
--- a/src/hw/pci_ids.h
+++ b/src/hw/pci_ids.h
@@ -2265,6 +2265,7 @@
 
 #define PCI_VENDOR_ID_REDHAT		0x1b36
 #define PCI_DEVICE_ID_REDHAT_ROOT_PORT	0x000C
+#define PCI_DEVICE_ID_REDHAT_BRIDGE	0x0001
 
 #define PCI_VENDOR_ID_TEKRAM		0x1de1
 #define PCI_DEVICE_ID_TEKRAM_DC290	0xdc29
-- 
1.8.3.1




More information about the SeaBIOS mailing list