From nobody Sun Nov 16 12:32:36 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=1600590139; cv=none; d=zohomail.com; s=zohoarc; b=K0tBRFD4KA2CA+zdG395uy/3ke2JMpLRRyIGFGFs1oqNnKB8R+FfiF1XsafBWtUWD8y+sgoK97HYBy4f8BkRokpwEyA/pIJ2kF7WypfJ9B7nu5tmieQgbVvTvoooqAJvl5Lmfc4J3UIIDwefpAwEwjfsDZImSIaO/QHHluwuUjo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600590139; 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=i4QL/W3F4xnSm45pBuVF5PTsH8kt2RL+Tf+3UZ4HTS0=; b=kbuV1VIlgRcr/83Kdx7SzQtewg0O1IxpTfpA1IVWSbTVlM27GOQDC34Pv5uWpijtzg7tOn+mgOeN5GWA+vRcMv0he30xOGTQi6HftsCU1On1lfQpXj+lqB9ulpHncBT6l7qmUmmGhrLt0rf6dWbtk6hn3U8bibNWT2/3e0+MebI= 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 1600590139688826.4193087934331; Sun, 20 Sep 2020 01:22:19 -0700 (PDT) Received: from localhost ([::1]:59124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJubx-000503-9a for importer@patchew.org; Sun, 20 Sep 2020 04:22:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJuaN-0003Nv-52; Sun, 20 Sep 2020 04:20:39 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:56516 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 1kJuaL-0003qP-2k; Sun, 20 Sep 2020 04:20:38 -0400 Received: from host81-154-161-117.range81-154.btcentralplus.com ([81.154.161.117] 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 1kJuap-0006Dn-Lv; Sun, 20 Sep 2020 09:21: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: Sun, 20 Sep 2020 09:20:13 +0100 Message-Id: <20200920082018.16135-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200920082018.16135-1-mark.cave-ayland@ilande.co.uk> References: <20200920082018.16135-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.161.117 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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" Content-Type: text/plain; charset="utf-8" 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 a402665a9c..a7b1dd8418 100644 --- a/include/hw/sparc/sparc32_dma.h +++ b/include/hw/sparc/sparc32_dma.h @@ -56,8 +56,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:36 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=1600590141; cv=none; d=zohomail.com; s=zohoarc; b=V91f+Nzx3vtX5gRxOKVejkCSVbxrCZvMPWFEtlSEE/lzBcOjaeCHa9ZsbJN2/Bw9ZMmbm1wM8sZmfpqwUkSmo+bFkx3/ne7ZQo/D7/K5qIeFBinPIU78X1hvRY7EsZvz+TOZf7NeRiHS/jWiUxssd7YIXkFqVqC4ultKO9/lS50= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600590141; 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=/bUfkg/OVUKSo1OxjB6TiK8aeCRkWaEEZUTjW66c68g=; b=h7LEx4mYbh5aYHEGolSTHSAjbUKhAAJg07EWa/NUwVBtn8GhTHiUvTot5IB9hXT37TJDadfeyU64X/3/ywReYNfH4w6Ww23B1s6C1L4Q42QZhpthMycwOo7nHLelQhapcg6HSsPiJQIePRQAMSqTwk2Kb2nk1bQYBVGGAWhNRUE= 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 1600590141669435.2617091193008; Sun, 20 Sep 2020 01:22:21 -0700 (PDT) Received: from localhost ([::1]:59362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJuc0-00055p-B4 for importer@patchew.org; Sun, 20 Sep 2020 04:22:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJuaR-0003OL-Nv; Sun, 20 Sep 2020 04:20:43 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:56530 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 1kJuaQ-0003uQ-2Q; Sun, 20 Sep 2020 04:20:43 -0400 Received: from host81-154-161-117.range81-154.btcentralplus.com ([81.154.161.117] 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 1kJuau-0006Dn-L5; Sun, 20 Sep 2020 09:21:18 +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: Sun, 20 Sep 2020 09:20:14 +0100 Message-Id: <20200920082018.16135-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200920082018.16135-1-mark.cave-ayland@ilande.co.uk> References: <20200920082018.16135-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.161.117 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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" Content-Type: text/plain; charset="utf-8" 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 a7b1dd8418..f2bfe272ba 100644 --- a/include/hw/sparc/sparc32_dma.h +++ b/include/hw/sparc/sparc32_dma.h @@ -43,7 +43,7 @@ DECLARE_INSTANCE_CHECKER(LEDMADeviceState, SPARC32_LEDMA_= 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:36 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=1600590143; cv=none; d=zohomail.com; s=zohoarc; b=mvGshs72tSOVVf+Es9JckiEock1TeK6APPy3P408T4WOD5FUr/qPPsBkcrnmurb7XOxF1iJm9fGbJ7O+IpodAtSHDK4cPpQ/DGS4CPa4s0u2lfiB9cgXsak2mRqEeNMuyZbDJup96UN/43M0i2ao+1exJTfCHbIF8U4xHtcm/u0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600590143; 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=SRVSdTArYZLaTwB29EfJfOlcM8dC0zmcslGOPR/0gTQ=; b=T7Uv4yIkFYXu55c5PO2Av4ab8YpQDkozWY/UAPbClKYyw4SWbO2QwWHyxOPdim0PXwlpDIVh2xOItiZ3gcCj6JLDctzqWBFWWZ/TW6Lb2MqQJDOSxO+xhmtPfleqWxuSNqTBM0bCnqOxNaxBR1fen0TppmXcVAmithh+1mZU7oo= 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 1600590143261294.92574765475695; Sun, 20 Sep 2020 01:22:23 -0700 (PDT) Received: from localhost ([::1]:59520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJuc1-00059p-M1 for importer@patchew.org; Sun, 20 Sep 2020 04:22:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJuaY-0003UZ-3r; Sun, 20 Sep 2020 04:20:50 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:56542 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 1kJuaW-0003ud-GQ; Sun, 20 Sep 2020 04:20:49 -0400 Received: from host81-154-161-117.range81-154.btcentralplus.com ([81.154.161.117] 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 1kJub0-0006Dn-U6; Sun, 20 Sep 2020 09:21:25 +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: Sun, 20 Sep 2020 09:20:15 +0100 Message-Id: <20200920082018.16135-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200920082018.16135-1-mark.cave-ayland@ilande.co.uk> References: <20200920082018.16135-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.161.117 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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" Content-Type: text/plain; charset="utf-8" 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 f2bfe272ba..d40eca0cc8 100644 --- a/include/hw/sparc/sparc32_dma.h +++ b/include/hw/sparc/sparc32_dma.h @@ -32,7 +32,7 @@ DECLARE_INSTANCE_CHECKER(ESPDMADeviceState, SPARC32_ESPDM= A_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:36 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=1600590242; cv=none; d=zohomail.com; s=zohoarc; b=PTYcvvfS6X6olNcfbJOasafYjjL1s+Z3N+E/+2of9PSBdeDxyUYEimEgbwJkESG2+QcQhO1j4n1rmGTNHV0gZJS5rcvPbYbE2lfFLFjSr0ArqQu/KEODKO6K768LOdgYhqmXHDMZjp5SlMDzqce2//ambBValOa8cAxWHsfDcbw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600590242; 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=Jr2iE/+CnzFaNHqvkalw6SNpzO5Jg6QS5LPpVcdNkWs=; b=PSXJyRwT5mjoiy2d582n/DKRgXgZIptQ2fGC3EPZhELNFS7D13mNW3KJFPYy3bJ5lFbWX4/jSIAWLMddMll6FKKlhTNq1sX6vJHK7aw54xUqO9J4j4U9WnOXslnerY3eqrMW375PAvVehYM6ogIGe2GusMwAWhWh/vV0Fke9GR0= 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 160059024224383.27518238478604; Sun, 20 Sep 2020 01:24:02 -0700 (PDT) Received: from localhost ([::1]:38728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJudc-00089n-Vo for importer@patchew.org; Sun, 20 Sep 2020 04:24:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJuab-0003Xp-Pm; Sun, 20 Sep 2020 04:20:54 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:56554 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 1kJuaa-0003uo-24; Sun, 20 Sep 2020 04:20:53 -0400 Received: from host81-154-161-117.range81-154.btcentralplus.com ([81.154.161.117] 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 1kJub7-0006Dn-8l; Sun, 20 Sep 2020 09:21:28 +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: Sun, 20 Sep 2020 09:20:16 +0100 Message-Id: <20200920082018.16135-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200920082018.16135-1-mark.cave-ayland@ilande.co.uk> References: <20200920082018.16135-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.161.117 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 --- 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 947b69d159..ed5f3ccd9f 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; @@ -854,6 +857,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 "," @@ -914,9 +918,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); @@ -1047,7 +1052,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:36 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=1600590308; cv=none; d=zohomail.com; s=zohoarc; b=NPfLDJUdoFMIpEi6dlJFAdMjgL0XVuQF49wm3w38oFJuKnWkNiHvb9B5CTIaK7aumG+lsc8lXh/mooSWynkw8zFN8ozWLvfiRVv2rmxsa35HcJqFalcgOis96vzQ1z1RJdXwdj9cfnqZkhMmWGwdMICWzV/MaKXPaebiZJzuLEw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600590308; 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=jCVT0fmrwnqIf6g1J2P/zacOEUHy1yundL7pGaRfk/0=; b=KPmqQe3K+cZoeozxJxKyy2tRD/XYX7xhDrQxkCIy5b6KPvL+ofraa5t63VnjZCaCUeOgoE/6+bjGAsS4AJ054agr28Sedwtbp9j2zn/zQNviwvtuACB+5WVhIscw8vWgTkg96H0qXPpJGjrsadOkBHBIN//CgQVXgt3DCttjjjo= 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 1600590308433334.690783443707; Sun, 20 Sep 2020 01:25:08 -0700 (PDT) Received: from localhost ([::1]:42128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJueh-00017e-8L for importer@patchew.org; Sun, 20 Sep 2020 04:25:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJuag-0003ch-2d; Sun, 20 Sep 2020 04:20:58 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:56566 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 1kJuae-0003uy-5x; Sun, 20 Sep 2020 04:20:57 -0400 Received: from host81-154-161-117.range81-154.btcentralplus.com ([81.154.161.117] 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 1kJubA-0006Dn-Kp; Sun, 20 Sep 2020 09:21:33 +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: Sun, 20 Sep 2020 09:20:17 +0100 Message-Id: <20200920082018.16135-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200920082018.16135-1-mark.cave-ayland@ilande.co.uk> References: <20200920082018.16135-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.161.117 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 change user_createable to true accordingly. Signed-off-by: Mark Cave-Ayland --- hw/misc/macio/macio.c | 5 +---- hw/ppc/mac_newworld.c | 6 ++++++ hw/ppc/mac_oldworld.c | 6 ++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index 679722628e..ce641d41fd 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,7 @@ 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; + dc->user_creatable =3D true; } =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:36 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=1600590251; cv=none; d=zohomail.com; s=zohoarc; b=QybalAVQXrPwmUm+CZGBLNU6eoCjgmUmOTR/o40/MfB3Z/9yfljZ2nkPALWTZtl+S1Ka3nMUmKW4iyHKEybVsraBwMA9ciqBEWpkQU5tkh0DlJm2WjsyzA2ZH6SBrfgR8uudrBlCre2DNTt6CZNEi3TkDmuH+QNEq5jkznbwKsU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600590251; 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=60xzXNToWxeQqXt8so2RDot7te7y/E6G5avKmzCMIWc=; b=BLBKUjdpmh2qcG9zPtQ19gfQn1z9hiIjdYCOZ9Epn175GCBLyyI7MOl7yro5LKNBKF5jXNd3zEBSVb8zxx4xfZZYExFMfShI+G1g+a8p0wBRZNEddaxVmLy+wgVvX9q8Nz/DdD57yVaCkbkLrWpUdKcek3NxvNYfUi7N//kxieg= 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 1600590251098306.26343445949067; Sun, 20 Sep 2020 01:24:11 -0700 (PDT) Received: from localhost ([::1]:38946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJudl-0008F7-D6 for importer@patchew.org; Sun, 20 Sep 2020 04:24:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJual-0003pj-16; Sun, 20 Sep 2020 04:21:03 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:56576 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 1kJuaj-0003vI-Ah; Sun, 20 Sep 2020 04:21:02 -0400 Received: from host81-154-161-117.range81-154.btcentralplus.com ([81.154.161.117] 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 1kJubF-0006Dn-IG; Sun, 20 Sep 2020 09:21:38 +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: Sun, 20 Sep 2020 09:20:18 +0100 Message-Id: <20200920082018.16135-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200920082018.16135-1-mark.cave-ayland@ilande.co.uk> References: <20200920082018.16135-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.161.117 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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" Content-Type: text/plain; charset="utf-8" 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 b4aabfc076..f80ddde5dc 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -592,6 +592,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