From nobody Sun May 5 01:16:00 2024 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 1500761565675127.11236854338631; Sat, 22 Jul 2017 15:12:45 -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 1dZ2bQ-0007uj-Bk; Sun, 23 Jul 2017 00:10:24 +0200 Received: from mail-lf0-f68.google.com ([209.85.215.68]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2) (envelope-from ) id 1dZ2bF-0007sV-Vm for seabios@seabios.org; Sun, 23 Jul 2017 00:10:22 +0200 Received: by mail-lf0-f68.google.com with SMTP id b127so3054405lfb.2 for ; Sat, 22 Jul 2017 15:12:13 -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.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 22 Jul 2017 15:12:10 -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=CmOZwW4vOVXjo1EUJyHCnxM0Fzt7UWfVLonZFjhFXqg=; b=aJjQ10xIoKi82nx50/XffaBRQbCLrnZiT42U+Ihu5ZUtvb9fM/YNfPtkVIG+vru7BR FREQjBpYadYRJc+E16/nbOSKborl6hNSFsQhYIvypZ/sv8/siFUjHYswKxUzysrQ2x2D AFZM9Umf0cqNAYuSAKNwALFbN+3ehp7QYZ8edTTBL45T25xWdc7tkGntW0cDSrwVLYqk 0VeXlnGaYhMJ8S5yaDI2EelcKHYC9AeNVmKGc1qyBqN0EsnpW2SvN9C+y8Cict3oMg3q bJEL98rnPE0mba9H2Rqbc5lGegNlxDmprhEk1oKQPOdNO7OP4NuFTQXRZ2+LnXQcC09O nOoA== 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=CmOZwW4vOVXjo1EUJyHCnxM0Fzt7UWfVLonZFjhFXqg=; b=ATRd3ZS0RzMIw5ykrF4em8wq7Yb+9OjUGDJ2Tg6lvepUd04uE9qbrMtiqoAJMpdgiM AYy8sVuTZH5sZgusiCcfXEFa049xd32jnLIbgfwlnO9KlzuPpDaYLNUfYO6wpzkdul6E 5nEA0Zk2YSpzeOBE/Y2oOfKYbNMPnT4+E/0hBYx7kwhbWmF8iud2r+7tQ9X0GaaqzwT4 UmTe053IHHaFNZSlZI8vuPHcvstqAQOA0ZwlGLBxTz51zA4D04W61EVLzcZZfibmw3Jf +2Ah7aIaUkf6vQb14N/tXD2b1fIKpQge0BeYI6lvThrQPNpCQ8nJtvaLniMYppkuEkBa PU/A== X-Gm-Message-State: AIVw112KGRVRUt9yRNdThV8PqvLoR2/ZAHPft/g/dcWG6eO03/8MhoVC lrQfrBvZ5EIuSL13otk= X-Received: by 10.25.28.77 with SMTP id c74mr3258272lfc.32.1500761532066; Sat, 22 Jul 2017 15:12:12 -0700 (PDT) From: Aleksandr Bezzubikov To: seabios@seabios.org Date: Sun, 23 Jul 2017 01:11:47 +0300 Message-Id: <1500761510-1556-2-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: -3.5 (---) Subject: [SeaBIOS] [RFC PATCH v2 1/4] pci: refactor pci_find_capapibilty to get bdf as the first argument instead of the whole pci_device 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" Refactor pci_find_capability function to get bdf instead of a whole pci_device* as the only necessary field for this function=20 is still bdf. It greatly helps when we have bdf but not pci_device. Signed-off-by: Aleksandr Bezzubikov Reviewed-by: Marcel Apfelbaum --- src/fw/pciinit.c | 4 ++-- src/hw/pcidevice.c | 12 ++++++------ src/hw/pcidevice.h | 2 +- src/hw/virtio-pci.c | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index 08221e6..864954f 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -762,7 +762,7 @@ static int pci_bus_hotplug_support(struct pci_bus *bus,= u8 pcie_cap) return downstream_port && slot_implemented; } =20 - shpc_cap =3D pci_find_capability(bus->bus_dev, PCI_CAP_ID_SHPC, 0); + shpc_cap =3D pci_find_capability(bus->bus_dev->bdf, PCI_CAP_ID_SHPC, 0= ); return !!shpc_cap; } =20 @@ -844,7 +844,7 @@ static int pci_bios_check_devices(struct pci_bus *busse= s) */ parent =3D &busses[0]; int type; - u8 pcie_cap =3D pci_find_capability(s->bus_dev, PCI_CAP_ID_EXP, 0); + u8 pcie_cap =3D pci_find_capability(s->bus_dev->bdf, PCI_CAP_ID_EX= P, 0); int hotplug_support =3D pci_bus_hotplug_support(s, pcie_cap); for (type =3D 0; type < PCI_REGION_TYPE_COUNT; type++) { u64 align =3D (type =3D=3D PCI_REGION_TYPE_IO) ? diff --git a/src/hw/pcidevice.c b/src/hw/pcidevice.c index cfebf66..d01e27b 100644 --- a/src/hw/pcidevice.c +++ b/src/hw/pcidevice.c @@ -134,25 +134,25 @@ pci_find_init_device(const struct pci_device_id *ids,= void *arg) return NULL; } =20 -u8 pci_find_capability(struct pci_device *pci, u8 cap_id, u8 cap) +u8 pci_find_capability(u16 bdf, u8 cap_id, u8 cap) { int i; - u16 status =3D pci_config_readw(pci->bdf, PCI_STATUS); + u16 status =3D pci_config_readw(bdf, PCI_STATUS); =20 if (!(status & PCI_STATUS_CAP_LIST)) return 0; =20 if (cap =3D=3D 0) { /* find first */ - cap =3D pci_config_readb(pci->bdf, PCI_CAPABILITY_LIST); + cap =3D pci_config_readb(bdf, PCI_CAPABILITY_LIST); } else { /* find next */ - cap =3D pci_config_readb(pci->bdf, cap + PCI_CAP_LIST_NEXT); + cap =3D pci_config_readb(bdf, cap + PCI_CAP_LIST_NEXT); } for (i =3D 0; cap && i <=3D 0xff; i++) { - if (pci_config_readb(pci->bdf, cap + PCI_CAP_LIST_ID) =3D=3D cap_i= d) + if (pci_config_readb(bdf, cap + PCI_CAP_LIST_ID) =3D=3D cap_id) return cap; - cap =3D pci_config_readb(pci->bdf, cap + PCI_CAP_LIST_NEXT); + cap =3D pci_config_readb(bdf, cap + PCI_CAP_LIST_NEXT); } =20 return 0; diff --git a/src/hw/pcidevice.h b/src/hw/pcidevice.h index 354b549..adcc75a 100644 --- a/src/hw/pcidevice.h +++ b/src/hw/pcidevice.h @@ -69,7 +69,7 @@ int pci_init_device(const struct pci_device_id *ids , struct pci_device *pci, void *arg); struct pci_device *pci_find_init_device(const struct pci_device_id *ids , void *arg); -u8 pci_find_capability(struct pci_device *pci, u8 cap_id, u8 cap); +u8 pci_find_capability(u16 bdf, u8 cap_id, u8 cap); void pci_enable_busmaster(struct pci_device *pci); u16 pci_enable_iobar(struct pci_device *pci, u32 addr); void *pci_enable_membar(struct pci_device *pci, u32 addr); diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c index e5c2c33..4e33033 100644 --- a/src/hw/virtio-pci.c +++ b/src/hw/virtio-pci.c @@ -381,7 +381,7 @@ fail: =20 void vp_init_simple(struct vp_device *vp, struct pci_device *pci) { - u8 cap =3D pci_find_capability(pci, PCI_CAP_ID_VNDR, 0); + u8 cap =3D pci_find_capability(pci->bdf, PCI_CAP_ID_VNDR, 0); struct vp_cap *vp_cap; const char *mode; u32 offset, base, mul; @@ -479,7 +479,7 @@ void vp_init_simple(struct vp_device *vp, struct pci_de= vice *pci) vp_cap->cap, type, vp_cap->bar, addr, offset, mode); } =20 - cap =3D pci_find_capability(pci, PCI_CAP_ID_VNDR, cap); + cap =3D pci_find_capability(pci->bdf, PCI_CAP_ID_VNDR, cap); } =20 if (vp->common.cap && vp->notify.cap && vp->isr.cap && vp->device.cap)= { --=20 2.7.4 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios From nobody Sun May 5 01:16:00 2024 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 1500761566967157.4916347567156; Sat, 22 Jul 2017 15:12:46 -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 1dZ2ba-0007xj-Cq; Sun, 23 Jul 2017 00:10:34 +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 1dZ2bH-0007sZ-CG for seabios@seabios.org; Sun, 23 Jul 2017 00:10:32 +0200 Received: by mail-lf0-f67.google.com with SMTP id p11so5149114lfd.1 for ; Sat, 22 Jul 2017 15:12:15 -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.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 22 Jul 2017 15:12:12 -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=r1QHDDfOij7VwT64NbCcLhPdX0HZJStE2wBqnkdTKDM=; b=GxyOYzlUgSA70RWp32boybJisfZwJdhyvsuF/b/3Uk3zayHHP8jzHa99EFf92eNHfO YawUR+muO2o8Sl8DGbrPogZZu/+Thd6F51vURp1cHyKs0moEquXTWRG5E+9d7ZJwihS8 V+7ZA2ZHLgEw2hKe0UJCuQ/SQ7Dnuk4QJyk8a4CBAhjfRhloSvQVYDZt+g94ZehhpiSI K4EUrWdmCHYuAme9LGZB8lGy9222OmGRZibIVDrfBaSjO5VEqWE9FWEdiEVxPtFLAyMG jeenlayMEBJ5YdFONn1doK8tGLq3C7PGnRJWswn7L8isrZBLycHifyh468o+zZ2S/1NM cq8g== 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=r1QHDDfOij7VwT64NbCcLhPdX0HZJStE2wBqnkdTKDM=; b=Tgn68tHIzobs6FEE7SGv0fvTIMU/3P65jLlGFDWZffN4ZDQzU9VDjK+ffL9Ta4tubj tnR/YeDdZzWTLp/9hdQCJZQ3ITc9lc/BuItWAWZK4RWBQZ+vj3dfBSnL5tWterGM3i5P kn9fJ5mmhwYi6fMKmZGBeN4DbyJQeDgJ4WmFAzHvyRR8aV3dtfc9aWjPxYKKAOL0pnVx RDKKXMKsIly5B9rTAvUVTVWiLqdOaETz8OWGtIkb4ubkem4QV6vlhGbXZ49Lgu6z2CLD 8BccbjF3rVnKW64Y8Z10H+3zVRxseN+4ARRFLdjyRdpMG+Pjy9YAbjBnO144gcZ7o4O3 F0xQ== X-Gm-Message-State: AIVw110UGagoEjlsvDjJdu4S8KlxyIXGyXp6BXKXNZ0xX5j6VK+6cnBl cR9HztDR1gRrT8dX06c= X-Received: by 10.25.80.89 with SMTP id z25mr1894021lfj.157.1500761533573; Sat, 22 Jul 2017 15:12:13 -0700 (PDT) From: Aleksandr Bezzubikov To: seabios@seabios.org Date: Sun, 23 Jul 2017 01:11:48 +0300 Message-Id: <1500761510-1556-3-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: -4.0 (----) Subject: [SeaBIOS] [RFC PATCH v2 2/4] pci: add RedHat vendor ID 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" Signed-off-by: Aleksandr Bezzubikov --- src/hw/pci_ids.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hw/pci_ids.h b/src/hw/pci_ids.h index 4ac73b4..db2e694 100644 --- a/src/hw/pci_ids.h +++ b/src/hw/pci_ids.h @@ -2263,6 +2263,8 @@ #define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600 #define PCI_DEVICE_ID_KORENIX_JETCARDF1 0x16ff =20 +#define PCI_VENDOR_ID_REDHAT 0x1b36 + #define PCI_VENDOR_ID_TEKRAM 0x1de1 #define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 =20 --=20 2.7.4 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios From nobody Sun May 5 01:16:00 2024 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 1500761565615887.6131186080312; Sat, 22 Jul 2017 15:12:45 -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 1dZ2bW-0007wO-Vz; Sun, 23 Jul 2017 00:10:31 +0200 Received: from mail-lf0-f68.google.com ([209.85.215.68]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2) (envelope-from ) id 1dZ2bI-0007sm-QZ for seabios@seabios.org; Sun, 23 Jul 2017 00:10:29 +0200 Received: by mail-lf0-f68.google.com with SMTP id y15so1358922lfd.5 for ; Sat, 22 Jul 2017 15:12:16 -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.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 22 Jul 2017 15:12:14 -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=kgpcWRrTDr4w12raFy9LS/RpFay1P3HV9A18dm6OKrU=; b=rvgX9rd2RW2C7e9I6Ya+C0/+RgDAmnC6VLRGhTbm/H0pQa/vyTLlhfyDm9VMIz8Krl UQxa97GGFrH30i96onLHMoj1Gh1ZycgMDnQG8HT8rowOE0OQGvOcaGdP587JSSFtnLEg wxDlJW/TfLYJXLW1fRbbuuAiZYaagbKwnQJP79vYGsssQbw4+1pk5vO6kM0+Q8KsPXt6 5vnzm9W4p9ZxV6Hu7NjTA5RS4erqCzw2OmNSistGVn60PCtjO7cuCq1/pmtsvTWpJs+v XhscHBMXRKQMgYT2rlwlNLjIiYo2C1g3DhtuNBTtoQoH8zWuqOyNs+h3GLmLTg66o1Au V4Eg== 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=kgpcWRrTDr4w12raFy9LS/RpFay1P3HV9A18dm6OKrU=; b=GKDS25lrJa8fl+ULvHsQ+j69LJYUQwyAnmlQj1paWFw5USdUPFYR2r2w61qCu8LpaK ddB7AgoNsxGVSN8bY4oO2jtqvr8TDnLukPjaZTGpBJc7OYiLAZ/hShAVRmZOiemC8Efb X62qYUNhCjIAOnJupDkjSzBTv7fsp3KSHo80yt/BTqEm56sr1G9HrLsjAsVUxNEEQ7ht QlyG/H1ijMoL64MQR2ja1+6ytQ2tHVfNEgrxFll7311kNx0NN6/Kzz9yfnMauflfeYCc LRje3Jx1ko32qmeNb73uk4PeT2lFrjCeW1IhfwJkpuNqEB0AAPABOLQruV5eoQvsElFO w1bQ== X-Gm-Message-State: AIVw113GEFwZxAmpkTcGHeZGlQR5Qyt0sDKkqHDZI0Tt/nUsNdYBWCmz cZYgJiOlNMqxi0ZonF0= X-Received: by 10.46.33.214 with SMTP id h83mr3698738lji.75.1500761534959; Sat, 22 Jul 2017 15:12:14 -0700 (PDT) From: Aleksandr Bezzubikov To: seabios@seabios.org Date: Sun, 23 Jul 2017 01:11:49 +0300 Message-Id: <1500761510-1556-4-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: -3.5 (---) Subject: [SeaBIOS] [RFC PATCH v2 3/4] pci: add QEMU-specific PCI capability structure 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" On PCI init PCI bridge devices may need some extra info about bus number to reserve, IO, memory and prefetchable memory limits. QEMU can provide this with special vendor-specific PCI capability. This capability is intended to be used only for Red Hat PCI bridges, i.e. QEMU cooperation. Sizes of limits match ones from=20 PCI Type 1 Configuration Space Header, number of buses to reserve occupies only 1 byte=20 since it is the size of Subordinate Bus Number register. Signed-off-by: Aleksandr Bezzubikov --- src/hw/pci_cap.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/hw/pci_cap.h diff --git a/src/hw/pci_cap.h b/src/hw/pci_cap.h new file mode 100644 index 0000000..1382b0b --- /dev/null +++ b/src/hw/pci_cap.h @@ -0,0 +1,23 @@ +#ifndef _PCI_CAP_H +#define _PCI_CAP_H + +#include "types.h" + +struct vendor_pci_cap { + u8 id; + u8 next; + u8 len; +}; + +struct redhat_pci_bridge_cap { + struct vendor_pci_cap hdr; + u8 bus_res; + u32 pref_lim_upper; + u16 pref_lim; + u16 mem_lim; + u16 io_lim_upper; + u8 io_lim; + u8 padd; +}; + +#endif /* _PCI_CAP_H */ --=20 2.7.4 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios From nobody Sun May 5 01:16:00 2024 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