qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Bauer <mail@sebastianbauer.info>
To: mail@sebastianbauer.info
Cc: qemu-devel@nongnu.org, david@gibson.dropbear.id.au,
	agraf@suse.de, qemu-ppc@nongnu.org, balaton@eik.bme.hu
Subject: [Qemu-devel] [PATCH 2/2] sam460ex: Create the PCI-X bus with only one interrupt
Date: Tue, 31 Jul 2018 06:36:35 +0200	[thread overview]
Message-ID: <20180731043635.9802-3-mail@sebastianbauer.info> (raw)
In-Reply-To: <20180731043635.9802-1-mail@sebastianbauer.info>

This is done by unfolding the sysbus_create_varargs() call and by
announcing that only a single irq is needed before connecting the irqs
before the bus is initialized.

This should model the design of the SAM board better, which is that all
PCI interrupts are connected to a single interrupt pin, in particular that
the logical level of the destination pin is an combined or of all the
individual interrupt levels.

Signed-off-by: Sebastian Bauer <mail@sebastianbauer.info>
---
 hw/ppc/sam460ex.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index b2b22f280d..28265bcb4c 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -515,10 +515,16 @@ static void sam460ex_init(MachineState *machine)
 
     /* PCI bus */
     ppc460ex_pcie_init(env);
-    /* All PCI ints are connected to the same UIC pin (cf. UBoot source) */
-    dev = sysbus_create_varargs("ppc440-pcix-host", 0xc0ec00000,
-                                uic[1][0], uic[1][0], uic[1][0], uic[1][0],
-                                NULL);
+
+    /* All PCI ints of the PCI-X bus are connected to the same UIC pin (cf.
+     * UBoot source) so only one connection is needed. */
+    dev = qdev_create(NULL, "ppc440-pcix-host");
+    qdev_prop_set_uint16(dev, "num-irqs", 1);
+    sbdev = SYS_BUS_DEVICE(dev);
+    qdev_init_nofail(dev);
+    sysbus_mmio_map(sbdev, 0, 0xc0ec00000);
+    sysbus_connect_irq(sbdev, 0, uic[1][0]);
+
     pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci.0");
     if (!pci_bus) {
         error_report("couldn't create PCI controller!");
-- 
2.18.0

      parent reply	other threads:[~2018-07-31  4:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31  4:36 [Qemu-devel] [PATCH 0/2] sam460ex: Improve logicial or'ed PCI-X interrupts Sebastian Bauer
2018-07-31  4:36 ` [Qemu-devel] [PATCH 1/2] ppc: Allow clients of the 440 pcix bus to specify the number of interrupts Sebastian Bauer
2018-07-31 14:28   ` [Qemu-devel] [Qemu-ppc] " Cédric Le Goater
2018-07-31  4:36 ` Sebastian Bauer [this message]

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=20180731043635.9802-3-mail@sebastianbauer.info \
    --to=mail@sebastianbauer.info \
    --cc=agraf@suse.de \
    --cc=balaton@eik.bme.hu \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).