From nobody Sun Nov 16 12:32:37 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1601129061; cv=none; d=zohomail.com; s=zohoarc; b=EhHGcnRGgIBDbTK2GV78mUEvpSp2pr7ctdmSUUe1q6y0r7AzuWPcWuog//KBi3chkS+dfOc0ZPEI9Xlpnhf26kLNAqGFfhgWxeBwNwDt5vz4beGMGIQPAbRFGjteIXMVSmChXFY6B7zvgN9LS5A7yhbRV14JN0okoAqDL+Rnzrw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601129061; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BpQ0JQo6KdpE1IRTPnAJruBEauvG10lWwOkMWWUIvzw=; b=PBjOyZf+2HpJUwGpfmU14u0RycuPy3ieNMEFI1EohZ4veZjkFP3KJyohtyiTJeJ3HNsb+jPkINtr7IXA+EfiybuGi0Hw7K/h6qI1ciUmZ/C/yJwyfO9fOXbGpWSyJwdCUJiQ3ZoFzVOPO0xUMkxiNvlSD/Qj19nCylNGofOjfyk= ARC-Authentication-Results: i=1; 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 1601129061451765.7088327598129; Sat, 26 Sep 2020 07:04:21 -0700 (PDT) Received: from localhost ([::1]:50434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMAoF-0007pp-UG for importer@patchew.org; Sat, 26 Sep 2020 10:04:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMAmh-000635-A0; Sat, 26 Sep 2020 10:02:43 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:41404 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMAmf-0005Fc-ET; Sat, 26 Sep 2020 10:02:42 -0400 Received: from host86-184-131-21.range86-184.btcentralplus.com ([86.184.131.21] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMAn5-0001Y4-L3; Sat, 26 Sep 2020 15:03:12 +0100 From: Mark Cave-Ayland To: armbru@redhat.com, david@gibson.dropbear.id.au, atar4qemu@gmail.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Sat, 26 Sep 2020 15:02:11 +0100 Message-Id: <20200926140216.7368-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200926140216.7368-1-mark.cave-ayland@ilande.co.uk> References: <20200926140216.7368-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.184.131.21 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 1/6] sparc32-dma: use object_initialize_child() for espdma and ledma child objects X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) 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.default.ilande.uk0.bigv.io X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" Store the child objects directly within the sparc32-dma object rather than = using link properties. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/dma/sparc32_dma.c | 15 +++++++++------ include/hw/sparc/sparc32_dma.h | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c index d20a5bc065..b25a212f7a 100644 --- a/hw/dma/sparc32_dma.c +++ b/hw/dma/sparc32_dma.c @@ -379,10 +379,9 @@ static void sparc32_dma_realize(DeviceState *dev, Erro= r **errp) return; } =20 - espdma =3D qdev_new(TYPE_SPARC32_ESPDMA_DEVICE); + espdma =3D DEVICE(&s->espdma); object_property_set_link(OBJECT(espdma), "iommu", iommu, &error_abort); - object_property_add_child(OBJECT(s), "espdma", OBJECT(espdma)); - sysbus_realize_and_unref(SYS_BUS_DEVICE(espdma), &error_fatal); + sysbus_realize(SYS_BUS_DEVICE(espdma), &error_fatal); =20 esp =3D DEVICE(object_resolve_path_component(OBJECT(espdma), "esp")); sbd =3D SYS_BUS_DEVICE(esp); @@ -394,10 +393,9 @@ static void sparc32_dma_realize(DeviceState *dev, Erro= r **errp) memory_region_add_subregion(&s->dmamem, 0x0, sysbus_mmio_get_region(sbd, 0)); =20 - ledma =3D qdev_new(TYPE_SPARC32_LEDMA_DEVICE); + ledma =3D DEVICE(&s->ledma); object_property_set_link(OBJECT(ledma), "iommu", iommu, &error_abort); - object_property_add_child(OBJECT(s), "ledma", OBJECT(ledma)); - sysbus_realize_and_unref(SYS_BUS_DEVICE(ledma), &error_fatal); + sysbus_realize(SYS_BUS_DEVICE(ledma), &error_fatal); =20 lance =3D DEVICE(object_resolve_path_component(OBJECT(ledma), "lance")= ); sbd =3D SYS_BUS_DEVICE(lance); @@ -421,6 +419,11 @@ static void sparc32_dma_init(Object *obj) =20 memory_region_init(&s->dmamem, OBJECT(s), "dma", DMA_SIZE + DMA_ETH_SI= ZE); sysbus_init_mmio(sbd, &s->dmamem); + + object_initialize_child(obj, "espdma", &s->espdma, + TYPE_SPARC32_ESPDMA_DEVICE); + object_initialize_child(obj, "ledma", &s->ledma, + TYPE_SPARC32_LEDMA_DEVICE); } =20 static void sparc32_dma_class_init(ObjectClass *klass, void *data) diff --git a/include/hw/sparc/sparc32_dma.h b/include/hw/sparc/sparc32_dma.h index e650489414..3348a725f0 100644 --- a/include/hw/sparc/sparc32_dma.h +++ b/include/hw/sparc/sparc32_dma.h @@ -48,8 +48,8 @@ struct SPARC32DMAState { =20 MemoryRegion dmamem; MemoryRegion ledma_alias; - ESPDMADeviceState *espdma; - LEDMADeviceState *ledma; + ESPDMADeviceState espdma; + LEDMADeviceState ledma; }; =20 /* sparc32_dma.c */ --=20 2.20.1 From nobody Sun Nov 16 12:32:37 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1601129072; cv=none; d=zohomail.com; s=zohoarc; b=oKcYjprgKlCXC29qcNEQOazMJdFngJ6mIeNcQIa8f0aiUCmS8/smKOXRK/xXiMptw57xnJc1nFKO0ts9TDZioP4zBdaMV9ceQiGC4gM5TUrzaj+kFExpyGx0lSSMBUuEDtxfntwtViYs10A4X2FCjeHEXyIALylgnM9IKOBXU6k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601129072; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BaHezv/sMqxRz/fzXPoucXwWK0LnTvRe2/+UiN8D4p4=; b=d+rQdNdBulYWe5lfgS72FpLGcMGp9lzyLtR4Ht4rMeRA9YFl6/bBVMagG4EfDEyn7VxqTBmv18m78NX/ndQqdyVBTLwKEjahff++fJ/VXZ+nmGusIZ4UlLhVpJnu1p/IQqKcT+4TRwhTQ/XLebWc0+nt5onAng/RHKZqWfRg7yI= ARC-Authentication-Results: i=1; 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 1601129072251965.0166909777263; Sat, 26 Sep 2020 07:04:32 -0700 (PDT) Received: from localhost ([::1]:50930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMAoQ-00083N-Pr for importer@patchew.org; Sat, 26 Sep 2020 10:04:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMAmf-00060J-PA; Sat, 26 Sep 2020 10:02:41 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:41390 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMAmc-0005FP-LZ; Sat, 26 Sep 2020 10:02:41 -0400 Received: from host86-184-131-21.range86-184.btcentralplus.com ([86.184.131.21] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMAnA-0001Y4-Io; Sat, 26 Sep 2020 15:03:17 +0100 From: Mark Cave-Ayland To: armbru@redhat.com, david@gibson.dropbear.id.au, atar4qemu@gmail.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Sat, 26 Sep 2020 15:02:12 +0100 Message-Id: <20200926140216.7368-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200926140216.7368-1-mark.cave-ayland@ilande.co.uk> References: <20200926140216.7368-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.184.131.21 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 2/6] sparc32-ledma: use object_initialize_child() for lance child object X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) 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.default.ilande.uk0.bigv.io X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" Store the child object directly within the sparc32-ledma object rather than using link properties. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/dma/sparc32_dma.c | 14 ++++++++------ include/hw/sparc/sparc32_dma.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c index b25a212f7a..84196afb95 100644 --- a/hw/dma/sparc32_dma.c +++ b/hw/dma/sparc32_dma.c @@ -331,24 +331,26 @@ static const TypeInfo sparc32_espdma_device_info =3D { static void sparc32_ledma_device_init(Object *obj) { DMADeviceState *s =3D SPARC32_DMA_DEVICE(obj); + LEDMADeviceState *ls =3D SPARC32_LEDMA_DEVICE(obj); =20 memory_region_init_io(&s->iomem, OBJECT(s), &dma_mem_ops, s, "ledma-mmio", DMA_SIZE); + + object_initialize_child(obj, "lance", &ls->lance, TYPE_LANCE); } =20 static void sparc32_ledma_device_realize(DeviceState *dev, Error **errp) { - DeviceState *d; + LEDMADeviceState *s =3D SPARC32_LEDMA_DEVICE(dev); + SysBusPCNetState *lance =3D SYSBUS_PCNET(&s->lance); NICInfo *nd =3D &nd_table[0]; =20 /* FIXME use qdev NIC properties instead of nd_table[] */ qemu_check_nic_model(nd, TYPE_LANCE); =20 - d =3D qdev_new(TYPE_LANCE); - object_property_add_child(OBJECT(dev), "lance", OBJECT(d)); - qdev_set_nic_properties(d, nd); - object_property_set_link(OBJECT(d), "dma", OBJECT(dev), &error_abort); - sysbus_realize_and_unref(SYS_BUS_DEVICE(d), &error_fatal); + qdev_set_nic_properties(DEVICE(lance), nd); + object_property_set_link(OBJECT(lance), "dma", OBJECT(dev), &error_abo= rt); + sysbus_realize(SYS_BUS_DEVICE(lance), &error_fatal); } =20 static void sparc32_ledma_device_class_init(ObjectClass *klass, void *data) diff --git a/include/hw/sparc/sparc32_dma.h b/include/hw/sparc/sparc32_dma.h index 3348a725f0..80d69cbba2 100644 --- a/include/hw/sparc/sparc32_dma.h +++ b/include/hw/sparc/sparc32_dma.h @@ -37,7 +37,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(LEDMADeviceState, SPARC32_LEDM= A_DEVICE) struct LEDMADeviceState { DMADeviceState parent_obj; =20 - SysBusPCNetState *lance; + SysBusPCNetState lance; }; =20 #define TYPE_SPARC32_DMA "sparc32-dma" --=20 2.20.1 From nobody Sun Nov 16 12:32:37 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1601129263; cv=none; d=zohomail.com; s=zohoarc; b=c7FQDVCGfr08MlFEnTDD4MInscOJRB5uVL3MjtsgOKBBIyef/qcluKUHlgzsDITKxvghokx+Gozfqe5GuAbQSEEWu4Baz8OQ/iQ0WXOEd+z1/3c5QHM9E2ZV4qhrBXUeqxM/mXKJuY9y9OuzIAP1Y/9bvax15CMGBcHzC3+qSm0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601129263; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=m7vvNmbrST263v1S7xq8MT7IJs4cBzgPEEz4xMukrjo=; b=cJAxNvt0ckPYrrkiY8U058AdUMPLhVyptholv1gyupIy2uLfbn7VQt1wMlk4I7y/71w5h5JAoZpgZ4dVZb1KTgqDYhFtUsGwIG6ODrVhYOXx016uUp9NYRCWd9cfKtnptjZRUZY+BtN0IiXiN7HWnVUjgGIhk6QoUqwRmszbi08= ARC-Authentication-Results: i=1; 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 1601129263657850.3910294991234; Sat, 26 Sep 2020 07:07:43 -0700 (PDT) Received: from localhost ([::1]:58760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMArW-0002z2-1f for importer@patchew.org; Sat, 26 Sep 2020 10:07:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMAmi-00065y-D8; Sat, 26 Sep 2020 10:02:44 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:41408 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMAmg-0005Fj-IM; Sat, 26 Sep 2020 10:02:44 -0400 Received: from host86-184-131-21.range86-184.btcentralplus.com ([86.184.131.21] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMAnF-0001Y4-Sm; Sat, 26 Sep 2020 15:03:22 +0100 From: Mark Cave-Ayland To: armbru@redhat.com, david@gibson.dropbear.id.au, atar4qemu@gmail.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Sat, 26 Sep 2020 15:02:13 +0100 Message-Id: <20200926140216.7368-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200926140216.7368-1-mark.cave-ayland@ilande.co.uk> References: <20200926140216.7368-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.184.131.21 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 3/6] sparc32-espdma: use object_initialize_child() for esp child object X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) 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.default.ilande.uk0.bigv.io X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" Store the child object directly within the sparc32-espdma object rather than using link properties. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/dma/sparc32_dma.c | 17 ++++++++--------- include/hw/sparc/sparc32_dma.h | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c index 84196afb95..2cbe331959 100644 --- a/hw/dma/sparc32_dma.c +++ b/hw/dma/sparc32_dma.c @@ -290,27 +290,26 @@ static const TypeInfo sparc32_dma_device_info =3D { static void sparc32_espdma_device_init(Object *obj) { DMADeviceState *s =3D SPARC32_DMA_DEVICE(obj); + ESPDMADeviceState *es =3D SPARC32_ESPDMA_DEVICE(obj); =20 memory_region_init_io(&s->iomem, OBJECT(s), &dma_mem_ops, s, "espdma-mmio", DMA_SIZE); + + object_initialize_child(obj, "esp", &es->esp, TYPE_ESP); } =20 static void sparc32_espdma_device_realize(DeviceState *dev, Error **errp) { - DeviceState *d; - SysBusESPState *sysbus; - ESPState *esp; - - d =3D qdev_new(TYPE_ESP); - object_property_add_child(OBJECT(dev), "esp", OBJECT(d)); - sysbus =3D ESP(d); - esp =3D &sysbus->esp; + ESPDMADeviceState *es =3D SPARC32_ESPDMA_DEVICE(dev); + SysBusESPState *sysbus =3D ESP(&es->esp); + ESPState *esp =3D &sysbus->esp; + esp->dma_memory_read =3D espdma_memory_read; esp->dma_memory_write =3D espdma_memory_write; esp->dma_opaque =3D SPARC32_DMA_DEVICE(dev); sysbus->it_shift =3D 2; esp->dma_enabled =3D 1; - sysbus_realize_and_unref(SYS_BUS_DEVICE(d), &error_fatal); + sysbus_realize(SYS_BUS_DEVICE(sysbus), &error_fatal); } =20 static void sparc32_espdma_device_class_init(ObjectClass *klass, void *dat= a) diff --git a/include/hw/sparc/sparc32_dma.h b/include/hw/sparc/sparc32_dma.h index 80d69cbba2..cde8ec02cb 100644 --- a/include/hw/sparc/sparc32_dma.h +++ b/include/hw/sparc/sparc32_dma.h @@ -28,7 +28,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(ESPDMADeviceState, SPARC32_ESP= DMA_DEVICE) struct ESPDMADeviceState { DMADeviceState parent_obj; =20 - SysBusESPState *esp; + SysBusESPState esp; }; =20 #define TYPE_SPARC32_LEDMA_DEVICE "sparc32-ledma" --=20 2.20.1 From nobody Sun Nov 16 12:32:37 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1601129269; cv=none; d=zohomail.com; s=zohoarc; b=a99bz291onrGVvLK8CvnG22fRYb7wRfkhDD22Ovmy7gMkTDJQKX3Br6WWvJv40+ug/GzWejIJ3+cEaFtJlAtT4/pGVj+HP+mNNG7mXQY8B4+H9AugqG+jydkBDM+mSylQZ+adCgftpVl9zmrQFf2DvAnlgZy7VjYN6Q2z5Sqank= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601129269; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ldPCtBumNA3PCKzY3JocwhNTeeONClbISz8dIuhej7E=; b=VQHHpBh1e/hnR73KOV1nuUIewBF26h6DHTSKMh0iLSi63NAqLx/5mb+p/f1VNte9j1NWd9MgG8D0VJI9iKbOArO43+j9x5wkdztBTFROjJ/tz3b9Xs7umjcEYuPdfThoj6tw9JeuP0DjRtkUq12DXRllATk05mP9kOx5vgtUD8c= ARC-Authentication-Results: i=1; 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 1601129269074779.552946779279; Sat, 26 Sep 2020 07:07:49 -0700 (PDT) Received: from localhost ([::1]:59382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMArb-0003EH-Mi for importer@patchew.org; Sat, 26 Sep 2020 10:07:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMAmn-0006KI-RQ; Sat, 26 Sep 2020 10:02:49 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:41420 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMAml-0005GW-Sz; Sat, 26 Sep 2020 10:02:49 -0400 Received: from host86-184-131-21.range86-184.btcentralplus.com ([86.184.131.21] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMAnK-0001Y4-TS; Sat, 26 Sep 2020 15:03:27 +0100 From: Mark Cave-Ayland To: armbru@redhat.com, david@gibson.dropbear.id.au, atar4qemu@gmail.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Sat, 26 Sep 2020 15:02:14 +0100 Message-Id: <20200926140216.7368-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200926140216.7368-1-mark.cave-ayland@ilande.co.uk> References: <20200926140216.7368-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.184.131.21 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 4/6] sparc32-ledma: don't reference nd_table directly within the device X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) 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.default.ilande.uk0.bigv.io X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" Content-Type: text/plain; charset="utf-8" Instead use qdev_set_nic_properties() to configure the on-board NIC at the sun4m machine level. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/dma/sparc32_dma.c | 5 ----- hw/sparc/sun4m.c | 21 +++++++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c index 2cbe331959..b643b413c5 100644 --- a/hw/dma/sparc32_dma.c +++ b/hw/dma/sparc32_dma.c @@ -342,12 +342,7 @@ static void sparc32_ledma_device_realize(DeviceState *= dev, Error **errp) { LEDMADeviceState *s =3D SPARC32_LEDMA_DEVICE(dev); SysBusPCNetState *lance =3D SYSBUS_PCNET(&s->lance); - NICInfo *nd =3D &nd_table[0]; =20 - /* FIXME use qdev NIC properties instead of nd_table[] */ - qemu_check_nic_model(nd, TYPE_LANCE); - - qdev_set_nic_properties(DEVICE(lance), nd); object_property_set_link(OBJECT(lance), "dma", OBJECT(dev), &error_abo= rt); sysbus_realize(SYS_BUS_DEVICE(lance), &error_fatal); } diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 54a2b2f9ef..6765982fe9 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -319,7 +319,7 @@ static void *iommu_init(hwaddr addr, uint32_t version, = qemu_irq irq) =20 static void *sparc32_dma_init(hwaddr dma_base, hwaddr esp_base, qemu_irq espdma_irq, - hwaddr le_base, qemu_irq ledma_irq) + hwaddr le_base, qemu_irq ledma_irq, NICInfo = *nd) { DeviceState *dma; ESPDMADeviceState *espdma; @@ -328,16 +328,11 @@ static void *sparc32_dma_init(hwaddr dma_base, SysBusPCNetState *lance; =20 dma =3D qdev_new(TYPE_SPARC32_DMA); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dma), &error_fatal); - sysbus_mmio_map(SYS_BUS_DEVICE(dma), 0, dma_base); - espdma =3D SPARC32_ESPDMA_DEVICE(object_resolve_path_component( OBJECT(dma), "espdma")); sysbus_connect_irq(SYS_BUS_DEVICE(espdma), 0, espdma_irq); =20 esp =3D ESP(object_resolve_path_component(OBJECT(espdma), "esp")); - sysbus_mmio_map(SYS_BUS_DEVICE(esp), 0, esp_base); - scsi_bus_legacy_handle_cmdline(&esp->esp.bus); =20 ledma =3D SPARC32_LEDMA_DEVICE(object_resolve_path_component( OBJECT(dma), "ledma")); @@ -345,6 +340,14 @@ static void *sparc32_dma_init(hwaddr dma_base, =20 lance =3D SYSBUS_PCNET(object_resolve_path_component( OBJECT(ledma), "lance")); + qdev_set_nic_properties(DEVICE(lance), nd); + + sysbus_realize_and_unref(SYS_BUS_DEVICE(dma), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dma), 0, dma_base); + + sysbus_mmio_map(SYS_BUS_DEVICE(esp), 0, esp_base); + scsi_bus_legacy_handle_cmdline(&esp->esp.bus); + sysbus_mmio_map(SYS_BUS_DEVICE(lance), 0, le_base); =20 return dma; @@ -850,6 +853,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwd= ef, unsigned int max_cpus =3D machine->smp.max_cpus; Object *ram_memdev =3D object_resolve_path_type(machine->ram_memdev_id, TYPE_MEMORY_BACKEND, NUL= L); + NICInfo *nd =3D &nd_table[0]; =20 if (machine->ram_size > hwdef->max_mem) { error_report("Too much memory for this machine: %" PRId64 "," @@ -910,9 +914,10 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hw= def, hwdef->iommu_pad_base, hwdef->iommu_pad_len); } =20 + qemu_check_nic_model(nd, TYPE_LANCE); sparc32_dma_init(hwdef->dma_base, hwdef->esp_base, slavio_irq[18], - hwdef->le_base, slavio_irq[16]); + hwdef->le_base, slavio_irq[16], nd); =20 if (graphic_depth !=3D 8 && graphic_depth !=3D 24) { error_report("Unsupported depth: %d", graphic_depth); @@ -1043,7 +1048,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *h= wdef, machine->initrd_filename, machine->ram_size, &initrd_size); =20 - nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr, machine->kernel_cmd= line, + nvram_init(nvram, (uint8_t *)&nd->macaddr, machine->kernel_cmdline, machine->boot_order, machine->ram_size, kernel_size, graphic_width, graphic_height, graphic_depth, hwdef->nvram_machine_id, "Sun4m"); --=20 2.20.1 From nobody Sun Nov 16 12:32:37 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1601129182; cv=none; d=zohomail.com; s=zohoarc; b=kNNNEf1Znl1iCddM5HVWePXU6mJs7KrxgBEtwNDM5AqOxoM0bA/Ov6jSqPqEtOh+gIXr4egjLY/22MrH+Yh+BEmp/YlLWKcJkeXbCMJBhhMtIKdsn1sQAm5uAM+m6VBoDqUcd52o+j7lyo/HFjrzOcmWaXJSa39pK8/di6NBD9w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601129182; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MQYwkHv9IFxd+Ei/QalX4jxZQn3Ll+lqjmAFKcpHTYM=; b=jvWTyT+NZgxrhBnb54REB1uaAo489H1rh+/sgfAnwk2PYFaHGYvvDyrOncJCHlTWfTRDuclF4t6YiktUAGV+NSetZyvotVo+ck2FwLHXGlVEYQMMaolfOXzAD6fxdI5geLubbSWYhx3HYyKniiNomjonJrWZvN1ibxLiDDuDAaQ= ARC-Authentication-Results: i=1; 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 1601129182996978.4244385487609; Sat, 26 Sep 2020 07:06:22 -0700 (PDT) Received: from localhost ([::1]:53808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMAqD-0000pr-Lj for importer@patchew.org; Sat, 26 Sep 2020 10:06:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMAms-0006Um-Ss; Sat, 26 Sep 2020 10:02:54 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:41430 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMAmq-0005Gs-Rb; Sat, 26 Sep 2020 10:02:54 -0400 Received: from host86-184-131-21.range86-184.btcentralplus.com ([86.184.131.21] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMAnP-0001Y4-Sl; Sat, 26 Sep 2020 15:03:32 +0100 From: Mark Cave-Ayland To: armbru@redhat.com, david@gibson.dropbear.id.au, atar4qemu@gmail.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Sat, 26 Sep 2020 15:02:15 +0100 Message-Id: <20200926140216.7368-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200926140216.7368-1-mark.cave-ayland@ilande.co.uk> References: <20200926140216.7368-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.184.131.21 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 5/6] macio: don't reference serial_hd() directly within the device X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) 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.default.ilande.uk0.bigv.io X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" Content-Type: text/plain; charset="utf-8" Instead use qdev_prop_set_chr() to configure the ESCC serial chardevs at the Mac Old World and New World machine level. Also remove the now obsolete comment referring to the use of serial_hd() and the setting of user_creatable to false accordingly. Signed-off-by: Mark Cave-Ayland --- hw/misc/macio/macio.c | 4 ---- hw/ppc/mac_newworld.c | 6 ++++++ hw/ppc/mac_oldworld.c | 6 ++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index 679722628e..51368884d0 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -109,8 +109,6 @@ static void macio_common_realize(PCIDevice *d, Error **= errp) qdev_prop_set_uint32(DEVICE(&s->escc), "disabled", 0); qdev_prop_set_uint32(DEVICE(&s->escc), "frequency", ESCC_CLOCK); qdev_prop_set_uint32(DEVICE(&s->escc), "it_shift", 4); - qdev_prop_set_chr(DEVICE(&s->escc), "chrA", serial_hd(0)); - qdev_prop_set_chr(DEVICE(&s->escc), "chrB", serial_hd(1)); qdev_prop_set_uint32(DEVICE(&s->escc), "chnBtype", escc_serial); qdev_prop_set_uint32(DEVICE(&s->escc), "chnAtype", escc_serial); if (!qdev_realize(DEVICE(&s->escc), BUS(&s->macio_bus), errp)) { @@ -458,8 +456,6 @@ static void macio_class_init(ObjectClass *klass, void *= data) k->class_id =3D PCI_CLASS_OTHERS << 8; device_class_set_props(dc, macio_properties); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); - /* Reason: Uses serial_hds in macio_instance_init */ - dc->user_creatable =3D false; } =20 static const TypeInfo macio_bus_info =3D { diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index e42bd7a626..e59b30e0a7 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -123,6 +123,7 @@ static void ppc_core99_init(MachineState *machine) UNINHostState *uninorth_pci; PCIBus *pci_bus; PCIDevice *macio; + ESCCState *escc; bool has_pmu, has_adb; MACIOIDEState *macio_ide; BusState *adb_bus; @@ -382,6 +383,11 @@ static void ppc_core99_init(MachineState *machine) qdev_prop_set_bit(dev, "has-adb", has_adb); object_property_set_link(OBJECT(macio), "pic", OBJECT(pic_dev), &error_abort); + + escc =3D ESCC(object_resolve_path_component(OBJECT(macio), "escc")); + qdev_prop_set_chr(DEVICE(escc), "chrA", serial_hd(0)); + qdev_prop_set_chr(DEVICE(escc), "chrB", serial_hd(1)); + pci_realize_and_unref(macio, pci_bus, &error_fatal); =20 /* We only emulate 2 out of 3 IDE controllers for now */ diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 7aba040f1b..25ade63ba3 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -96,6 +96,7 @@ static void ppc_heathrow_init(MachineState *machine) PCIBus *pci_bus; PCIDevice *macio; MACIOIDEState *macio_ide; + ESCCState *escc; SysBusDevice *s; DeviceState *dev, *pic_dev; BusState *adb_bus; @@ -283,6 +284,11 @@ static void ppc_heathrow_init(MachineState *machine) qdev_prop_set_uint64(dev, "frequency", tbfreq); object_property_set_link(OBJECT(macio), "pic", OBJECT(pic_dev), &error_abort); + + escc =3D ESCC(object_resolve_path_component(OBJECT(macio), "escc")); + qdev_prop_set_chr(DEVICE(escc), "chrA", serial_hd(0)); + qdev_prop_set_chr(DEVICE(escc), "chrB", serial_hd(1)); + pci_realize_and_unref(macio, pci_bus, &error_fatal); =20 macio_ide =3D MACIO_IDE(object_resolve_path_component(OBJECT(macio), --=20 2.20.1 From nobody Sun Nov 16 12:32:37 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1601129313; cv=none; d=zohomail.com; s=zohoarc; b=X4BTsXv570I3P5rsY4RH6OIf10NWmhsaSuGnbjvWpFIjIYFGigHx1AskAhZaJ+4N2LxwRCFr1/iaN1sMFP5T3GOqEE4JhUHPYZbkUknqZywCJz3OiitlKXkRy3wWUxqpr3cMx+vI2w0EdvUX+IoQFlnbqMn22d6p4xHeBFCRvsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601129313; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OL5Vj8Q43+2BjKGHf1KzhhTfFHN7vl7svn0aTI5HCSM=; b=mIL1Q9xXZgSMtim4fn1JDuuTg27pLuKqAJRFNxErv0CbJL1GCKB4Rks6DixejlX5qdc2CTloDTZkl0n0AC192cik38EBukNuVYeSW+syZyrXG9MYNK+Jv8/xm+sVLyiXeMfHNi+Xp8HVzgkkg98vvTU3yNb2ECTSXyHrcyjRB7M= ARC-Authentication-Results: i=1; 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 1601129313144762.195346266688; Sat, 26 Sep 2020 07:08:33 -0700 (PDT) Received: from localhost ([::1]:33824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMAsJ-0004IH-R1 for importer@patchew.org; Sat, 26 Sep 2020 10:08:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMAn3-0006b4-82; Sat, 26 Sep 2020 10:03:07 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:41438 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMAmz-0005HP-JC; Sat, 26 Sep 2020 10:03:04 -0400 Received: from host86-184-131-21.range86-184.btcentralplus.com ([86.184.131.21] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMAnV-0001Y4-63; Sat, 26 Sep 2020 15:03:39 +0100 From: Mark Cave-Ayland To: armbru@redhat.com, david@gibson.dropbear.id.au, atar4qemu@gmail.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Sat, 26 Sep 2020 15:02:16 +0100 Message-Id: <20200926140216.7368-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200926140216.7368-1-mark.cave-ayland@ilande.co.uk> References: <20200926140216.7368-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.184.131.21 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 6/6] sabre: don't call sysbus_mmio_map() in sabre_realize() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) 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.default.ilande.uk0.bigv.io X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" The device should not map itself but instead should be mapped to sysbus by = the sun4u machine. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/pci-host/sabre.c | 8 -------- hw/sparc64/sun4u.c | 7 +++++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/pci-host/sabre.c b/hw/pci-host/sabre.c index 5ac6283623..5394ad5cd0 100644 --- a/hw/pci-host/sabre.c +++ b/hw/pci-host/sabre.c @@ -378,16 +378,8 @@ static void sabre_realize(DeviceState *dev, Error **er= rp) { SabreState *s =3D SABRE(dev); PCIHostState *phb =3D PCI_HOST_BRIDGE(dev); - SysBusDevice *sbd =3D SYS_BUS_DEVICE(s); PCIDevice *pci_dev; =20 - /* sabre_config */ - sysbus_mmio_map(sbd, 0, s->special_base); - /* PCI configuration space */ - sysbus_mmio_map(sbd, 1, s->special_base + 0x1000000ULL); - /* pci_ioport */ - sysbus_mmio_map(sbd, 2, s->special_base + 0x2000000ULL); - memory_region_init(&s->pci_mmio, OBJECT(s), "pci-mmio", 0x100000000ULL= ); memory_region_add_subregion(get_system_memory(), s->mem_base, &s->pci_mmio); diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index ad5ca2472a..ebb3b89250 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -588,6 +588,13 @@ static void sun4uv_init(MemoryRegion *address_space_me= m, &error_abort); sysbus_realize_and_unref(SYS_BUS_DEVICE(sabre), &error_fatal); =20 + /* sabre_config */ + sysbus_mmio_map(SYS_BUS_DEVICE(sabre), 0, PBM_SPECIAL_BASE); + /* PCI configuration space */ + sysbus_mmio_map(SYS_BUS_DEVICE(sabre), 1, PBM_SPECIAL_BASE + 0x1000000= ULL); + /* pci_ioport */ + sysbus_mmio_map(SYS_BUS_DEVICE(sabre), 2, PBM_SPECIAL_BASE + 0x2000000= ULL); + /* Wire up PCI interrupts to CPU */ for (i =3D 0; i < IVEC_MAX; i++) { qdev_connect_gpio_out_named(DEVICE(sabre), "ivec-irq", i, --=20 2.20.1