From nobody Tue Nov 18 10:38:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) client-ip=209.85.221.49; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f49.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1609455039; cv=none; d=zohomail.com; s=zohoarc; b=YHUkf5raiBXttjqnZ4YRgBRL32mG7JEc15uPXsnfMqRZ/UmzPXB/c3vcy3ufoBl7pmtrrKYrBeAz7oWa8NZrcEwpI/7VLVyTarcnEU4F+HqI0N7ENxHmCiEUUxH8cDlQVX1SZ3WXYkl+/qjyBW/+L/snjS/jfvURmMsH+Y43n8Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609455039; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UF9C9rlsBDCs9WWqG2eWdP7HydEgcGaCKsEyc6/esyM=; b=e/EpWS0qvVCMAIZgm9/zXhlJi5a7JGae5lFk95wkp8ZqlDPvAfWlblmdO3U18Pacrn4ELFrynKqGiwnZpBTNwF6lyfBU48GKljZt0e48XMbVrZnFSUC/LUr4H6tjBClni56YkxeS5/Y1t9jmaa8Q+xDd++geSyYeSE60VSK7Bpg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mx.zohomail.com with SMTPS id 1609455039830157.3778158021297; Thu, 31 Dec 2020 14:50:39 -0800 (PST) Received: by mail-wr1-f49.google.com with SMTP id i9so21046309wrc.4 for ; Thu, 31 Dec 2020 14:50:39 -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 v4sm71421865wrw.42.2020.12.31.14.50.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Dec 2020 14:50:36 -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=UF9C9rlsBDCs9WWqG2eWdP7HydEgcGaCKsEyc6/esyM=; b=droiYmEKIwW90N4e0qmB2pejDtiNvETQkmpurJ7uSetyKPyLsOQTklmjdSkiHU8frO nImJvu1bYzBY6iTEv0KO03zpf04lWCW0Bou+d38IsScsYfnreH8V2BSV3mwtFBkQQB0v Mi6pjU+MnsZeocrjdX/ouk3S2Oz0FomXRIiVT2acU+xLgv4yFcphJZxytnTVcD3nw2FO ZqyuXtRkJFe1YRJksBq7Lbjilt8xAcL+lg/um8yIw/1nHG7OjKNxNDD2JGBRy/DB8DTc j0BjbOMle/bBjIdkz7DvXnbAwyFYWpVpwdVVB5i8iT+w7FqItiPuidRyVDlcO8CMlzLB vV2Q== 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=UF9C9rlsBDCs9WWqG2eWdP7HydEgcGaCKsEyc6/esyM=; b=uBlcSNR3x1a9WciGM09lTrvt4bFuduS9NxrudjlXEkardOc+Q+iXtt5JorFokXFkvi 9BmmOlv+7AjDYFtez3QgMOCSJ7cgrWoToaS5WUVsdzYaYfrFKWR5cpUCP0PIyvMMepdX UPDlNyGrnBEQVA5ZtsqiZ3iZS32k2MwdYjdCC+dq8y0SGcpc1fXVUbxFgIBsnIPFkh5E z6bO/WE0aRCQrJypFA2rHS6zgdFBS7yYmBNPV5MlWv1JJkd9fuzI0wu9aBzzUdnIDQJT QiVhyOKgyAirpAtfaYFUnwqqZWMxUfsaA6x7y+Vr/4wZViopO1OxlTBio4zZCERY7ENF WdrA== X-Gm-Message-State: AOAM533sQwBG6nVHhSwe7eHb/1v0CHhzQXpuJYykJZVHDjyrjQt5p2jq kF50H79ZL56qsOx8mBCSmD4= X-Google-Smtp-Source: ABdhPJy01jgWHtQHWS6xsNSy6BAxU0CySc87Nr0u66dRpC5Nk+FddIpBrq9eYqoQcw+BSsxP28Ez/g== X-Received: by 2002:adf:f58f:: with SMTP id f15mr66717570wro.388.1609455036959; Thu, 31 Dec 2020 14:50:36 -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: [PATCH 17/18] hw/pci-host/bonito: Declare TYPE_BONITO_PCI_HOST_BRIDGE in include/ Date: Thu, 31 Dec 2020 23:49:10 +0100 Message-Id: <20201231224911.1467352-18-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) Declare TYPE_BONITO_PCI_HOST_BRIDGE in the new "hw/pci-host/bonito.h" header, so we can inline the bonito_init() call in the next commit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/pci-host/bonito.h | 34 ++++++++++++++++++++++++++++++++++ hw/pci-host/bonito.c | 16 +--------------- MAINTAINERS | 1 + 3 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 include/hw/pci-host/bonito.h diff --git a/include/hw/pci-host/bonito.h b/include/hw/pci-host/bonito.h new file mode 100644 index 00000000000..d0264f34783 --- /dev/null +++ b/include/hw/pci-host/bonito.h @@ -0,0 +1,34 @@ +/* + * Algorithmics Bonito64 'north bridge' controller + * + * Copyright (c) 2008 yajin (yajin@vm-kernel.org) + * Copyright (c) 2010 Huacai Chen (zltjiangshi@gmail.com) + * Copyright (c) 2020 Philippe Mathieu-Daud=C3=A9 + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef HW_PCI_HOST_BONITO_H +#define HW_PCI_HOST_BONITO_H + +#include "exec/memory.h" +#include "hw/pci/pci_host.h" +#include "qom/object.h" + +typedef struct BonitoPciState BonitoPciState; + +#define TYPE_BONITO_PCI_HOST_BRIDGE "Bonito-pcihost" +OBJECT_DECLARE_SIMPLE_TYPE(BonitoState, BONITO_PCI_HOST_BRIDGE) + +typedef struct BonitoState BonitoState; + +struct BonitoState { + /*< private >*/ + PCIHostState parent_obj; + /*< public >*/ + qemu_irq *pic; + BonitoPciState *pci_dev; + MemoryRegion pci_mem; + MemoryRegion pcimem_lo_alias[3]; +}; + +#endif diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 5a8a85ae443..b959b353854 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -45,6 +45,7 @@ #include "hw/pci/pci.h" #include "hw/irq.h" #include "hw/mips/mips.h" +#include "hw/pci-host/bonito.h" #include "hw/pci/pci_host.h" #include "migration/vmstate.h" #include "sysemu/reset.h" @@ -198,8 +199,6 @@ FIELD(PCIMAP, 2G, 18, 1) ((((busno) << 16) & 0xff0000) + (((devno) << 11) & 0xf800) + \ (((funno) << 8) & 0x700) + (regno)) =20 -typedef struct BonitoState BonitoState; - struct BonitoPciState { PCIDevice dev; =20 @@ -227,20 +226,7 @@ struct BonitoPciState { MemoryRegion iomem_cop; MemoryRegion bonito_pciio; MemoryRegion bonito_localio; - }; -typedef struct BonitoPciState BonitoPciState; - -struct BonitoState { - PCIHostState parent_obj; - qemu_irq *pic; - BonitoPciState *pci_dev; - MemoryRegion pci_mem; - MemoryRegion pcimem_lo_alias[3]; -}; - -#define TYPE_BONITO_PCI_HOST_BRIDGE "Bonito-pcihost" -OBJECT_DECLARE_SIMPLE_TYPE(BonitoState, BONITO_PCI_HOST_BRIDGE) =20 #define TYPE_PCI_BONITO "Bonito" OBJECT_DECLARE_SIMPLE_TYPE(BonitoPciState, PCI_BONITO) diff --git a/MAINTAINERS b/MAINTAINERS index 1e7c8f04885..2e22830efba 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1153,6 +1153,7 @@ F: hw/mips/fuloong2e.c F: hw/isa/vt82c686.c F: hw/pci-host/bonito.c F: include/hw/isa/vt82c686.h +F: include/hw/pci-host/bonito.h =20 Loongson-3 virtual platforms M: Huacai Chen --=20 2.26.2