All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Thorpe <thorpej@me.com>
To: qemu-devel@nongnu.org
Cc: Jason Thorpe <thorpej@me.com>, richard.henderson@linaro.org
Subject: [PATCH 2/4] alpha: Set minimum PCI device ID to 1 to match Clipper IRQ mappings.
Date: Sun, 13 Jun 2021 14:15:47 -0700	[thread overview]
Message-ID: <20210613211549.18094-3-thorpej@me.com> (raw)
In-Reply-To: <20210613211549.18094-1-thorpej@me.com>

Since we are emulating a Clipper device topology, we need to set the
minimum PCI device ID to 1, as there is no IRQ mapping for a device
at ID 0 (see sys_dp264.c:clipper_map_irq()).

- Add a 'devfn_min' argument to typhoon_init().  Pass that argument
  along to pci_register_root_bus().
- In clipper_init(), pass PCI_DEVFN(1, 0) as the minimum PCI device
  ID/function.

Signed-off-by: Jason Thorpe <thorpej@me.com>
---
 hw/alpha/alpha_sys.h | 2 +-
 hw/alpha/dp264.c     | 5 +++--
 hw/alpha/typhoon.c   | 5 +++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h
index e2c02e2bbe..4835b3d5ee 100644
--- a/hw/alpha/alpha_sys.h
+++ b/hw/alpha/alpha_sys.h
@@ -11,7 +11,7 @@
 
 
 PCIBus *typhoon_init(MemoryRegion *, ISABus **, qemu_irq *, AlphaCPU *[4],
-                     pci_map_irq_fn);
+                     pci_map_irq_fn, uint8_t devfn_min);
 
 /* alpha_pci.c.  */
 extern const MemoryRegionOps alpha_pci_ignore_ops;
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 1017ecf330..ac97104464 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -76,9 +76,10 @@ static void clipper_init(MachineState *machine)
     cpus[0]->env.trap_arg1 = 0;
     cpus[0]->env.trap_arg2 = smp_cpus;
 
-    /* Init the chipset.  */
+    /* Init the chipset.  Because we're using CLIPPER IRQ mappings,
+       the minimum PCI device IdSel is 1.  */
     pci_bus = typhoon_init(machine->ram, &isa_bus, &rtc_irq, cpus,
-                           clipper_pci_map_irq);
+                           clipper_pci_map_irq, PCI_DEVFN(1, 0));
 
     /* Since we have an SRM-compatible PALcode, use the SRM epoch.  */
     mc146818_rtc_init(isa_bus, 1900, rtc_irq);
diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c
index 87020cbe0d..fa31a2f286 100644
--- a/hw/alpha/typhoon.c
+++ b/hw/alpha/typhoon.c
@@ -815,7 +815,8 @@ static void typhoon_alarm_timer(void *opaque)
 }
 
 PCIBus *typhoon_init(MemoryRegion *ram, ISABus **isa_bus, qemu_irq *p_rtc_irq,
-                     AlphaCPU *cpus[4], pci_map_irq_fn sys_map_irq)
+                     AlphaCPU *cpus[4], pci_map_irq_fn sys_map_irq,
+                     uint8_t devfn_min)
 {
     MemoryRegion *addr_space = get_system_memory();
     DeviceState *dev;
@@ -885,7 +886,7 @@ PCIBus *typhoon_init(MemoryRegion *ram, ISABus **isa_bus, qemu_irq *p_rtc_irq,
     b = pci_register_root_bus(dev, "pci",
                               typhoon_set_irq, sys_map_irq, s,
                               &s->pchip.reg_mem, &s->pchip.reg_io,
-                              0, 64, TYPE_PCI_BUS);
+                              devfn_min, 64, TYPE_PCI_BUS);
     phb->bus = b;
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
 
-- 
2.30.2



  parent reply	other threads:[~2021-06-13 21:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13 21:15 [PATCH 0/4] Emulator fixes to enable running NetBSD/alpha Jason Thorpe
2021-06-13 21:15 ` [PATCH 1/4] mc146818rtc: Make PF independent of PIE Jason Thorpe
2021-06-15  4:17   ` Richard Henderson
2021-06-16 17:34     ` Jason Thorpe
2021-06-19 15:56       ` Philippe Mathieu-Daudé
2021-06-19 16:25         ` Jason Thorpe
2021-06-13 21:15 ` Jason Thorpe [this message]
2021-06-15  4:03   ` [PATCH 2/4] alpha: Set minimum PCI device ID to 1 to match Clipper IRQ mappings Richard Henderson
2021-06-13 21:15 ` [PATCH 3/4] alpha: Provide a PCI-ISA bridge device node for guest OS's that expect it Jason Thorpe
2021-06-15  4:20   ` Richard Henderson
2021-06-15  4:24     ` Jason Thorpe
2021-06-16 13:53       ` Jason Thorpe
2021-06-16 16:55         ` Richard Henderson
2021-06-13 21:15 ` [PATCH 4/4] alpha: Provide console information to the PALcode at start-up Jason Thorpe
2021-06-15  4:08   ` Richard Henderson
2021-06-14 22:09 ` [PATCH 0/4] Emulator fixes to enable running NetBSD/alpha no-reply

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=20210613211549.18094-3-thorpej@me.com \
    --to=thorpej@me.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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 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.