From patchwork Mon Jan 8 11:05:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 186002 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:37c1:b0:101:2151:f287 with SMTP id y1csp1022742dyq; Mon, 8 Jan 2024 05:40:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcQ7MSSkIZzqG23YicGQ6Yd+iQJzYzezuWzmuba9dyRhnzujmAtDlTS53/6fmn6fOwmgX5 X-Received: by 2002:a05:6a20:47d7:b0:199:9680:bf0f with SMTP id ey23-20020a056a2047d700b001999680bf0fmr640982pzb.120.1704721221525; Mon, 08 Jan 2024 05:40:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704721221; cv=pass; d=google.com; s=arc-20160816; b=tFx5HfeepO/gD9st5QkeB6RLX0tRWfBpTdyS2Qcgyitc2eNDgl+hXN6kSNpzdz9yeW rIZ9wBb5bq+493upQc7TQ+zOioFLOU4PEMPLLyDlKbY03VTR0nd2fOIHX62E5Nh9xO78 xqskAGDiUtGmDjlUiAxO8J+0KjLGxqHzE0x69wKt3w8kwra5xuOSC/Vlx/3SICezCWMd oCGdUeBvoRgkXPPMpQRWT80Q1UxSCFzg0LehNDz3tFVr0mTD0JS2QNS4c+SP1+zCLYC9 t3IaHvS7A876Z/ETFiVCKQittj8pxSt15yaasMoZyjNjTox4HgHeRCz3jg2aEaCaYtcQ hTiQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from; bh=VXXtaYWxPM3l50fI5furwsMZGzPDogGyg6F7i2V3hkY=; fh=2Bxzh03UCe+gGoy6PzJXhIx6NDrOamQNShtEzX+UDKU=; b=cnvwnJw0UMBTJVWTEafoQRrtHQ/Df+2BdKYUiQlNugbqWGxvs6c0d5DIeK0XcRD4M1 qG7uS570jUM9ko9e8tqZ2DVU+wDRdbI19TzdlweNDsUEIylIo1Qq8K99KW32FgkAczQU dobONFvddRpynBqcqQPZGPX05Hf/vJ3PkQ+Szv2/UO84Ji0KWhVBJcvbkRVak+Px7jJ6 EzGANtVuv/4TlcGzbcn+Jt8AgviWtqfKrRr7IkZGYZXSR+Lzp9RHNmEn1/MCxpw/avpc f5XUlOPO9UIVmGNPdrnETnT+xaCdJdHN2BVekiYOl06/2Ddg1qFhj1eqVPfiCMINg5BK CoIw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=starfivetech.com dkim=pass dkdomain=starfivetech.com dmarc=pass fromdomain=starfivetech.com); spf=pass (google.com: domain of linux-kernel+bounces-19630-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19630-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q21-20020a656255000000b005cd8723fab0si5956863pgv.557.2024.01.08.05.40.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 05:40:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19630-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=starfivetech.com dkim=pass dkdomain=starfivetech.com dmarc=pass fromdomain=starfivetech.com); spf=pass (google.com: domain of linux-kernel+bounces-19630-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19630-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B03ACB2213F for ; Mon, 8 Jan 2024 13:40:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F320445940; Mon, 8 Jan 2024 13:39:59 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from CHN02-SH0-obe.outbound.protection.partner.outlook.cn (mail-sh0chn02on2088.outbound.protection.partner.outlook.cn [139.219.146.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 919BA44C83; Mon, 8 Jan 2024 13:39:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GKGkb5Ph6xG7WPkzUdNNvg/PRKxvjOTQQIoQVCVJJ2FZ3MjIGv8WNo2gRq7JEY3m7D3r6BXtqfoUG2qfTMXwAREsd8eQ0+qcMiyi7xGqnA2idL2m9/e4R0GFoNPYOckiVwsIVQAkp3U4CmE/xtqXPO5FATcMCHbWx+Hz6S967R2xiuPKHp2p71kDKYO110jF3PQYBG23TNT7rE54UgAKaG5VRMeS9aCSlSqcysTXgtB5ZxhG/bDKDfr/IOnOMuiRoJLfuY+64mG3rY3TQUvFcGpb6AHn1+CPzUW89SAsgLLgFGISclLdWEXwc3RuX8MZl/hCENnsu9SaBn0HU9Q8dA== 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=VXXtaYWxPM3l50fI5furwsMZGzPDogGyg6F7i2V3hkY=; b=Q84sYDOtqnCpzqZ5X99uIw7JjlzlBo21bqi77tWdci2+6O+Qm5vfpq3mxo9CYKvkcST4GZP+pq0MkdsZL7XtNnQRasHzkv75537l3q+TNKpbQ/j4cWbG6WyVzkLw+XSza5PQNPJkQ4gYWknpsDNRaoWQ1aA7Ws5PHv8qYsuzRmaRpBvinGEJFrK07uNo0AxCS6xJ94GPQiNq8Jjayjsvsrq+dCxpktnGwJLG1ztJ5PnM9rGxhRdReOhuGf5rUcDT9y58Y4iKvrBO9bD5aJyE56e4EfCGGC1JSm+QXu02Z8884huy2vH58+U1ls7LzBrstbjbLPCK/KVSf0lUNOd+iA== 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 SHXPR01MB0797.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:26::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.32; Mon, 8 Jan 2024 11:06:34 +0000 Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::e6aa:baea:fd8c:4cd2]) by SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::e6aa:baea:fd8c:4cd2%7]) with mapi id 15.20.7135.032; Mon, 8 Jan 2024 11:06:34 +0000 From: Minda Chen To: Conor Dooley , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , 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 v14 06/22] PCI: microchip: Move PCIe host data structures to plda-pcie.h Date: Mon, 8 Jan 2024 19:05:56 +0800 Message-Id: <20240108110612.19048-7-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240108110612.19048-1-minda.chen@starfivetech.com> References: <20240108110612.19048-1-minda.chen@starfivetech.com> X-ClientProxiedBy: ZQ0PR01CA0014.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:5::19) To SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SHXPR01MB0863:EE_|SHXPR01MB0797:EE_ X-MS-Office365-Filtering-Correlation-Id: f531cc61-3368-4f45-a6a0-08dc1039e041 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w/Pl5HjmTUrcIdKsZguWYYaPeyhS7N8bh5GibwCttgbmIDSHxWvz9Szch7Bw0MALMsfiAAZW7vWni+wf9lt59ZCUURwH+xsEoEJn69ooV7mt2wiCMCLfC2Tm7sLRg70bl71+ZtAbr27NwSm0AhCa3ilk9kF+UXchqoqwXA4tA/7+9ZAXRs+gd7K3cghvUbL30y53JxBp0dHRVGUYDkjWnvmqfK9BVRWQtU1QFiyKJcF7VcENq3jxVe0btBRaUXU8UaoHNIt3j68kdaPfDNZvDX7a59+cVVrcs3DwswcifZaahAydLqcCZ14Cerl7HRAAIla7NhP4Ncd5sQXxDPTiqQJz+SD/PZMcC9Ti+gg1Pp500yIIbeeeSO7ojPrUNBOAAkl85bRileiCTgVqp4sB61/LOi/C7rjvYOeHq9Q1X0KR5Q3rIaVH9ncZv5EOS0ucB5FaM9RbK7qMZOxoKgn3tfuucc5ejBXnsUBzPP5c/GzfIMiXitv6tsWN2yJwYMPVeNuLwh+R1aIEjerugbeyQN72bz2cyhXgGhU83947tIlccfuGv+kJxrnqzr89RsEm 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)(366004)(396003)(136003)(39830400003)(346002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(8936002)(41320700001)(1076003)(107886003)(26005)(2616005)(83380400001)(44832011)(8676002)(4326008)(86362001)(52116002)(508600001)(66476007)(6666004)(66946007)(66556008)(54906003)(110136005)(40160700002)(38100700002)(38350700005)(2906002)(5660300002)(7416002)(40180700001)(41300700001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TG+6TgETj91dIeuMPJNMn8JnnKo0yqf38mQB9kc9koaMbSwKe9WJR3aNpSLMd+Of9lyuyVYljbSHSOLC4Nb7N03ooiQyViGjoI5RA2HpJlSkAh2Q+MvVVb2zMCKP8qWDfAXCleGoQL2LHrtqh2Vs7DNrSjU1mYQuRzIkjEXeZMvbsrAg3Bh8tUvn7kdpbNI5tUrwTm4Jrf33L40bKkL/dWNscn69+i94ce2V8ykqM/kJi0Q9UEp577et98NqpABHkU3tvX+O0iZp5vYgKr5I0xUghUPukYXiWkY2xgLg0sZ2K41cJGOctnqoPyag68yJZoUF+pJejaTWgmfwig2X7M9irsfzo+2BFg1Axag67VRiwebPd7LjE7X3hD0SUQWuxa0oEK2BASBRE9Wf+8L1n25qVjwoddkR/eMBmjrEO05kjPmWWX6zUUsMnqxUr/lLszMAA2T0BIUVQq+X7lX2nF9/nIWvphihSM63IKXLRnepMGt/NmONe/tIuTo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6421ExEtSPOMhougvHuQOnd5hES4Li8DW7FzD4Ig== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: f531cc61-3368-4f45-a6a0-08dc1039e041 X-MS-Exchange-CrossTenant-AuthSource: SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 11:06:34.2687 (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: +NNgNxdOfRSIdxqGK0U38oL4/g0OI5mzsjxuDSJF2uV5vtjDNR6vWLdKC4RYpxIOuWl50dthkVDVonOFZVYl95d7jlLFILEIvXycqU+vKGE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SHXPR01MB0797 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787529759557236523 X-GMAIL-MSGID: 1787529759557236523 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 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 cad3a98d967e..7bec6a470758 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_INT_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