From nobody Tue Nov 26 22:18:37 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=1704747105; cv=none; d=zohomail.com; s=zohoarc; b=m+LtdjtzYND+d10ELdRCqb4mAgE0Pik5VLleX4teuKKN2OnkVyWJ9PdDuANIE/ew0nLLsvER3PfbxpqLs2utZnUk/G8O4Zi/W2PO8ALHN+o75kJJy9UkPmzQvDKv8tIskx4B54KbiZMx63eusvMLYhXptia9ufr+wR75vF4yy68= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704747105; 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=hIoRnAOMf4YLSnQadmaBzYXHMtK98X95ymuChZmuyOk=; b=grCCjmka18NpKQ0qACaOtXAfEWJH/A0Q7c6VO6i/0CtDyRWmgxlSG4xl1NnnSpKF4SF2Hp9O9GPU+V6e6voonmtP2JoRPwpBgSkkVwScrbc+1Dr8msWUy121zDJTXUs/U6zPNOvTqBxVqDn6NZYBXE5DCTVNyTvleRJWiQAtyXw= 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 1704747105325740.3124420894056; Mon, 8 Jan 2024 12:51:45 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.663906.1033900 (Exim 4.92) (envelope-from ) id 1rMwaS-0002hz-GC; Mon, 08 Jan 2024 20:51:08 +0000 Received: by outflank-mailman (output) from mailman id 663906.1033900; Mon, 08 Jan 2024 20:51:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rMwaS-0002fu-7Q; Mon, 08 Jan 2024 20:51:08 +0000 Received: by outflank-mailman (input) for mailman id 663906; Mon, 08 Jan 2024 20:51:05 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rMwaP-0000R6-8w for xen-devel@lists.xenproject.org; Mon, 08 Jan 2024 20:51:05 +0000 Received: from casper.infradead.org (casper.infradead.org [2001:8b0:10b:1236::1]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a24ba91e-ae67-11ee-9b0f-b553b5be7939; Mon, 08 Jan 2024 21:51:02 +0100 (CET) Received: from [2001:8b0:10b:1::ebe] (helo=i7.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1rMwYj-008RPl-Eh; Mon, 08 Jan 2024 20:49:22 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.96.2 #2 (Red Hat Linux)) id 1rMwYk-002NFO-0e; Mon, 08 Jan 2024 20:49:22 +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: a24ba91e-ae67-11ee-9b0f-b553b5be7939 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=hIoRnAOMf4YLSnQadmaBzYXHMtK98X95ymuChZmuyOk=; b=nfxsfbqV1CHr1yheFZqmqLuDWj OkCLvnwbhPHn2IVSnOAZlJcmn3l++D3kgPeT6bXOqWCPoFwuMqq4di8mfLBX9m3NESJ0NiMZJVYdY A+OO59fTIAzChlNUEYpim+kMzrYnSgEY8y8oqz6pB2juLoGEPrW9WE6gQOiWcl6UaumHGjhLukdLn xW/kDvmrsqXhVWnlafADfHvUWavzvCPo/+D9N2eKUEPzFC5ayE9nYyc8LtXHw/KOj0WfTVgx3v14M o93mKqGsZVbRFaHaToR+1JuwA6mCR6EY/rPI2QAFvSMx7dqTsPo0o2ktlvxJnt7wd9L3Toaw3Ejlo tAby7F6Q==; 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 Subject: [PATCH v3 21/46] hw/arm/allwinner: use qemu_configure_nic_device() Date: Mon, 8 Jan 2024 20:26:50 +0000 Message-ID: <20240108204909.564514-22-dwmw2@infradead.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240108204909.564514-1-dwmw2@infradead.org> References: <20240108204909.564514-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: 1704747105787100006 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.41.0