From patchwork Thu Mar 28 09:18:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 13608261 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4B7E4C54E67 for ; Thu, 28 Mar 2024 09:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xdbIf0H10G3gNLLNe8jxlr3Eq6X6SBqeyRfO4Yl+TcU=; b=NrPh9ZK7Qwgn7y kpfAHoBO9SEjuGew02un48+C8nGfNPYI0H7I9vt8VeePJkzTefBTFj8iCWCWZQA5ETK5GS8OoX2zg HjTtFyyzQXZnw00moPU3tDUuhJKMh0sk5gtP2q+JyxO0kAhl67e/dmJTvXaTAgE59iDon+1Ps/hfL EISDFGJ5+XF8g0OwUXV1omMY4KJml+PxGmyT/aC7ozh++jvt874309m5k5H0V+P4ocpYXV8XacZFY cGh8CYOBIRQFfAHFNOzRU0eIUns5CgQs0kVKd4zmB+jo1U9K3V7b80FMH/vWoCz0HVeXu4kjh1BW4 uTsgdMX3d4bYxBY2DWUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rplvL-0000000DHmT-21ge; Thu, 28 Mar 2024 09:19:51 +0000 Received: from mail-sh0chn02on2072b.outbound.protection.partner.outlook.cn ([2406:e500:4420:2::72b] helo=CHN02-SH0-obe.outbound.protection.partner.outlook.cn) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpluj-0000000DHIC-28uE for linux-riscv@lists.infradead.org; Thu, 28 Mar 2024 09:19:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DRie1ElbU+KE517CM5J2TUblm00+JeCWhYWODvzDKSLye0oxrYDF2H9kzFvpfRozdy6pz7kAf+gxpWQpyLdeYBWuEuDwdUya2LNYrGtk8h+i7A4vzGhgpKMTaCICxzul+tJOcshhiIVZgeoO6LPYW0wN6+yDGKa2L4WfQedK/dC6r9AO5qFkFrc/aLIj213n4MnhwDkjznvkIcomEMa4Nv5+M2crbbBDtOCFBN2UodApFNIAFL/vTzWv9J1MBNSU6iIvai0eCRw+JkvhsTggUKChMkZkmPlQxH1f81THC6OP/Ps18ah2zc4t/kwJzw5MXx70BXo4mTP6tvta3cBvMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mmti4Mzosy+9FFE0EDrNRmDgW0khnDOK1Vefu3r0lh8=; b=l0/BflHbgl32la2uVngkWE7shnq7mx5i96Gylr91tc39V8ceHDF+3pSjd/WaT04kp00CW6hfpGZ/jsHS8VM3yyPcIvsihLnVkb0N4n5U/mi/GpdttyJfp1HK3CIIcKFrQ36X4H1i8+jR0ZPV4OwiMVtzE5pdB549c1PMyDBsgKnI405mbivY/CdZJvi8G2K9nePHs4kEt/POqhQnTgetIXTHqsATIoRoNIVqexQ9yi6twGjJSVMgd6q8qRLnRNHvYNtbhHjthM5Un9kD48+r/YL8klIalYoCpvTj8ZS6Cw64VXFeP8ZHO/UpaOBcDGz7XdNuzbnnLULG8loSer+5iA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::15) by SHXPR01MB0496.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.32; Thu, 28 Mar 2024 09:18:50 +0000 Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::c738:9e6b:f92e:8bb9]) by SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::c738:9e6b:f92e:8bb9%6]) with mapi id 15.20.7409.031; Thu, 28 Mar 2024 09:18:49 +0000 From: Minda Chen To: Lorenzo Pieralisi , Conor Dooley , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Thomas Gleixner , Daire McNamara , Emil Renner Berthing , Krzysztof Kozlowski Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-pci@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie , Minda Chen Subject: [PATCH v16 06/22] PCI: microchip: Move PCIe host data structures to plda-pcie.h Date: Thu, 28 Mar 2024 17:18:19 +0800 Message-Id: <20240328091835.14797-7-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240328091835.14797-1-minda.chen@starfivetech.com> References: <20240328091835.14797-1-minda.chen@starfivetech.com> X-ClientProxiedBy: NT0PR01CA0020.CHNPR01.prod.partner.outlook.cn (2406:e500:c510:c::16) To SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SHXPR01MB0863:EE_|SHXPR01MB0496:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a4f727a-0627-446f-de7b-08dc4f081445 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 448CbUJaU/XAo9u0vVgaF7L2/pBSfW6f4x2+6q4B6jNwpDPUYaN4EdGuy2cJvZ+TJ0keS/WE94mlpdAxPGPisyxROXNVERoVEcS6B9HOIhUjkhOvv88hVkCjG3Z7EfWaIeRwoSLyIaFwcx86EtTpzTgBZxtirZkuB55xaaxmC/PEgRnJrxwFtgVYIOTXL4+fAXDuq9dOLQUnVzZR7QT5yeOyMM0A+BdanN73ed45UFbvlGISCWIy4oBcUjHOYm3L5gfBEVud19h2Qa1g5vr2GuQmYqLgltPp6FTd4psnKYbF8qrJMMqaPbtR5UuGuH7PgHT8AdL4kvKMYITYmsa1ZQdVY++wGNgKHy8JyUPdQWKWVqNHurBaUJLW+c3EbjOIq9Vru3IP+c4dgnenBhPtwy2lLPpaAFl37JCl/YGrzU+r/fKhXvF4sZ6cGrbiGK6bX70k4yjE9DP5u8ScC+94PLoOOtPR/wDXOzJGcM6+QibAeVvWm+oGuBurCXZei6TD6gVMSOpEqJlOv9ttcYUYzQ/OZuJgHsIrhTpDgb7gX/869+CeiMciRrLh40J2vUfYW6LESKrz992pncTj0qXT8niNyNjO+Zxol71JzaSEhBiZdhcYKJHY9h6yMyAhjusl X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230031)(52116005)(1800799015)(7416005)(41320700004)(366007)(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Hcae3SH0rdp498QDh8V+SI1pX94Gw/tG9FU0rp3uN3ThUTe+zea5WBNhpX8N0DmuF8LKwh4UyhEuZwWqwONkT7wSVVWmZrmLPqFC+MLMrexZoWsS+AIe85rXXiGx2/gmgsLgDzsibrCQKLHNoYcWHNQTcoTTFARcdX1DNTHGqWnCzWrEe4GuMhltVXKgCk6RFaFFhYEqqyfLhqJowmIjgMGi2T9L5GUKdiDhYxTaGIHWV/TpSW4BD/dnfPgk4xpUhGyTkAGwbt1aH/QhaWaVSm7QSrwZ0ofoQ6kgkndFe82Lq3XXkfh3SACsjrUpGkMP5xF3nwsaE+ODoh6zfH2jbvZHSmtbjRYP50eT4lfJcCVoB+GXYAd5sY4Fzx+s9Ye+xpMp1PSxYd4GiB51Fd48Lrj3mQ3RkPdXTBl1oQrlr2kG4ROnWIGc04FVSaO4LbanaIIyiXpc1vQ9xXa8AIkwx7E+mlbX/isQFaGgnJpIcp3utYjJUqkugl60pefx1NmCidwISF4zeH5TXflN44R4UexotCQlflhjIBWU/WTejuvzuMeVcYWEtt7SuoKTDvBnWCyhLmQWhAOsyMbO2uppPs7HNhZcuvc2Gqdy6p/x2bv4D7jA5UEHS6u6nA== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a4f727a-0627-446f-de7b-08dc4f081445 X-MS-Exchange-CrossTenant-AuthSource: SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2024 09:18:49.9299 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LCHQ2sJHbI/lT7eo2ROwhPuuYZ+Sxfs29NJD+imxzLfPJMh+gkZZJnHXBaiI++zLXXOxQAyJa0ojj/it/a8ib8kjDUGET09inyxbr8o65Zk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SHXPR01MB0496 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240328_021913_774899_7915A0BA X-CRM114-Status: GOOD ( 11.43 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Move the common data structures definition to head file becauce 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 df0736f688ce..a554a56cc0e8 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 65e0f3b72184..9ca66916c609 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) @@ -105,4 +108,22 @@ enum plda_int_event { #define PLDA_MAX_EVENT_NUM (PLDA_NUM_DMA_EVENTS + PLDA_INT_EVENT_NUM) +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