From patchwork Sat Jun 18 02:44:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Kumar Gogada X-Patchwork-Id: 12886190 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7291EC43334 for ; Sat, 18 Jun 2022 02:45:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383924AbiFRCpO (ORCPT ); Fri, 17 Jun 2022 22:45:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231473AbiFRCpN (ORCPT ); Fri, 17 Jun 2022 22:45:13 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2054.outbound.protection.outlook.com [40.107.102.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CDF86A00E; Fri, 17 Jun 2022 19:45:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dqEpaFexy7aKm1ta7TMP+TVPxyxKeh8cT/ztst8K+PToBgVzBShZwJBiEVPF6/gm5tdUOcLtqSCS0MV7KLSsgKj+qVF07D/PsyRrE9OAmvtvTWffpA4/vCW8xtWhueYtn0xBBS+NddaRjd6OUIgatpA3XH3uST+CYkY9tlt7ziPSSCODuanF58UpOVrKaEWIKb80jikd5+lLUewkZYDit7akqLt541BGRkIXCdbfs4f9n3ovcYbtutTw/naOvHmKsB1YZEqSx631a/nnhVROhMC+Iv/WFFmRFFLT5YQZmYWcS0p9gml02PRDgDzxxA/RSGTBvKz/PLcumYggvyx7iw== 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=jhxl0OPRdYEJQYQizH7s9QG6W/seRQ29jt240nkZG1k=; b=CyLBI9hIgxk23/5uClHUBICy47+TAZrqatPW1i7uds8yVsbM1W4R+NL0C2puRhgpeHe4SfaAN7N+3BXVlUXL/uimrnMAR6m+Sfegeei3uQelWn07jaGf90PXUiIUP8LUqF11aI0BE2jtQiY3Rt9v3Zxoqg7T9OOYinFrK78+j4ZNMMSbStX5tHFrCB7YhSJrl4uoDNmxAnaItqYqIQOdRGOsBbblAMY9om8ahYK+vOX3RrW2SIUL3nnZf0aoPEB7gF9mLN74hRyjgDXyDLHGDWbBZ/XZFVyBkeed7P4vCxgmKpSzdQB8KU5iB5uDUBqQzqmj/TNMmnzIo12+drcOYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jhxl0OPRdYEJQYQizH7s9QG6W/seRQ29jt240nkZG1k=; b=pbxfz8KawTZLLzBhf9d6nKHr/BlpUzdURHN6DukbY4S71x+MKXnjlxM+sM2jKhw20sqoZNmfrJ/36eQ/yVrCVeUr9N29aOB5JjxgTBwVyKOwBoCkCZb2naYzTvnGLMWQjhLJAPoXeTAMy9NgI1D89iQ7krflK+ySMYqgeuttKRQ= Received: from DM5PR12CA0020.namprd12.prod.outlook.com (2603:10b6:4:1::30) by BYAPR02MB4597.namprd02.prod.outlook.com (2603:10b6:a03:11::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.13; Sat, 18 Jun 2022 02:45:10 +0000 Received: from DM3NAM02FT041.eop-nam02.prod.protection.outlook.com (2603:10b6:4:1:cafe::6b) by DM5PR12CA0020.outlook.office365.com (2603:10b6:4:1::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14 via Frontend Transport; Sat, 18 Jun 2022 02:45:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; pr=C Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT041.mail.protection.outlook.com (10.13.5.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5353.14 via Frontend Transport; Sat, 18 Jun 2022 02:45:09 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 17 Jun 2022 19:45:07 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 17 Jun 2022 19:45:07 -0700 Envelope-to: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, lorenzo.pieralisi@arm.com, bhelgaas@google.com, robh@kernel.org Received: from [10.140.9.2] (port=44908 helo=xhdbharatku40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1o2OSQ-000FZO-Lj; Fri, 17 Jun 2022 19:45:07 -0700 From: Bharat Kumar Gogada To: , , CC: , , , , Bharat Kumar Gogada Subject: [PATCH v5 1/2] dt-bindings: PCI: xilinx-cpm: Add Versal CPM5 Root Port Date: Sat, 18 Jun 2022 08:14:58 +0530 Message-ID: <20220618024459.7554-2-bharat.kumar.gogada@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220618024459.7554-1-bharat.kumar.gogada@xilinx.com> References: <20220618024459.7554-1-bharat.kumar.gogada@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cf02fa32-c09a-4028-a34c-08da50d48fa0 X-MS-TrafficTypeDiagnostic: BYAPR02MB4597:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eyHcQSPIqldc7OuWie+iUVGueGVUSelhFhoAUtFX/1rrSA3aRkM49Oa5GQuuLL7vVDuFq9Mew1sUWuQOBQSvkD0wd/eQhEnSLRH9RFXAVfxGtps9y1uiXGHVbweq41eNnk/EygJXufMPT4rl1Ffm73oeHz/ZgH4bVl4cYmoZ0dkOc4fk6WuQMyey26JRRw0DYwhEkbZDVbjTVxh1+vAtV5+3O4a1cWngVsYgbeR+0t8JHK98n0N8MCVh+Kj1m1CCyi23dI6myhPgHag6OUMg5XxQY66iUzXXXF3QaBlIZeWT8is9BA+IXqe/RdcybH37FZFfhXsi5gR77ywt5gQ1PMFw2U+ciSbPmziDSWBbWXct4AagwaPpZB6Sd3Veo4K26OHqGwINeczJI+rhVPfZEH67vd5yeIe1GdspmnfTC4w6bmasaAhGBqG+mtSrcdecYF4X+Ce+VxU/CWenPYS3wmsnQpiggnRNku+pN0LGfTzNjUFJxPHvwSzm2ZOQtfhXkjrPHhZJ4ylZWc/f7NJnx440sDH/tqrr/OkuQdxGC33I4Dg7QZ5M9TU4JTSjf2kYF71qoZrrZ6Jtq+y5aVgwI3jbltgufesvI9nDmqf8hmtM66Zb/0MpDY0OWk9lvXl05/bWbbyd8BvE5qb+f7g6+WTEA4rGkFHh0SQ1m5N1dhHImwHtBC/dBP/z8vfsIP7klJgp3B0xrSkLR+Al5kATjg== X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch01.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(13230016)(4636009)(40470700004)(36840700001)(46966006)(83380400001)(316002)(4326008)(6666004)(1076003)(7696005)(356005)(47076005)(107886003)(70206006)(7636003)(70586007)(2906002)(2616005)(36756003)(82310400005)(8676002)(54906003)(36860700001)(26005)(186003)(5660300002)(103116003)(110136005)(40460700003)(9786002)(498600001)(336012)(8936002)(426003)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2022 02:45:09.8367 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf02fa32-c09a-4028-a34c-08da50d48fa0 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT041.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB4597 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Xilinx Versal Premium series has CPM5 block which supports Root Port functionality at Gen5 speed. Add support for YAML schemas documentation for Versal CPM5 Root Port driver. Signed-off-by: Bharat Kumar Gogada --- .../bindings/pci/xilinx-versal-cpm.yaml | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/pci/xilinx-versal-cpm.yaml b/Documentation/devicetree/bindings/pci/xilinx-versal-cpm.yaml index cca395317a4c..133a7a74e6ac 100644 --- a/Documentation/devicetree/bindings/pci/xilinx-versal-cpm.yaml +++ b/Documentation/devicetree/bindings/pci/xilinx-versal-cpm.yaml @@ -14,17 +14,23 @@ allOf: properties: compatible: - const: xlnx,versal-cpm-host-1.00 + enum: + - xlnx,versal-cpm-host-1.00 + - xlnx,versal-cpm5-host reg: items: - description: CPM system level control and status registers. - description: Configuration space region and bridge registers. + - description: CPM5 control and status registers. + minItems: 2 reg-names: items: - const: cpm_slcr - const: cfg + - const: cpm_csr + minItems: 2 interrupts: maxItems: 1 @@ -95,4 +101,34 @@ examples: interrupt-controller; }; }; + + cpm5_pcie: pcie@fcdd0000 { + compatible = "xlnx,versal-cpm5-host"; + device_type = "pci"; + #address-cells = <3>; + #interrupt-cells = <1>; + #size-cells = <2>; + interrupts = <0 72 4>; + interrupt-parent = <&gic>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc_1 0>, + <0 0 0 2 &pcie_intc_1 1>, + <0 0 0 3 &pcie_intc_1 2>, + <0 0 0 4 &pcie_intc_1 3>; + bus-range = <0x00 0xff>; + ranges = <0x02000000 0x0 0xe0000000 0x0 0xe0000000 0x0 0x10000000>, + <0x43000000 0x80 0x00000000 0x80 0x00000000 0x0 0x80000000>; + msi-map = <0x0 &its_gic 0x0 0x10000>; + reg = <0x00 0xfcdd0000 0x00 0x1000>, + <0x06 0x00000000 0x00 0x1000000>, + <0x00 0xfce20000 0x00 0x1000000>; + reg-names = "cpm_slcr", "cfg", "cpm_csr"; + + pcie_intc_1: interrupt-controller { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + }; From patchwork Sat Jun 18 02:44:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Kumar Gogada X-Patchwork-Id: 12886191 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E27EC433EF for ; Sat, 18 Jun 2022 02:45:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383937AbiFRCpV (ORCPT ); Fri, 17 Jun 2022 22:45:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383936AbiFRCpT (ORCPT ); Fri, 17 Jun 2022 22:45:19 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2056.outbound.protection.outlook.com [40.107.94.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA0566AA73; Fri, 17 Jun 2022 19:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DoPxkTxc+kh+L3hJaFXeF8YrxO3uZCFOxhDd+J3PJoZDJ7wkuz8PjQkxFV5vpZL62cT+V4p5D6fQpDcg9EJKMeq9Sa1uxAVR9z8BtJsLYbornu05wVmWMHInsUvGiixITqS1QOFtNvZCZVPbF4QItEeDllYBrsmQCUFIicwZ0WNEEJRZCBRipCmVmXIX/OihXeWuv+vCYl3KYEB5RGD2OvFSDSHMRXcmjTkaD4eMjhi7FrJf1lE/7sfQriEQQLNtmti4nEKOeibc+qhad9J98WzJpRbUgy/n7LDgpa+UUVGv1qzMJktYqhit8UgxGm+gN0fPzmtK31UGWjjA/uCZ7A== 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=lJ2RMDeBBUL290SYRRhu3qCiF5XEVuN/6QlCMSYkVA0=; b=jJT+fMWBB/gb+g04KLRRTmvJagCkbNanHD6RivKcHFiRYHcicBCB5x0appdLtGFZQ/oHxXvUit2dMEnxkT1tFMGqjbhsPFKs62snsckeSfIkoTjqv2ZlausK9jxYlJHOtp6fZ4NnneI59DH1klB7CwEgC/WRJqFU2OXo8+dVQHxD+bxjjiZlbji0vHyr/XIwg1rB3tkNVS3J0iBWCzN9twIQnWUGt28kapQ6JCvJPBoUOhdNijjVAAXgJ5fD2IK9hknUWNJcTB89ai/oz91XT91z9p96t4uABa9jN5A7OlQS5ux73vq5p7A4biDw/B0xmAL/e7dYr5cROyOZW13Yuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lJ2RMDeBBUL290SYRRhu3qCiF5XEVuN/6QlCMSYkVA0=; b=PqYul5uCqZpElYoAK0broo0K2LniLV4pmAIgAPyPz+TAN6dQAjE5a/Fe7KBEXcln43QD1FF/3o4lKYV9ZJvhsaZCP+2t959o42qPCjBVCGcdSj0aH9mvuR4E2RPqGi4ez679sFAE4y/HNIyf4TRfOtP+7TmqKqd1hM6wE0utOJk= Received: from DM5PR12CA0007.namprd12.prod.outlook.com (2603:10b6:4:1::17) by MN2PR02MB5888.namprd02.prod.outlook.com (2603:10b6:208:11b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.15; Sat, 18 Jun 2022 02:45:16 +0000 Received: from DM3NAM02FT041.eop-nam02.prod.protection.outlook.com (2603:10b6:4:1:cafe::66) by DM5PR12CA0007.outlook.office365.com (2603:10b6:4:1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.16 via Frontend Transport; Sat, 18 Jun 2022 02:45:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; pr=C Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT041.mail.protection.outlook.com (10.13.5.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5353.14 via Frontend Transport; Sat, 18 Jun 2022 02:45:15 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 17 Jun 2022 19:45:10 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 17 Jun 2022 19:45:10 -0700 Envelope-to: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, lorenzo.pieralisi@arm.com, bhelgaas@google.com, robh@kernel.org Received: from [10.140.9.2] (port=44908 helo=xhdbharatku40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1o2OSU-000FZO-Ab; Fri, 17 Jun 2022 19:45:10 -0700 From: Bharat Kumar Gogada To: , , CC: , , , , Bharat Kumar Gogada Subject: [PATCH v5 2/2] PCI: xilinx-cpm: Add support for Versal CPM5 Root Port Date: Sat, 18 Jun 2022 08:14:59 +0530 Message-ID: <20220618024459.7554-3-bharat.kumar.gogada@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220618024459.7554-1-bharat.kumar.gogada@xilinx.com> References: <20220618024459.7554-1-bharat.kumar.gogada@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ac280487-2110-448b-08d6-08da50d49340 X-MS-TrafficTypeDiagnostic: MN2PR02MB5888:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D5vfUv0ZG9rbbwYAd8gvtbEareQDurULxwnXOngGNIj6mrZ7NCztRLwliti+67YBu2bC7uEQeEw7h/9E4Qk779SjMhOqud2APAuVgn6LoOsdhQMeIalJHbn9z3lZv5cVL/54+YqzqyMvOd0xO0C4LvzFcVInr8x9u+XjrqTDGgsxPfIbzG5mveAhqK7rTmDoLKWdA4jmTKJxuOjSYmMjawZ1KAY8WMlBXs8yWT9BQOEs88HCjxCIhKEeEHq9rSAAhHg9eiKXGsrgsVNTt+JRRQZS9BZZQ656u6kGbVCnq9rW8Qg/yhgb45tPIiAX+LWq2lM/3LiyEXWCyMGzj/b3/zn6AmbodwUlrspMQUOby+s5JKZMZgU7WFSPji8LVm4Ti1W8uAepBsI0QUoqRLoOcAWaT+xLNnDCWSLjPSydrttDp7z8Xa5gQFp+CaZKhnwe3ZH42jWq9cWHVhVP3Vj/vZwsZn2qnwMdNRxjiNAcLYc+RWgbfWm4oZMKsz38fhOp+otGFvoRzfIb+6XcmChVarCh6+hho1ujSTBaEFshdfxh6sKZHAwWqtymxHQIZOcobvVfMJKaiZjlRSK+t3paj3y3bzf2q1Xkpi02v/x0l0dcl9zL7wjJbRjUCcjusPhfmUPp8DToHxZjiqRBv0Tdj/G5yRezsp83eI2jDSbb0nCSN6rpvZsE/5+SPrXptGjI/UlcCqGhABPyaHtlTJ6xmw== X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch01.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(13230016)(4636009)(46966006)(40470700004)(36840700001)(426003)(336012)(186003)(1076003)(47076005)(107886003)(103116003)(7636003)(40460700003)(356005)(2616005)(36860700001)(83380400001)(8936002)(54906003)(70586007)(70206006)(9786002)(8676002)(110136005)(316002)(36756003)(26005)(498600001)(6666004)(7696005)(82310400005)(5660300002)(4326008)(2906002)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2022 02:45:15.9145 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac280487-2110-448b-08d6-08da50d49340 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT041.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB5888 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Xilinx Versal Premium series has CPM5 block which supports Root Port functioning at Gen5 speed. Xilinx Versal CPM5 has few changes with existing CPM block. - CPM5 has dedicated register space for control and status registers. - CPM5 legacy interrupt handling needs additional register bit to enable and handle legacy interrupts. Signed-off-by: Bharat Kumar Gogada --- drivers/pci/controller/pcie-xilinx-cpm.c | 62 ++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/pcie-xilinx-cpm.c b/drivers/pci/controller/pcie-xilinx-cpm.c index c7cd44ed4dfc..0bcd11d27eeb 100644 --- a/drivers/pci/controller/pcie-xilinx-cpm.c +++ b/drivers/pci/controller/pcie-xilinx-cpm.c @@ -35,6 +35,10 @@ #define XILINX_CPM_PCIE_MISC_IR_ENABLE 0x00000348 #define XILINX_CPM_PCIE_MISC_IR_LOCAL BIT(1) +#define XILINX_CPM_PCIE_IR_STATUS 0x000002A0 +#define XILINX_CPM_PCIE_IR_ENABLE 0x000002A8 +#define XILINX_CPM_PCIE_IR_LOCAL BIT(0) + /* Interrupt registers definitions */ #define XILINX_CPM_PCIE_INTR_LINK_DOWN 0 #define XILINX_CPM_PCIE_INTR_HOT_RESET 3 @@ -98,6 +102,16 @@ /* Phy Status/Control Register definitions */ #define XILINX_CPM_PCIE_REG_PSCR_LNKUP BIT(11) +/** + * struct xilinx_cpm_variant - CPM variant information + * @cpm_version: CPM5 has few changes compared to CPM block. + * CPM5 has dedicated register space for control and status registers. + * + */ +struct xilinx_cpm_variant { + bool cpm_version; +}; + /** * struct xilinx_cpm_pcie - PCIe port information * @dev: Device pointer @@ -109,6 +123,7 @@ * @intx_irq: legacy interrupt number * @irq: Error interrupt number * @lock: lock protecting shared register access + * @is_cpm5: value to check cpm version */ struct xilinx_cpm_pcie { struct device *dev; @@ -120,6 +135,7 @@ struct xilinx_cpm_pcie { int intx_irq; int irq; raw_spinlock_t lock; + bool is_cpm5; }; static u32 pcie_read(struct xilinx_cpm_pcie *port, u32 reg) @@ -285,6 +301,14 @@ static void xilinx_cpm_pcie_event_flow(struct irq_desc *desc) generic_handle_domain_irq(port->cpm_domain, i); pcie_write(port, val, XILINX_CPM_PCIE_REG_IDR); + if (port->is_cpm5) { + val = readl_relaxed(port->cpm_base + XILINX_CPM_PCIE_IR_STATUS); + if (val) + writel_relaxed(val, + port->cpm_base + + XILINX_CPM_PCIE_IR_STATUS); + } + /* * XILINX_CPM_PCIE_MISC_IR_STATUS register is mapped to * CPM SLCR block. @@ -484,6 +508,12 @@ static void xilinx_cpm_pcie_init_port(struct xilinx_cpm_pcie *port) */ writel(XILINX_CPM_PCIE_MISC_IR_LOCAL, port->cpm_base + XILINX_CPM_PCIE_MISC_IR_ENABLE); + + if (port->is_cpm5) { + writel(XILINX_CPM_PCIE_IR_LOCAL, + port->cpm_base + XILINX_CPM_PCIE_IR_ENABLE); + } + /* Enable the Bridge enable bit */ pcie_write(port, pcie_read(port, XILINX_CPM_PCIE_REG_RPSC) | XILINX_CPM_PCIE_REG_RPSC_BEN, @@ -503,6 +533,10 @@ static int xilinx_cpm_pcie_parse_dt(struct xilinx_cpm_pcie *port, struct device *dev = port->dev; struct platform_device *pdev = to_platform_device(dev); struct resource *res; + const struct xilinx_cpm_variant *variant = + of_device_get_match_data(dev); + + port->is_cpm5 = variant->cpm_version; port->cpm_base = devm_platform_ioremap_resource_byname(pdev, "cpm_slcr"); @@ -518,7 +552,14 @@ static int xilinx_cpm_pcie_parse_dt(struct xilinx_cpm_pcie *port, if (IS_ERR(port->cfg)) return PTR_ERR(port->cfg); - port->reg_base = port->cfg->win; + if (port->is_cpm5) { + port->reg_base = devm_platform_ioremap_resource_byname(pdev, + "cpm_csr"); + if (IS_ERR(port->reg_base)) + return PTR_ERR(port->reg_base); + } else { + port->reg_base = port->cfg->win; + } return 0; } @@ -591,9 +632,24 @@ static int xilinx_cpm_pcie_probe(struct platform_device *pdev) return err; } +static const struct xilinx_cpm_variant cpm_host = { + .cpm_version = false, +}; + +static const struct xilinx_cpm_variant cpm5_host = { + .cpm_version = true, +}; + static const struct of_device_id xilinx_cpm_pcie_of_match[] = { - { .compatible = "xlnx,versal-cpm-host-1.00", }, - {} + { + .compatible = "xlnx,versal-cpm-host-1.00", + .data = &cpm_host, + }, + { + .compatible = "xlnx,versal-cpm5-host", + .data = &cpm5_host, + }, + {}, }; static struct platform_driver xilinx_cpm_pcie_driver = {