From nobody Wed Apr 1 22:05:05 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=yodel.dev ARC-Seal: i=1; a=rsa-sha256; t=1775063163; cv=none; d=zohomail.com; s=zohoarc; b=dkWtMYaJjxFopUyX6z2Ju7hmG2devJ6vS0W1LyzaNbg+UjcfmWDbeOhhkdV2v/XaSpTU7qNsQRtOUduh79XJNuHF/aq5cXMJjcfUORGZnO0Al1yFmUIAgAwNjeECf1PEGmwthRTsxPwcSvQJAUZSAN9yo3PpB/Pouv1GgbB+hwU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775063163; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AJlzKuAkDZcYrX0s+aHJjENlPGBg3C9Smuh0yRglnGM=; b=CJ1IEpKEjJVFDMpco21cf/lSnnOVnypuf1iZo/olwjBojPAGWLeRP+KwPXcFar+vS17mxlLWSkIL/4PlFbj4c3scHUtQrtkLoVIeA6JazJlF7gkOiLt5da0z45HeWQEP23X3g6Gsuludv3Vemm3QEKTaqAVLtM1Ah4DyxIw6hnI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775063163564324.0665580550516; Wed, 1 Apr 2026 10:06:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w7z0X-00015j-AC; Wed, 01 Apr 2026 13:05:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w7z09-0000pj-Nn for qemu-devel@nongnu.org; Wed, 01 Apr 2026 13:05:11 -0400 Received: from v512.v5f06b487.use4.send.mailgun.net ([143.55.232.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w7z07-0007sm-AM for qemu-devel@nongnu.org; Wed, 01 Apr 2026 13:05:09 -0400 Received: from mail.yodel.dev (mail.yodel.dev [35.209.39.246]) by 657e51e36a66f18c38ea7955c08c805cbc6585bdd20ef3000326122a1a6815cb with SMTP id 69cd503a2c50a55f4d6cb994; Wed, 01 Apr 2026 17:04:58 GMT X-Mailgun-Sid: WyI4ZDFlNiIsInFlbXUtZGV2ZWxAbm9uZ251Lm9yZyIsIjk3NjA3ZSJd X-Mailgun-Sending-Ip: 143.55.232.12 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yodel.dev; s=rsa2048; t=1775063097; bh=AJlzKuAkDZcYrX0s+aHJjENlPGBg3C9Smuh0yRglnGM=; h=X-Mailgun-Dkim:From:To:Cc:Subject:Date:Message-ID:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:From:Reply-to: Subject:Date:Message-id:To:Cc:Mime-version:Content-type: Content-transfer-encoding:In-reply-to:References; b=CwVlYMPOUNoEgWUY/HBh6nhPVCL+eTs1aZrWumY46c0Ui3EZw/DAUCz1Heiyr9Bi7 5RsejjGjMQkzMJfa/0tJkcUm+5Wk+0uzip5zJ3w/RuiBNhAgWJk9XWLvDLPa0OIr8G XMdQfBaRrx+jfGBu3zESoDw8X2AEYWInPI1ArSZlvfRNZXuwsFLl8O0sOKrubf/GJE u0079rRjhlZ1jifT4skJ0joDtNPVL0Xz9ykweSKFiqsKw0tA3seXwaj7Ui+l0Ta8jO 5xnp1XTOxdvr3iuUv/6g9gZrI14bNgxSWVajIkB3r38OfL9GbvEKU0JdEJayIis4HZ XmsXlxkOaCPUQ== X-Mailgun-Dkim: no X-Mailgun-Dkim: no From: "Yodel Eldar" To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yodel Eldar Subject: [RFC PATCH 1/4] alpha: Define Typhoon instance_init Date: Wed, 1 Apr 2026 12:04:51 -0500 Message-ID: <20260401170454.32045-2-yodel.eldar@yodel.dev> In-Reply-To: <20260401170454.32045-1-yodel.eldar@yodel.dev> References: <20260401170454.32045-1-yodel.eldar@yodel.dev> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=143.55.232.12; envelope-from=bounce+0e9322.97607e-qemu-devel=nongnu.org@yodel.dev; helo=v512.v5f06b487.use4.send.mailgun.net X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HELO_STATIC_HOST=-0.001, RCVD_IN_MSPIKE_H2=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yodel.dev) X-ZM-MESSAGEID: 1775063164273158500 Content-Type: text/plain; charset="utf-8" From: Yodel Eldar Signed-off-by: Yodel Eldar --- hw/alpha/alpha_sys.h | 4 +++- hw/alpha/dp264.c | 8 +++++++- hw/alpha/typhoon.c | 24 ++++++++++++------------ 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h index 6e6691d116..247a52b776 100644 --- a/hw/alpha/alpha_sys.h +++ b/hw/alpha/alpha_sys.h @@ -8,9 +8,11 @@ #include "hw/core/boards.h" #include "hw/intc/i8259.h" =20 +#define TYPE_TYPHOON_PCI_HOST_BRIDGE "typhoon-pcihost" +OBJECT_DECLARE_SIMPLE_TYPE(TyphoonState, TYPHOON_PCI_HOST_BRIDGE) =20 PCIBus *typhoon_init(MemoryRegion *, qemu_irq *, qemu_irq *, AlphaCPU *[4], - pci_map_irq_fn, uint8_t devfn_min); + pci_map_irq_fn, uint8_t devfn_min, TyphoonState *); =20 /* alpha_pci.c. */ extern const MemoryRegionOps alpha_pci_ignore_ops; diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 2ab3c14747..ce2f8765cd 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -49,6 +49,7 @@ static void clipper_init(MachineState *machine) const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; MachineClass *mc =3D MACHINE_GET_CLASS(machine); + Object *typhoon_obj; AlphaCPU *cpus[4]; PCIBus *pci_bus; PCIDevice *pci_dev; @@ -62,6 +63,10 @@ static void clipper_init(MachineState *machine) uint64_t kernel_entry, kernel_low; unsigned int smp_cpus =3D machine->smp.cpus; =20 + typhoon_obj =3D object_new_with_props(TYPE_TYPHOON_PCI_HOST_BRIDGE, + OBJECT(machine), "typhoon", + &error_fatal, NULL); + /* Create up to 4 cpus. */ memset(cpus, 0, sizeof(cpus)); for (i =3D 0; i < smp_cpus; ++i) { @@ -87,7 +92,8 @@ static void clipper_init(MachineState *machine) * the minimum PCI device IdSel is 1. */ pci_bus =3D typhoon_init(machine->ram, &isa_irq, &rtc_irq, cpus, - clipper_pci_map_irq, PCI_DEVFN(1, 0)); + clipper_pci_map_irq, PCI_DEVFN(1, 0), + TYPHOON_PCI_HOST_BRIDGE(typhoon_obj)); =20 /* * Init the PCI -> ISA bridge. diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index 7722d4fd00..26580664d8 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -17,7 +17,6 @@ #include "alpha_sys.h" =20 =20 -#define TYPE_TYPHOON_PCI_HOST_BRIDGE "typhoon-pcihost" #define TYPE_TYPHOON_IOMMU_MEMORY_REGION "typhoon-iommu-memory-region" =20 typedef struct TyphoonCchip { @@ -49,8 +48,6 @@ typedef struct TyphoonPchip { TyphoonWindow win[4]; } TyphoonPchip; =20 -OBJECT_DECLARE_SIMPLE_TYPE(TyphoonState, TYPHOON_PCI_HOST_BRIDGE) - struct TyphoonState { PCIHostState parent_obj; =20 @@ -819,25 +816,27 @@ static void typhoon_alarm_timer(void *opaque) cpu_interrupt(CPU(s->cchip.cpu[cpu]), CPU_INTERRUPT_TIMER); } =20 +static void typhoon_pcihost_instance_init(Object *obj) +{ + TyphoonState *s =3D TYPHOON_PCI_HOST_BRIDGE(obj); + + s->cchip.misc =3D 0x800000000ull; /* Revision: Typhoon. */ + s->pchip.win[3].wba =3D 2; /* Window 3 SG always enabled. */ +} + PCIBus *typhoon_init(MemoryRegion *ram, qemu_irq *p_isa_irq, qemu_irq *p_rtc_irq, AlphaCPU *cpus[4], - pci_map_irq_fn sys_map_irq, uint8_t devfn_min) + pci_map_irq_fn sys_map_irq, uint8_t devfn_min, + TyphoonState *s) { MemoryRegion *addr_space =3D get_system_memory(); - DeviceState *dev; - TyphoonState *s; + DeviceState *dev =3D DEVICE(s); PCIHostState *phb; PCIBus *b; int i; =20 - dev =3D qdev_new(TYPE_TYPHOON_PCI_HOST_BRIDGE); - - s =3D TYPHOON_PCI_HOST_BRIDGE(dev); phb =3D PCI_HOST_BRIDGE(dev); =20 - s->cchip.misc =3D 0x800000000ull; /* Revision: Typhoon. */ - s->pchip.win[3].wba =3D 2; /* Window 3 SG always enabled. */ - /* Remember the CPUs so that we can deliver interrupts to them. */ for (i =3D 0; i < 4; i++) { AlphaCPU *cpu =3D cpus[i]; @@ -931,6 +930,7 @@ PCIBus *typhoon_init(MemoryRegion *ram, qemu_irq *p_isa= _irq, static const TypeInfo typhoon_pcihost_info =3D { .name =3D TYPE_TYPHOON_PCI_HOST_BRIDGE, .parent =3D TYPE_PCI_HOST_BRIDGE, + .instance_init =3D typhoon_pcihost_instance_init, .instance_size =3D sizeof(TyphoonState), }; =20 --=20 2.53.0