From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651656596913248.14122775681642; Wed, 4 May 2022 02:29:56 -0700 (PDT) Received: from localhost ([::1]:46452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBKU-0001uV-SQ for importer@patchew.org; Wed, 04 May 2022 05:29:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBH4-0007Cf-5G for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:22 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:48958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBH2-0003xQ-OX for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:21 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBG4-0002VG-Ub; Wed, 04 May 2022 10:25:25 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:11 +0100 Message-Id: <20220504092600.10048-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 01/50] dino: checkpatch fixes X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651656597627100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Acked-by: Helge Deller --- hw/hppa/dino.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index eab96dd84e..4031cfb7f0 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -101,8 +101,10 @@ static const uint32_t reg800_keep_bits[DINO800_REGS] = =3D { struct DinoState { PCIHostState parent_obj; =20 - /* PCI_CONFIG_ADDR is parent_obj.config_reg, via pci_host_conf_be_ops, - so that we can map PCI_CONFIG_DATA to pci_host_data_be_ops. */ + /* + * PCI_CONFIG_ADDR is parent_obj.config_reg, via pci_host_conf_be_ops, + * so that we can map PCI_CONFIG_DATA to pci_host_data_be_ops. + */ uint32_t config_reg_dino; /* keep original copy, including 2 lowest bi= ts */ =20 uint32_t iar0; --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651656640735906.9918643474982; Wed, 4 May 2022 02:30:40 -0700 (PDT) Received: from localhost ([::1]:46752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBLD-00028c-Gv for importer@patchew.org; Wed, 04 May 2022 05:30:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBH8-0007Qw-UA for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:26 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:48966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBH7-0003xg-FZ for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:26 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBG9-0002VG-8B; Wed, 04 May 2022 10:25:29 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:12 +0100 Message-Id: <20220504092600.10048-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 02/50] dino: move registers from dino_init() to DINO_PCI_BRIDGE init function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651656641780100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 4031cfb7f0..9401b68ff7 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -526,21 +526,6 @@ PCIBus *dino_init(MemoryRegion *addr_space, s->iar0 =3D s->iar1 =3D CPU_HPA + 3; s->toc_addr =3D 0xFFFA0030; /* IO_COMMAND of CPU */ =20 - /* Dino PCI access from main memory. */ - memory_region_init_io(&s->this_mem, OBJECT(s), &dino_chip_ops, - s, "dino", 4096); - memory_region_add_subregion(addr_space, DINO_HPA, &s->this_mem); - - /* Dino PCI config. */ - memory_region_init_io(&s->parent_obj.conf_mem, OBJECT(&s->parent_obj), - &dino_config_addr_ops, dev, "pci-conf-idx", 4); - memory_region_init_io(&s->parent_obj.data_mem, OBJECT(&s->parent_obj), - &dino_config_data_ops, dev, "pci-conf-data", 4); - memory_region_add_subregion(&s->this_mem, DINO_PCI_CONFIG_ADDR, - &s->parent_obj.conf_mem); - memory_region_add_subregion(&s->this_mem, DINO_CONFIG_DATA, - &s->parent_obj.data_mem); - /* Dino PCI bus memory. */ memory_region_init(&s->pci_mem, OBJECT(s), "pci-memory", 4 * GiB); =20 @@ -550,6 +535,9 @@ PCIBus *dino_init(MemoryRegion *addr_space, s->parent_obj.bus =3D b; sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 + memory_region_add_subregion(addr_space, DINO_HPA, + sysbus_mmio_get_region(SYS_BUS_DEVICE(dev)= , 0)); + /* Set up windows into PCI bus memory. */ for (i =3D 1; i < 31; i++) { uint32_t addr =3D 0xf0000000 + i * DINO_MEM_CHUNK_SIZE; @@ -588,6 +576,31 @@ PCIBus *dino_init(MemoryRegion *addr_space, return b; } =20 +static void dino_pcihost_init(Object *obj) +{ + DinoState *s =3D DINO_PCI_HOST_BRIDGE(obj); + PCIHostState *phb =3D PCI_HOST_BRIDGE(obj); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); + + /* Dino PCI access from main memory. */ + memory_region_init_io(&s->this_mem, OBJECT(s), &dino_chip_ops, + s, "dino", 4096); + + /* Dino PCI config. */ + memory_region_init_io(&phb->conf_mem, OBJECT(phb), + &dino_config_addr_ops, DEVICE(s), + "pci-conf-idx", 4); + memory_region_init_io(&phb->data_mem, OBJECT(phb), + &dino_config_data_ops, DEVICE(s), + "pci-conf-data", 4); + memory_region_add_subregion(&s->this_mem, DINO_PCI_CONFIG_ADDR, + &phb->conf_mem); + memory_region_add_subregion(&s->this_mem, DINO_CONFIG_DATA, + &phb->data_mem); + + sysbus_init_mmio(sbd, &s->this_mem); +} + static void dino_pcihost_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -598,6 +611,7 @@ static void dino_pcihost_class_init(ObjectClass *klass,= void *data) static const TypeInfo dino_pcihost_info =3D { .name =3D TYPE_DINO_PCI_HOST_BRIDGE, .parent =3D TYPE_PCI_HOST_BRIDGE, + .instance_init =3D dino_pcihost_init, .instance_size =3D sizeof(DinoState), .class_init =3D dino_pcihost_class_init, }; --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651657390691325.43744120530573; Wed, 4 May 2022 02:43:10 -0700 (PDT) Received: from localhost ([::1]:37142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBXJ-0000VR-Cr for importer@patchew.org; Wed, 04 May 2022 05:43:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHC-0007cA-KC for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:30 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:48974) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHB-0003yI-1q for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:30 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGD-0002VG-Er; Wed, 04 May 2022 10:25:33 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:13 +0100 Message-Id: <20220504092600.10048-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 03/50] dino: move PCI bus initialisation to dino_pcihost_init() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651657392933100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 9401b68ff7..c6c01ea14c 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -526,13 +526,7 @@ PCIBus *dino_init(MemoryRegion *addr_space, s->iar0 =3D s->iar1 =3D CPU_HPA + 3; s->toc_addr =3D 0xFFFA0030; /* IO_COMMAND of CPU */ =20 - /* Dino PCI bus memory. */ - memory_region_init(&s->pci_mem, OBJECT(s), "pci-memory", 4 * GiB); - - b =3D pci_register_root_bus(dev, "pci", dino_set_irq, dino_pci_map_irq= , s, - &s->pci_mem, get_system_io(), - PCI_DEVFN(0, 0), 32, TYPE_PCI_BUS); - s->parent_obj.bus =3D b; + b =3D s->parent_obj.bus; sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 memory_region_add_subregion(addr_space, DINO_HPA, @@ -598,6 +592,14 @@ static void dino_pcihost_init(Object *obj) memory_region_add_subregion(&s->this_mem, DINO_CONFIG_DATA, &phb->data_mem); =20 + /* Dino PCI bus memory. */ + memory_region_init(&s->pci_mem, OBJECT(s), "pci-memory", 4 * GiB); + + phb->bus =3D pci_register_root_bus(DEVICE(s), "pci", + dino_set_irq, dino_pci_map_irq, s, + &s->pci_mem, get_system_io(), + PCI_DEVFN(0, 0), 32, TYPE_PCI_BUS); + sysbus_init_mmio(sbd, &s->this_mem); } =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651656939066758.0079176736582; Wed, 4 May 2022 02:35:39 -0700 (PDT) Received: from localhost ([::1]:53692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBQ1-0007yD-R4 for importer@patchew.org; Wed, 04 May 2022 05:35:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHG-0007fX-TG for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:39 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:48982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHF-0003zl-86 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:34 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGH-0002VG-MC; Wed, 04 May 2022 10:25:37 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:14 +0100 Message-Id: <20220504092600.10048-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 04/50] dino: move PCI windows initialisation to dino_pcihost_init() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651656940021100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index c6c01ea14c..bc27aad5dc 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -519,7 +519,6 @@ PCIBus *dino_init(MemoryRegion *addr_space, DeviceState *dev; DinoState *s; PCIBus *b; - int i; =20 dev =3D qdev_new(TYPE_DINO_PCI_HOST_BRIDGE); s =3D DINO_PCI_HOST_BRIDGE(dev); @@ -532,16 +531,6 @@ PCIBus *dino_init(MemoryRegion *addr_space, memory_region_add_subregion(addr_space, DINO_HPA, sysbus_mmio_get_region(SYS_BUS_DEVICE(dev)= , 0)); =20 - /* Set up windows into PCI bus memory. */ - for (i =3D 1; i < 31; i++) { - uint32_t addr =3D 0xf0000000 + i * DINO_MEM_CHUNK_SIZE; - char *name =3D g_strdup_printf("PCI Outbound Window %d", i); - memory_region_init_alias(&s->pci_mem_alias[i], OBJECT(s), - name, &s->pci_mem, addr, - DINO_MEM_CHUNK_SIZE); - g_free(name); - } - /* Set up PCI view of memory: Bus master address space. */ memory_region_init(&s->bm, OBJECT(s), "bm-dino", 4 * GiB); memory_region_init_alias(&s->bm_ram_alias, OBJECT(s), @@ -575,6 +564,7 @@ static void dino_pcihost_init(Object *obj) DinoState *s =3D DINO_PCI_HOST_BRIDGE(obj); PCIHostState *phb =3D PCI_HOST_BRIDGE(obj); SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); + int i; =20 /* Dino PCI access from main memory. */ memory_region_init_io(&s->this_mem, OBJECT(s), &dino_chip_ops, @@ -600,6 +590,16 @@ static void dino_pcihost_init(Object *obj) &s->pci_mem, get_system_io(), PCI_DEVFN(0, 0), 32, TYPE_PCI_BUS); =20 + /* Set up windows into PCI bus memory. */ + for (i =3D 1; i < 31; i++) { + uint32_t addr =3D 0xf0000000 + i * DINO_MEM_CHUNK_SIZE; + char *name =3D g_strdup_printf("PCI Outbound Window %d", i); + memory_region_init_alias(&s->pci_mem_alias[i], OBJECT(s), + name, &s->pci_mem, addr, + DINO_MEM_CHUNK_SIZE); + g_free(name); + } + sysbus_init_mmio(sbd, &s->this_mem); } =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651656948184413.5630233826038; Wed, 4 May 2022 02:35:48 -0700 (PDT) Received: from localhost ([::1]:54242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBQA-0008Q4-OM for importer@patchew.org; Wed, 04 May 2022 05:35:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHL-0007fm-49 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:39 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:48990) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHJ-000401-I3 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:38 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGL-0002VG-TC; Wed, 04 May 2022 10:25:41 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:15 +0100 Message-Id: <20220504092600.10048-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 05/50] dino: add memory-as property containing a link to the memory address space X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651656949784100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index bc27aad5dc..13b2210462 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -17,6 +17,7 @@ #include "hw/irq.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" +#include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "hppa_sys.h" #include "trace.h" @@ -124,6 +125,8 @@ struct DinoState { MemoryRegion pci_mem; MemoryRegion pci_mem_alias[32]; =20 + MemoryRegion *memory_as; + AddressSpace bm_as; MemoryRegion bm; MemoryRegion bm_ram_alias; @@ -521,6 +524,8 @@ PCIBus *dino_init(MemoryRegion *addr_space, PCIBus *b; =20 dev =3D qdev_new(TYPE_DINO_PCI_HOST_BRIDGE); + object_property_set_link(OBJECT(dev), "memory-as", OBJECT(addr_space), + &error_fatal); s =3D DINO_PCI_HOST_BRIDGE(dev); s->iar0 =3D s->iar1 =3D CPU_HPA + 3; s->toc_addr =3D 0xFFFA0030; /* IO_COMMAND of CPU */ @@ -603,10 +608,17 @@ static void dino_pcihost_init(Object *obj) sysbus_init_mmio(sbd, &s->this_mem); } =20 +static Property dino_pcihost_properties[] =3D { + DEFINE_PROP_LINK("memory-as", DinoState, memory_as, TYPE_MEMORY_REGION, + MemoryRegion *), + DEFINE_PROP_END_OF_LIST(), +}; + static void dino_pcihost_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 + device_class_set_props(dc, dino_pcihost_properties); dc->vmsd =3D &vmstate_dino; } =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651657217740388.5470760566451; Wed, 4 May 2022 02:40:17 -0700 (PDT) Received: from localhost ([::1]:33030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBUW-0005os-L7 for importer@patchew.org; Wed, 04 May 2022 05:40:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHP-0007gy-16 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:43 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49004) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHM-00040S-VS for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:42 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGP-0002VG-Kb; Wed, 04 May 2022 10:25:45 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:16 +0100 Message-Id: <20220504092600.10048-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 06/50] dino: move pci_setup_iommu() to dino_pcihost_init() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651657219364100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 13b2210462..dcebb9f98f 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -556,7 +556,6 @@ PCIBus *dino_init(MemoryRegion *addr_space, memory_region_add_subregion(&s->bm, 0xfff00000, &s->bm_cpu_alias); address_space_init(&s->bm_as, &s->bm, "pci-bm"); - pci_setup_iommu(b, dino_pcihost_set_iommu, s); =20 *p_rtc_irq =3D qemu_allocate_irq(dino_set_timer_irq, s, 0); *p_ser_irq =3D qemu_allocate_irq(dino_set_serial_irq, s, 0); @@ -605,6 +604,8 @@ static void dino_pcihost_init(Object *obj) g_free(name); } =20 + pci_setup_iommu(phb->bus, dino_pcihost_set_iommu, s); + sysbus_init_mmio(sbd, &s->this_mem); } =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651657590177461.13189650505524; Wed, 4 May 2022 02:46:30 -0700 (PDT) Received: from localhost ([::1]:41006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBaW-0003F5-3p for importer@patchew.org; Wed, 04 May 2022 05:46:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHP-0007gx-1N for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:43 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49006) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHN-00040U-51 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:42 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGT-0002VG-BZ; Wed, 04 May 2022 10:25:45 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:17 +0100 Message-Id: <20220504092600.10048-8-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 07/50] dino: move PCI bus master address space setup to dino_pcihost_realize() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651657592274100001 Content-Type: text/plain; charset="utf-8" Add a new dino_pcihost_unrealize() function to remove the address space whe= n the device is unrealized. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index dcebb9f98f..ae79ddbf5c 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -536,17 +536,27 @@ PCIBus *dino_init(MemoryRegion *addr_space, memory_region_add_subregion(addr_space, DINO_HPA, sysbus_mmio_get_region(SYS_BUS_DEVICE(dev)= , 0)); =20 + *p_rtc_irq =3D qemu_allocate_irq(dino_set_timer_irq, s, 0); + *p_ser_irq =3D qemu_allocate_irq(dino_set_serial_irq, s, 0); + + return b; +} + +static void dino_pcihost_realize(DeviceState *dev, Error **errp) +{ + DinoState *s =3D DINO_PCI_HOST_BRIDGE(dev); + /* Set up PCI view of memory: Bus master address space. */ memory_region_init(&s->bm, OBJECT(s), "bm-dino", 4 * GiB); memory_region_init_alias(&s->bm_ram_alias, OBJECT(s), - "bm-system", addr_space, 0, + "bm-system", s->memory_as, 0, 0xf0000000 + DINO_MEM_CHUNK_SIZE); memory_region_init_alias(&s->bm_pci_alias, OBJECT(s), "bm-pci", &s->pci_mem, 0xf0000000 + DINO_MEM_CHUNK_SIZE, 30 * DINO_MEM_CHUNK_SIZE); memory_region_init_alias(&s->bm_cpu_alias, OBJECT(s), - "bm-cpu", addr_space, 0xfff00000, + "bm-cpu", s->memory_as, 0xfff00000, 0xfffff); memory_region_add_subregion(&s->bm, 0, &s->bm_ram_alias); @@ -555,12 +565,15 @@ PCIBus *dino_init(MemoryRegion *addr_space, &s->bm_pci_alias); memory_region_add_subregion(&s->bm, 0xfff00000, &s->bm_cpu_alias); + address_space_init(&s->bm_as, &s->bm, "pci-bm"); +} =20 - *p_rtc_irq =3D qemu_allocate_irq(dino_set_timer_irq, s, 0); - *p_ser_irq =3D qemu_allocate_irq(dino_set_serial_irq, s, 0); +static void dino_pcihost_unrealize(DeviceState *dev) +{ + DinoState *s =3D DINO_PCI_HOST_BRIDGE(dev); =20 - return b; + address_space_destroy(&s->bm_as); } =20 static void dino_pcihost_init(Object *obj) @@ -619,6 +632,8 @@ static void dino_pcihost_class_init(ObjectClass *klass,= void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 + dc->realize =3D dino_pcihost_realize; + dc->unrealize =3D dino_pcihost_unrealize; device_class_set_props(dc, dino_pcihost_properties); dc->vmsd =3D &vmstate_dino; } --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165165722843543.05824413869709; Wed, 4 May 2022 02:40:28 -0700 (PDT) Received: from localhost ([::1]:33594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBUh-0006Gh-Fd for importer@patchew.org; Wed, 04 May 2022 05:40:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHQ-0007id-9A for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:44 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49016) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHO-00040a-Jv for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:44 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGT-0002VG-Nf; Wed, 04 May 2022 10:25:46 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:18 +0100 Message-Id: <20220504092600.10048-9-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 08/50] dino: move initial register configuration to new dino_pcihost_reset() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651657229424100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index ae79ddbf5c..d3cd8578a1 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -527,8 +527,6 @@ PCIBus *dino_init(MemoryRegion *addr_space, object_property_set_link(OBJECT(dev), "memory-as", OBJECT(addr_space), &error_fatal); s =3D DINO_PCI_HOST_BRIDGE(dev); - s->iar0 =3D s->iar1 =3D CPU_HPA + 3; - s->toc_addr =3D 0xFFFA0030; /* IO_COMMAND of CPU */ =20 b =3D s->parent_obj.bus; sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); @@ -542,6 +540,14 @@ PCIBus *dino_init(MemoryRegion *addr_space, return b; } =20 +static void dino_pcihost_reset(DeviceState *dev) +{ + DinoState *s =3D DINO_PCI_HOST_BRIDGE(dev); + + s->iar0 =3D s->iar1 =3D CPU_HPA + 3; + s->toc_addr =3D 0xFFFA0030; /* IO_COMMAND of CPU */ +} + static void dino_pcihost_realize(DeviceState *dev, Error **errp) { DinoState *s =3D DINO_PCI_HOST_BRIDGE(dev); @@ -632,6 +638,7 @@ static void dino_pcihost_class_init(ObjectClass *klass,= void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 + dc->reset =3D dino_pcihost_reset; dc->realize =3D dino_pcihost_realize; dc->unrealize =3D dino_pcihost_unrealize; device_class_set_props(dc, dino_pcihost_properties); --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651656944529623.127326202243; Wed, 4 May 2022 02:35:44 -0700 (PDT) Received: from localhost ([::1]:53952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBQ6-0008BQ-TU for importer@patchew.org; Wed, 04 May 2022 05:35:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHQ-0007iW-8G for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:44 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49028) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHO-00040c-OJ for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:43 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGU-0002VG-FE; Wed, 04 May 2022 10:25:46 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:19 +0100 Message-Id: <20220504092600.10048-10-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 09/50] dino: use QOM cast instead of directly referencing parent_obj X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651656945820100001 Content-Type: text/plain; charset="utf-8" Use a QOM cast in both dino_chip_read_with_attrs() and dino_chip_write_with= _attrs() instead of directly referencing parent_obj. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index d3cd8578a1..77b8089664 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -205,6 +205,7 @@ static MemTxResult dino_chip_read_with_attrs(void *opaq= ue, hwaddr addr, MemTxAttrs attrs) { DinoState *s =3D opaque; + PCIHostState *phb =3D PCI_HOST_BRIDGE(s); MemTxResult ret =3D MEMTX_OK; AddressSpace *io; uint16_t ioaddr; @@ -214,7 +215,7 @@ static MemTxResult dino_chip_read_with_attrs(void *opaq= ue, hwaddr addr, case DINO_PCI_IO_DATA ... DINO_PCI_IO_DATA + 3: /* Read from PCI IO space. */ io =3D &address_space_io; - ioaddr =3D s->parent_obj.config_reg + (addr & 3); + ioaddr =3D phb->config_reg + (addr & 3); switch (size) { case 1: val =3D address_space_ldub(io, ioaddr, attrs, &ret); @@ -297,6 +298,7 @@ static MemTxResult dino_chip_write_with_attrs(void *opa= que, hwaddr addr, MemTxAttrs attrs) { DinoState *s =3D opaque; + PCIHostState *phb =3D PCI_HOST_BRIDGE(s); AddressSpace *io; MemTxResult ret; uint16_t ioaddr; @@ -308,7 +310,7 @@ static MemTxResult dino_chip_write_with_attrs(void *opa= que, hwaddr addr, case DINO_IO_DATA ... DINO_PCI_IO_DATA + 3: /* Write into PCI IO space. */ io =3D &address_space_io; - ioaddr =3D s->parent_obj.config_reg + (addr & 3); + ioaddr =3D phb->config_reg + (addr & 3); switch (size) { case 1: address_space_stb(io, ioaddr, val, attrs, &ret); --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165165783348545.47817577917567; Wed, 4 May 2022 02:50:33 -0700 (PDT) Received: from localhost ([::1]:49318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBeR-0000ZC-TM for importer@patchew.org; Wed, 04 May 2022 05:50:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHR-0007is-Fa for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:47 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49030) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHO-00040g-OV for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:45 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGU-0002VG-RS; Wed, 04 May 2022 10:25:47 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:20 +0100 Message-Id: <20220504092600.10048-11-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 10/50] dino: return PCIBus from dino_init() using qdev_get_child_bus() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651657835197100001 Content-Type: text/plain; charset="utf-8" This allows access to the PCI bus without having to reference parent_obj di= rectly. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 77b8089664..d89b48493f 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -523,14 +523,12 @@ PCIBus *dino_init(MemoryRegion *addr_space, { DeviceState *dev; DinoState *s; - PCIBus *b; + PCIBus *pci_bus; =20 dev =3D qdev_new(TYPE_DINO_PCI_HOST_BRIDGE); object_property_set_link(OBJECT(dev), "memory-as", OBJECT(addr_space), &error_fatal); s =3D DINO_PCI_HOST_BRIDGE(dev); - - b =3D s->parent_obj.bus; sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 memory_region_add_subregion(addr_space, DINO_HPA, @@ -539,7 +537,8 @@ PCIBus *dino_init(MemoryRegion *addr_space, *p_rtc_irq =3D qemu_allocate_irq(dino_set_timer_irq, s, 0); *p_ser_irq =3D qemu_allocate_irq(dino_set_serial_irq, s, 0); =20 - return b; + pci_bus =3D PCI_BUS(qdev_get_child_bus(dev, "pci")); + return pci_bus; } =20 static void dino_pcihost_reset(DeviceState *dev) --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651657642203364.06156777372735; Wed, 4 May 2022 02:47:22 -0700 (PDT) Received: from localhost ([::1]:41624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBbM-0003fp-VK for importer@patchew.org; Wed, 04 May 2022 05:47:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHb-0007oi-Bn for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:56 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49038) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHZ-00040n-98 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:55 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGV-0002VG-66; Wed, 04 May 2022 10:25:47 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:21 +0100 Message-Id: <20220504092600.10048-12-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 11/50] dino: split declarations from dino.c into dino.h X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651657644103100001 Content-Type: text/plain; charset="utf-8" This is to allow access to DinoState from outside dino.c. With the changes = to the headers it is now possible to remove the duplicate definition for TYPE_DINO_PCI_HOST_BRIDGE from hppa_sys.h. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller --- hw/hppa/dino.c | 111 +-------------------------------------- hw/hppa/dino.h | 127 +++++++++++++++++++++++++++++++++++++++++++++ hw/hppa/hppa_sys.h | 2 - 3 files changed, 128 insertions(+), 112 deletions(-) create mode 100644 hw/hppa/dino.h diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index d89b48493f..01546ff6fc 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -18,122 +18,13 @@ #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" #include "hw/qdev-properties.h" +#include "dino.h" #include "migration/vmstate.h" #include "hppa_sys.h" #include "trace.h" #include "qom/object.h" =20 =20 -#define TYPE_DINO_PCI_HOST_BRIDGE "dino-pcihost" - -#define DINO_IAR0 0x004 -#define DINO_IODC 0x008 -#define DINO_IRR0 0x00C /* RO */ -#define DINO_IAR1 0x010 -#define DINO_IRR1 0x014 /* RO */ -#define DINO_IMR 0x018 -#define DINO_IPR 0x01C -#define DINO_TOC_ADDR 0x020 -#define DINO_ICR 0x024 -#define DINO_ILR 0x028 /* RO */ -#define DINO_IO_COMMAND 0x030 /* WO */ -#define DINO_IO_STATUS 0x034 /* RO */ -#define DINO_IO_CONTROL 0x038 -#define DINO_IO_GSC_ERR_RESP 0x040 /* RO */ -#define DINO_IO_ERR_INFO 0x044 /* RO */ -#define DINO_IO_PCI_ERR_RESP 0x048 /* RO */ -#define DINO_IO_FBB_EN 0x05c -#define DINO_IO_ADDR_EN 0x060 -#define DINO_PCI_CONFIG_ADDR 0x064 -#define DINO_PCI_CONFIG_DATA 0x068 -#define DINO_PCI_IO_DATA 0x06c -#define DINO_PCI_MEM_DATA 0x070 /* Dino 3.x only */ -#define DINO_GSC2X_CONFIG 0x7b4 /* RO */ -#define DINO_GMASK 0x800 -#define DINO_PAMR 0x804 -#define DINO_PAPR 0x808 -#define DINO_DAMODE 0x80c -#define DINO_PCICMD 0x810 -#define DINO_PCISTS 0x814 /* R/WC */ -#define DINO_MLTIM 0x81c -#define DINO_BRDG_FEAT 0x820 -#define DINO_PCIROR 0x824 -#define DINO_PCIWOR 0x828 -#define DINO_TLTIM 0x830 - -#define DINO_IRQS 11 /* bits 0-10 are architected */ -#define DINO_IRR_MASK 0x5ff /* only 10 bits are implemented */ -#define DINO_LOCAL_IRQS (DINO_IRQS + 1) -#define DINO_MASK_IRQ(x) (1 << (x)) - -#define PCIINTA 0x001 -#define PCIINTB 0x002 -#define PCIINTC 0x004 -#define PCIINTD 0x008 -#define PCIINTE 0x010 -#define PCIINTF 0x020 -#define GSCEXTINT 0x040 -/* #define xxx 0x080 - bit 7 is "default" */ -/* #define xxx 0x100 - bit 8 not used */ -/* #define xxx 0x200 - bit 9 not used */ -#define RS232INT 0x400 - -#define DINO_MEM_CHUNK_SIZE (8 * MiB) - -OBJECT_DECLARE_SIMPLE_TYPE(DinoState, DINO_PCI_HOST_BRIDGE) - -#define DINO800_REGS (1 + (DINO_TLTIM - DINO_GMASK) / 4) -static const uint32_t reg800_keep_bits[DINO800_REGS] =3D { - MAKE_64BIT_MASK(0, 1), /* GMASK */ - MAKE_64BIT_MASK(0, 7), /* PAMR */ - MAKE_64BIT_MASK(0, 7), /* PAPR */ - MAKE_64BIT_MASK(0, 8), /* DAMODE */ - MAKE_64BIT_MASK(0, 7), /* PCICMD */ - MAKE_64BIT_MASK(0, 9), /* PCISTS */ - MAKE_64BIT_MASK(0, 32), /* Undefined */ - MAKE_64BIT_MASK(0, 8), /* MLTIM */ - MAKE_64BIT_MASK(0, 30), /* BRDG_FEAT */ - MAKE_64BIT_MASK(0, 24), /* PCIROR */ - MAKE_64BIT_MASK(0, 22), /* PCIWOR */ - MAKE_64BIT_MASK(0, 32), /* Undocumented */ - MAKE_64BIT_MASK(0, 9), /* TLTIM */ -}; - -struct DinoState { - PCIHostState parent_obj; - - /* - * PCI_CONFIG_ADDR is parent_obj.config_reg, via pci_host_conf_be_ops, - * so that we can map PCI_CONFIG_DATA to pci_host_data_be_ops. - */ - uint32_t config_reg_dino; /* keep original copy, including 2 lowest bi= ts */ - - uint32_t iar0; - uint32_t iar1; - uint32_t imr; - uint32_t ipr; - uint32_t icr; - uint32_t ilr; - uint32_t io_fbb_en; - uint32_t io_addr_en; - uint32_t io_control; - uint32_t toc_addr; - - uint32_t reg800[DINO800_REGS]; - - MemoryRegion this_mem; - MemoryRegion pci_mem; - MemoryRegion pci_mem_alias[32]; - - MemoryRegion *memory_as; - - AddressSpace bm_as; - MemoryRegion bm; - MemoryRegion bm_ram_alias; - MemoryRegion bm_pci_alias; - MemoryRegion bm_cpu_alias; -}; - /* * Dino can forward memory accesses from the CPU in the range between * 0xf0800000 and 0xff000000 to the PCI bus. diff --git a/hw/hppa/dino.h b/hw/hppa/dino.h new file mode 100644 index 0000000000..1a26667377 --- /dev/null +++ b/hw/hppa/dino.h @@ -0,0 +1,127 @@ +/* + * HP-PARISC Dino PCI chipset emulation, as in B160L and similiar machines + * + * (C) 2017-2019 by Helge Deller + * + * This work is licensed under the GNU GPL license version 2 or later. + * + * Documentation available at: + * https://parisc.wiki.kernel.org/images-parisc/9/91/Dino_ers.pdf + * https://parisc.wiki.kernel.org/images-parisc/7/70/Dino_3_1_Errata.pdf + */ + +#ifndef DINO_H +#define DINO_H + +#include "hw/pci/pci_host.h" + +#define TYPE_DINO_PCI_HOST_BRIDGE "dino-pcihost" +OBJECT_DECLARE_SIMPLE_TYPE(DinoState, DINO_PCI_HOST_BRIDGE) + +#define DINO_IAR0 0x004 +#define DINO_IODC 0x008 +#define DINO_IRR0 0x00C /* RO */ +#define DINO_IAR1 0x010 +#define DINO_IRR1 0x014 /* RO */ +#define DINO_IMR 0x018 +#define DINO_IPR 0x01C +#define DINO_TOC_ADDR 0x020 +#define DINO_ICR 0x024 +#define DINO_ILR 0x028 /* RO */ +#define DINO_IO_COMMAND 0x030 /* WO */ +#define DINO_IO_STATUS 0x034 /* RO */ +#define DINO_IO_CONTROL 0x038 +#define DINO_IO_GSC_ERR_RESP 0x040 /* RO */ +#define DINO_IO_ERR_INFO 0x044 /* RO */ +#define DINO_IO_PCI_ERR_RESP 0x048 /* RO */ +#define DINO_IO_FBB_EN 0x05c +#define DINO_IO_ADDR_EN 0x060 +#define DINO_PCI_CONFIG_ADDR 0x064 +#define DINO_PCI_CONFIG_DATA 0x068 +#define DINO_PCI_IO_DATA 0x06c +#define DINO_PCI_MEM_DATA 0x070 /* Dino 3.x only */ +#define DINO_GSC2X_CONFIG 0x7b4 /* RO */ +#define DINO_GMASK 0x800 +#define DINO_PAMR 0x804 +#define DINO_PAPR 0x808 +#define DINO_DAMODE 0x80c +#define DINO_PCICMD 0x810 +#define DINO_PCISTS 0x814 /* R/WC */ +#define DINO_MLTIM 0x81c +#define DINO_BRDG_FEAT 0x820 +#define DINO_PCIROR 0x824 +#define DINO_PCIWOR 0x828 +#define DINO_TLTIM 0x830 + +#define DINO_IRQS 11 /* bits 0-10 are architected */ +#define DINO_IRR_MASK 0x5ff /* only 10 bits are implemented */ +#define DINO_LOCAL_IRQS (DINO_IRQS + 1) +#define DINO_MASK_IRQ(x) (1 << (x)) + +#define PCIINTA 0x001 +#define PCIINTB 0x002 +#define PCIINTC 0x004 +#define PCIINTD 0x008 +#define PCIINTE 0x010 +#define PCIINTF 0x020 +#define GSCEXTINT 0x040 +/* #define xxx 0x080 - bit 7 is "default" */ +/* #define xxx 0x100 - bit 8 not used */ +/* #define xxx 0x200 - bit 9 not used */ +#define RS232INT 0x400 + +#define DINO_MEM_CHUNK_SIZE (8 * MiB) + +#define DINO800_REGS (1 + (DINO_TLTIM - DINO_GMASK) / 4) +static const uint32_t reg800_keep_bits[DINO800_REGS] =3D { + MAKE_64BIT_MASK(0, 1), /* GMASK */ + MAKE_64BIT_MASK(0, 7), /* PAMR */ + MAKE_64BIT_MASK(0, 7), /* PAPR */ + MAKE_64BIT_MASK(0, 8), /* DAMODE */ + MAKE_64BIT_MASK(0, 7), /* PCICMD */ + MAKE_64BIT_MASK(0, 9), /* PCISTS */ + MAKE_64BIT_MASK(0, 32), /* Undefined */ + MAKE_64BIT_MASK(0, 8), /* MLTIM */ + MAKE_64BIT_MASK(0, 30), /* BRDG_FEAT */ + MAKE_64BIT_MASK(0, 24), /* PCIROR */ + MAKE_64BIT_MASK(0, 22), /* PCIWOR */ + MAKE_64BIT_MASK(0, 32), /* Undocumented */ + MAKE_64BIT_MASK(0, 9), /* TLTIM */ +}; + +struct DinoState { + PCIHostState parent_obj; + + /* + * PCI_CONFIG_ADDR is parent_obj.config_reg, via pci_host_conf_be_ops, + * so that we can map PCI_CONFIG_DATA to pci_host_data_be_ops. + */ + uint32_t config_reg_dino; /* keep original copy, including 2 lowest bi= ts */ + + uint32_t iar0; + uint32_t iar1; + uint32_t imr; + uint32_t ipr; + uint32_t icr; + uint32_t ilr; + uint32_t io_fbb_en; + uint32_t io_addr_en; + uint32_t io_control; + uint32_t toc_addr; + + uint32_t reg800[DINO800_REGS]; + + MemoryRegion this_mem; + MemoryRegion pci_mem; + MemoryRegion pci_mem_alias[32]; + + MemoryRegion *memory_as; + + AddressSpace bm_as; + MemoryRegion bm; + MemoryRegion bm_ram_alias; + MemoryRegion bm_pci_alias; + MemoryRegion bm_cpu_alias; +}; + +#endif diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index 0b18271cc9..9d8b28ec01 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -14,8 +14,6 @@ PCIBus *dino_init(MemoryRegion *, qemu_irq *, qemu_irq *); DeviceState *lasi_init(MemoryRegion *); #define enable_lasi_lan() 0 =20 -#define TYPE_DINO_PCI_HOST_BRIDGE "dino-pcihost" - /* hppa_pci.c. */ extern const MemoryRegionOps hppa_pci_ignore_ops; extern const MemoryRegionOps hppa_pci_conf1_ops; --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16516580163398.280040025454355; Wed, 4 May 2022 02:53:36 -0700 (PDT) Received: from localhost ([::1]:57758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBhO-0006Te-Hy for importer@patchew.org; Wed, 04 May 2022 05:53:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHe-0007pl-Or for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:58 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49052) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHc-00041P-Su for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:58 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGV-0002VG-Sm; Wed, 04 May 2022 10:25:51 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:22 +0100 Message-Id: <20220504092600.10048-13-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 12/50] hppa: use new CONFIG_HPPA_B160L option instead of CONFIG_DINO to build hppa machine X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658017509100001 Content-Type: text/plain; charset="utf-8" DINO refers to the GSC-PCI bridge device which will soon be handled separat= ely, however the QEMU HPPA machine is actually based upon the HPPA B160L as indi= cated by the Linux kernel dmesg output when booted in qemu-system-hppa and the QE= MU MAINTAINERS file. Update the machine configuration to use CONFIG_HPPA_B160L instead of CONFIG= _DINO and also update the machine description accordingly. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- configs/devices/hppa-softmmu/default.mak | 2 +- hw/hppa/Kconfig | 2 +- hw/hppa/machine.c | 2 +- hw/hppa/meson.build | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/devices/hppa-softmmu/default.mak b/configs/devices/hpp= a-softmmu/default.mak index b64c5eb3ff..b0364bb88f 100644 --- a/configs/devices/hppa-softmmu/default.mak +++ b/configs/devices/hppa-softmmu/default.mak @@ -6,4 +6,4 @@ =20 # Boards: # -CONFIG_DINO=3Dy +CONFIG_HPPA_B160L=3Dy diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig index 22948db025..8d64ead217 100644 --- a/hw/hppa/Kconfig +++ b/hw/hppa/Kconfig @@ -1,4 +1,4 @@ -config DINO +config HPPA_B160L bool imply PCI_DEVICES imply E1000_PCI diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index f7595c0857..971d7ffcfe 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -366,7 +366,7 @@ static void hppa_nmi(NMIState *n, int cpu_index, Error = **errp) =20 static void machine_hppa_machine_init(MachineClass *mc) { - mc->desc =3D "HPPA generic machine"; + mc->desc =3D "HPPA B160L machine"; mc->default_cpu_type =3D TYPE_HPPA_CPU; mc->init =3D machine_hppa_init; mc->reset =3D hppa_machine_reset; diff --git a/hw/hppa/meson.build b/hw/hppa/meson.build index 1deae83aee..32072bf204 100644 --- a/hw/hppa/meson.build +++ b/hw/hppa/meson.build @@ -1,4 +1,4 @@ hppa_ss =3D ss.source_set() -hppa_ss.add(when: 'CONFIG_DINO', if_true: files('pci.c', 'machine.c', 'din= o.c', 'lasi.c')) +hppa_ss.add(when: 'CONFIG_HPPA_B160L', if_true: files('pci.c', 'machine.c'= , 'dino.c', 'lasi.c')) =20 hw_arch +=3D {'hppa': hppa_ss} --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651658324551393.75911070223776; Wed, 4 May 2022 02:58:44 -0700 (PDT) Received: from localhost ([::1]:38248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBmM-00045N-T7 for importer@patchew.org; Wed, 04 May 2022 05:58:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHf-0007r6-6F for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:00 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49054) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHd-00041R-9w for qemu-devel@nongnu.org; Wed, 04 May 2022 05:26:58 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGZ-0002VG-FC; Wed, 04 May 2022 10:25:51 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:23 +0100 Message-Id: <20220504092600.10048-14-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 13/50] dino: change dino_init() to return the DINO device instead of PCIBus X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658325273100001 Content-Type: text/plain; charset="utf-8" This is in preparation for using more qdev APIs during the configuration of= the HPPA generic machine. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 8 +++----- hw/hppa/hppa_sys.h | 3 ++- hw/hppa/machine.c | 6 ++++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 01546ff6fc..6c488c908e 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -409,12 +409,11 @@ static void dino_set_serial_irq(void *opaque, int irq= , int level) dino_set_irq(opaque, 10, level); } =20 -PCIBus *dino_init(MemoryRegion *addr_space, - qemu_irq *p_rtc_irq, qemu_irq *p_ser_irq) +DinoState *dino_init(MemoryRegion *addr_space, + qemu_irq *p_rtc_irq, qemu_irq *p_ser_irq) { DeviceState *dev; DinoState *s; - PCIBus *pci_bus; =20 dev =3D qdev_new(TYPE_DINO_PCI_HOST_BRIDGE); object_property_set_link(OBJECT(dev), "memory-as", OBJECT(addr_space), @@ -428,8 +427,7 @@ PCIBus *dino_init(MemoryRegion *addr_space, *p_rtc_irq =3D qemu_allocate_irq(dino_set_timer_irq, s, 0); *p_ser_irq =3D qemu_allocate_irq(dino_set_serial_irq, s, 0); =20 - pci_bus =3D PCI_BUS(qdev_get_child_bus(dev, "pci")); - return pci_bus; + return s; } =20 static void dino_pcihost_reset(DeviceState *dev) diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index 9d8b28ec01..88773d2c35 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -9,8 +9,9 @@ #include "hw/intc/i8259.h" =20 #include "hppa_hardware.h" +#include "dino.h" =20 -PCIBus *dino_init(MemoryRegion *, qemu_irq *, qemu_irq *); +DinoState *dino_init(MemoryRegion *, qemu_irq *, qemu_irq *); DeviceState *lasi_init(MemoryRegion *); #define enable_lasi_lan() 0 =20 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 971d7ffcfe..94bc1b202a 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -17,6 +17,7 @@ #include "hw/char/serial.h" #include "hw/net/lasi_82596.h" #include "hw/nmi.h" +#include "dino.h" #include "hppa_sys.h" #include "qemu/units.h" #include "qapi/error.h" @@ -126,7 +127,7 @@ static void machine_hppa_init(MachineState *machine) const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; - DeviceState *dev; + DeviceState *dev, *dino_dev; PCIBus *pci_bus; ISABus *isa_bus; qemu_irq rtc_irq, serial_irq; @@ -166,7 +167,8 @@ static void machine_hppa_init(MachineState *machine) lasi_init(addr_space); =20 /* Init Dino (PCI host bus chip). */ - pci_bus =3D dino_init(addr_space, &rtc_irq, &serial_irq); + dino_dev =3D DEVICE(dino_init(addr_space, &rtc_irq, &serial_irq)); + pci_bus =3D PCI_BUS(qdev_get_child_bus(dino_dev, "pci")); assert(pci_bus); =20 /* Create ISA bus. */ --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165165772873655.09038689612726; Wed, 4 May 2022 02:48:48 -0700 (PDT) Received: from localhost ([::1]:45434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBcl-0006Mv-3p for importer@patchew.org; Wed, 04 May 2022 05:48:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHj-0007sO-G2 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:04 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHh-00041e-2z for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:02 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGZ-0002VG-T6; Wed, 04 May 2022 10:25:55 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:24 +0100 Message-Id: <20220504092600.10048-15-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 14/50] machine.c: map DINO device during board configuration X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651657730812100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 3 --- hw/hppa/machine.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 6c488c908e..82f301653b 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -421,9 +421,6 @@ DinoState *dino_init(MemoryRegion *addr_space, s =3D DINO_PCI_HOST_BRIDGE(dev); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 - memory_region_add_subregion(addr_space, DINO_HPA, - sysbus_mmio_get_region(SYS_BUS_DEVICE(dev)= , 0)); - *p_rtc_irq =3D qemu_allocate_irq(dino_set_timer_irq, s, 0); *p_ser_irq =3D qemu_allocate_irq(dino_set_serial_irq, s, 0); =20 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 94bc1b202a..5a490a9c37 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -168,6 +168,9 @@ static void machine_hppa_init(MachineState *machine) =20 /* Init Dino (PCI host bus chip). */ dino_dev =3D DEVICE(dino_init(addr_space, &rtc_irq, &serial_irq)); + memory_region_add_subregion(addr_space, DINO_HPA, + sysbus_mmio_get_region( + SYS_BUS_DEVICE(dino_dev), 0)); pci_bus =3D PCI_BUS(qdev_get_child_bus(dino_dev, "pci")); assert(pci_bus); =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651657225562707.2914807207143; Wed, 4 May 2022 02:40:25 -0700 (PDT) Received: from localhost ([::1]:33340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBUe-00063H-9K for importer@patchew.org; Wed, 04 May 2022 05:40:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHk-0007td-HX for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:04 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49070) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHi-00041h-Hq for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:04 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGd-0002VG-Mc; Wed, 04 May 2022 10:25:56 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:25 +0100 Message-Id: <20220504092600.10048-16-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 15/50] dino.h: add defines for DINO IRQ numbers X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651657227442100001 Content-Type: text/plain; charset="utf-8" This is to allow the DINO IRQs to be defined as qdev GPIOs. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/hppa/dino.h b/hw/hppa/dino.h index 1a26667377..70fb8c52c8 100644 --- a/hw/hppa/dino.h +++ b/hw/hppa/dino.h @@ -58,6 +58,18 @@ OBJECT_DECLARE_SIMPLE_TYPE(DinoState, DINO_PCI_HOST_BRID= GE) #define DINO_LOCAL_IRQS (DINO_IRQS + 1) #define DINO_MASK_IRQ(x) (1 << (x)) =20 +#define DINO_IRQ_PCIINTA 0 +#define DINO_IRQ_PCIINTB 1 +#define DINO_IRQ_PCIINTC 2 +#define DINO_IRQ_PCIINTD 3 +#define DINO_IRQ_PCIINTE 4 +#define DINO_IRQ_PCIINTF 5 +#define DINO_IRQ_GSCEXTINT 6 +#define DINO_IRQ_BUSERRINT 7 +#define DINO_IRQ_PS2INT 8 +#define DINO_IRQ_UNUSED 9 +#define DINO_IRQ_RS232INT 10 + #define PCIINTA 0x001 #define PCIINTB 0x002 #define PCIINTC 0x004 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651657873062232.89573426427944; Wed, 4 May 2022 02:51:13 -0700 (PDT) Received: from localhost ([::1]:49992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBf5-00012u-GH for importer@patchew.org; Wed, 04 May 2022 05:51:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHo-0007xz-An for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:09 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHl-000429-Iy for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:06 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGe-0002VG-3F; Wed, 04 May 2022 10:26:00 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:26 +0100 Message-Id: <20220504092600.10048-17-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 16/50] dino: define IRQ inputs as qdev GPIOs X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651657873367100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 2 ++ hw/hppa/dino.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 82f301653b..f58aebf94d 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -513,6 +513,8 @@ static void dino_pcihost_init(Object *obj) pci_setup_iommu(phb->bus, dino_pcihost_set_iommu, s); =20 sysbus_init_mmio(sbd, &s->this_mem); + + qdev_init_gpio_in(DEVICE(obj), dino_set_irq, DINO_IRQS); } =20 static Property dino_pcihost_properties[] =3D { diff --git a/hw/hppa/dino.h b/hw/hppa/dino.h index 70fb8c52c8..ca380515f2 100644 --- a/hw/hppa/dino.h +++ b/hw/hppa/dino.h @@ -134,6 +134,8 @@ struct DinoState { MemoryRegion bm_ram_alias; MemoryRegion bm_pci_alias; MemoryRegion bm_cpu_alias; + + qemu_irq irqs[DINO_IRQS]; }; =20 #endif --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651657945261106.75323898961733; Wed, 4 May 2022 02:52:25 -0700 (PDT) Received: from localhost ([::1]:53816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBgF-0003l9-C0 for importer@patchew.org; Wed, 04 May 2022 05:52:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHr-0007zF-E8 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:11 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49086) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHp-00042c-U1 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:11 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGi-0002VG-AV; Wed, 04 May 2022 10:26:03 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:27 +0100 Message-Id: <20220504092600.10048-18-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 17/50] dino: wire up serial IRQ using a qdev GPIO in machine.c X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651657947095100001 Content-Type: text/plain; charset="utf-8" This makes it unnecessary to allocate a separate IRQ for the serial port. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 8 +------- hw/hppa/hppa_sys.h | 2 +- hw/hppa/machine.c | 7 ++++--- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index f58aebf94d..80ffe27188 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -404,13 +404,8 @@ static void dino_set_timer_irq(void *opaque, int irq, = int level) /* ??? Not connected. */ } =20 -static void dino_set_serial_irq(void *opaque, int irq, int level) -{ - dino_set_irq(opaque, 10, level); -} - DinoState *dino_init(MemoryRegion *addr_space, - qemu_irq *p_rtc_irq, qemu_irq *p_ser_irq) + qemu_irq *p_rtc_irq) { DeviceState *dev; DinoState *s; @@ -422,7 +417,6 @@ DinoState *dino_init(MemoryRegion *addr_space, sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 *p_rtc_irq =3D qemu_allocate_irq(dino_set_timer_irq, s, 0); - *p_ser_irq =3D qemu_allocate_irq(dino_set_serial_irq, s, 0); =20 return s; } diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index 88773d2c35..c238e7ebc8 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -11,7 +11,7 @@ #include "hppa_hardware.h" #include "dino.h" =20 -DinoState *dino_init(MemoryRegion *, qemu_irq *, qemu_irq *); +DinoState *dino_init(MemoryRegion *, qemu_irq *); DeviceState *lasi_init(MemoryRegion *); #define enable_lasi_lan() 0 =20 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 5a490a9c37..f757aecda0 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -130,7 +130,7 @@ static void machine_hppa_init(MachineState *machine) DeviceState *dev, *dino_dev; PCIBus *pci_bus; ISABus *isa_bus; - qemu_irq rtc_irq, serial_irq; + qemu_irq rtc_irq; char *firmware_filename; uint64_t firmware_low, firmware_high; long size; @@ -167,7 +167,7 @@ static void machine_hppa_init(MachineState *machine) lasi_init(addr_space); =20 /* Init Dino (PCI host bus chip). */ - dino_dev =3D DEVICE(dino_init(addr_space, &rtc_irq, &serial_irq)); + dino_dev =3D DEVICE(dino_init(addr_space, &rtc_irq)); memory_region_add_subregion(addr_space, DINO_HPA, sysbus_mmio_get_region( SYS_BUS_DEVICE(dino_dev), 0)); @@ -184,7 +184,8 @@ static void machine_hppa_init(MachineState *machine) /* Serial code setup. */ if (serial_hd(0)) { uint32_t addr =3D DINO_UART_HPA + 0x800; - serial_mm_init(addr_space, addr, 0, serial_irq, + serial_mm_init(addr_space, addr, 0, + qdev_get_gpio_in(dino_dev, DINO_IRQ_RS232INT), 115200, serial_hd(0), DEVICE_BIG_ENDIAN); } =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651658664829337.58636100687795; Wed, 4 May 2022 03:04:24 -0700 (PDT) Received: from localhost ([::1]:49784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBrr-0003cZ-If for importer@patchew.org; Wed, 04 May 2022 06:04:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHv-00082K-PZ for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:17 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49094) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHu-00043D-3t for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:15 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGm-0002VG-1l; Wed, 04 May 2022 10:26:08 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:28 +0100 Message-Id: <20220504092600.10048-19-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 18/50] dino: remove unused dino_set_timer_irq() IRQ handler X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658665503100001 Content-Type: text/plain; charset="utf-8" According to the comments in dino.c the timer IRQ is unused, so remove the = empty dino_set_timer_irq() handler function and simply pass NULL to mc146818_rtc_= init() in machine.c instead. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 10 +--------- hw/hppa/hppa_sys.h | 2 +- hw/hppa/machine.c | 5 ++--- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 80ffe27188..d8baf139d6 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -399,13 +399,7 @@ static int dino_pci_map_irq(PCIDevice *d, int irq_num) return slot & 0x03; } =20 -static void dino_set_timer_irq(void *opaque, int irq, int level) -{ - /* ??? Not connected. */ -} - -DinoState *dino_init(MemoryRegion *addr_space, - qemu_irq *p_rtc_irq) +DinoState *dino_init(MemoryRegion *addr_space) { DeviceState *dev; DinoState *s; @@ -416,8 +410,6 @@ DinoState *dino_init(MemoryRegion *addr_space, s =3D DINO_PCI_HOST_BRIDGE(dev); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 - *p_rtc_irq =3D qemu_allocate_irq(dino_set_timer_irq, s, 0); - return s; } =20 diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index c238e7ebc8..ebedecf1c8 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -11,7 +11,7 @@ #include "hppa_hardware.h" #include "dino.h" =20 -DinoState *dino_init(MemoryRegion *, qemu_irq *); +DinoState *dino_init(MemoryRegion *); DeviceState *lasi_init(MemoryRegion *); #define enable_lasi_lan() 0 =20 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index f757aecda0..49ecb971be 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -130,7 +130,6 @@ static void machine_hppa_init(MachineState *machine) DeviceState *dev, *dino_dev; PCIBus *pci_bus; ISABus *isa_bus; - qemu_irq rtc_irq; char *firmware_filename; uint64_t firmware_low, firmware_high; long size; @@ -167,7 +166,7 @@ static void machine_hppa_init(MachineState *machine) lasi_init(addr_space); =20 /* Init Dino (PCI host bus chip). */ - dino_dev =3D DEVICE(dino_init(addr_space, &rtc_irq)); + dino_dev =3D DEVICE(dino_init(addr_space)); memory_region_add_subregion(addr_space, DINO_HPA, sysbus_mmio_get_region( SYS_BUS_DEVICE(dino_dev), 0)); @@ -179,7 +178,7 @@ static void machine_hppa_init(MachineState *machine) assert(isa_bus); =20 /* Realtime clock, used by firmware for PDC_TOD call. */ - mc146818_rtc_init(isa_bus, 2000, rtc_irq); + mc146818_rtc_init(isa_bus, 2000, NULL); =20 /* Serial code setup. */ if (serial_hd(0)) { --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651659066713780.982745671934; Wed, 4 May 2022 03:11:06 -0700 (PDT) Received: from localhost ([::1]:58372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmByL-00019f-91 for importer@patchew.org; Wed, 04 May 2022 06:11:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHz-000875-JA for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:19 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49104) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHy-00043Z-2t for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:19 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGq-0002VG-Cp; Wed, 04 May 2022 10:26:12 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:29 +0100 Message-Id: <20220504092600.10048-20-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 19/50] hppa: move dino_init() from dino.c to machine.c X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651659068768100001 Content-Type: text/plain; charset="utf-8" Now that dino_init() is completely decoupled from dino.c it can be moved to machine.c with the rest of the board configuration. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 14 -------------- hw/hppa/hppa_sys.h | 2 -- hw/hppa/machine.c | 12 ++++++++++++ 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index d8baf139d6..6d12c385aa 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -399,20 +399,6 @@ static int dino_pci_map_irq(PCIDevice *d, int irq_num) return slot & 0x03; } =20 -DinoState *dino_init(MemoryRegion *addr_space) -{ - DeviceState *dev; - DinoState *s; - - dev =3D qdev_new(TYPE_DINO_PCI_HOST_BRIDGE); - object_property_set_link(OBJECT(dev), "memory-as", OBJECT(addr_space), - &error_fatal); - s =3D DINO_PCI_HOST_BRIDGE(dev); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - - return s; -} - static void dino_pcihost_reset(DeviceState *dev) { DinoState *s =3D DINO_PCI_HOST_BRIDGE(dev); diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index ebedecf1c8..7c31dd8396 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -9,9 +9,7 @@ #include "hw/intc/i8259.h" =20 #include "hppa_hardware.h" -#include "dino.h" =20 -DinoState *dino_init(MemoryRegion *); DeviceState *lasi_init(MemoryRegion *); #define enable_lasi_lan() 0 =20 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 49ecb971be..4b753fa346 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -122,6 +122,18 @@ static FWCfgState *create_fw_cfg(MachineState *ms) return fw_cfg; } =20 +static DinoState *dino_init(MemoryRegion *addr_space) +{ + DeviceState *dev; + + dev =3D qdev_new(TYPE_DINO_PCI_HOST_BRIDGE); + object_property_set_link(OBJECT(dev), "memory-as", OBJECT(addr_space), + &error_fatal); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + + return DINO_PCI_HOST_BRIDGE(dev); +} + static void machine_hppa_init(MachineState *machine) { const char *kernel_filename =3D machine->kernel_filename; --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651657604140276.4401784757066; Wed, 4 May 2022 02:46:44 -0700 (PDT) Received: from localhost ([::1]:41298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBal-0003Rr-0H for importer@patchew.org; Wed, 04 May 2022 05:46:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHz-000874-FJ for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:19 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49110) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBHy-00043d-2T for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:19 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGu-0002VG-3v; Wed, 04 May 2022 10:26:12 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:30 +0100 Message-Id: <20220504092600.10048-21-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 20/50] dino: use numerical constant for iar0 and iar1 reset values X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651657606184100001 Content-Type: text/plain; charset="utf-8" This is to allow us to decouple the DINO device from the board logic. The c= hoice of using a hard-coded constant (along with a comment) is to match how this = is already done for toc_addr. If it is decided later that these values need to= be configurable then they can easily be converted to qdev properties. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 6d12c385aa..aa7f812e22 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -403,7 +403,7 @@ static void dino_pcihost_reset(DeviceState *dev) { DinoState *s =3D DINO_PCI_HOST_BRIDGE(dev); =20 - s->iar0 =3D s->iar1 =3D CPU_HPA + 3; + s->iar0 =3D s->iar1 =3D 0xFFFB0000 + 3; /* CPU_HPA + 3 */ s->toc_addr =3D 0xFFFA0030; /* IO_COMMAND of CPU */ } =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651658205127109.17513046764645; Wed, 4 May 2022 02:56:45 -0700 (PDT) Received: from localhost ([::1]:34362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBkR-0001JN-Mg for importer@patchew.org; Wed, 04 May 2022 05:56:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBI3-0008EA-4q for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:23 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49118) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBI1-00044C-Lv for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:22 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGu-0002VG-Hk; Wed, 04 May 2022 10:26:16 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:31 +0100 Message-Id: <20220504092600.10048-22-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 21/50] dino: move DINO HPA constants from hppa_hardware.h to dino.h X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658206784100001 Content-Type: text/plain; charset="utf-8" This is to allow us to decouple the DINO device from the board logic. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/dino.h | 5 +++++ hw/hppa/hppa_hardware.h | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/hppa/dino.h b/hw/hppa/dino.h index ca380515f2..a1b0184940 100644 --- a/hw/hppa/dino.h +++ b/hw/hppa/dino.h @@ -101,6 +101,11 @@ static const uint32_t reg800_keep_bits[DINO800_REGS] = =3D { MAKE_64BIT_MASK(0, 9), /* TLTIM */ }; =20 +/* offsets to DINO HPA: */ +#define DINO_PCI_ADDR 0x064 +#define DINO_CONFIG_DATA 0x068 +#define DINO_IO_DATA 0x06c + struct DinoState { PCIHostState parent_obj; =20 diff --git a/hw/hppa/hppa_hardware.h b/hw/hppa/hppa_hardware.h index 5edf577563..8b6b9222cb 100644 --- a/hw/hppa/hppa_hardware.h +++ b/hw/hppa/hppa_hardware.h @@ -30,11 +30,6 @@ #define PCI_HPA DINO_HPA /* PCI bus */ #define IDE_HPA 0xf9000000 /* Boot disc controller */ =20 -/* offsets to DINO HPA: */ -#define DINO_PCI_ADDR 0x064 -#define DINO_CONFIG_DATA 0x068 -#define DINO_IO_DATA 0x06c - #define PORT_PCI_CMD (PCI_HPA + DINO_PCI_ADDR) #define PORT_PCI_DATA (PCI_HPA + DINO_CONFIG_DATA) =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651658491406207.34426671322933; Wed, 4 May 2022 03:01:31 -0700 (PDT) Received: from localhost ([::1]:43082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBp4-0007Kt-AS for importer@patchew.org; Wed, 04 May 2022 06:01:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIF-0008KD-Ug for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:36 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49128) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBI6-00044V-0i for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:27 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBGy-0002VG-Be; Wed, 04 May 2022 10:26:20 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:32 +0100 Message-Id: <20220504092600.10048-23-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 22/50] dino: move from hw/hppa to hw/pci-host X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658492358100001 Content-Type: text/plain; charset="utf-8" Move the DINO device implementation from hw/hppa to hw/pci-host so that it = is located with all the other PCI host bridges. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- MAINTAINERS | 2 ++ hw/hppa/Kconfig | 2 +- hw/hppa/machine.c | 2 +- hw/hppa/meson.build | 2 +- hw/hppa/trace-events | 5 ----- hw/pci-host/Kconfig | 4 ++++ hw/{hppa =3D> pci-host}/dino.c | 3 +-- hw/pci-host/meson.build | 3 +++ hw/pci-host/trace-events | 5 +++++ {hw/hppa =3D> include/hw/pci-host}/dino.h | 0 10 files changed, 18 insertions(+), 10 deletions(-) rename hw/{hppa =3D> pci-host}/dino.c (99%) rename {hw/hppa =3D> include/hw/pci-host}/dino.h (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 294c88ace9..07f85829b0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1114,7 +1114,9 @@ S: Odd Fixes F: configs/devices/hppa-softmmu/default.mak F: hw/hppa/ F: hw/net/*i82596* +F: hw/pci-host/dino.c F: include/hw/net/lasi_82596.h +F: include/hw/pci-host/dino.h F: pc-bios/hppa-firmware.img =20 M68K Machines diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig index 8d64ead217..724380ecec 100644 --- a/hw/hppa/Kconfig +++ b/hw/hppa/Kconfig @@ -3,7 +3,7 @@ config HPPA_B160L imply PCI_DEVICES imply E1000_PCI imply VIRTIO_VGA - select PCI + select DINO select SERIAL select ISA_BUS select I8259 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 4b753fa346..c847febe5d 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -17,7 +17,7 @@ #include "hw/char/serial.h" #include "hw/net/lasi_82596.h" #include "hw/nmi.h" -#include "dino.h" +#include "hw/pci-host/dino.h" #include "hppa_sys.h" #include "qemu/units.h" #include "qapi/error.h" diff --git a/hw/hppa/meson.build b/hw/hppa/meson.build index 32072bf204..a6f9db455c 100644 --- a/hw/hppa/meson.build +++ b/hw/hppa/meson.build @@ -1,4 +1,4 @@ hppa_ss =3D ss.source_set() -hppa_ss.add(when: 'CONFIG_HPPA_B160L', if_true: files('pci.c', 'machine.c'= , 'dino.c', 'lasi.c')) +hppa_ss.add(when: 'CONFIG_HPPA_B160L', if_true: files('pci.c', 'machine.c'= , 'lasi.c')) =20 hw_arch +=3D {'hppa': hppa_ss} diff --git a/hw/hppa/trace-events b/hw/hppa/trace-events index 3f42be9056..871a473771 100644 --- a/hw/hppa/trace-events +++ b/hw/hppa/trace-events @@ -3,11 +3,6 @@ # pci.c hppa_pci_iack_write(void) "" =20 -# dino.c -dino_chip_mem_valid(uint64_t addr, uint32_t val) "access to addr 0x%"PRIx6= 4" is %d" -dino_chip_read(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x" -dino_chip_write(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x" - # lasi.c lasi_chip_mem_valid(uint64_t addr, uint32_t val) "access to addr 0x%"PRIx6= 4" is %d" lasi_chip_read(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x" diff --git a/hw/pci-host/Kconfig b/hw/pci-host/Kconfig index 2b5f7d58cc..38fd2ee8f3 100644 --- a/hw/pci-host/Kconfig +++ b/hw/pci-host/Kconfig @@ -77,3 +77,7 @@ config MV64361 bool select PCI select I8259 + +config DINO + bool + select PCI diff --git a/hw/hppa/dino.c b/hw/pci-host/dino.c similarity index 99% rename from hw/hppa/dino.c rename to hw/pci-host/dino.c index aa7f812e22..f257c24e64 100644 --- a/hw/hppa/dino.c +++ b/hw/pci-host/dino.c @@ -18,9 +18,8 @@ #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" #include "hw/qdev-properties.h" -#include "dino.h" +#include "hw/pci-host/dino.h" #include "migration/vmstate.h" -#include "hppa_sys.h" #include "trace.h" #include "qom/object.h" =20 diff --git a/hw/pci-host/meson.build b/hw/pci-host/meson.build index 4c4f39c15c..c07596d0d1 100644 --- a/hw/pci-host/meson.build +++ b/hw/pci-host/meson.build @@ -25,6 +25,9 @@ pci_ss.add(when: 'CONFIG_MV64361', if_true: files('mv6436= 1.c')) # ARM devices pci_ss.add(when: 'CONFIG_VERSATILE_PCI', if_true: files('versatile.c')) =20 +# HPPA devices +pci_ss.add(when: 'CONFIG_DINO', if_true: files('dino.c')) + softmmu_ss.add_all(when: 'CONFIG_PCI', if_true: pci_ss) =20 specific_ss.add(when: 'CONFIG_PCI_POWERNV', if_true: files( diff --git a/hw/pci-host/trace-events b/hw/pci-host/trace-events index 6e5d8d3355..437e66ff50 100644 --- a/hw/pci-host/trace-events +++ b/hw/pci-host/trace-events @@ -34,3 +34,8 @@ unin_read(uint64_t addr, uint64_t value) "addr=3D0x%" PRI= x64 " val=3D0x%"PRIx64 pnv_phb4_xive_notify(uint64_t notif_port, uint64_t data) "notif=3D@0x%"PRI= x64" data=3D0x%"PRIx64 pnv_phb4_xive_notify_ic(uint64_t addr, uint64_t data) "addr=3D@0x%"PRIx64"= data=3D0x%"PRIx64 pnv_phb4_xive_notify_abt(uint64_t notif_port, uint64_t data) "notif=3D@0x%= "PRIx64" data=3D0x%"PRIx64 + +# dino.c +dino_chip_mem_valid(uint64_t addr, uint32_t val) "access to addr 0x%"PRIx6= 4" is %d" +dino_chip_read(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x" +dino_chip_write(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x" diff --git a/hw/hppa/dino.h b/include/hw/pci-host/dino.h similarity index 100% rename from hw/hppa/dino.h rename to include/hw/pci-host/dino.h --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651659304739338.7789532269006; Wed, 4 May 2022 03:15:04 -0700 (PDT) Received: from localhost ([::1]:38638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmC2B-0007Bu-N8 for importer@patchew.org; Wed, 04 May 2022 06:15:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIF-0008KA-Ut for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:36 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49134) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBI6-00044X-Aw for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:27 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBH2-0002VG-N2; Wed, 04 May 2022 10:26:20 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:33 +0100 Message-Id: <20220504092600.10048-24-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 23/50] lasi: checkpatch fixes X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651659306887100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/lasi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 88c3791eb6..3b77fba1c6 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -169,10 +169,11 @@ static MemTxResult lasi_chip_write_with_attrs(void *o= paque, hwaddr addr, break; case LASI_IMR: s->imr =3D val; - if (((val & LASI_IRQ_BITS) !=3D val) && (val !=3D 0xffffffff)) + if (((val & LASI_IRQ_BITS) !=3D val) && (val !=3D 0xffffffff)) { qemu_log_mask(LOG_GUEST_ERROR, "LASI: tried to set invalid %lx IMR value.\n", (unsigned long) val); + } break; case LASI_IPR: /* Any write to IPR clears the register. */ @@ -200,8 +201,9 @@ static MemTxResult lasi_chip_write_with_attrs(void *opa= que, hwaddr addr, break; =20 case LASI_PCR: - if (val =3D=3D 0x02) /* immediately power off */ + if (val =3D=3D 0x02) { /* immediately power off */ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } break; case LASI_ERRLOG: s->errlog =3D val; --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651657839662684.8388514069941; Wed, 4 May 2022 02:50:39 -0700 (PDT) Received: from localhost ([::1]:49546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBeY-0000ks-MR for importer@patchew.org; Wed, 04 May 2022 05:50:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIJ-0008M0-OE for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:41 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49142) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIC-00044s-9I for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:36 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBH3-0002VG-1d; Wed, 04 May 2022 10:26:24 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:34 +0100 Message-Id: <20220504092600.10048-25-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 24/50] lasi: move memory region initialisation to new lasi_init() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651657841249100001 Content-Type: text/plain; charset="utf-8" Create a new lasi_init() instance initialisation function and move the LASI memory region initialisation into it. Rename the existing lasi_init() funct= ion to lasi_initfn() for now. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/hppa_sys.h | 2 +- hw/hppa/lasi.c | 13 ++++++++++--- hw/hppa/machine.c | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index 7c31dd8396..0929dedded 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -10,7 +10,7 @@ =20 #include "hppa_hardware.h" =20 -DeviceState *lasi_init(MemoryRegion *); +DeviceState *lasi_initfn(MemoryRegion *); #define enable_lasi_lan() 0 =20 /* hppa_pci.c. */ diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 3b77fba1c6..c028b7786e 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -296,7 +296,7 @@ static int lasi_get_irq(unsigned long hpa) } } =20 -DeviceState *lasi_init(MemoryRegion *address_space) +DeviceState *lasi_initfn(MemoryRegion *address_space) { DeviceState *dev; LasiState *s; @@ -306,8 +306,6 @@ DeviceState *lasi_init(MemoryRegion *address_space) s->iar =3D CPU_HPA + 3; =20 /* Lasi access from main memory. */ - memory_region_init_io(&s->this_mem, OBJECT(s), &lasi_chip_ops, - s, "lasi", 0x100000); memory_region_add_subregion(address_space, LASI_HPA, &s->this_mem); =20 sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); @@ -347,6 +345,14 @@ DeviceState *lasi_init(MemoryRegion *address_space) return dev; } =20 +static void lasi_init(Object *obj) +{ + LasiState *s =3D LASI_CHIP(obj); + + memory_region_init_io(&s->this_mem, OBJECT(s), &lasi_chip_ops, + s, "lasi", 0x100000); +} + static void lasi_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -357,6 +363,7 @@ static void lasi_class_init(ObjectClass *klass, void *d= ata) static const TypeInfo lasi_pcihost_info =3D { .name =3D TYPE_LASI_CHIP, .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_init =3D lasi_init, .instance_size =3D sizeof(LasiState), .class_init =3D lasi_class_init, }; diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index c847febe5d..2fa55de549 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -175,7 +175,7 @@ static void machine_hppa_init(MachineState *machine) =20 =20 /* Init Lasi chip */ - lasi_init(addr_space); + lasi_initfn(addr_space); =20 /* Init Dino (PCI host bus chip). */ dino_dev =3D DEVICE(dino_init(addr_space)); --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651658026976463.259008432708; Wed, 4 May 2022 02:53:46 -0700 (PDT) Received: from localhost ([::1]:58056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBhZ-0006fp-Hs for importer@patchew.org; Wed, 04 May 2022 05:53:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIJ-0008M2-Nm for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:41 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49150) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBID-00045D-SE for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:38 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBH6-0002VG-Q1; Wed, 04 May 2022 10:26:28 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:35 +0100 Message-Id: <20220504092600.10048-26-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 25/50] lasi: move register memory mapping from lasi.c to machine.c X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658027459100001 Content-Type: text/plain; charset="utf-8" The device register should be mapped directly by the board code. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller --- hw/hppa/lasi.c | 7 +++---- hw/hppa/machine.c | 7 +++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index c028b7786e..08ebe7c6d9 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -304,10 +304,6 @@ DeviceState *lasi_initfn(MemoryRegion *address_space) dev =3D qdev_new(TYPE_LASI_CHIP); s =3D LASI_CHIP(dev); s->iar =3D CPU_HPA + 3; - - /* Lasi access from main memory. */ - memory_region_add_subregion(address_space, LASI_HPA, &s->this_mem); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 /* LAN */ @@ -348,9 +344,12 @@ DeviceState *lasi_initfn(MemoryRegion *address_space) static void lasi_init(Object *obj) { LasiState *s =3D LASI_CHIP(obj); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); =20 memory_region_init_io(&s->this_mem, OBJECT(s), &lasi_chip_ops, s, "lasi", 0x100000); + + sysbus_init_mmio(sbd, &s->this_mem); } =20 static void lasi_class_init(ObjectClass *klass, void *data) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 2fa55de549..6618bce435 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -139,7 +139,7 @@ static void machine_hppa_init(MachineState *machine) const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; - DeviceState *dev, *dino_dev; + DeviceState *dev, *dino_dev, *lasi_dev; PCIBus *pci_bus; ISABus *isa_bus; char *firmware_filename; @@ -175,7 +175,10 @@ static void machine_hppa_init(MachineState *machine) =20 =20 /* Init Lasi chip */ - lasi_initfn(addr_space); + lasi_dev =3D lasi_initfn(addr_space); + memory_region_add_subregion(addr_space, LASI_HPA, + sysbus_mmio_get_region( + SYS_BUS_DEVICE(lasi_dev), 0)); =20 /* Init Dino (PCI host bus chip). */ dino_dev =3D DEVICE(dino_init(addr_space)); --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651658751147368.290911481682; Wed, 4 May 2022 03:05:51 -0700 (PDT) Received: from localhost ([::1]:51606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBtF-0004po-Pc for importer@patchew.org; Wed, 04 May 2022 06:05:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIM-0008OV-UZ for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:43 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49158) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIK-00045e-3s for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:42 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHA-0002VG-IJ; Wed, 04 May 2022 10:26:32 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:36 +0100 Message-Id: <20220504092600.10048-27-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 26/50] lasi: move initialisation of iar and rtc to new lasi_reset() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658751860100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/lasi.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 08ebe7c6d9..242713c7bd 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -303,7 +303,6 @@ DeviceState *lasi_initfn(MemoryRegion *address_space) =20 dev =3D qdev_new(TYPE_LASI_CHIP); s =3D LASI_CHIP(dev); - s->iar =3D CPU_HPA + 3; sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 /* LAN */ @@ -319,11 +318,6 @@ DeviceState *lasi_initfn(MemoryRegion *address_space) parallel_mm_init(address_space, LASI_LPT_HPA + 0x800, 0, lpt_irq, parallel_hds[0]); =20 - /* Real time clock (RTC), it's only one 32-bit counter @9000 */ - - s->rtc =3D time(NULL); - s->rtc_ref =3D 0; - if (serial_hd(1)) { /* Serial port */ qemu_irq serial_irq =3D qemu_allocate_irq(lasi_set_irq, s, @@ -341,6 +335,17 @@ DeviceState *lasi_initfn(MemoryRegion *address_space) return dev; } =20 +static void lasi_reset(DeviceState *dev) +{ + LasiState *s =3D LASI_CHIP(dev); + + s->iar =3D CPU_HPA + 3; + + /* Real time clock (RTC), it's only one 32-bit counter @9000 */ + s->rtc =3D time(NULL); + s->rtc_ref =3D 0; +} + static void lasi_init(Object *obj) { LasiState *s =3D LASI_CHIP(obj); @@ -356,6 +361,7 @@ static void lasi_class_init(ObjectClass *klass, void *d= ata) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 + dc->reset =3D lasi_reset; dc->vmsd =3D &vmstate_lasi; } =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651659849182704.353479700253; Wed, 4 May 2022 03:24:09 -0700 (PDT) Received: from localhost ([::1]:56200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmCAy-0002Go-0R for importer@patchew.org; Wed, 04 May 2022 06:24:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIR-0008Vm-EK for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:48 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49166) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIP-000472-M2 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:47 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHE-0002VG-Py; Wed, 04 May 2022 10:26:36 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:37 +0100 Message-Id: <20220504092600.10048-28-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 27/50] lasi: move LASIState and associated QOM structures to lasi.h X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651659850235100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/lasi.c | 44 +------------------------------------- hw/hppa/lasi.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 43 deletions(-) create mode 100644 hw/hppa/lasi.h diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 242713c7bd..c1dfd5310f 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -24,50 +24,8 @@ #include "hw/input/lasips2.h" #include "migration/vmstate.h" #include "qom/object.h" +#include "lasi.h" =20 -#define TYPE_LASI_CHIP "lasi-chip" - -#define LASI_IRR 0x00 /* RO */ -#define LASI_IMR 0x04 -#define LASI_IPR 0x08 -#define LASI_ICR 0x0c -#define LASI_IAR 0x10 - -#define LASI_PCR 0x0C000 /* LASI Power Control register */ -#define LASI_ERRLOG 0x0C004 /* LASI Error Logging register */ -#define LASI_VER 0x0C008 /* LASI Version Control register */ -#define LASI_IORESET 0x0C00C /* LASI I/O Reset register */ -#define LASI_AMR 0x0C010 /* LASI Arbitration Mask register */ -#define LASI_IO_CONF 0x7FFFE /* LASI primary configuration register */ -#define LASI_IO_CONF2 0x7FFFF /* LASI secondary configuration register */ - -#define LASI_BIT(x) (1ul << (x)) -#define LASI_IRQ_BITS (LASI_BIT(5) | LASI_BIT(7) | LASI_BIT(8) | LASI_BI= T(9) \ - | LASI_BIT(13) | LASI_BIT(14) | LASI_BIT(16) | LASI_BIT(17) \ - | LASI_BIT(18) | LASI_BIT(19) | LASI_BIT(20) | LASI_BIT(21) \ - | LASI_BIT(26)) - -#define ICR_BUS_ERROR_BIT LASI_BIT(8) /* bit 8 in ICR */ -#define ICR_TOC_BIT LASI_BIT(1) /* bit 1 in ICR */ - -OBJECT_DECLARE_SIMPLE_TYPE(LasiState, LASI_CHIP) - -struct LasiState { - PCIHostState parent_obj; - - uint32_t irr; - uint32_t imr; - uint32_t ipr; - uint32_t icr; - uint32_t iar; - - uint32_t errlog; - uint32_t amr; - uint32_t rtc; - time_t rtc_ref; - - MemoryRegion this_mem; -}; =20 static bool lasi_chip_mem_valid(void *opaque, hwaddr addr, unsigned size, bool is_write, diff --git a/hw/hppa/lasi.h b/hw/hppa/lasi.h new file mode 100644 index 0000000000..559aae2560 --- /dev/null +++ b/hw/hppa/lasi.h @@ -0,0 +1,58 @@ +/* + * HP-PARISC Lasi chipset emulation. + * + * (C) 2019 by Helge Deller + * + * This work is licensed under the GNU GPL license version 2 or later. + * + * Documentation available at: + * https://parisc.wiki.kernel.org/images-parisc/7/79/Lasi_ers.pdf + */ + +#ifndef LASI_H +#define LASI_H + +#define TYPE_LASI_CHIP "lasi-chip" +OBJECT_DECLARE_SIMPLE_TYPE(LasiState, LASI_CHIP) + +#define LASI_IRR 0x00 /* RO */ +#define LASI_IMR 0x04 +#define LASI_IPR 0x08 +#define LASI_ICR 0x0c +#define LASI_IAR 0x10 + +#define LASI_PCR 0x0C000 /* LASI Power Control register */ +#define LASI_ERRLOG 0x0C004 /* LASI Error Logging register */ +#define LASI_VER 0x0C008 /* LASI Version Control register */ +#define LASI_IORESET 0x0C00C /* LASI I/O Reset register */ +#define LASI_AMR 0x0C010 /* LASI Arbitration Mask register */ +#define LASI_IO_CONF 0x7FFFE /* LASI primary configuration register */ +#define LASI_IO_CONF2 0x7FFFF /* LASI secondary configuration register */ + +#define LASI_BIT(x) (1ul << (x)) +#define LASI_IRQ_BITS (LASI_BIT(5) | LASI_BIT(7) | LASI_BIT(8) | LASI_BI= T(9) \ + | LASI_BIT(13) | LASI_BIT(14) | LASI_BIT(16) | LASI_BIT(17) \ + | LASI_BIT(18) | LASI_BIT(19) | LASI_BIT(20) | LASI_BIT(21) \ + | LASI_BIT(26)) + +#define ICR_BUS_ERROR_BIT LASI_BIT(8) /* bit 8 in ICR */ +#define ICR_TOC_BIT LASI_BIT(1) /* bit 1 in ICR */ + +struct LasiState { + PCIHostState parent_obj; + + uint32_t irr; + uint32_t imr; + uint32_t ipr; + uint32_t icr; + uint32_t iar; + + uint32_t errlog; + uint32_t amr; + uint32_t rtc; + time_t rtc_ref; + + MemoryRegion this_mem; +}; + +#endif --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651658029390554.9486119098837; Wed, 4 May 2022 02:53:49 -0700 (PDT) Received: from localhost ([::1]:58432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBhc-0006vl-7E for importer@patchew.org; Wed, 04 May 2022 05:53:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIS-0008Vs-2K for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:48 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIQ-00047B-BJ for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:47 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHI-0002VG-HT; Wed, 04 May 2022 10:26:40 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:38 +0100 Message-Id: <20220504092600.10048-29-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 28/50] lasi: replace lasi_get_irq() with defined constants X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658031495100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller --- hw/hppa/lasi.c | 31 ++++--------------------------- hw/hppa/lasi.h | 9 +++++++++ 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index c1dfd5310f..ec079601a1 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -231,29 +231,6 @@ static void lasi_set_irq(void *opaque, int irq, int le= vel) } } =20 -static int lasi_get_irq(unsigned long hpa) -{ - switch (hpa) { - case LASI_HPA: - return 14; - case LASI_UART_HPA: - return 5; - case LASI_LPT_HPA: - return 7; - case LASI_LAN_HPA: - return 8; - case LASI_SCSI_HPA: - return 9; - case LASI_AUDIO_HPA: - return 13; - case LASI_PS2KBD_HPA: - case LASI_PS2MOU_HPA: - return 26; - default: - g_assert_not_reached(); - } -} - DeviceState *lasi_initfn(MemoryRegion *address_space) { DeviceState *dev; @@ -266,20 +243,20 @@ DeviceState *lasi_initfn(MemoryRegion *address_space) /* LAN */ if (enable_lasi_lan()) { qemu_irq lan_irq =3D qemu_allocate_irq(lasi_set_irq, s, - lasi_get_irq(LASI_LAN_HPA)); + LASI_IRQ_LAN_HPA); lasi_82596_init(address_space, LASI_LAN_HPA, lan_irq); } =20 /* Parallel port */ qemu_irq lpt_irq =3D qemu_allocate_irq(lasi_set_irq, s, - lasi_get_irq(LASI_LPT_HPA)); + LASI_IRQ_LPT_HPA); parallel_mm_init(address_space, LASI_LPT_HPA + 0x800, 0, lpt_irq, parallel_hds[0]); =20 if (serial_hd(1)) { /* Serial port */ qemu_irq serial_irq =3D qemu_allocate_irq(lasi_set_irq, s, - lasi_get_irq(LASI_UART_HPA)); + LASI_IRQ_UART_HPA); serial_mm_init(address_space, LASI_UART_HPA + 0x800, 0, serial_irq, 8000000 / 16, serial_hd(0), DEVICE_NATIVE_ENDIAN); @@ -287,7 +264,7 @@ DeviceState *lasi_initfn(MemoryRegion *address_space) =20 /* PS/2 Keyboard/Mouse */ qemu_irq ps2kbd_irq =3D qemu_allocate_irq(lasi_set_irq, s, - lasi_get_irq(LASI_PS2KBD_HPA)); + LASI_IRQ_PS2KBD_HPA); lasips2_init(address_space, LASI_PS2KBD_HPA, ps2kbd_irq); =20 return dev; diff --git a/hw/hppa/lasi.h b/hw/hppa/lasi.h index 559aae2560..f40546da6e 100644 --- a/hw/hppa/lasi.h +++ b/hw/hppa/lasi.h @@ -38,6 +38,15 @@ OBJECT_DECLARE_SIMPLE_TYPE(LasiState, LASI_CHIP) #define ICR_BUS_ERROR_BIT LASI_BIT(8) /* bit 8 in ICR */ #define ICR_TOC_BIT LASI_BIT(1) /* bit 1 in ICR */ =20 +#define LASI_IRQ_HPA 14 +#define LASI_IRQ_UART_HPA 5 +#define LASI_IRQ_LPT_HPA 7 +#define LASI_IRQ_LAN_HPA 8 +#define LASI_IRQ_SCSI_HPA 9 +#define LASI_IRQ_AUDIO_HPA 13 +#define LASI_IRQ_PS2KBD_HPA 26 +#define LASI_IRQ_PS2MOU_HPA 26 + struct LasiState { PCIHostState parent_obj; =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651658330429350.8922537055082; Wed, 4 May 2022 02:58:50 -0700 (PDT) Received: from localhost ([::1]:38540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBmT-0004H6-2M for importer@patchew.org; Wed, 04 May 2022 05:58:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIX-0000DV-Pr for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:54 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIV-00047e-9R for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:53 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHM-0002VG-Ov; Wed, 04 May 2022 10:26:44 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:39 +0100 Message-Id: <20220504092600.10048-30-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 29/50] lasi: define IRQ inputs as qdev GPIOs X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658331355100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/lasi.c | 2 ++ hw/hppa/lasi.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index ec079601a1..9489a80bad 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -290,6 +290,8 @@ static void lasi_init(Object *obj) s, "lasi", 0x100000); =20 sysbus_init_mmio(sbd, &s->this_mem); + + qdev_init_gpio_in(DEVICE(obj), lasi_set_irq, LASI_IRQS); } =20 static void lasi_class_init(ObjectClass *klass, void *data) diff --git a/hw/hppa/lasi.h b/hw/hppa/lasi.h index f40546da6e..63a2be3740 100644 --- a/hw/hppa/lasi.h +++ b/hw/hppa/lasi.h @@ -38,6 +38,8 @@ OBJECT_DECLARE_SIMPLE_TYPE(LasiState, LASI_CHIP) #define ICR_BUS_ERROR_BIT LASI_BIT(8) /* bit 8 in ICR */ #define ICR_TOC_BIT LASI_BIT(1) /* bit 1 in ICR */ =20 +#define LASI_IRQS 27 + #define LASI_IRQ_HPA 14 #define LASI_IRQ_UART_HPA 5 #define LASI_IRQ_LPT_HPA 7 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651658596156926.1722570942597; Wed, 4 May 2022 03:03:16 -0700 (PDT) Received: from localhost ([::1]:47066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBqk-0001jZ-MI for importer@patchew.org; Wed, 04 May 2022 06:03:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIX-0000DW-QG for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:54 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIV-00047g-9b for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:53 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHQ-0002VG-Gc; Wed, 04 May 2022 10:26:44 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:40 +0100 Message-Id: <20220504092600.10048-31-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 30/50] lasi: use qdev GPIOs to wire up IRQs in lasi_initfn() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658597051100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/lasi.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 9489a80bad..32c7514d3a 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -234,38 +234,31 @@ static void lasi_set_irq(void *opaque, int irq, int l= evel) DeviceState *lasi_initfn(MemoryRegion *address_space) { DeviceState *dev; - LasiState *s; =20 dev =3D qdev_new(TYPE_LASI_CHIP); - s =3D LASI_CHIP(dev); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 /* LAN */ if (enable_lasi_lan()) { - qemu_irq lan_irq =3D qemu_allocate_irq(lasi_set_irq, s, - LASI_IRQ_LAN_HPA); - lasi_82596_init(address_space, LASI_LAN_HPA, lan_irq); + lasi_82596_init(address_space, LASI_LAN_HPA, + qdev_get_gpio_in(dev, LASI_IRQ_LAN_HPA)); } =20 /* Parallel port */ - qemu_irq lpt_irq =3D qemu_allocate_irq(lasi_set_irq, s, - LASI_IRQ_LPT_HPA); parallel_mm_init(address_space, LASI_LPT_HPA + 0x800, 0, - lpt_irq, parallel_hds[0]); + qdev_get_gpio_in(dev, LASI_IRQ_LAN_HPA), + parallel_hds[0]); =20 if (serial_hd(1)) { /* Serial port */ - qemu_irq serial_irq =3D qemu_allocate_irq(lasi_set_irq, s, - LASI_IRQ_UART_HPA); serial_mm_init(address_space, LASI_UART_HPA + 0x800, 0, - serial_irq, 8000000 / 16, + qdev_get_gpio_in(dev, LASI_IRQ_UART_HPA), 8000000 / 16, serial_hd(0), DEVICE_NATIVE_ENDIAN); } =20 /* PS/2 Keyboard/Mouse */ - qemu_irq ps2kbd_irq =3D qemu_allocate_irq(lasi_set_irq, s, - LASI_IRQ_PS2KBD_HPA); - lasips2_init(address_space, LASI_PS2KBD_HPA, ps2kbd_irq); + lasips2_init(address_space, LASI_PS2KBD_HPA, + qdev_get_gpio_in(dev, LASI_IRQ_PS2KBD_HPA)); =20 return dev; } --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651658855158692.2920326479988; Wed, 4 May 2022 03:07:35 -0700 (PDT) Received: from localhost ([::1]:55618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBuv-0007ed-Jn for importer@patchew.org; Wed, 04 May 2022 06:07:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIZ-0000E0-C4 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:56 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49200) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIX-00048a-VA for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:55 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHQ-0002VG-SD; Wed, 04 May 2022 10:26:48 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:41 +0100 Message-Id: <20220504092600.10048-32-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 31/50] lasi: fix serial port initialisation X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658856640100001 Content-Type: text/plain; charset="utf-8" The existing code checks for serial_hd(1) but sets the LASI serial port cha= rdev to serial_hd(0). Use serial_hd(1) for the LASI serial port and also set the serial port endian to DEVICE_BIG_ENDIAN (which also matches the endian of t= he existing serial port). Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/lasi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 32c7514d3a..219eb779f3 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -253,7 +253,7 @@ DeviceState *lasi_initfn(MemoryRegion *address_space) /* Serial port */ serial_mm_init(address_space, LASI_UART_HPA + 0x800, 0, qdev_get_gpio_in(dev, LASI_IRQ_UART_HPA), 8000000 / 16, - serial_hd(0), DEVICE_NATIVE_ENDIAN); + serial_hd(1), DEVICE_BIG_ENDIAN); } =20 /* PS/2 Keyboard/Mouse */ --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651659096631873.3175008820784; Wed, 4 May 2022 03:11:36 -0700 (PDT) Received: from localhost ([::1]:60238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmByo-0002ZW-UA for importer@patchew.org; Wed, 04 May 2022 06:11:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBId-0000IM-3w for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:59 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIb-000490-LJ for qemu-devel@nongnu.org; Wed, 04 May 2022 05:27:58 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHU-0002VG-Jn; Wed, 04 May 2022 10:26:52 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:42 +0100 Message-Id: <20220504092600.10048-33-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 32/50] lasi: update lasi_initfn() to return LASIState X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651659096958100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/hppa_sys.h | 3 ++- hw/hppa/lasi.c | 4 ++-- hw/hppa/machine.c | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index 0929dedded..3832b787d1 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -7,10 +7,11 @@ #include "hw/pci/pci_host.h" #include "hw/boards.h" #include "hw/intc/i8259.h" +#include "lasi.h" =20 #include "hppa_hardware.h" =20 -DeviceState *lasi_initfn(MemoryRegion *); +LasiState *lasi_initfn(MemoryRegion *); #define enable_lasi_lan() 0 =20 /* hppa_pci.c. */ diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 219eb779f3..65139bb29b 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -231,7 +231,7 @@ static void lasi_set_irq(void *opaque, int irq, int lev= el) } } =20 -DeviceState *lasi_initfn(MemoryRegion *address_space) +LasiState *lasi_initfn(MemoryRegion *address_space) { DeviceState *dev; =20 @@ -260,7 +260,7 @@ DeviceState *lasi_initfn(MemoryRegion *address_space) lasips2_init(address_space, LASI_PS2KBD_HPA, qdev_get_gpio_in(dev, LASI_IRQ_PS2KBD_HPA)); =20 - return dev; + return LASI_CHIP(dev); } =20 static void lasi_reset(DeviceState *dev) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 6618bce435..c815dde305 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -18,6 +18,7 @@ #include "hw/net/lasi_82596.h" #include "hw/nmi.h" #include "hw/pci-host/dino.h" +#include "lasi.h" #include "hppa_sys.h" #include "qemu/units.h" #include "qapi/error.h" @@ -175,7 +176,7 @@ static void machine_hppa_init(MachineState *machine) =20 =20 /* Init Lasi chip */ - lasi_dev =3D lasi_initfn(addr_space); + lasi_dev =3D DEVICE(lasi_initfn(addr_space)); memory_region_add_subregion(addr_space, LASI_HPA, sysbus_mmio_get_region( SYS_BUS_DEVICE(lasi_dev), 0)); --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651658344306219.85529290679744; Wed, 4 May 2022 02:59:04 -0700 (PDT) Received: from localhost ([::1]:38876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBmg-0004UY-Rf for importer@patchew.org; Wed, 04 May 2022 05:59:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIh-0000MI-SW for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:04 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49216) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIf-00049S-TH for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:03 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHY-0002VG-CX; Wed, 04 May 2022 10:26:56 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:43 +0100 Message-Id: <20220504092600.10048-34-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 33/50] lasi: move LAN initialisation to machine.c X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658345575100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/lasi.c | 7 ------- hw/hppa/machine.c | 5 +++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 65139bb29b..88ff9141e4 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -18,7 +18,6 @@ #include "sysemu/sysemu.h" #include "sysemu/runstate.h" #include "hppa_sys.h" -#include "hw/net/lasi_82596.h" #include "hw/char/parallel.h" #include "hw/char/serial.h" #include "hw/input/lasips2.h" @@ -238,12 +237,6 @@ LasiState *lasi_initfn(MemoryRegion *address_space) dev =3D qdev_new(TYPE_LASI_CHIP); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 - /* LAN */ - if (enable_lasi_lan()) { - lasi_82596_init(address_space, LASI_LAN_HPA, - qdev_get_gpio_in(dev, LASI_IRQ_LAN_HPA)); - } - /* Parallel port */ parallel_mm_init(address_space, LASI_LPT_HPA + 0x800, 0, qdev_get_gpio_in(dev, LASI_IRQ_LAN_HPA), diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index c815dde305..b3b4a00ad6 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -221,6 +221,11 @@ static void machine_hppa_init(MachineState *machine) } =20 /* Network setup. */ + if (enable_lasi_lan()) { + lasi_82596_init(addr_space, LASI_LAN_HPA, + qdev_get_gpio_in(lasi_dev, LASI_IRQ_LAN_HPA)); + } + for (i =3D 0; i < nb_nics; i++) { if (!enable_lasi_lan()) { pci_nic_init_nofail(&nd_table[i], pci_bus, "tulip", NULL); --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651658618435740.042452022748; Wed, 4 May 2022 03:03:38 -0700 (PDT) Received: from localhost ([::1]:47430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBr6-0001zS-Uo for importer@patchew.org; Wed, 04 May 2022 06:03:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIk-0000RG-W2 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:08 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIj-0004A4-Gb for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:06 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHc-0002VG-IW; Wed, 04 May 2022 10:27:00 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:44 +0100 Message-Id: <20220504092600.10048-35-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 34/50] lasi: move parallel port initialisation to machine.c X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658619065100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/lasi.c | 6 ------ hw/hppa/machine.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 88ff9141e4..6faa98dca5 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -18,7 +18,6 @@ #include "sysemu/sysemu.h" #include "sysemu/runstate.h" #include "hppa_sys.h" -#include "hw/char/parallel.h" #include "hw/char/serial.h" #include "hw/input/lasips2.h" #include "migration/vmstate.h" @@ -237,11 +236,6 @@ LasiState *lasi_initfn(MemoryRegion *address_space) dev =3D qdev_new(TYPE_LASI_CHIP); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 - /* Parallel port */ - parallel_mm_init(address_space, LASI_LPT_HPA + 0x800, 0, - qdev_get_gpio_in(dev, LASI_IRQ_LAN_HPA), - parallel_hds[0]); - if (serial_hd(1)) { /* Serial port */ serial_mm_init(address_space, LASI_UART_HPA + 0x800, 0, diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index b3b4a00ad6..5244178aaf 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -15,6 +15,7 @@ #include "hw/rtc/mc146818rtc.h" #include "hw/timer/i8254.h" #include "hw/char/serial.h" +#include "hw/char/parallel.h" #include "hw/net/lasi_82596.h" #include "hw/nmi.h" #include "hw/pci-host/dino.h" @@ -204,6 +205,11 @@ static void machine_hppa_init(MachineState *machine) 115200, serial_hd(0), DEVICE_BIG_ENDIAN); } =20 + /* Parallel port */ + parallel_mm_init(addr_space, LASI_LPT_HPA + 0x800, 0, + qdev_get_gpio_in(lasi_dev, LASI_IRQ_LAN_HPA), + parallel_hds[0]); + /* fw_cfg configuration interface */ create_fw_cfg(machine); =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651659244618285.11924715733073; Wed, 4 May 2022 03:14:04 -0700 (PDT) Received: from localhost ([::1]:35914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmC1D-0005N5-Jb for importer@patchew.org; Wed, 04 May 2022 06:14:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIl-0000RQ-Fm for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:08 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49234) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIk-0004AJ-0I for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:07 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHg-0002VG-9b; Wed, 04 May 2022 10:27:00 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:45 +0100 Message-Id: <20220504092600.10048-36-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 35/50] lasi: move second serial port initialisation to machine.c X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651659247458100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/lasi.c | 8 -------- hw/hppa/machine.c | 7 +++++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 6faa98dca5..753a08d454 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -18,7 +18,6 @@ #include "sysemu/sysemu.h" #include "sysemu/runstate.h" #include "hppa_sys.h" -#include "hw/char/serial.h" #include "hw/input/lasips2.h" #include "migration/vmstate.h" #include "qom/object.h" @@ -236,13 +235,6 @@ LasiState *lasi_initfn(MemoryRegion *address_space) dev =3D qdev_new(TYPE_LASI_CHIP); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 - if (serial_hd(1)) { - /* Serial port */ - serial_mm_init(address_space, LASI_UART_HPA + 0x800, 0, - qdev_get_gpio_in(dev, LASI_IRQ_UART_HPA), 8000000 / 16, - serial_hd(1), DEVICE_BIG_ENDIAN); - } - /* PS/2 Keyboard/Mouse */ lasips2_init(address_space, LASI_PS2KBD_HPA, qdev_get_gpio_in(dev, LASI_IRQ_PS2KBD_HPA)); diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 5244178aaf..5b43ae2960 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -205,6 +205,13 @@ static void machine_hppa_init(MachineState *machine) 115200, serial_hd(0), DEVICE_BIG_ENDIAN); } =20 + if (serial_hd(1)) { + /* Serial port */ + serial_mm_init(addr_space, LASI_UART_HPA + 0x800, 0, + qdev_get_gpio_in(lasi_dev, LASI_IRQ_UART_HPA), 8000000 / 1= 6, + serial_hd(1), DEVICE_BIG_ENDIAN); + } + /* Parallel port */ parallel_mm_init(addr_space, LASI_LPT_HPA + 0x800, 0, qdev_get_gpio_in(lasi_dev, LASI_IRQ_LAN_HPA), --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165166024739317.30878918602184; Wed, 4 May 2022 03:30:47 -0700 (PDT) Received: from localhost ([::1]:36696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmCHO-0008KA-5i for importer@patchew.org; Wed, 04 May 2022 06:30:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIm-0000S9-QE for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:08 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49240) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIk-0004AV-EX for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:07 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHg-0002VG-PL; Wed, 04 May 2022 10:27:01 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:46 +0100 Message-Id: <20220504092600.10048-37-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 36/50] lasi: move PS2 initialisation to machine.c X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651660248236100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/lasi.c | 5 ----- hw/hppa/machine.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 753a08d454..9d8c9e3936 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -18,7 +18,6 @@ #include "sysemu/sysemu.h" #include "sysemu/runstate.h" #include "hppa_sys.h" -#include "hw/input/lasips2.h" #include "migration/vmstate.h" #include "qom/object.h" #include "lasi.h" @@ -235,10 +234,6 @@ LasiState *lasi_initfn(MemoryRegion *address_space) dev =3D qdev_new(TYPE_LASI_CHIP); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 - /* PS/2 Keyboard/Mouse */ - lasips2_init(address_space, LASI_PS2KBD_HPA, - qdev_get_gpio_in(dev, LASI_IRQ_PS2KBD_HPA)); - return LASI_CHIP(dev); } =20 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 5b43ae2960..1d48ec341d 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -16,6 +16,7 @@ #include "hw/timer/i8254.h" #include "hw/char/serial.h" #include "hw/char/parallel.h" +#include "hw/input/lasips2.h" #include "hw/net/lasi_82596.h" #include "hw/nmi.h" #include "hw/pci-host/dino.h" @@ -245,6 +246,10 @@ static void machine_hppa_init(MachineState *machine) } } =20 + /* PS/2 Keyboard/Mouse */ + lasips2_init(addr_space, LASI_PS2KBD_HPA, + qdev_get_gpio_in(lasi_dev, LASI_IRQ_PS2KBD_HPA)); + /* register power switch emulation */ qemu_register_powerdown_notifier(&hppa_system_powerdown_notifier); =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651660556325818.9766750065213; Wed, 4 May 2022 03:35:56 -0700 (PDT) Received: from localhost ([::1]:45072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmCMM-0005qX-Rk for importer@patchew.org; Wed, 04 May 2022 06:35:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIq-0000XC-76 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:12 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49248) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIo-0004B6-KE for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:11 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHh-0002VG-4a; Wed, 04 May 2022 10:27:05 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:47 +0100 Message-Id: <20220504092600.10048-38-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 37/50] lasi: remove address space parameter from lasi_initfn() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651660558324100001 Content-Type: text/plain; charset="utf-8" Now that all of the LASI devices are mapped by the board, this parameter is= no longer required. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/hppa_sys.h | 2 +- hw/hppa/lasi.c | 2 +- hw/hppa/machine.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index 3832b787d1..31e3856059 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -11,7 +11,7 @@ =20 #include "hppa_hardware.h" =20 -LasiState *lasi_initfn(MemoryRegion *); +LasiState *lasi_initfn(void); #define enable_lasi_lan() 0 =20 /* hppa_pci.c. */ diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 9d8c9e3936..81c8e4d2d9 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -227,7 +227,7 @@ static void lasi_set_irq(void *opaque, int irq, int lev= el) } } =20 -LasiState *lasi_initfn(MemoryRegion *address_space) +LasiState *lasi_initfn(void) { DeviceState *dev; =20 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 1d48ec341d..52f12f6604 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -178,7 +178,7 @@ static void machine_hppa_init(MachineState *machine) =20 =20 /* Init Lasi chip */ - lasi_dev =3D DEVICE(lasi_initfn(addr_space)); + lasi_dev =3D DEVICE(lasi_initfn()); memory_region_add_subregion(addr_space, LASI_HPA, sysbus_mmio_get_region( SYS_BUS_DEVICE(lasi_dev), 0)); --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16516588601041007.3035502150256; Wed, 4 May 2022 03:07:40 -0700 (PDT) Received: from localhost ([::1]:56014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmBv0-0007vJ-Ru for importer@patchew.org; Wed, 04 May 2022 06:07:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIr-0000Z5-FB for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:13 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49256) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIp-0004BF-Hn for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:13 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHl-0002VG-Bs; Wed, 04 May 2022 10:27:05 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:48 +0100 Message-Id: <20220504092600.10048-39-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 38/50] lasi: move lasi_initfn() to machine.c X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651658862347100001 Content-Type: text/plain; charset="utf-8" Move the simplified lasi_initfn() back to machine.c whilst also renaming it back to its original lasi_init() name. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/hppa_sys.h | 2 -- hw/hppa/lasi.c | 10 ---------- hw/hppa/machine.c | 12 +++++++++++- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index 31e3856059..f7a127be19 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -7,11 +7,9 @@ #include "hw/pci/pci_host.h" #include "hw/boards.h" #include "hw/intc/i8259.h" -#include "lasi.h" =20 #include "hppa_hardware.h" =20 -LasiState *lasi_initfn(void); #define enable_lasi_lan() 0 =20 /* hppa_pci.c. */ diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 81c8e4d2d9..ad50880a13 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -227,16 +227,6 @@ static void lasi_set_irq(void *opaque, int irq, int le= vel) } } =20 -LasiState *lasi_initfn(void) -{ - DeviceState *dev; - - dev =3D qdev_new(TYPE_LASI_CHIP); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - - return LASI_CHIP(dev); -} - static void lasi_reset(DeviceState *dev) { LasiState *s =3D LASI_CHIP(dev); diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 52f12f6604..58b25ca5bc 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -125,6 +125,16 @@ static FWCfgState *create_fw_cfg(MachineState *ms) return fw_cfg; } =20 +static LasiState *lasi_init(void) +{ + DeviceState *dev; + + dev =3D qdev_new(TYPE_LASI_CHIP); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + + return LASI_CHIP(dev); +} + static DinoState *dino_init(MemoryRegion *addr_space) { DeviceState *dev; @@ -178,7 +188,7 @@ static void machine_hppa_init(MachineState *machine) =20 =20 /* Init Lasi chip */ - lasi_dev =3D DEVICE(lasi_initfn()); + lasi_dev =3D DEVICE(lasi_init()); memory_region_add_subregion(addr_space, LASI_HPA, sysbus_mmio_get_region( SYS_BUS_DEVICE(lasi_dev), 0)); --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651659256103552.1184676966083; Wed, 4 May 2022 03:14:16 -0700 (PDT) Received: from localhost ([::1]:36298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmC1P-0005ch-2n for importer@patchew.org; Wed, 04 May 2022 06:14:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIu-0000er-Is for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:16 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49264) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIt-0004Bn-18 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:16 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHl-0002VG-R8; Wed, 04 May 2022 10:27:09 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:49 +0100 Message-Id: <20220504092600.10048-40-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 39/50] lasi: use constants for device register offsets X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651659256651100001 Content-Type: text/plain; charset="utf-8" Instead of generating the offset based upon the physical address of the register, add constants for each of the device registers to lasi.h and update lasi.c to use them. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/lasi.c | 28 ++++++++++++++-------------- hw/hppa/lasi.h | 5 +++++ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index ad50880a13..11ca33fba3 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -36,10 +36,10 @@ static bool lasi_chip_mem_valid(void *opaque, hwaddr ad= dr, case LASI_ICR: case LASI_IAR: =20 - case (LASI_LAN_HPA - LASI_HPA): - case (LASI_LPT_HPA - LASI_HPA): - case (LASI_UART_HPA - LASI_HPA): - case (LASI_RTC_HPA - LASI_HPA): + case LASI_LPT: + case LASI_UART: + case LASI_LAN: + case LASI_RTC: =20 case LASI_PCR ... LASI_AMR: ret =3D true; @@ -76,12 +76,12 @@ static MemTxResult lasi_chip_read_with_attrs(void *opaq= ue, hwaddr addr, val =3D s->iar; break; =20 - case (LASI_LAN_HPA - LASI_HPA): - case (LASI_LPT_HPA - LASI_HPA): - case (LASI_UART_HPA - LASI_HPA): + case LASI_LPT: + case LASI_UART: + case LASI_LAN: val =3D 0; break; - case (LASI_RTC_HPA - LASI_HPA): + case LASI_RTC: val =3D time(NULL); val +=3D s->rtc_ref; break; @@ -141,16 +141,16 @@ static MemTxResult lasi_chip_write_with_attrs(void *o= paque, hwaddr addr, s->iar =3D val; break; =20 - case (LASI_LAN_HPA - LASI_HPA): - /* XXX: reset LAN card */ - break; - case (LASI_LPT_HPA - LASI_HPA): + case LASI_LPT: /* XXX: reset parallel port */ break; - case (LASI_UART_HPA - LASI_HPA): + case LASI_UART: /* XXX: reset serial port */ break; - case (LASI_RTC_HPA - LASI_HPA): + case LASI_LAN: + /* XXX: reset LAN card */ + break; + case LASI_RTC: s->rtc_ref =3D val - time(NULL); break; =20 diff --git a/hw/hppa/lasi.h b/hw/hppa/lasi.h index 63a2be3740..11cf7d6b0b 100644 --- a/hw/hppa/lasi.h +++ b/hw/hppa/lasi.h @@ -21,6 +21,11 @@ OBJECT_DECLARE_SIMPLE_TYPE(LasiState, LASI_CHIP) #define LASI_ICR 0x0c #define LASI_IAR 0x10 =20 +#define LASI_LPT 0x02000 +#define LASI_UART 0x05000 +#define LASI_LAN 0x07000 +#define LASI_RTC 0x09000 + #define LASI_PCR 0x0C000 /* LASI Power Control register */ #define LASI_ERRLOG 0x0C004 /* LASI Error Logging register */ #define LASI_VER 0x0C008 /* LASI Version Control register */ --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651659604295211.5314491078426; Wed, 4 May 2022 03:20:04 -0700 (PDT) Received: from localhost ([::1]:44880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmC70-000349-0l for importer@patchew.org; Wed, 04 May 2022 06:20:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIy-0000mj-KR for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:20 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49274) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIx-0004CR-7M for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:20 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHp-0002VG-LG; Wed, 04 May 2022 10:27:13 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:50 +0100 Message-Id: <20220504092600.10048-41-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 40/50] lasi: use numerical constant for iar reset value X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651659604734100001 Content-Type: text/plain; charset="utf-8" This is to allow us to decouple the LASI device from the board logic. If it= is decided later that this value needs to be configurable then it can easily be converted to a qdev property. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Acked-by: Richard Henderson --- hw/hppa/lasi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 11ca33fba3..5ef36f3f58 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -231,7 +231,7 @@ static void lasi_reset(DeviceState *dev) { LasiState *s =3D LASI_CHIP(dev); =20 - s->iar =3D CPU_HPA + 3; + s->iar =3D 0xFFFB0000 + 3; /* CPU_HPA + 3 */ =20 /* Real time clock (RTC), it's only one 32-bit counter @9000 */ s->rtc =3D time(NULL); --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651659400620343.0157942070531; Wed, 4 May 2022 03:16:40 -0700 (PDT) Received: from localhost ([::1]:40446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmC3j-0008QD-3E for importer@patchew.org; Wed, 04 May 2022 06:16:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIz-0000nF-23 for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:21 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49280) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBIx-0004Ca-IM for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:20 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHt-0002VG-T4; Wed, 04 May 2022 10:27:14 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:51 +0100 Message-Id: <20220504092600.10048-42-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 41/50] hppa: move device headers from hppa_sys.h into individual .c files X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651659401641100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/hppa_sys.h | 3 --- hw/hppa/lasi.h | 4 ++++ hw/hppa/machine.c | 2 ++ hw/hppa/pci.c | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index f7a127be19..9964d4a7a7 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -3,10 +3,7 @@ #ifndef HW_HPPA_SYS_H #define HW_HPPA_SYS_H =20 -#include "hw/pci/pci.h" -#include "hw/pci/pci_host.h" #include "hw/boards.h" -#include "hw/intc/i8259.h" =20 #include "hppa_hardware.h" =20 diff --git a/hw/hppa/lasi.h b/hw/hppa/lasi.h index 11cf7d6b0b..ecc7065ce8 100644 --- a/hw/hppa/lasi.h +++ b/hw/hppa/lasi.h @@ -12,6 +12,10 @@ #ifndef LASI_H #define LASI_H =20 +#include "exec/address-spaces.h" +#include "hw/pci/pci_host.h" +#include "hw/boards.h" + #define TYPE_LASI_CHIP "lasi-chip" OBJECT_DECLARE_SIMPLE_TYPE(LasiState, LASI_CHIP) =20 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 58b25ca5bc..9d904b7a60 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -16,9 +16,11 @@ #include "hw/timer/i8254.h" #include "hw/char/serial.h" #include "hw/char/parallel.h" +#include "hw/intc/i8259.h" #include "hw/input/lasips2.h" #include "hw/net/lasi_82596.h" #include "hw/nmi.h" +#include "hw/pci/pci.h" #include "hw/pci-host/dino.h" #include "lasi.h" #include "hppa_sys.h" diff --git a/hw/hppa/pci.c b/hw/hppa/pci.c index 32609aba63..a92dcb6b9e 100644 --- a/hw/hppa/pci.c +++ b/hw/hppa/pci.c @@ -6,6 +6,9 @@ #include "qemu/osdep.h" #include "hppa_sys.h" #include "qemu/log.h" +#include "hw/pci/pci.h" +#include "hw/pci/pci_host.h" +#include "hw/intc/i8259.h" #include "trace.h" =20 =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651659716323421.8478356356883; Wed, 4 May 2022 03:21:56 -0700 (PDT) Received: from localhost ([::1]:49068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmC8o-0005x7-0P for importer@patchew.org; Wed, 04 May 2022 06:21:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJ2-0000sX-TH for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:24 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49288) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJ1-0004D8-5B for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:24 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHu-0002VG-BP; Wed, 04 May 2022 10:27:17 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:52 +0100 Message-Id: <20220504092600.10048-43-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 42/50] lasi: move from hw/hppa to hw/misc X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651659717476100001 Content-Type: text/plain; charset="utf-8" Move the LASI device implementation from hw/hppa to hw/misc so that it is located with all the other miscellaneous devices. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller --- MAINTAINERS | 2 ++ hw/hppa/Kconfig | 1 + hw/hppa/machine.c | 2 +- hw/hppa/meson.build | 2 +- hw/hppa/trace-events | 5 ----- hw/misc/Kconfig | 3 +++ hw/{hppa =3D> misc}/lasi.c | 3 +-- hw/misc/meson.build | 3 +++ hw/misc/trace-events | 5 +++++ {hw/hppa =3D> include/hw/misc}/lasi.h | 0 10 files changed, 17 insertions(+), 9 deletions(-) rename hw/{hppa =3D> misc}/lasi.c (99%) rename {hw/hppa =3D> include/hw/misc}/lasi.h (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 07f85829b0..162a1732d8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1114,7 +1114,9 @@ S: Odd Fixes F: configs/devices/hppa-softmmu/default.mak F: hw/hppa/ F: hw/net/*i82596* +F: hw/misc/lasi.c F: hw/pci-host/dino.c +F: include/hw/misc/lasi.h F: include/hw/net/lasi_82596.h F: include/hw/pci-host/dino.h F: pc-bios/hppa-firmware.img diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig index 724380ecec..5dd8b5b21e 100644 --- a/hw/hppa/Kconfig +++ b/hw/hppa/Kconfig @@ -4,6 +4,7 @@ config HPPA_B160L imply E1000_PCI imply VIRTIO_VGA select DINO + select LASI select SERIAL select ISA_BUS select I8259 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 9d904b7a60..f3d72b4c35 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -22,7 +22,7 @@ #include "hw/nmi.h" #include "hw/pci/pci.h" #include "hw/pci-host/dino.h" -#include "lasi.h" +#include "hw/misc/lasi.h" #include "hppa_sys.h" #include "qemu/units.h" #include "qapi/error.h" diff --git a/hw/hppa/meson.build b/hw/hppa/meson.build index a6f9db455c..bd5a1fb1d2 100644 --- a/hw/hppa/meson.build +++ b/hw/hppa/meson.build @@ -1,4 +1,4 @@ hppa_ss =3D ss.source_set() -hppa_ss.add(when: 'CONFIG_HPPA_B160L', if_true: files('pci.c', 'machine.c'= , 'lasi.c')) +hppa_ss.add(when: 'CONFIG_HPPA_B160L', if_true: files('pci.c', 'machine.c'= )) =20 hw_arch +=3D {'hppa': hppa_ss} diff --git a/hw/hppa/trace-events b/hw/hppa/trace-events index 871a473771..1a4fbe2fa8 100644 --- a/hw/hppa/trace-events +++ b/hw/hppa/trace-events @@ -2,8 +2,3 @@ =20 # pci.c hppa_pci_iack_write(void) "" - -# lasi.c -lasi_chip_mem_valid(uint64_t addr, uint32_t val) "access to addr 0x%"PRIx6= 4" is %d" -lasi_chip_read(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x" -lasi_chip_write(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x" diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig index 507058d8bf..cbabe9f78c 100644 --- a/hw/misc/Kconfig +++ b/hw/misc/Kconfig @@ -171,4 +171,7 @@ config SIFIVE_U_PRCI config VIRT_CTRL bool =20 +config LASI + bool + source macio/Kconfig diff --git a/hw/hppa/lasi.c b/hw/misc/lasi.c similarity index 99% rename from hw/hppa/lasi.c rename to hw/misc/lasi.c index 5ef36f3f58..23a7634a8c 100644 --- a/hw/hppa/lasi.c +++ b/hw/misc/lasi.c @@ -17,10 +17,9 @@ #include "hw/irq.h" #include "sysemu/sysemu.h" #include "sysemu/runstate.h" -#include "hppa_sys.h" #include "migration/vmstate.h" #include "qom/object.h" -#include "lasi.h" +#include "hw/misc/lasi.h" =20 =20 static bool lasi_chip_mem_valid(void *opaque, hwaddr addr, diff --git a/hw/misc/meson.build b/hw/misc/meson.build index 2ff05c7afa..132b7b7344 100644 --- a/hw/misc/meson.build +++ b/hw/misc/meson.build @@ -134,3 +134,6 @@ specific_ss.add(when: 'CONFIG_MIPS_CPS', if_true: files= ('mips_cmgcr.c', 'mips_cp specific_ss.add(when: 'CONFIG_MIPS_ITU', if_true: files('mips_itu.c')) =20 specific_ss.add(when: 'CONFIG_SBSA_REF', if_true: files('sbsa_ec.c')) + +# HPPA devices +softmmu_ss.add(when: 'CONFIG_LASI', if_true: files('lasi.c')) diff --git a/hw/misc/trace-events b/hw/misc/trace-events index 4e0c7973a4..c5e37b0154 100644 --- a/hw/misc/trace-events +++ b/hw/misc/trace-events @@ -263,3 +263,8 @@ virt_ctrl_write(void *dev, unsigned int addr, unsigned = int size, uint64_t value) virt_ctrl_reset(void *dev) "ctrl: %p" virt_ctrl_realize(void *dev) "ctrl: %p" virt_ctrl_instance_init(void *dev) "ctrl: %p" + +# lasi.c +lasi_chip_mem_valid(uint64_t addr, uint32_t val) "access to addr 0x%"PRIx6= 4" is %d" +lasi_chip_read(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x" +lasi_chip_write(uint64_t addr, uint32_t val) "addr 0x%"PRIx64" val 0x%08x" diff --git a/hw/hppa/lasi.h b/include/hw/misc/lasi.h similarity index 100% rename from hw/hppa/lasi.h rename to include/hw/misc/lasi.h --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651659603259465.8791570734804; Wed, 4 May 2022 03:20:03 -0700 (PDT) Received: from localhost ([::1]:44780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmC6z-00030P-On for importer@patchew.org; Wed, 04 May 2022 06:20:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJ6-0000vi-FZ for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:28 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49296) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJ4-0004DV-Tr for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:28 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBHx-0002VG-VS; Wed, 04 May 2022 10:27:21 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:53 +0100 Message-Id: <20220504092600.10048-44-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 43/50] hppa: move hppa_pci_ignore_ops from pci.c to machine.c X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651659604745100002 Content-Type: text/plain; charset="utf-8" The memory region only has one user which is for ensuring accesses to the I= SA bus memory do not fault. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/hppa_sys.h | 1 - hw/hppa/machine.c | 23 +++++++++++++++++++++++ hw/hppa/pci.c | 26 -------------------------- 3 files changed, 23 insertions(+), 27 deletions(-) diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index 9964d4a7a7..d984b2895d 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -10,7 +10,6 @@ #define enable_lasi_lan() 0 =20 /* hppa_pci.c. */ -extern const MemoryRegionOps hppa_pci_ignore_ops; extern const MemoryRegionOps hppa_pci_conf1_ops; extern const MemoryRegionOps hppa_pci_iack_ops; =20 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index f3d72b4c35..ca595d343e 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -57,6 +57,29 @@ static Notifier hppa_system_powerdown_notifier =3D { .notify =3D hppa_powerdown_req }; =20 +/* Fallback for unassigned PCI I/O operations. Avoids MCHK. */ +static uint64_t ignore_read(void *opaque, hwaddr addr, unsigned size) +{ + return 0; +} + +static void ignore_write(void *opaque, hwaddr addr, uint64_t v, unsigned s= ize) +{ +} + +static const MemoryRegionOps hppa_pci_ignore_ops =3D { + .read =3D ignore_read, + .write =3D ignore_write, + .endianness =3D DEVICE_BIG_ENDIAN, + .valid =3D { + .min_access_size =3D 1, + .max_access_size =3D 8, + }, + .impl =3D { + .min_access_size =3D 1, + .max_access_size =3D 8, + }, +}; =20 static ISABus *hppa_isa_bus(void) { diff --git a/hw/hppa/pci.c b/hw/hppa/pci.c index a92dcb6b9e..4d62d54c22 100644 --- a/hw/hppa/pci.c +++ b/hw/hppa/pci.c @@ -12,32 +12,6 @@ #include "trace.h" =20 =20 -/* Fallback for unassigned PCI I/O operations. Avoids MCHK. */ - -static uint64_t ignore_read(void *opaque, hwaddr addr, unsigned size) -{ - return 0; -} - -static void ignore_write(void *opaque, hwaddr addr, uint64_t v, unsigned s= ize) -{ -} - -const MemoryRegionOps hppa_pci_ignore_ops =3D { - .read =3D ignore_read, - .write =3D ignore_write, - .endianness =3D DEVICE_BIG_ENDIAN, - .valid =3D { - .min_access_size =3D 1, - .max_access_size =3D 8, - }, - .impl =3D { - .min_access_size =3D 1, - .max_access_size =3D 8, - }, -}; - - /* PCI config space reads/writes, to byte-word addressable memory. */ static uint64_t bw_conf1_read(void *opaque, hwaddr addr, unsigned size) --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651659801123959.7441309030391; Wed, 4 May 2022 03:23:21 -0700 (PDT) Received: from localhost ([::1]:53554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmCAC-0000Uj-0R for importer@patchew.org; Wed, 04 May 2022 06:23:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJA-00018b-HC for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:32 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49304) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJ8-0004Dk-Rf for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:32 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBI1-0002VG-MD; Wed, 04 May 2022 10:27:25 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:54 +0100 Message-Id: <20220504092600.10048-45-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 44/50] hppa: remove hw/hppa/pci.c X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651659802055100001 Content-Type: text/plain; charset="utf-8" The functions and definitions in this file are not used anywhere within the generic hppa machine. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/hppa_sys.h | 6 ---- hw/hppa/meson.build | 2 +- hw/hppa/pci.c | 65 -------------------------------------------- hw/hppa/trace-events | 3 -- 4 files changed, 1 insertion(+), 75 deletions(-) delete mode 100644 hw/hppa/pci.c diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index d984b2895d..17e2c6dec1 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -3,14 +3,8 @@ #ifndef HW_HPPA_SYS_H #define HW_HPPA_SYS_H =20 -#include "hw/boards.h" - #include "hppa_hardware.h" =20 #define enable_lasi_lan() 0 =20 -/* hppa_pci.c. */ -extern const MemoryRegionOps hppa_pci_conf1_ops; -extern const MemoryRegionOps hppa_pci_iack_ops; - #endif diff --git a/hw/hppa/meson.build b/hw/hppa/meson.build index bd5a1fb1d2..3d0c586c30 100644 --- a/hw/hppa/meson.build +++ b/hw/hppa/meson.build @@ -1,4 +1,4 @@ hppa_ss =3D ss.source_set() -hppa_ss.add(when: 'CONFIG_HPPA_B160L', if_true: files('pci.c', 'machine.c'= )) +hppa_ss.add(when: 'CONFIG_HPPA_B160L', if_true: files('machine.c')) =20 hw_arch +=3D {'hppa': hppa_ss} diff --git a/hw/hppa/pci.c b/hw/hppa/pci.c deleted file mode 100644 index 4d62d54c22..0000000000 --- a/hw/hppa/pci.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * QEMU HP-PARISC PCI support functions. - * - */ - -#include "qemu/osdep.h" -#include "hppa_sys.h" -#include "qemu/log.h" -#include "hw/pci/pci.h" -#include "hw/pci/pci_host.h" -#include "hw/intc/i8259.h" -#include "trace.h" - - -/* PCI config space reads/writes, to byte-word addressable memory. */ -static uint64_t bw_conf1_read(void *opaque, hwaddr addr, - unsigned size) -{ - PCIBus *b =3D opaque; - return pci_data_read(b, addr, size); -} - -static void bw_conf1_write(void *opaque, hwaddr addr, - uint64_t val, unsigned size) -{ - PCIBus *b =3D opaque; - pci_data_write(b, addr, val, size); -} - -const MemoryRegionOps hppa_pci_conf1_ops =3D { - .read =3D bw_conf1_read, - .write =3D bw_conf1_write, - .endianness =3D DEVICE_BIG_ENDIAN, - .impl =3D { - .min_access_size =3D 1, - .max_access_size =3D 4, - }, -}; - -/* PCI/EISA Interrupt Acknowledge Cycle. */ - -static uint64_t iack_read(void *opaque, hwaddr addr, unsigned size) -{ - return pic_read_irq(isa_pic); -} - -static void special_write(void *opaque, hwaddr addr, - uint64_t val, unsigned size) -{ - trace_hppa_pci_iack_write(); -} - -const MemoryRegionOps hppa_pci_iack_ops =3D { - .read =3D iack_read, - .write =3D special_write, - .endianness =3D DEVICE_BIG_ENDIAN, - .valid =3D { - .min_access_size =3D 4, - .max_access_size =3D 4, - }, - .impl =3D { - .min_access_size =3D 4, - .max_access_size =3D 4, - }, -}; diff --git a/hw/hppa/trace-events b/hw/hppa/trace-events index 1a4fbe2fa8..23bc9b19b9 100644 --- a/hw/hppa/trace-events +++ b/hw/hppa/trace-events @@ -1,4 +1 @@ # See docs/devel/tracing.rst for syntax documentation. - -# pci.c -hppa_pci_iack_write(void) "" --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165166003962443.964332548051175; Wed, 4 May 2022 03:27:19 -0700 (PDT) Received: from localhost ([::1]:60848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmCE2-0005Nm-HW for importer@patchew.org; Wed, 04 May 2022 06:27:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJB-0001CY-Pn for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:33 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49318) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJ9-0004Ds-Dy for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:33 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBI5-0002VG-LY; Wed, 04 May 2022 10:27:26 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:55 +0100 Message-Id: <20220504092600.10048-46-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 45/50] hppa: remove unused trace-events from from hw/hppa X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651660041231100001 Content-Type: text/plain; charset="utf-8" Now that there are no longer any devices in hw/hppa the trace-events file is empty and can be removed. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/trace-events | 1 - meson.build | 1 - 2 files changed, 2 deletions(-) delete mode 100644 hw/hppa/trace-events diff --git a/hw/hppa/trace-events b/hw/hppa/trace-events deleted file mode 100644 index 23bc9b19b9..0000000000 --- a/hw/hppa/trace-events +++ /dev/null @@ -1 +0,0 @@ -# See docs/devel/tracing.rst for syntax documentation. diff --git a/meson.build b/meson.build index 1fe7d257ff..95dcfd41f7 100644 --- a/meson.build +++ b/meson.build @@ -2816,7 +2816,6 @@ if have_system 'hw/char', 'hw/display', 'hw/dma', - 'hw/hppa', 'hw/hyperv', 'hw/i2c', 'hw/i386', --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651660088191305.8623043194; Wed, 4 May 2022 03:28:08 -0700 (PDT) Received: from localhost ([::1]:34034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmCEp-0006Pv-0E for importer@patchew.org; Wed, 04 May 2022 06:28:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJB-0001Co-Rv for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:33 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49320) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJA-0004Dz-0K for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:33 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBI6-0002VG-46; Wed, 04 May 2022 10:27:26 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:56 +0100 Message-Id: <20220504092600.10048-47-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 46/50] hppa: move enable_lan() define from hppa_sys.h to machine.c X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651660089579100001 Content-Type: text/plain; charset="utf-8" Now that the board configuration is in one place, the define is only needed= when wiring up the board in machine.c. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/hppa_sys.h | 2 -- hw/hppa/machine.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index 17e2c6dec1..e7f65cad75 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -5,6 +5,4 @@ =20 #include "hppa_hardware.h" =20 -#define enable_lasi_lan() 0 - #endif diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index ca595d343e..e6431aa541 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -36,6 +36,9 @@ =20 #define HPA_POWER_BUTTON (FIRMWARE_END - 0x10) =20 +#define enable_lasi_lan() 0 + + static void hppa_powerdown_req(Notifier *n, void *opaque) { hwaddr soft_power_reg =3D HPA_POWER_BUTTON; --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651660437041557.906693571932; Wed, 4 May 2022 03:33:57 -0700 (PDT) Received: from localhost ([::1]:41188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmCKR-0003CJ-Jx for importer@patchew.org; Wed, 04 May 2022 06:33:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJF-0001PW-HC for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:37 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49328) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJE-0004ED-0y for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:37 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBI6-0002VG-EZ; Wed, 04 May 2022 10:27:30 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:57 +0100 Message-Id: <20220504092600.10048-48-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 47/50] hppa: remove the empty hppa_sys.h file X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651660437817100001 Content-Type: text/plain; charset="utf-8" This file is now just a simple wrapper that includes hppa_hardware.h so rem= ove the file completely, and update its single user in machine.c to include hppa_hardware.h directly. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/hppa_sys.h | 8 -------- hw/hppa/machine.c | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 hw/hppa/hppa_sys.h diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h deleted file mode 100644 index e7f65cad75..0000000000 --- a/hw/hppa/hppa_sys.h +++ /dev/null @@ -1,8 +0,0 @@ -/* HPPA cores and system support chips. */ - -#ifndef HW_HPPA_SYS_H -#define HW_HPPA_SYS_H - -#include "hppa_hardware.h" - -#endif diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index e6431aa541..75820838bf 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -23,7 +23,7 @@ #include "hw/pci/pci.h" #include "hw/pci-host/dino.h" #include "hw/misc/lasi.h" -#include "hppa_sys.h" +#include "hppa_hardware.h" #include "qemu/units.h" #include "qapi/error.h" #include "net/net.h" --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651660719978926.1577883870167; Wed, 4 May 2022 03:38:39 -0700 (PDT) Received: from localhost ([::1]:52552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmCP1-0002d2-11 for importer@patchew.org; Wed, 04 May 2022 06:38:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJM-0001Rs-Op for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:44 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJH-0004Ec-Si for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:44 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBIA-0002VG-N4; Wed, 04 May 2022 10:27:34 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:58 +0100 Message-Id: <20220504092600.10048-49-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 48/50] hppa: use MACHINE QOM macros for defining the hppa machine X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651660721961100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/machine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 75820838bf..2393335a64 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -471,8 +471,8 @@ static void machine_hppa_machine_init_class_init(Object= Class *oc, void *data) } =20 static const TypeInfo machine_hppa_machine_init_typeinfo =3D { - .name =3D ("hppa" "-machine"), - .parent =3D "machine", + .name =3D MACHINE_TYPE_NAME("hppa"), + .parent =3D TYPE_MACHINE, .class_init =3D machine_hppa_machine_init_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_NMI }, --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651660651549278.3482557681763; Wed, 4 May 2022 03:37:31 -0700 (PDT) Received: from localhost ([::1]:49380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmCNu-0000Sd-E6 for importer@patchew.org; Wed, 04 May 2022 06:37:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJM-0001Sg-Pt for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:45 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49344) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBJI-0004Eg-6f for qemu-devel@nongnu.org; Wed, 04 May 2022 05:28:44 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBIE-0002VG-GR; Wed, 04 May 2022 10:27:34 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:25:59 +0100 Message-Id: <20220504092600.10048-50-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 49/50] hppa: fold machine_hppa_machine_init() into machine_hppa_machine_init_class_init() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651660652730100001 Content-Type: text/plain; charset="utf-8" There is no need for a separate function to set the machine class properties separately from the others. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/machine.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 2393335a64..724ee24795 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -446,8 +446,11 @@ static void hppa_nmi(NMIState *n, int cpu_index, Error= **errp) } } =20 -static void machine_hppa_machine_init(MachineClass *mc) +static void machine_hppa_machine_init_class_init(ObjectClass *oc, void *da= ta) { + MachineClass *mc =3D MACHINE_CLASS(oc); + NMIClass *nc =3D NMI_CLASS(oc); + mc->desc =3D "HPPA B160L machine"; mc->default_cpu_type =3D TYPE_HPPA_CPU; mc->init =3D machine_hppa_init; @@ -459,14 +462,7 @@ static void machine_hppa_machine_init(MachineClass *mc) mc->default_ram_size =3D 512 * MiB; mc->default_boot_order =3D "cd"; mc->default_ram_id =3D "ram"; -} =20 -static void machine_hppa_machine_init_class_init(ObjectClass *oc, void *da= ta) -{ - MachineClass *mc =3D MACHINE_CLASS(oc); - machine_hppa_machine_init(mc); - - NMIClass *nc =3D NMI_CLASS(oc); nc->nmi_monitor_handler =3D hppa_nmi; } =20 --=20 2.20.1 From nobody Sat May 11 06:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651660670283688.4994614855925; Wed, 4 May 2022 03:37:50 -0700 (PDT) Received: from localhost ([::1]:50366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmCOC-00018u-7w for importer@patchew.org; Wed, 04 May 2022 06:37:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBLD-0003h1-8e for qemu-devel@nongnu.org; Wed, 04 May 2022 05:30:39 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49352) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmBLB-0004dn-QN for qemu-devel@nongnu.org; Wed, 04 May 2022 05:30:38 -0400 Received: from [2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmBIE-0002VG-U0; Wed, 04 May 2022 10:27:38 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Wed, 4 May 2022 10:26:00 +0100 Message-Id: <20220504092600.10048-51-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> References: <20220504092600.10048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:3700:6895:4d68:6f22:ca1c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 50/50] hppa: simplify machine function names in machine.c X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) 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=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651660671064100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/machine.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 724ee24795..ae0bc07e75 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -446,7 +446,7 @@ static void hppa_nmi(NMIState *n, int cpu_index, Error = **errp) } } =20 -static void machine_hppa_machine_init_class_init(ObjectClass *oc, void *da= ta) +static void hppa_machine_init_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); NMIClass *nc =3D NMI_CLASS(oc); @@ -466,19 +466,19 @@ static void machine_hppa_machine_init_class_init(Obje= ctClass *oc, void *data) nc->nmi_monitor_handler =3D hppa_nmi; } =20 -static const TypeInfo machine_hppa_machine_init_typeinfo =3D { +static const TypeInfo hppa_machine_init_typeinfo =3D { .name =3D MACHINE_TYPE_NAME("hppa"), .parent =3D TYPE_MACHINE, - .class_init =3D machine_hppa_machine_init_class_init, + .class_init =3D hppa_machine_init_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_NMI }, { } }, }; =20 -static void machine_hppa_machine_init_register_types(void) +static void hppa_machine_init_register_types(void) { - type_register_static(&machine_hppa_machine_init_typeinfo); + type_register_static(&hppa_machine_init_typeinfo); } =20 -type_init(machine_hppa_machine_init_register_types) +type_init(hppa_machine_init_register_types) --=20 2.20.1