Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5816227rdb; Wed, 13 Dec 2023 23:29:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVAj9EgxlNPQznyb+nns6d0vkk3I+rCdAV7n66H9E1TZYWUBiNhWOxrVKyRRGAOCo3Tuk1 X-Received: by 2002:a05:6e02:170f:b0:35e:6bf2:3090 with SMTP id u15-20020a056e02170f00b0035e6bf23090mr10942706ill.31.1702538986739; Wed, 13 Dec 2023 23:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702538986; cv=none; d=google.com; s=arc-20160816; b=bkfBGUtHUdwlvo892FIDPUCzxgYp4xDiEzJN9/OunWK4DinxL0DGCxbL3S4Q5b4+ZH 5OlYaaminSPVc15qvEDMmkceHN6sbj2f8Z+chkW67vsKrWq4ZRoMAomtK0W9tSpIuH6W xE0YLO/twCxotqgfBht4tv7Qwu9WTmOhzz82UeJ1NF5S5MPBVzxdQsu+TCdDT7WSSKNZ YG04v/e3D5iJVR3p/nmodtNFM9TK8/aAV62T0kth9eeReztnr+YzU8YNXVHcCl4QuMjm 9+hfOib0K00xjeVQD/veZKv59rb7Kd+1lYfEqtHivS31maPA+arEFsTkm7nxMo5YPAhG V0yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=1nIp0F7nlVuJXqKKGYmD2aOarhdPXlIymbNABfnFbR0=; fh=ld3UXb1S5Y4IkunPfuj6e9Ppmc+fy6ncC+eQtrVLfK8=; b=uUg54BCOZrCLhib+T6YZL8H6DVcGrCKS6pur7M/Texw5V05ArmqSzqwzirlNzI2iUO 1tvxynQstdhrPwEhwlnjrezMNxfnb4bwk4sKDi/HTnmdLWW7NA7NHUszmqyksVoc+JlI fgdbRAH3GDMNHfEdP5SpZ8VipP4gi6cojeO0qMCCaMm814tEI9dgYTgooIvNTdNNCytF wh3CqftuzbtDTbne2Wz+qdIBzng9ty9gl6n7/G0wwoB5sva8rBH3cDvQ65CLCBv5Gp6L LxE/4+hbTDkpf1b1kLxNvVsMx1t67jnrmnE9jwzSQxePhgHBKRABDWtlZFsMHU63Zr0Y HF9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id 36-20020a631564000000b005af21fd2c6fsi10993854pgv.898.2023.12.13.23.29.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 23:29:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DFBE7802EE70; Wed, 13 Dec 2023 23:29:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235537AbjLNH3Z (ORCPT + 99 others); Thu, 14 Dec 2023 02:29:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443337AbjLNH3N (ORCPT ); Thu, 14 Dec 2023 02:29:13 -0500 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00A06185; Wed, 13 Dec 2023 23:29:12 -0800 (PST) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id C7D6B24E203; Thu, 14 Dec 2023 15:29:11 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 14 Dec 2023 15:29:11 +0800 Received: from ubuntu.localdomain (113.72.145.168) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 14 Dec 2023 15:29:08 +0800 From: Minda Chen To: Conor Dooley , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , "Daire McNamara" , Emil Renner Berthing , Krzysztof Kozlowski CC: , , , , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie , Minda Chen Subject: [PATCH v13 06/21] PCI: microchip: Move PCIe host data structures to plda-pcie.h Date: Thu, 14 Dec 2023 15:28:24 +0800 Message-ID: <20231214072839.2367-7-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231214072839.2367-1-minda.chen@starfivetech.com> References: <20231214072839.2367-1-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [113.72.145.168] X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 23:29:44 -0800 (PST) Move the common data structures definition to head file for these two data structures can be re-used. Signed-off-by: Minda Chen Reviewed-by: Conor Dooley --- .../pci/controller/plda/pcie-microchip-host.c | 20 ------------------ drivers/pci/controller/plda/pcie-plda.h | 21 +++++++++++++++++++ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c index 3dc4d4ca9d0c..261147a0a446 100644 --- a/drivers/pci/controller/plda/pcie-microchip-host.c +++ b/drivers/pci/controller/plda/pcie-microchip-host.c @@ -21,9 +21,6 @@ #include "../../pci.h" #include "pcie-plda.h" -/* Number of MSI IRQs */ -#define PLDA_MAX_NUM_MSI_IRQS 32 - /* PCIe Bridge Phy and Controller Phy offsets */ #define MC_PCIE1_BRIDGE_ADDR 0x00008000u #define MC_PCIE1_CTRL_ADDR 0x0000a000u @@ -179,23 +176,6 @@ struct event_map { u32 event_bit; }; -struct plda_msi { - struct mutex lock; /* Protect used bitmap */ - struct irq_domain *msi_domain; - struct irq_domain *dev_domain; - u32 num_vectors; - u64 vector_phy; - DECLARE_BITMAP(used, PLDA_MAX_NUM_MSI_IRQS); -}; - -struct plda_pcie_rp { - struct device *dev; - struct irq_domain *intx_domain; - struct irq_domain *event_domain; - raw_spinlock_t lock; - struct plda_msi msi; - void __iomem *bridge_addr; -}; struct mc_pcie { struct plda_pcie_rp plda; diff --git a/drivers/pci/controller/plda/pcie-plda.h b/drivers/pci/controller/plda/pcie-plda.h index 727fc54312c9..363fcbbaf6ec 100644 --- a/drivers/pci/controller/plda/pcie-plda.h +++ b/drivers/pci/controller/plda/pcie-plda.h @@ -6,6 +6,9 @@ #ifndef _PCIE_PLDA_H #define _PCIE_PLDA_H +/* Number of MSI IRQs */ +#define PLDA_MAX_NUM_MSI_IRQS 32 + /* PCIe Bridge Phy Regs */ #define PCIE_PCI_IRQ_DW0 0xa8 #define MSIX_CAP_MASK BIT(31) @@ -99,4 +102,22 @@ #define EVENT_PM_MSI_INT_SYS_ERR 12 #define NUM_PLDA_EVENTS 13 +struct plda_msi { + struct mutex lock; /* Protect used bitmap */ + struct irq_domain *msi_domain; + struct irq_domain *dev_domain; + u32 num_vectors; + u64 vector_phy; + DECLARE_BITMAP(used, PLDA_MAX_NUM_MSI_IRQS); +}; + +struct plda_pcie_rp { + struct device *dev; + struct irq_domain *intx_domain; + struct irq_domain *event_domain; + raw_spinlock_t lock; + struct plda_msi msi; + void __iomem *bridge_addr; +}; + #endif -- 2.17.1