From nobody Sat May 10 07:09:26 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) client-ip=80.81.252.135; envelope-from=seabios-bounces@seabios.org; helo=mail.coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org Return-Path: Received: from mail.coreboot.org (mail.coreboot.org [80.81.252.135]) by mx.zohomail.com with SMTPS id 1500761568278764.1288664541639; Sat, 22 Jul 2017 15:12:48 -0700 (PDT) Received: from [127.0.0.1] (helo=ra.coresystems.de) by mail.coreboot.org with esmtp (Exim 4.86_2) (envelope-from ) id 1dZ2bY-0007wq-J8; Sun, 23 Jul 2017 00:10:32 +0200 Received: from mail-lf0-f67.google.com ([209.85.215.67]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2) (envelope-from ) id 1dZ2bK-0007su-6a for seabios@seabios.org; Sun, 23 Jul 2017 00:10:29 +0200 Received: by mail-lf0-f67.google.com with SMTP id y15so1358940lfd.5 for ; Sat, 22 Jul 2017 15:12:18 -0700 (PDT) Received: from localhost.localdomain (broadband-178-140-16-138.moscow.rt.ru. [178.140.16.138]) by smtp.gmail.com with ESMTPSA id s134sm1604053lfe.27.2017.07.22.15.12.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 22 Jul 2017 15:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DGBWUcwkNJnG+/Kbr+H/0FcXbeJw32MyqwBDvtYix6c=; b=noLuaX6QlwDWtfdiLDdm7mG8e3BFyVAJ89Nx9IaoOvrmY+kciekb9crC/ZhXIQHEo4 PuCKUeuPnss5rbRxUd7xPN9nF0av0C6zuen3OhZsy/fLwPLX68ZPpjZhPGapEgClnwMs Da7ma45ox5WwchJ/BGBfm1cQVrA+B8VKJdyOtdMEoqG3RIUJLzRkNc4xMNGHiOwWEqCk Ps8l6XILHUi/rfEXKOqTfcEchj9PkGv04eqBkn8dFOqZ/L0Rse9FWoCMlQ7lvlWxeFVd ka03swayyUA09GFd5u8onKI8qbd3CRgr8hIe79O3QJVsfMfWR9OISpbl+cHHqX6hzp+J JDIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DGBWUcwkNJnG+/Kbr+H/0FcXbeJw32MyqwBDvtYix6c=; b=tU6sc2FiMPDLARbDM+y3Fg9Z5mC355Uq5SMNEzb3HCrWJ3UGqUcNaI4Rz3kECcPLeS /8rHN8BM36/FVEIyDHUZuz6STdW/BdU6mkSLwDDSoEijociTn/jNW0RnK/MD9wIOgPII OjMgXwwS1590xhoAbcTNEVhyk2EPtB23laSpmzdi3SouJyQAsPo3NRbqEJGWuQsGa9xF y6WnAf4YNMgRyqeR9frnRj8IP+pri4ZeRc2cdbErY18XwjagJ2WqFPAcyB4WQRRIMYmN qKeYrB/jlsXnPnZgx4D+mmsXMXC1Y3uV+wQO+rabvqeultw6tU4h5hElIRFjdG1Ogbs+ l7AA== X-Gm-Message-State: AIVw110YVHhUBgCPiSY/3X0GkpcTztFfyNs3YB56AeWy84AyU6UrHicZ 2eOMvgDseRdoDLqQ3lE= X-Received: by 10.46.20.16 with SMTP id u16mr3905491ljd.54.1500761536316; Sat, 22 Jul 2017 15:12:16 -0700 (PDT) From: Aleksandr Bezzubikov To: seabios@seabios.org Date: Sun, 23 Jul 2017 01:11:50 +0300 Message-Id: <1500761510-1556-5-git-send-email-zuban32s@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500761510-1556-1-git-send-email-zuban32s@gmail.com> References: <1500761510-1556-1-git-send-email-zuban32s@gmail.com> X-Spam-Score: -2.6 (--) Subject: [SeaBIOS] [RFC PATCH v2 4/4] pci: enable RedHat PCI bridges to reserve additional buses on PCI init X-BeenThere: seabios@seabios.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SeaBIOS mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: konrad.wilk@oracle.com, mst@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com, marcel@redhat.com, lersek@redhat.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: seabios-bounces@seabios.org Sender: "SeaBIOS" X-Duff: Orig. Duff, Duff Lite, Duff Dry, Duff Dark, Raspberry Duff, Lady Duff, Red Duff, Tartar Control Duff X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In case of Red Hat PCI bridges reserve additional buses, which number is pr= ovided in a vendor-specific capability.=20 Signed-off-by: Aleksandr Bezzubikov --- src/fw/pciinit.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index 864954f..f05a8b9 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -15,6 +15,7 @@ #include "hw/pcidevice.h" // pci_probe_devices #include "hw/pci_ids.h" // PCI_VENDOR_ID_INTEL #include "hw/pci_regs.h" // PCI_COMMAND +#include "hw/pci_cap.h" // qemu_pci_cap #include "list.h" // struct hlist_node #include "malloc.h" // free #include "output.h" // dprintf @@ -578,9 +579,18 @@ pci_bios_init_bus_rec(int bus, u8 *pci_bus) pci_bios_init_bus_rec(secbus, pci_bus); =20 if (subbus !=3D *pci_bus) { + u8 res_bus =3D 0; + if (pci_config_readw(bdf, PCI_VENDOR_ID) =3D=3D PCI_VENDOR_ID_= REDHAT) { + u8 cap =3D pci_find_capability(bdf, PCI_CAP_ID_VNDR, 0); + if (cap) { + res_bus =3D pci_config_readb(bdf, + cap + offsetof(struct redhat_pci_bridge_cap, + bus_res)); + } + } dprintf(1, "PCI: subordinate bus =3D 0x%x -> 0x%x\n", - subbus, *pci_bus); - subbus =3D *pci_bus; + subbus, *pci_bus + res_bus); + subbus =3D *pci_bus + res_bus; } else { dprintf(1, "PCI: subordinate bus =3D 0x%x\n", subbus); } --=20 2.7.4 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios