Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp730066rdg; Wed, 11 Oct 2023 04:06:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrMwtjTruXaHbc4UI+HkNSFKrylsUKvq8fm/71dauAaGPbEW78v3KSOvCznkdugWs9i0IL X-Received: by 2002:a05:6a20:5602:b0:16b:9285:69e6 with SMTP id ir2-20020a056a20560200b0016b928569e6mr15415480pzc.35.1697022403111; Wed, 11 Oct 2023 04:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697022403; cv=none; d=google.com; s=arc-20160816; b=FbwNUgkT/TxZAb4pTOZHlhDeWAYkRUiv1XsA6O9KatyU9bB8C6oG8iCz+L/bezSwCd PEBSbEdf/s2CiyIBM7gSXHlCK2aglSfYv3qTr3oqyZ+nxG9ItYyDzOf3GOdXnL4voBSG Z9NnTRh4LWrPLl7DGGvSBVb8g4foYu0nXYeQYnpCs1yvGN4eCKLhAKqckzoK//bbJHti gKBOqfW8HJUJMu3P/UHRTldqGZvB6eVn7AMqTtSXy+9rV0MSZWbjLV5aUApX5YMJnt8M pyZTr02xtAbe+rQegS6RkRjxNJ7YizQh6KHiUwKHIB0BWAB63PokcvCnvn/zKz061mLl ZJCg== 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=Uypzx6GfAls0dl9+GnNJULBNXFZoCGO0zUYNbItF9is=; fh=ld3UXb1S5Y4IkunPfuj6e9Ppmc+fy6ncC+eQtrVLfK8=; b=YAAW6n9Y8WcgBofRmUj3LqLsTYsEsF23Gi4Sdh9E2MSoqx/DL/WJ/2w+CrfnguB7Q1 PNWPeNT3cjIFvkgl1gfuDzePl1VTCCKgv6Qk8NTtpeHZj6tic15QyhD2lmy2WoeBEda8 apeZVixn/lXqpweRZNPapAEyKBHRgojKE6XyVDTwOhOkCvgLqZUqQAry783Oxuk0j4oh 180RayEMW94U76YnJF7GGVCqzHyTYsOl+7IN4v/Am2BX1Xtd1Ou0UJWbGZKWMktLv+SO HNjSlnrXGbSR3deoPcGdMxSeO9wfYxs7B9Jif/B9j+8OU2wOcPPUgRW/di23aZH8FAV8 gUeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id b9-20020a63d809000000b0057c9e0c7bb7si4668560pgh.77.2023.10.11.04.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 04:06:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 545C880E7629; Wed, 11 Oct 2023 04:06:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234927AbjJKLGK (ORCPT + 99 others); Wed, 11 Oct 2023 07:06:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234864AbjJKLF2 (ORCPT ); Wed, 11 Oct 2023 07:05:28 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43DCEC4; Wed, 11 Oct 2023 04:05:27 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id CEBD424E36D; Wed, 11 Oct 2023 19:05:21 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 11 Oct 2023 19:05:21 +0800 Received: from ubuntu.localdomain (183.27.96.95) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 11 Oct 2023 19:05:20 +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 v8 06/22] PCI: microchip: Move PCIe host data structure to plda-pcie.h Date: Wed, 11 Oct 2023 19:04:58 +0800 Message-ID: <20231011110514.107528-7-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231011110514.107528-1-minda.chen@starfivetech.com> References: <20231011110514.107528-1-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [183.27.96.95] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 11 Oct 2023 04:06:35 -0700 (PDT) X-Spam-Level: ** Move the common data structures definition to head file for these data structure can be re-used. Signed-off-by: Minda Chen --- .../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