From nobody Tue May 14 21:09:58 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 1652040055038409.74132220886565; Sun, 8 May 2022 13:00:55 -0700 (PDT) Received: from localhost ([::1]:51434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnn5J-0006cV-4g for importer@patchew.org; Sun, 08 May 2022 16:00:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn1p-0004Tn-Jj for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:17 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55118) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn1o-0006x5-6X for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:17 -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 1nnn0o-0000yR-Ew; Sun, 08 May 2022 20:56:18 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:55:58 +0100 Message-Id: <20220508195650.28590-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 01/53] 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: 1652040056758100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Acked-by: Helge Deller Message-Id: <20220504092600.10048-2-mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 165204018350062.759307303262744; Sun, 8 May 2022 13:03:03 -0700 (PDT) Received: from localhost ([::1]:60120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnn7O-0004Jx-H4 for importer@patchew.org; Sun, 08 May 2022 16:03:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn1t-0004cA-Mr for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:21 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55126) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn1s-0006xH-6l for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57: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 1nnn0t-0000yR-2C; Sun, 08 May 2022 20:56:23 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:55:59 +0100 Message-Id: <20220508195650.28590-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 02/53] 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: 1652040185267100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-3-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040342542443.4411510300463; Sun, 8 May 2022 13:05:42 -0700 (PDT) Received: from localhost ([::1]:40518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnn9x-0001bV-5L for importer@patchew.org; Sun, 08 May 2022 16:05:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn1y-0004oH-Ds for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:26 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55134) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn1w-0006xV-TF for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57: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 1nnn0x-0000yR-9q; Sun, 08 May 2022 20:56:27 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:00 +0100 Message-Id: <20220508195650.28590-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 03/53] 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: 1652040344115100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-4-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040172661812.6404123115743; Sun, 8 May 2022 13:02:52 -0700 (PDT) Received: from localhost ([::1]:59484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnn7D-0003ty-LE for importer@patchew.org; Sun, 08 May 2022 16:02:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn22-0004yB-6G for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:30 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55142) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn20-0006xg-Ke for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:29 -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 1nnn11-0000yR-GY; Sun, 08 May 2022 20:56:31 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:01 +0100 Message-Id: <20220508195650.28590-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 04/53] 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: 1652040173286100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-5-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040079790712.8598161523205; Sun, 8 May 2022 13:01:19 -0700 (PDT) Received: from localhost ([::1]:53064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnn5i-000800-QC for importer@patchew.org; Sun, 08 May 2022 16:01:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn25-00054i-Iz for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:33 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55150) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn24-0006xy-4y for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57: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 1nnn15-0000yR-Pv; Sun, 08 May 2022 20:56:35 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:02 +0100 Message-Id: <20220508195650.28590-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 05/53] 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: 1652040080815100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-6-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040520767523.0348602407433; Sun, 8 May 2022 13:08:40 -0700 (PDT) Received: from localhost ([::1]:49118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnCp-0007Q5-Or for importer@patchew.org; Sun, 08 May 2022 16:08:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn29-0005EQ-My for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:37 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55158) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn28-0006yC-5x for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57: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 1nnn19-0000yR-BH; Sun, 08 May 2022 20:56:39 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:03 +0100 Message-Id: <20220508195650.28590-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 06/53] 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: 1652040522828100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-7-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040101926386.93426308841936; Sun, 8 May 2022 13:01:41 -0700 (PDT) Received: from localhost ([::1]:53692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnn64-0008Pa-So for importer@patchew.org; Sun, 08 May 2022 16:01:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2B-0005It-0n for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:39 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55166) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn28-0006yI-VH for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57: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 1nnn1D-0000yR-HF; Sun, 08 May 2022 20:56:39 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:04 +0100 Message-Id: <20220508195650.28590-8-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 07/53] 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: 1652040103176100001 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 Message-Id: <20220504092600.10048-8-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040325968766.0384609825542; Sun, 8 May 2022 13:05:25 -0700 (PDT) Received: from localhost ([::1]:39878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnn9g-0001BH-WB for importer@patchew.org; Sun, 08 May 2022 16:05:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2E-0005WR-Da for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:42 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55174) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2C-0006yf-Vk for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57: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 1nnn1E-0000yR-1W; Sun, 08 May 2022 20:56:44 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:05 +0100 Message-Id: <20220508195650.28590-9-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 08/53] 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: 1652040327954100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-9-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040229720531.9338127792704; Sun, 8 May 2022 13:03:49 -0700 (PDT) Received: from localhost ([::1]:33396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnn88-0005Ja-JP for importer@patchew.org; Sun, 08 May 2022 16:03:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2I-0005o1-Mn for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:46 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55182) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2H-0006ys-60 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:46 -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 1nnn1I-0000yR-A9; Sun, 08 May 2022 20:56:48 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:06 +0100 Message-Id: <20220508195650.28590-10-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 09/53] 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: 1652040231495100001 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 Message-Id: <20220504092600.10048-10-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040510073378.96479321329446; Sun, 8 May 2022 13:08:30 -0700 (PDT) Received: from localhost ([::1]:48362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnCe-0006us-Js for importer@patchew.org; Sun, 08 May 2022 16:08:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2N-00066S-6f for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:51 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2L-0006z5-OW for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:50 -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 1nnn1M-0000yR-Hc; Sun, 08 May 2022 20:56:52 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:07 +0100 Message-Id: <20220508195650.28590-11-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 10/53] 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: 1652040510775100001 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 Message-Id: <20220504092600.10048-11-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040369786195.55465762756762; Sun, 8 May 2022 13:06:09 -0700 (PDT) Received: from localhost ([::1]:42010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnAN-0002bO-Cp for importer@patchew.org; Sun, 08 May 2022 16:06:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2R-0006NF-S1 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:55 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55198) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2P-0006zH-QJ for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57: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 1nnn1Q-0000yR-Nn; Sun, 08 May 2022 20:56:56 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:08 +0100 Message-Id: <20220508195650.28590-12-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 11/53] 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: 1652040370271100001 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 Message-Id: <20220504092600.10048-12-mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040535943244.3190594584463; Sun, 8 May 2022 13:08:55 -0700 (PDT) Received: from localhost ([::1]:50552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnD4-0008NV-VH for importer@patchew.org; Sun, 08 May 2022 16:08:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2V-0006Sg-Bi for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:00 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55206) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2T-0006zW-T1 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:57:59 -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 1nnn1V-0000yR-1P; Sun, 08 May 2022 20:57:01 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:09 +0100 Message-Id: <20220508195650.28590-13-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 12/53] 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: 1652040536884100001 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 Message-Id: <20220504092600.10048-13-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040674154731.911989331603; Sun, 8 May 2022 13:11:14 -0700 (PDT) Received: from localhost ([::1]:56920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnFI-0004EO-Pj for importer@patchew.org; Sun, 08 May 2022 16:11:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2a-0006Yz-G2 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:04 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55214) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2Y-0006zj-Vt for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58: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 1nnn1Z-0000yR-96; Sun, 08 May 2022 20:57:05 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:10 +0100 Message-Id: <20220508195650.28590-14-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 13/53] 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: 1652040675863100001 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 Message-Id: <20220504092600.10048-14-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 165204080640279.68206790688316; Sun, 8 May 2022 13:13:26 -0700 (PDT) Received: from localhost ([::1]:37220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnHR-0001Yd-AT for importer@patchew.org; Sun, 08 May 2022 16:13:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2e-0006bd-2D for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:08 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55222) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2c-0006zy-G4 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58: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 1nnn1d-0000yR-Hq; Sun, 08 May 2022 20:57:09 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:11 +0100 Message-Id: <20220508195650.28590-15-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 14/53] 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: 1652040807893100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-15-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040709850708.7498333442755; Sun, 8 May 2022 13:11:49 -0700 (PDT) Received: from localhost ([::1]:59156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnFs-0005pF-3E for importer@patchew.org; Sun, 08 May 2022 16:11:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2i-0006hf-94 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:13 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55230) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2g-00071V-Mw for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58: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 1nnn1h-0000yR-PU; Sun, 08 May 2022 20:57:13 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:12 +0100 Message-Id: <20220508195650.28590-16-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 15/53] 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: 1652040711499100001 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 Message-Id: <20220504092600.10048-16-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040998111773.9632643697721; Sun, 8 May 2022 13:16:38 -0700 (PDT) Received: from localhost ([::1]:45694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnKW-0007Jv-L6 for importer@patchew.org; Sun, 08 May 2022 16:16:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2w-0006mP-F8 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:31 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55238) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2u-00071f-Vf for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58: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 1nnn1l-0000yR-W5; Sun, 08 May 2022 20:57:18 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:13 +0100 Message-Id: <20220508195650.28590-17-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 16/53] 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: 1652041001608100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-17-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 16520408367231004.7501735427743; Sun, 8 May 2022 13:13:56 -0700 (PDT) Received: from localhost ([::1]:39450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnHv-00033r-M6 for importer@patchew.org; Sun, 08 May 2022 16:13:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn31-0006mb-DB for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:34 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55246) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn2z-00071n-55 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58: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 1nnn1q-0000yR-7V; Sun, 08 May 2022 20:57:22 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:14 +0100 Message-Id: <20220508195650.28590-18-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 17/53] 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: 1652040837997100001 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 Message-Id: <20220504092600.10048-18-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040686314716.438124930102; Sun, 8 May 2022 13:11:26 -0700 (PDT) Received: from localhost ([::1]:57670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnFV-0004jq-0x for importer@patchew.org; Sun, 08 May 2022 16:11:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46928) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn34-0006mp-Ta for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:35 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn32-00071r-Li for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58: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 1nnn1u-0000yR-El; Sun, 08 May 2022 20:57:25 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:15 +0100 Message-Id: <20220508195650.28590-19-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 18/53] 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: 1652040687725100001 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 Message-Id: <20220504092600.10048-19-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041019066580.2144124398395; Sun, 8 May 2022 13:16:59 -0700 (PDT) Received: from localhost ([::1]:47942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnKr-0000PR-SO for importer@patchew.org; Sun, 08 May 2022 16:16:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn38-0006oI-NG for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:39 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55262) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn37-000721-5z for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58: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 1nnn1y-0000yR-1L; Sun, 08 May 2022 20:57:30 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:16 +0100 Message-Id: <20220508195650.28590-20-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 19/53] 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: 1652041019480100001 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 Message-Id: <20220504092600.10048-20-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040236906218.45117491780184; Sun, 8 May 2022 13:03:56 -0700 (PDT) Received: from localhost ([::1]:34054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnn8F-0005ls-TA for importer@patchew.org; Sun, 08 May 2022 16:03:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3E-0006p4-NB for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:45 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55270) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3B-00072F-7A for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58: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 1nnn22-0000yR-88; Sun, 08 May 2022 20:57:34 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:17 +0100 Message-Id: <20220508195650.28590-21-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 20/53] 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: 1652040237517100001 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 Message-Id: <20220504092600.10048-21-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041160021853.2445905607184; Sun, 8 May 2022 13:19:20 -0700 (PDT) Received: from localhost ([::1]:56462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnN8-00068N-Uw for importer@patchew.org; Sun, 08 May 2022 16:19:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3G-0006pc-M2 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:47 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55278) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3F-00072b-B2 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:46 -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 1nnn26-0000yR-E8; Sun, 08 May 2022 20:57:38 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:18 +0100 Message-Id: <20220508195650.28590-22-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 21/53] 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: 1652041162059100001 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 Message-Id: <20220504092600.10048-22-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 16520413431861013.9987676959034; Sun, 8 May 2022 13:22:23 -0700 (PDT) Received: from localhost ([::1]:36774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnQ5-0003UV-SU for importer@patchew.org; Sun, 08 May 2022 16:22:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3T-0006qc-M9 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:59 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55286) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3I-00072u-RQ for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:59 -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 1nnn2A-0000yR-KX; Sun, 08 May 2022 20:57:42 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:19 +0100 Message-Id: <20220508195650.28590-23-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 22/53] 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: 1652041344810100001 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 Message-Id: <20220504092600.10048-23-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 218c9459b6..59210b093a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1113,7 +1113,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 Tue May 14 21:09:58 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 1652040822173910.2430018105799; Sun, 8 May 2022 13:13:42 -0700 (PDT) Received: from localhost ([::1]:37984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnHh-00023l-3F for importer@patchew.org; Sun, 08 May 2022 16:13:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3T-0006qb-C1 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:59 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55294) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3O-000738-DP for qemu-devel@nongnu.org; Sun, 08 May 2022 15:58:59 -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 1nnn2E-0000yR-3s; Sun, 08 May 2022 20:57:45 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:20 +0100 Message-Id: <20220508195650.28590-24-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 23/53] 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: 1652040824157100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-24-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040385312212.46900326724563; Sun, 8 May 2022 13:06:25 -0700 (PDT) Received: from localhost ([::1]:42684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnAe-00032Q-Ap for importer@patchew.org; Sun, 08 May 2022 16:06:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3U-0006rk-JN for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:00 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3Q-00073S-Sp for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:00 -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 1nnn2H-0000yR-Vi; Sun, 08 May 2022 20:57:50 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:21 +0100 Message-Id: <20220508195650.28590-25-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 24/53] 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: 1652040386245100001 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 Message-Id: <20220504092600.10048-25-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040545124597.2575516675355; Sun, 8 May 2022 13:09:05 -0700 (PDT) Received: from localhost ([::1]:51426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnDD-0000WG-Th for importer@patchew.org; Sun, 08 May 2022 16:09:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3Z-0006zz-T1 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:05 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3Y-00073i-EA for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:05 -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 1nnn2M-0000yR-7q; Sun, 08 May 2022 20:57:54 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:22 +0100 Message-Id: <20220508195650.28590-26-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 25/53] 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: 1652040546919100003 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 Message-Id: <20220504092600.10048-26-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041049067160.7179884337296; Sun, 8 May 2022 13:17:29 -0700 (PDT) Received: from localhost ([::1]:49510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnLM-0001Sw-2y for importer@patchew.org; Sun, 08 May 2022 16:17:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3d-00072e-Vh for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:10 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55318) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3c-00073v-27 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:09 -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 1nnn2Q-0000yR-Fs; Sun, 08 May 2022 20:57:57 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:23 +0100 Message-Id: <20220508195650.28590-27-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 26/53] 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: 1652041049595100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-27-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 165204071737425.95225136240026; Sun, 8 May 2022 13:11:57 -0700 (PDT) Received: from localhost ([::1]:59970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnFz-0006Ll-PW for importer@patchew.org; Sun, 08 May 2022 16:11:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3f-00075U-LX for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:11 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55326) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3c-000740-LL for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59: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 1nnn2U-0000yR-0z; Sun, 08 May 2022 20:58:01 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:24 +0100 Message-Id: <20220508195650.28590-28-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 27/53] 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: 1652040717516100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-28-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041182861664.8610182544775; Sun, 8 May 2022 13:19:42 -0700 (PDT) Received: from localhost ([::1]:58050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnNV-0007Bz-SM for importer@patchew.org; Sun, 08 May 2022 16:19:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3i-00077O-DD for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:15 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55334) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3g-00074R-PA for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:14 -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 1nnn2X-0000yR-Uu; Sun, 08 May 2022 20:58:06 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:25 +0100 Message-Id: <20220508195650.28590-29-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 28/53] 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: 1652041184079100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-29-mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041123658973.2106511637479; Sun, 8 May 2022 13:18:43 -0700 (PDT) Received: from localhost ([::1]:54176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnMY-0004c7-6E for importer@patchew.org; Sun, 08 May 2022 16:18:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3m-00078X-E9 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:22 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55342) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3k-00074W-Ih for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:18 -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 1nnn2c-0000yR-6U; Sun, 08 May 2022 20:58:09 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:26 +0100 Message-Id: <20220508195650.28590-30-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 29/53] 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: 1652041123894100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-30-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041407524205.3518113663771; Sun, 8 May 2022 13:23:27 -0700 (PDT) Received: from localhost ([::1]:38474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnR8-0004dw-1w for importer@patchew.org; Sun, 08 May 2022 16:23:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4B-0007DG-W1 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:44 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55350) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3o-00076C-Ne for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59: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 1nnn2f-0000yR-P8; Sun, 08 May 2022 20:58:14 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:27 +0100 Message-Id: <20220508195650.28590-31-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 30/53] 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: 1652041409169100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-31-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652040850985291.670767847294; Sun, 8 May 2022 13:14:10 -0700 (PDT) Received: from localhost ([::1]:40184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnI9-0003X6-Vf for importer@patchew.org; Sun, 08 May 2022 16:14:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4B-0007DH-Vw for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:44 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55358) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn3s-00076U-KF for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59: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 1nnn2k-0000yR-2g; Sun, 08 May 2022 20:58:17 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:28 +0100 Message-Id: <20220508195650.28590-32-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 31/53] 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: 1652040852054100001 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 Message-Id: <20220504092600.10048-32-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041556913817.6307496453262; Sun, 8 May 2022 13:25:56 -0700 (PDT) Received: from localhost ([::1]:46994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnTX-0001pq-TM for importer@patchew.org; Sun, 08 May 2022 16:25:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4C-0007Dk-QN for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:48 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55366) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn49-00076l-Tz for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59: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 1nnn2n-0000yR-VO; Sun, 08 May 2022 20:58:22 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:29 +0100 Message-Id: <20220508195650.28590-33-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 32/53] 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: 1652041557603100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-33-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041901461327.9837068456126; Sun, 8 May 2022 13:31:41 -0700 (PDT) Received: from localhost ([::1]:35980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnZ6-0004uA-AN for importer@patchew.org; Sun, 08 May 2022 16:31:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4O-0007Rg-0z for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:56 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55376) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4L-00076z-5Y for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59: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 1nnn2s-0000yR-6F; Sun, 08 May 2022 20:58:26 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:30 +0100 Message-Id: <20220508195650.28590-34-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 33/53] 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: 1652041903112100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-34-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 165204167547060.00256745284685; Sun, 8 May 2022 13:27:55 -0700 (PDT) Received: from localhost ([::1]:51922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnVS-0005Bt-0Y for importer@patchew.org; Sun, 08 May 2022 16:27:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4O-0007Ra-1X for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:56 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55382) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4L-000771-5V for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59: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 1nnn2w-0000yR-DI; Sun, 08 May 2022 20:58:26 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:31 +0100 Message-Id: <20220508195650.28590-35-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 34/53] 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: 1652041676160100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-35-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 165204151635975.53065987226239; Sun, 8 May 2022 13:25:16 -0700 (PDT) Received: from localhost ([::1]:45386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnSt-0000lm-0F for importer@patchew.org; Sun, 08 May 2022 16:25:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4M-0007Oa-Lh for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:54 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55390) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4L-000779-53 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:54 -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 1nnn2w-0000yR-QO; Sun, 08 May 2022 20:58:30 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:32 +0100 Message-Id: <20220508195650.28590-36-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 35/53] 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: 1652041517491100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-36-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041456066404.4370768077897; Sun, 8 May 2022 13:24:16 -0700 (PDT) Received: from localhost ([::1]:43200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnRv-0007k6-2C for importer@patchew.org; Sun, 08 May 2022 16:24:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4O-0007Rf-1a for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:56 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55400) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4L-00077H-6V for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59: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 1nnn30-0000yR-CS; Sun, 08 May 2022 20:58:33 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:33 +0100 Message-Id: <20220508195650.28590-37-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 36/53] 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: 1652041457247100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-37-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041717475221.79507323236737; Sun, 8 May 2022 13:28:37 -0700 (PDT) Received: from localhost ([::1]:55638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnW8-0007fN-DV for importer@patchew.org; Sun, 08 May 2022 16:28:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4M-0007OZ-K8 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:54 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55408) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4L-00077O-4p for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:54 -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 1nnn33-0000yR-VJ; Sun, 08 May 2022 20:58:38 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:34 +0100 Message-Id: <20220508195650.28590-38-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 37/53] 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: 1652041718187100001 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 Message-Id: <20220504092600.10048-38-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 16520410275651014.9795302442127; Sun, 8 May 2022 13:17:07 -0700 (PDT) Received: from localhost ([::1]:48656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnKz-0000tF-TG for importer@patchew.org; Sun, 08 May 2022 16:17:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4N-0007RZ-U4 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:56 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55416) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4L-00077b-5J for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59: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 1nnn38-0000yR-6L; Sun, 08 May 2022 20:58:41 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:35 +0100 Message-Id: <20220508195650.28590-39-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 38/53] 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: 1652041029502100003 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 Message-Id: <20220504092600.10048-39-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041276602121.6919461938462; Sun, 8 May 2022 13:21:16 -0700 (PDT) Received: from localhost ([::1]:34500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnP1-0001yS-A0 for importer@patchew.org; Sun, 08 May 2022 16:21:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4O-0007Rh-37 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:56 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4L-00077m-7A for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59: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 1nnn3B-0000yR-No; Sun, 08 May 2022 20:58:45 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:36 +0100 Message-Id: <20220508195650.28590-40-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 39/53] 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: 1652041278544100001 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 Message-Id: <20220504092600.10048-40-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041699701947.2363063701828; Sun, 8 May 2022 13:28:19 -0700 (PDT) Received: from localhost ([::1]:53918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnVq-0006XV-KY for importer@patchew.org; Sun, 08 May 2022 16:28:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4P-0007T7-S1 for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:58 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4O-00078F-Hj for qemu-devel@nongnu.org; Sun, 08 May 2022 15:59:57 -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 1nnn3G-0000yR-0V; Sun, 08 May 2022 20:58:49 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:37 +0100 Message-Id: <20220508195650.28590-41-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 40/53] 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: 1652041700147100001 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 Message-Id: <20220504092600.10048-41-mark.cave-ayland@ilande.co.uk> Acked-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041801791487.048222675592; Sun, 8 May 2022 13:30:01 -0700 (PDT) Received: from localhost ([::1]:60518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnXU-0002SF-OY for importer@patchew.org; Sun, 08 May 2022 16:30:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4U-0007Wg-J5 for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:05 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55440) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4S-00078V-EV for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00: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 1nnn3J-0000yR-TF; Sun, 08 May 2022 20:58:53 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:38 +0100 Message-Id: <20220508195650.28590-42-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 41/53] 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: 1652041802447100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-42-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 16520418329542.5823566636773876; Sun, 8 May 2022 13:30:32 -0700 (PDT) Received: from localhost ([::1]:34306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnXz-0003mV-UK for importer@patchew.org; Sun, 08 May 2022 16:30:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4Z-0007XO-SU for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:07 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55448) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4W-00078g-NM for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00: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 1nnn3N-0000yR-Oy; Sun, 08 May 2022 20:58:57 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:39 +0100 Message-Id: <20220508195650.28590-43-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 42/53] 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: 1652041834576100001 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 Message-Id: <20220504092600.10048-43-mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- 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 59210b093a..662ec47246 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1113,7 +1113,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 Tue May 14 21:09:58 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 165204116811028.301996260006604; Sun, 8 May 2022 13:19:28 -0700 (PDT) Received: from localhost ([::1]:57172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnNH-0006bH-4Z for importer@patchew.org; Sun, 08 May 2022 16:19:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4c-0007ab-CN for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:10 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4a-00079f-5M for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:10 -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 1nnn3R-0000yR-WF; Sun, 08 May 2022 20:59:01 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:40 +0100 Message-Id: <20220508195650.28590-44-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 43/53] 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: 1652041170026100001 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 Message-Id: <20220504092600.10048-44-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652041373164471.5186701264988; Sun, 8 May 2022 13:22:53 -0700 (PDT) Received: from localhost ([::1]:37454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnQZ-0003vc-4w for importer@patchew.org; Sun, 08 May 2022 16:22:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4h-0007fo-Ke for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:22 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55464) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4e-0007A2-7i for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00: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 1nnn3V-0000yR-Gc; Sun, 08 May 2022 20:59:05 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:41 +0100 Message-Id: <20220508195650.28590-45-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 44/53] 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: 1652041374901100001 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 Message-Id: <20220504092600.10048-45-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652042112578758.768689434083; Sun, 8 May 2022 13:35:12 -0700 (PDT) Received: from localhost ([::1]:42052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnncV-0000ho-CR for importer@patchew.org; Sun, 08 May 2022 16:35:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4l-0007g3-En for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:24 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55472) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4i-0007MO-NZ for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:18 -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 1nnn3Z-0000yR-Fx; Sun, 08 May 2022 20:59:09 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:42 +0100 Message-Id: <20220508195650.28590-46-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 45/53] 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: 1652042113786100001 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 Message-Id: <20220504092600.10048-46-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 40132b4804..fa672e57bc 100644 --- a/meson.build +++ b/meson.build @@ -2944,7 +2944,6 @@ if have_system 'hw/char', 'hw/display', 'hw/dma', - 'hw/hppa', 'hw/hyperv', 'hw/i2c', 'hw/i386', --=20 2.20.1 From nobody Tue May 14 21:09:58 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 1652041542108543.3449636310654; Sun, 8 May 2022 13:25:42 -0700 (PDT) Received: from localhost ([::1]:46130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnTJ-0001Fe-4S for importer@patchew.org; Sun, 08 May 2022 16:25:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4s-0007hj-UQ for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:27 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4n-0007Ns-O1 for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:25 -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 1nnn3d-0000yR-RP; Sun, 08 May 2022 20:59:13 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:43 +0100 Message-Id: <20220508195650.28590-47-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 46/53] 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: 1652041543791100003 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 Message-Id: <20220504092600.10048-47-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652042092949658.3853264942992; Sun, 8 May 2022 13:34:52 -0700 (PDT) Received: from localhost ([::1]:40522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnncB-00086M-KH for importer@patchew.org; Sun, 08 May 2022 16:34:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4u-0007iw-SZ for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:28 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4r-0007OF-Cw for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00: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 1nnn3h-0000yR-HZ; Sun, 08 May 2022 20:59:17 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:44 +0100 Message-Id: <20220508195650.28590-48-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 47/53] 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: 1652042093937100001 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 Message-Id: <20220504092600.10048-48-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 165204170903261.16892267973185; Sun, 8 May 2022 13:28:29 -0700 (PDT) Received: from localhost ([::1]:54850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnVz-00077n-UV for importer@patchew.org; Sun, 08 May 2022 16:28:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4w-0007k3-Na for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:32 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4u-0007Qo-Cw for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:29 -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 1nnn3l-0000yR-Fo; Sun, 08 May 2022 20:59:21 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:45 +0100 Message-Id: <20220508195650.28590-49-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 48/53] 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: 1652041710181100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-49-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 165204212908176.21706289329916; Sun, 8 May 2022 13:35:29 -0700 (PDT) Received: from localhost ([::1]:43252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnncm-0001U7-0B for importer@patchew.org; Sun, 08 May 2022 16:35:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn51-0007si-EU for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:35 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55504) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn4z-0007W6-W2 for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:35 -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 1nnn3p-0000yR-MK; Sun, 08 May 2022 20:59:25 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:46 +0100 Message-Id: <20220508195650.28590-50-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 49/53] 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: 1652042129798100001 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 Message-Id: <20220504092600.10048-50-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 Tue May 14 21:09:58 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 1652042339654450.01057077187147; Sun, 8 May 2022 13:38:59 -0700 (PDT) Received: from localhost ([::1]:53866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnngA-0000RU-Fc for importer@patchew.org; Sun, 08 May 2022 16:38:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn5T-0008V6-R7 for qemu-devel@nongnu.org; Sun, 08 May 2022 16:01:03 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55522) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn5R-0007ap-EE for qemu-devel@nongnu.org; Sun, 08 May 2022 16:01: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 1nnn3t-0000yR-J4; Sun, 08 May 2022 20:59:29 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:47 +0100 Message-Id: <20220508195650.28590-51-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 50/53] 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: 1652042340756100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Message-Id: <20220504092600.10048-51-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- 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 From nobody Tue May 14 21:09:58 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 1652042241062491.445025430363; Sun, 8 May 2022 13:37:21 -0700 (PDT) Received: from localhost ([::1]:48334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnea-0004v3-0Y for importer@patchew.org; Sun, 08 May 2022 16:37:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn5G-0008Cy-3D for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:51 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn5E-0007aJ-Gh for qemu-devel@nongnu.org; Sun, 08 May 2022 16:00:49 -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 1nnn3x-0000yR-Pj; Sun, 08 May 2022 20:59:33 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:48 +0100 Message-Id: <20220508195650.28590-52-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 51/53] artist: checkpatch and newline style 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: 1652042242413100001 Content-Type: text/plain; charset="utf-8" Ensure that subsequent patches do not cause checkpatch to fail and also tid= y up extra/missing newlines. Signed-off-by: Mark Cave-Ayland Message-Id: <20220504153708.10352-2-mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell Reviewed-by: Helge Deller Reviewed-by: Sven Schnelle Signed-off-by: Mark Cave-Ayland --- hw/display/artist.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/hw/display/artist.c b/hw/display/artist.c index 8e121bb0b4..be92113494 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -211,8 +211,9 @@ static void artist_invalidate_lines(struct vram_buffer = *buf, int start =3D starty * buf->width; int size; =20 - if (starty + height > buf->height) + if (starty + height > buf->height) { height =3D buf->height - starty; + } =20 size =3D height * buf->width; =20 @@ -321,8 +322,9 @@ static void artist_get_cursor_pos(ARTISTState *s, int *= x, int *y) } =20 lx =3D artist_get_x(s->cursor_pos); - if (lx < offset) + if (lx < offset) { offset =3D lx; + } *x =3D (lx - offset) / 2; =20 *y =3D 1146 - artist_get_y(s->cursor_pos); @@ -343,6 +345,7 @@ static void artist_get_cursor_pos(ARTISTState *s, int *= x, int *y) static void artist_invalidate_cursor(ARTISTState *s) { int x, y; + artist_get_cursor_pos(s, &x, &y); artist_invalidate_lines(&s->vram_buffer[ARTIST_BUFFER_AP], y, s->cursor_height); @@ -470,10 +473,9 @@ static void draw_line(ARTISTState *s, =20 if ((x1 >=3D buf->width && x2 >=3D buf->width) || (y1 >=3D buf->height && y2 >=3D buf->height)) { - return; + return; } =20 - if (update_start) { s->vram_start =3D (x2 << 16) | y2; } @@ -553,15 +555,15 @@ static void draw_line(ARTISTState *s, x++; } while (x <=3D x2 && (max_pix =3D=3D -1 || --max_pix > 0)); =20 - if (c1) + if (c1) { artist_invalidate_lines(buf, x1, x2 - x1); - else + } else { artist_invalidate_lines(buf, y1 > y2 ? y2 : y1, x2 - x1); + } } =20 static void draw_line_pattern_start(ARTISTState *s) { - int startx =3D artist_get_x(s->vram_start); int starty =3D artist_get_y(s->vram_start); int endx =3D artist_get_x(s->blockmove_size); @@ -574,7 +576,6 @@ static void draw_line_pattern_start(ARTISTState *s) =20 static void draw_line_pattern_next(ARTISTState *s) { - int startx =3D artist_get_x(s->vram_start); int starty =3D artist_get_y(s->vram_start); int endx =3D artist_get_x(s->blockmove_size); @@ -589,7 +590,6 @@ static void draw_line_pattern_next(ARTISTState *s) =20 static void draw_line_size(ARTISTState *s, bool update_start) { - int startx =3D artist_get_x(s->vram_start); int starty =3D artist_get_y(s->vram_start); int endx =3D artist_get_x(s->line_size); @@ -600,7 +600,6 @@ static void draw_line_size(ARTISTState *s, bool update_= start) =20 static void draw_line_xy(ARTISTState *s, bool update_start) { - int startx =3D artist_get_x(s->vram_start); int starty =3D artist_get_y(s->vram_start); int sizex =3D artist_get_x(s->blockmove_size); @@ -650,7 +649,6 @@ static void draw_line_xy(ARTISTState *s, bool update_st= art) =20 static void draw_line_end(ARTISTState *s, bool update_start) { - int startx =3D artist_get_x(s->vram_start); int starty =3D artist_get_y(s->vram_start); int endx =3D artist_get_x(s->line_end); @@ -835,6 +833,7 @@ static void artist_vram_write(void *opaque, hwaddr addr= , uint64_t val, unsigned size) { ARTISTState *s =3D opaque; + s->vram_char_y =3D 0; trace_artist_vram_write(size, addr, val); vram_bit_write(opaque, addr, 0, val, size); @@ -1244,7 +1243,6 @@ static void artist_update_display(void *opaque) DisplaySurface *surface =3D qemu_console_surface(s->con); int first =3D 0, last; =20 - framebuffer_update_display(surface, &s->fbsection, s->width, s->height, s->width, s->width * 4, 0, 0, artist_draw_l= ine, s, &first, &last); @@ -1258,6 +1256,7 @@ static void artist_invalidate(void *opaque) { ARTISTState *s =3D ARTIST(opaque); struct vram_buffer *buf =3D &s->vram_buffer[ARTIST_BUFFER_AP]; + memory_region_set_dirty(&buf->mr, 0, buf->size); } =20 --=20 2.20.1 From nobody Tue May 14 21:09:58 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 1652042418083627.622930739357; Sun, 8 May 2022 13:40:18 -0700 (PDT) Received: from localhost ([::1]:58040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnhR-0003JD-0Y for importer@patchew.org; Sun, 08 May 2022 16:40:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn5l-0000wZ-Tm for qemu-devel@nongnu.org; Sun, 08 May 2022 16:01:22 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55534) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn5i-0007d2-Ow for qemu-devel@nongnu.org; Sun, 08 May 2022 16:01: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 1nnn41-0000yR-Q3; Sun, 08 May 2022 20:59:37 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:49 +0100 Message-Id: <20220508195650.28590-53-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 52/53] artist: remove unused ROP8OFF() macro 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: 1652042420009100001 Content-Type: text/plain; charset="utf-8" This macro is unused and so can simply be removed. Signed-off-by: Mark Cave-Ayland Message-Id: <20220504153708.10352-3-mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell Reviewed-by: Helge Deller Reviewed-by: Sven Schnelle Signed-off-by: Mark Cave-Ayland --- hw/display/artist.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hw/display/artist.c b/hw/display/artist.c index be92113494..4a9f7b5e59 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -25,12 +25,6 @@ #define TYPE_ARTIST "artist" OBJECT_DECLARE_SIMPLE_TYPE(ARTISTState, ARTIST) =20 -#if HOST_BIG_ENDIAN -#define ROP8OFF(_i) (3 - (_i)) -#else -#define ROP8OFF -#endif - struct vram_buffer { MemoryRegion mr; uint8_t *data; --=20 2.20.1 From nobody Tue May 14 21:09:58 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 1652042289275426.31221571050287; Sun, 8 May 2022 13:38:09 -0700 (PDT) Received: from localhost ([::1]:51734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnfL-0007Pv-P4 for importer@patchew.org; Sun, 08 May 2022 16:38:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn5X-0000F5-Mz for qemu-devel@nongnu.org; Sun, 08 May 2022 16:01:07 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:55528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnn5V-0007bS-6p for qemu-devel@nongnu.org; Sun, 08 May 2022 16:01: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 1nnn45-0000yR-HN; Sun, 08 May 2022 20:59:37 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org Date: Sun, 8 May 2022 20:56:50 +0100 Message-Id: <20220508195650.28590-54-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk> References: <20220508195650.28590-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: [PULL 53/53] artist: only render dirty scanlines on the display surface 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: 1652042290784100001 Content-Type: text/plain; charset="utf-8" The framebuffer_update_display() function returns the dirty scanlines that = were touched since the last display update, however artist_update_display() alwa= ys calls dpy_gfx_update() with start and end scanlines of 0 and s->height causing the entire display surface to be rendered on every update. Update artist_update_display() so that dpy_gfx_update() only renders the di= rty scanlines on the display surface, bypassing the display surface rendering completely if framebuffer_update_display() indicates no changes occurred. This noticeably improves boot performance when the framebuffer is enabled o= n my rather modest laptop here, including making the GTK UI usable. Signed-off-by: Mark Cave-Ayland Message-Id: <20220504153708.10352-4-mark.cave-ayland@ilande.co.uk> Reviewed-by: Helge Deller Reviewed-by: Sven Schnelle Signed-off-by: Mark Cave-Ayland --- hw/display/artist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/display/artist.c b/hw/display/artist.c index 4a9f7b5e59..39fc0c4ca5 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -1243,7 +1243,9 @@ static void artist_update_display(void *opaque) =20 artist_draw_cursor(s); =20 - dpy_gfx_update(s->con, 0, 0, s->width, s->height); + if (first >=3D 0) { + dpy_gfx_update(s->con, 0, first, s->width, last - first + 1); + } } =20 static void artist_invalidate(void *opaque) --=20 2.20.1