From nobody Tue Nov 18 10:37:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) client-ip=209.85.221.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1609455043; cv=none; d=zohomail.com; s=zohoarc; b=LjuqLnE55DwIxEPSjTq3Qdflnfn6aPoXN9u5DpPd0LyVvN0B/uviakfoUoF5X2iCK1p3Tc0J+tGeGBBLk0VUp4QvyFcV3pODYuvv1JRGaqUvYSwGHJdM0hg25yCaHkqrql6dcUJSURzLpy2A9Hmrgdb0vfRTkRcdKAlsXyvVr5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609455043; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=423UJbcbIa77Pf7DWP8ntIYBlM/uiTnfSWl6dX1wzkM=; b=CI7A6rAeV+ROdoOtUwUetzRZXoxIxHO8GL/H1k58nrbJx27nutJhFHPbf2nfPurwOmJB0Od6+ECI8cVCoREejjiSXrYAqAp8sBK5g5ivaiRbUwmXBn/xhHDEsEMOLIXGw33v1YSikLE95GjElqL85qE/aZH0g5rFxr1YpwFDgFw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.zohomail.com with SMTPS id 1609455043741601.4536576437504; Thu, 31 Dec 2020 14:50:43 -0800 (PST) Received: by mail-wr1-f43.google.com with SMTP id i9so21046433wrc.4 for ; Thu, 31 Dec 2020 14:50:43 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (239.red-83-42-57.dynamicip.rima-tde.net. [83.42.57.239]) by smtp.gmail.com with ESMTPSA id r2sm72319749wrn.83.2020.12.31.14.50.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Dec 2020 14:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=423UJbcbIa77Pf7DWP8ntIYBlM/uiTnfSWl6dX1wzkM=; b=HW7xG8rDq7aUhQi7ETz8ENCqsU1WwI/QSBHCBNc/SjvA4QX+bK0F/x5O+5Mp1gL+lH 3BMhjbDNcoZF+FntBru1ljFl1aglY+7p2Mq/NRueKvuCkbTuy0jHgeQOLHOzSw/6U8JW sS1xE2ajx05WduvWP/GHxB1BogmBdQfCtyEARdO9l8fAtrUqn7Pjgc9+UiMFq/vxWcTj 9wW4Dr4JoAUALxP1SUserUpYlRbujasv86y/TvVfZYpTxP7aQsmaNL4NfRE1nVfH0GqK bRtM7WQLXLhcjQSi6EgK73IjEpEr4Basevbt887Sozm/28D3zvejOQeIFp9HME3Kpo9E VitA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=423UJbcbIa77Pf7DWP8ntIYBlM/uiTnfSWl6dX1wzkM=; b=DtxaOr1HJebpB7i6PjasODoj3VoZCVzY+uj9puGSo90um3LpnKwIVLh5tDLwIUM4/U o+QktzAg0r0vjbeW104Z6QTFZcFDlpmGtO2FY5nlIGWipU9Y8bgVkTYJdwRYMQe1B+tb 68xpheF/IhmrPJiKqgYTMUjwYDQr4xHWHpOn+eVYvVz/esitPjz2WIoeIfOCa8ReNtC/ 9R+/tqWWV6m9zSJ/Xw38XA+bbsiXCEyPqX6fL9livbk6aQ5p5FhmTEORjbrI5hHgyy26 KSibhGyh7zE77Bb8f4PfkpM9lwU8F3WqsyoWs4jsBrSLtgGdeqrpOOxPDJ/q1YGqfyTM wtRQ== X-Gm-Message-State: AOAM530ve8rS1ZksEv6X4lzVXn8/SDHafk8iXf2FxF+zV0+Zx/OlR9pt +IFfVpMO2k2REVG2+PMa5Cs= X-Google-Smtp-Source: ABdhPJy+j67cr4SJreaz//u0IYQ5JJaJyIpWlW0YHR4WoxboDfiDlcg3bHROCNdQWmLaZyn3w0A9OA== X-Received: by 2002:a05:6000:cc:: with SMTP id q12mr67707459wrx.335.1609455041958; Thu, 31 Dec 2020 14:50:41 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Aurelien Jarno , Huacai Chen Subject: [RFC PATCH 18/18] hw/mips/fuloong2e: Inline bonito_init() Date: Thu, 31 Dec 2020 23:49:11 +0100 Message-Id: <20201231224911.1467352-19-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201231224911.1467352-1-f4bug@amsat.org> References: <20201231224911.1467352-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Remove bonito_init() by inlining it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- TBC next year. --- include/hw/mips/mips.h | 3 --- hw/mips/fuloong2e.c | 7 ++++++- hw/pci-host/bonito.c | 15 --------------- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/include/hw/mips/mips.h b/include/hw/mips/mips.h index 6c9c8805f3f..609a33881f6 100644 --- a/include/hw/mips/mips.h +++ b/include/hw/mips/mips.h @@ -12,9 +12,6 @@ /* gt64xxx.c */ PCIBus *gt64120_register(qemu_irq *pic); =20 -/* bonito.c */ -PCIBus *bonito_init(qemu_irq *pic); - /* rc4030.c */ typedef struct rc4030DMAState *rc4030_dma; void rc4030_dma_read(void *dma, uint8_t *buf, int len); diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index 45c596f4fe5..19b3788e816 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -25,6 +25,7 @@ #include "qapi/error.h" #include "cpu.h" #include "hw/clock.h" +#include "hw/pci-host/bonito.h" #include "hw/intc/i8259.h" #include "hw/dma/i8257.h" #include "hw/isa/superio.h" @@ -303,6 +304,7 @@ static void mips_fuloong2e_init(MachineState *machine) MIPSCPU *cpu; CPUMIPSState *env; DeviceState *dev; + BonitoState *bonito; =20 cpuclk =3D clock_new(OBJECT(machine), "cpu-refclk"); clock_set_hz(cpuclk, 533080000); /* ~533 MHz */ @@ -360,7 +362,10 @@ static void mips_fuloong2e_init(MachineState *machine) cpu_mips_clock_init(cpu); =20 /* North bridge, Bonito --> IP2 */ - pci_bus =3D bonito_init((qemu_irq *)&(env->irq[2])); + bonito =3D BONITO_PCI_HOST_BRIDGE(qdev_new(TYPE_BONITO_PCI_HOST_BRIDGE= )); + bonito->pic =3D (qemu_irq *)&(env->irq[2]); /* TODO link/property */ + sysbus_realize_and_unref(SYS_BUS_DEVICE(bonito), &error_fatal); + pci_bus =3D PCI_HOST_BRIDGE(bonito)->bus; =20 /* South bridge -> IP5 */ vt82c686b_southbridge_init(pci_bus, FULOONG2E_VIA_SLOT, env->irq[5], diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index b959b353854..28d385ff363 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -714,21 +714,6 @@ static void bonito_pci_realize(PCIDevice *dev, Error *= *errp) qemu_register_reset(bonito_reset, s); } =20 -PCIBus *bonito_init(qemu_irq *pic) -{ - DeviceState *dev; - BonitoState *pcihost; - PCIHostState *phb; - - dev =3D qdev_new(TYPE_BONITO_PCI_HOST_BRIDGE); - phb =3D PCI_HOST_BRIDGE(dev); - pcihost =3D BONITO_PCI_HOST_BRIDGE(dev); - pcihost->pic =3D pic; - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - - return phb->bus; -} - static void bonito_pci_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); --=20 2.26.2