From nobody Tue Nov 26 17:41:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1706290411; cv=none; d=zohomail.com; s=zohoarc; b=adfud7El9NP2qxxOW8vHKOST2jQgy8vNia5d/CRU7yshoJ4jsBHUQkdiQ/d1k3xcEO3CyG43gJyzGZvJF6bLcJkh9/NC04zNDKjrVq6NbI/24WZ8g+BRerUON87HlyA0yg1IN5LeedcaOWiyzYUvRZP5yT0tmc3N7yKXfmYpmbI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706290411; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=968FfiIx6xTKDJXJoXrAu14UZ4c3HMbAlGKHEl9nV4w=; b=RnlzDvJSbxdAA9DETyXPgJTIe66wpbQUVSmII39t8WtMQaVvfN9ZGr2SiAQOOSt/AJK6ogtGmfBI6JHMHxQE5FIUqXzPdhMf+HdVrGoShFaKIOa4es1n+oHt/u6aLOYNbQtBZeoLcaMS10og/6ye4fFsGfdl43VsMWG9MBpPbOY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1706290411487927.3049974303165; Fri, 26 Jan 2024 09:33:31 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.672263.1046130 (Exim 4.92) (envelope-from ) id 1rTQ4p-0006rF-E4; Fri, 26 Jan 2024 17:33:15 +0000 Received: by outflank-mailman (output) from mailman id 672263.1046130; Fri, 26 Jan 2024 17:33:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rTQ4o-0006p6-Uv; Fri, 26 Jan 2024 17:33:14 +0000 Received: by outflank-mailman (input) for mailman id 672263; Fri, 26 Jan 2024 17:33:13 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rTQ4n-0004Zo-OZ for xen-devel@lists.xenproject.org; Fri, 26 Jan 2024 17:33:13 +0000 Received: from casper.infradead.org (casper.infradead.org [2001:8b0:10b:1236::1]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fad9be61-bc70-11ee-8a43-1f161083a0e0; Fri, 26 Jan 2024 18:33:12 +0100 (CET) Received: from [2001:8b0:10b:1::ebe] (helo=i7.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTQ48-0000000EKUN-0LUU; Fri, 26 Jan 2024 17:32:33 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTQ48-00000001emE-3Z4R; Fri, 26 Jan 2024 17:32:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list X-Inumbo-ID: fad9be61-bc70-11ee-8a43-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=968FfiIx6xTKDJXJoXrAu14UZ4c3HMbAlGKHEl9nV4w=; b=bNQnqA3ia7NcIR0I5BM/faxrjJ RQqKOP7UTwn5CM9MqTVYRdLSglntBNT1+Z68wtYVQ7M8VFbMOFa1J93IPv9G68D/pDzlNGz94M7PL SzvEchfk5/xjMAVTF7DHS0PLexbY4t+WWLG9PZtrybRwqGKrSoBh/Lul/vXiRihNOHQHlNlohKXQ9 T/fhztZnc7WkSOt5GX74uYVaN8OuIcY0Sb27IROMoMObE+SpKfgEGnquCB/z5KPmf4hH0nQXFrd4X tr/O6dIBs7YD3ciKL3bKUq1lFsPuHBoSByMvikAkKk1UhcbGGUyw34CnpG+P6SAUG2ByunA3YlEu7 1F1CeXwQ==; From: David Woodhouse To: qemu-devel@nongnu.org Cc: Richard Henderson , Beniamino Galvani , Peter Maydell , Strahinja Jankovic , Niek Linnenbank , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Andrew Jeffery , Joel Stanley , Igor Mitsyanko , Jean-Christophe Dubois , Andrey Smirnov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rob Herring , Subbaraya Sundeep , Jan Kiszka , Tyrone Ting , Hao Wu , Radoslaw Biernacki , Leif Lindholm , Marcin Juszkiewicz , "Edgar E. Iglesias" , Alistair Francis , Helge Deller , Paolo Bonzini , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , Song Gao , Thomas Huth , Laurent Vivier , Huacai Chen , Jiaxun Yang , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aleksandar Rikalo , Aurelien Jarno , Jason Wang , Jia Liu , Stafford Horne , Mark Cave-Ayland , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Bin Meng , Palmer Dabbelt , Weiwei Li , Liu Zhiwei , Halil Pasic , Christian Borntraeger , Eric Farman , David Hildenbrand , Ilya Leoshkevich , Yoshinori Sato , Magnus Damm , Artyom Tarasenko , Stefano Stabellini , Anthony Perard , Paul Durrant , Max Filippov , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, xen-devel@lists.xenproject.org, David Woodhouse , Thomas Huth Subject: [PATCH v4 21/47] hw/arm/allwinner: use qemu_configure_nic_device() Date: Fri, 26 Jan 2024 17:24:58 +0000 Message-ID: <20240126173228.394202-22-dwmw2@infradead.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126173228.394202-1-dwmw2@infradead.org> References: <20240126173228.394202-1-dwmw2@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-ZohoMail-DKIM: pass (identity @infradead.org) X-ZM-MESSAGEID: 1706290412299100001 Content-Type: text/plain; charset="utf-8" From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/arm/allwinner-a10.c | 6 +----- hw/arm/allwinner-h3.c | 6 +----- hw/arm/allwinner-r40.c | 27 ++------------------------- 3 files changed, 4 insertions(+), 35 deletions(-) diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c index b0ea3f7f66..57f52871ec 100644 --- a/hw/arm/allwinner-a10.c +++ b/hw/arm/allwinner-a10.c @@ -142,11 +142,7 @@ static void aw_a10_realize(DeviceState *dev, Error **e= rrp) sysbus_realize(SYS_BUS_DEVICE(&s->dramc), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 0, AW_A10_DRAMC_BASE); =20 - /* FIXME use qdev NIC properties instead of nd_table[] */ - if (nd_table[0].used) { - qemu_check_nic_model(&nd_table[0], TYPE_AW_EMAC); - qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]); - } + qemu_configure_nic_device(DEVICE(&s->emac), true, NULL); if (!sysbus_realize(SYS_BUS_DEVICE(&s->emac), errp)) { return; } diff --git a/hw/arm/allwinner-h3.c b/hw/arm/allwinner-h3.c index f05afddf7e..4f102ad082 100644 --- a/hw/arm/allwinner-h3.c +++ b/hw/arm/allwinner-h3.c @@ -369,11 +369,7 @@ static void allwinner_h3_realize(DeviceState *dev, Err= or **errp) "sd-bus"); =20 /* EMAC */ - /* FIXME use qdev NIC properties instead of nd_table[] */ - if (nd_table[0].used) { - qemu_check_nic_model(&nd_table[0], TYPE_AW_SUN8I_EMAC); - qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]); - } + qemu_configure_nic_device(DEVICE(&s->emac), true, NULL); object_property_set_link(OBJECT(&s->emac), "dma-memory", OBJECT(get_system_memory()), &error_fatal); sysbus_realize(SYS_BUS_DEVICE(&s->emac), &error_fatal); diff --git a/hw/arm/allwinner-r40.c b/hw/arm/allwinner-r40.c index a0d367c60d..4d5661b014 100644 --- a/hw/arm/allwinner-r40.c +++ b/hw/arm/allwinner-r40.c @@ -294,7 +294,6 @@ static void allwinner_r40_init(Object *obj) =20 static void allwinner_r40_realize(DeviceState *dev, Error **errp) { - const char *r40_nic_models[] =3D { "gmac", "emac", NULL }; AwR40State *s =3D AW_R40(dev); =20 /* CPUs */ @@ -454,31 +453,8 @@ static void allwinner_r40_realize(DeviceState *dev, Er= ror **errp) sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 2, s->memmap[AW_R40_DEV_DRAMPHY]); =20 - /* nic support gmac and emac */ - for (int i =3D 0; i < ARRAY_SIZE(r40_nic_models) - 1; i++) { - NICInfo *nic =3D &nd_table[i]; - - if (!nic->used) { - continue; - } - if (qemu_show_nic_models(nic->model, r40_nic_models)) { - exit(0); - } - - switch (qemu_find_nic_model(nic, r40_nic_models, r40_nic_models[0]= )) { - case 0: /* gmac */ - qdev_set_nic_properties(DEVICE(&s->gmac), nic); - break; - case 1: /* emac */ - qdev_set_nic_properties(DEVICE(&s->emac), nic); - break; - default: - exit(1); - break; - } - } - /* GMAC */ + qemu_configure_nic_device(DEVICE(&s->gmac), true, "gmac"); object_property_set_link(OBJECT(&s->gmac), "dma-memory", OBJECT(get_system_memory()), &error_f= atal); sysbus_realize(SYS_BUS_DEVICE(&s->gmac), &error_fatal); @@ -487,6 +463,7 @@ static void allwinner_r40_realize(DeviceState *dev, Err= or **errp) qdev_get_gpio_in(DEVICE(&s->gic), AW_R40_GIC_SPI_GM= AC)); =20 /* EMAC */ + qemu_configure_nic_device(DEVICE(&s->emac), true, "emac"); sysbus_realize(SYS_BUS_DEVICE(&s->emac), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(&s->emac), 0, s->memmap[AW_R40_DEV_EMAC= ]); sysbus_connect_irq(SYS_BUS_DEVICE(&s->emac), 0, --=20 2.43.0