All of lore.kernel.org
 help / color / mirror / Atom feed
From: deller@kernel.org
To: qemu-devel@nongnu.org, Richard Henderson <richard.henderson@linaro.org>
Cc: "Fam Zheng" <fam@euphon.net>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Soumyajyotii Ssarkar" <soumyajyotisarkar23@gmail.com>,
	"Helge Deller" <deller@gmx.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [PATCH v2 09/11] hw/hppa: PCI devices depend on availability of PCI bus
Date: Sat, 25 Oct 2025 18:18:59 +0200	[thread overview]
Message-ID: <20251025161901.32710-10-deller@kernel.org> (raw)
In-Reply-To: <20251025161901.32710-1-deller@kernel.org>

From: Helge Deller <deller@gmx.de>

Only create the PCI serial ports (DIVA) and PCI network cards when there is
actually a PCI bus. The shortly added 715 machine will not have a PCI bus, so
avoid creating further PCI devices.

v2:
Clean up sequential testing of NULL pointers - as suggested by Richard

Signed-off-by: Helge Deller <deller@gmx.de>
---
 hw/hppa/machine.c | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index bec5a86f24..31eeba72b4 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -387,20 +387,22 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
                         enable_lasi_lan());
     }
 
-    pci_init_nic_devices(pci_bus, mc->default_nic);
-
-    /* BMC board: HP Diva GSP */
-    dev = qdev_new("diva-gsp");
-    if (!object_property_get_bool(OBJECT(dev), "disable", NULL)) {
-        pci_dev = pci_new_multifunction(PCI_DEVFN(2, 0), "diva-gsp");
-        if (!lasi_dev) {
-            /* bind default keyboard/serial to Diva card */
-            qdev_prop_set_chr(DEVICE(pci_dev), "chardev1", serial_hd(0));
-            qdev_prop_set_chr(DEVICE(pci_dev), "chardev2", serial_hd(1));
-            qdev_prop_set_chr(DEVICE(pci_dev), "chardev3", serial_hd(2));
-            qdev_prop_set_chr(DEVICE(pci_dev), "chardev4", serial_hd(3));
+    if (pci_bus) {
+        pci_init_nic_devices(pci_bus, mc->default_nic);
+
+        /* BMC board: HP Diva GSP PCI card */
+        dev = qdev_new("diva-gsp");
+        if (dev && !object_property_get_bool(OBJECT(dev), "disable", NULL)) {
+            pci_dev = pci_new_multifunction(PCI_DEVFN(2, 0), "diva-gsp");
+            if (!lasi_dev) {
+                /* bind default keyboard/serial to Diva card */
+                qdev_prop_set_chr(DEVICE(pci_dev), "chardev1", serial_hd(0));
+                qdev_prop_set_chr(DEVICE(pci_dev), "chardev2", serial_hd(1));
+                qdev_prop_set_chr(DEVICE(pci_dev), "chardev3", serial_hd(2));
+                qdev_prop_set_chr(DEVICE(pci_dev), "chardev4", serial_hd(3));
+            }
+            pci_realize_and_unref(pci_dev, pci_bus, &error_fatal);
         }
-        pci_realize_and_unref(pci_dev, pci_bus, &error_fatal);
     }
 
     /* create USB OHCI controller for USB keyboard & mouse on Astro machines */
-- 
2.51.0



  parent reply	other threads:[~2025-10-25 16:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-25 16:18 [PATCH v2 00/11] HP-PARISC 715 machine with NCR710 SCSI chip deller
2025-10-25 16:18 ` [PATCH v2 01/11] target/hppa: Update SeaBIOS-hppa to version 19 deller
2025-10-25 16:18 ` [PATCH v2 02/11] lasi_ncr710: Add LASI wrapper for NCR 53c710 SCSI chip deller
2025-10-25 16:18 ` [PATCH v2 03/11] ncr710: Add driver for the " deller
2025-10-25 16:59   ` BALATON Zoltan
2025-10-25 17:07     ` Helge Deller
2025-10-25 16:18 ` [PATCH v2 04/11] lasi: Forward LASI SCSI ports to NCR 53c710 driver deller
2025-10-25 16:18 ` [PATCH v2 05/11] hw/scsi: Add config option for new ncr710 driver deller
2025-10-25 16:18 ` [PATCH v2 06/11] hw/hppa: Fix firmware end address for LASI chip deller
2025-10-25 16:18 ` [PATCH v2 07/11] hw/hppa: Fix interrupt of LASI parallel port deller
2025-10-25 16:21   ` Philippe Mathieu-Daudé
2025-10-25 16:18 ` [PATCH v2 08/11] hw/hppa: Add NCR 710 SCSI driver to LASI chip Kconfig entry deller
2025-10-25 16:18 ` deller [this message]
2025-10-25 16:23   ` [PATCH v2 09/11] hw/hppa: PCI devices depend on availability of PCI bus Philippe Mathieu-Daudé
2025-10-25 16:57   ` Richard Henderson
2025-10-25 16:19 ` [PATCH v2 10/11] hw/hppa: Require SeaBIOS version 19 for 715 machine deller
2025-10-25 16:19 ` [PATCH v2 11/11] hw/hppa: Add 715 machine type including NCR710 SCSI deller
2025-10-25 16:25   ` Philippe Mathieu-Daudé
2025-10-25 16:32     ` Helge Deller
2025-10-25 16:48       ` [PATCH v3 " Helge Deller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251025161901.32710-10-deller@kernel.org \
    --to=deller@kernel.org \
    --cc=deller@gmx.de \
    --cc=fam@euphon.net \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=soumyajyotisarkar23@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.