From patchwork Fri Sep 6 09:31:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thippeswamy Havalige X-Patchwork-Id: 13793775 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 02EB2CE7AF9 for ; Fri, 6 Sep 2024 09:41:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding: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=1YOqrT0AojDcSKqnRtXqUNbpkncz4YmnEBLi7chPvdE=; b=xdsfXb+b+T0VpKxTOAkiJtjHbu RUwLhF+It+kvnFHXGymBAeC5dS1WEphkY2vqeJTo6l5WKt5th85Y2uYhPs5QiCl17XQ4ffFcJR0hl r7Q9Fcneh20CXCCoOBuA1hx3tgcxzhAqCOQptIDHrkTa4xRRogm07h7KkgfJKDIBMdKByy83DA6NA SOGQrgDFi3ZpIgNAEI4qTsYmTNyPDdkaNUvylIiT/OzVqwt4hRn67qFjRwZAEN/B9QHt1BoBfXc5K FvCb4PpjVgBhQrLU7K3BCPXyeipJOcGCiKQHgcD9lVdaZqqDC7dTUH+cKvYoJuT9OfKdtoqjdGZyR 1ijicGHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smVST-0000000BYrL-006u; Fri, 06 Sep 2024 09:40:49 +0000 Received: from mail-bn8nam11on20611.outbound.protection.outlook.com ([2a01:111:f403:2414::611] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smVKO-0000000BWpo-3Yts for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 09:32:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hk7OS5Mkunnb1LbYqD2d1AiShxxfwP8rtxyM7l+mjhFIAjanFX+/JU6G5Q3GXxMXs0qVwmr09TKeccr7sX3ihOubWvHNVHoKBvUcVw1L91Bhfyt3pYeEO+hnuxh6WKCilXTnqnoHqjZf07EdcTf8T8MRRXTbxNqsTDxaBkJ9X4hq3BhvxxKplMYNd+aYXJ0Lu62hcP8+s7sXBK1lsYlLQhoekKdMdQF9cuQZjuY1jRdefI4rip5VSGjAhgz8XGOL7gqxFWfdZzmGAPjKHtoXppyXhjMkIxoxJYdCzLt2v+cHUUo4Cz937yp0+r3BthvlFZls7nX23HHEGBkUSRIxlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=1YOqrT0AojDcSKqnRtXqUNbpkncz4YmnEBLi7chPvdE=; b=lg8ZhwLZRErIS0g5rJggdP8IB6M5mPSuKubodMvU6Pfjh9lznL+6ziEM7W0AXNzuU7XuqG3rW+B7bwtnp4iq4Zf99BJbstm2Y62vRg7mtWBUEwrDKSyXXeEUY2JS++4kCxfq9FttAJGyBpDuZwhHBtsJJSpEYDnx1rYMwdwtwu5H8Dtl3ZXCJ84SakURziMrkDh6g1jGyycojBRGsjAtv+z2+TdFUr3WxhU2DNuvIk/zcPDgz1dHwkdqav8g9iFXOXwOYemM86hHHAlXuGsMUbE6rpcbhsx9SjzAj8yaWjMHgjXZW+jS0S9Us7CWxkSBh8ykBTK4NqVuBJICkfFTDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1YOqrT0AojDcSKqnRtXqUNbpkncz4YmnEBLi7chPvdE=; b=YA/KwICx/6SlidyO5qhxNL3WH6rjzvabD1faC2CP0J76poGn4tjcYjObu45MPsnjkSJ+sn3buPi44LVXt58yVNsp4dt6qXE7hGEldIExRlXyQ/5ZxL89WQ2Z0QJ4soMFYxtGj2jq3goPJpfip80/QI/YEtV9Mb2QzuyfAJ5zehc= Received: from MW3PR05CA0010.namprd05.prod.outlook.com (2603:10b6:303:2b::15) by IA1PR12MB7760.namprd12.prod.outlook.com (2603:10b6:208:418::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27; Fri, 6 Sep 2024 09:32:23 +0000 Received: from SJ1PEPF000023D1.namprd02.prod.outlook.com (2603:10b6:303:2b:cafe::f2) by MW3PR05CA0010.outlook.office365.com (2603:10b6:303:2b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.17 via Frontend Transport; Fri, 6 Sep 2024 09:32:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SJ1PEPF000023D1.mail.protection.outlook.com (10.167.244.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Fri, 6 Sep 2024 09:32:22 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 6 Sep 2024 04:32:18 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Fri, 6 Sep 2024 04:32:14 -0500 From: Thippeswamy Havalige To: , , , , , , , , CC: , , , , Thippeswamy Havalige Subject: [PATCH 2/2] PCI: xilinx-cpm: Add support for Versal CPM5 Root Port controller-1 Date: Fri, 6 Sep 2024 15:01:48 +0530 Message-ID: <20240906093148.830452-3-thippesw@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240906093148.830452-1-thippesw@amd.com> References: <20240906093148.830452-1-thippesw@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: thippesw@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF000023D1:EE_|IA1PR12MB7760:EE_ X-MS-Office365-Filtering-Correlation-Id: d9f89fac-557a-4b03-a6b0-08dcce56cf97 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|7416014|376014|82310400026; X-Microsoft-Antispam-Message-Info: bl9yClukUxYZCOgSCVq8tsz3O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MQjqYH/uqxiI+DVt6RUYzOl29Uoz5mHs9hsWgNNTvMu0YsuiGdA9517DXsF0F4cs5zFw9vceLFMWMWzL/mtMju0MpX4xnJXHh+pFxwJ6RtquONG9qTqRrHs4nw8ixYYvXkoYqKUF1l6DxlPnqMavfHRWy5jcaoLOyatZaJrFhHwoLfSxvtAo/VTwYU7pUA8Vn1x09nN++dqLk+W3ncgv7Tod8u4DfICBbmlLEtekv2sUyyWokxwH2BWpxGOjauhNjeEvaD6uaLTdPt+UmWOK8X1nRYl5lwFfOBDJ4ArErztGv/5Ur/4foz/B6jVQ18Rv3fzwZv4+Z6KHzjbKyyop4XkwheYQKyJyg8= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(7416014)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2024 09:32:22.3380 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9f89fac-557a-4b03-a6b0-08dcce56cf97 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF000023D1.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7760 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_023228_913046_A25314B2 X-CRM114-Status: GOOD ( 13.99 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In the CPM5, controller-1 has platform-specific error interrupt bits located at different offsets compared to controller-0. Signed-off-by: Thippeswamy Havalige --- drivers/pci/controller/pcie-xilinx-cpm.c | 39 +++++++++++++++++++----- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/drivers/pci/controller/pcie-xilinx-cpm.c b/drivers/pci/controller/pcie-xilinx-cpm.c index a0f5e1d67b04..d672f620bc4c 100644 --- a/drivers/pci/controller/pcie-xilinx-cpm.c +++ b/drivers/pci/controller/pcie-xilinx-cpm.c @@ -30,10 +30,13 @@ #define XILINX_CPM_PCIE_REG_IDRN_MASK 0x00000E3C #define XILINX_CPM_PCIE_MISC_IR_STATUS 0x00000340 #define XILINX_CPM_PCIE_MISC_IR_ENABLE 0x00000348 -#define XILINX_CPM_PCIE_MISC_IR_LOCAL BIT(1) +#define XILINX_CPM_PCIE0_MISC_IR_LOCAL BIT(1) +#define XILINX_CPM_PCIE1_MISC_IR_LOCAL BIT(2) -#define XILINX_CPM_PCIE_IR_STATUS 0x000002A0 -#define XILINX_CPM_PCIE_IR_ENABLE 0x000002A8 +#define XILINX_CPM_PCIE0_IR_STATUS 0x000002A0 +#define XILINX_CPM_PCIE1_IR_STATUS 0x000002B4 +#define XILINX_CPM_PCIE0_IR_ENABLE 0x000002A8 +#define XILINX_CPM_PCIE1_IR_ENABLE 0x000002BC #define XILINX_CPM_PCIE_IR_LOCAL BIT(0) #define IMR(x) BIT(XILINX_PCIE_INTR_ ##x) @@ -280,10 +283,17 @@ static void xilinx_cpm_pcie_event_flow(struct irq_desc *desc) pcie_write(port, val, XILINX_CPM_PCIE_REG_IDR); if (port->variant->version == CPM5) { - val = readl_relaxed(port->cpm_base + XILINX_CPM_PCIE_IR_STATUS); + val = readl_relaxed(port->cpm_base + XILINX_CPM_PCIE0_IR_STATUS); if (val) writel_relaxed(val, port->cpm_base + - XILINX_CPM_PCIE_IR_STATUS); + XILINX_CPM_PCIE0_IR_STATUS); + } + + else if (port->variant->version == CPM5_HOST1) { + val = readl_relaxed(port->cpm_base + XILINX_CPM_PCIE1_IR_STATUS); + if (val) + writel_relaxed(val, port->cpm_base + + XILINX_CPM_PCIE1_IR_STATUS); } /* @@ -483,12 +493,19 @@ static void xilinx_cpm_pcie_init_port(struct xilinx_cpm_pcie *port) * XILINX_CPM_PCIE_MISC_IR_ENABLE register is mapped to * CPM SLCR block. */ - writel(XILINX_CPM_PCIE_MISC_IR_LOCAL, + writel(XILINX_CPM_PCIE0_MISC_IR_LOCAL, port->cpm_base + XILINX_CPM_PCIE_MISC_IR_ENABLE); if (port->variant->version == CPM5) { writel(XILINX_CPM_PCIE_IR_LOCAL, - port->cpm_base + XILINX_CPM_PCIE_IR_ENABLE); + port->cpm_base + XILINX_CPM_PCIE0_IR_ENABLE); + } + + else if (port->variant->version == CPM5_HOST1) { + writel(XILINX_CPM_PCIE1_MISC_IR_LOCAL, + port->cpm_base + XILINX_CPM_PCIE_MISC_IR_ENABLE); + writel(XILINX_CPM_PCIE_IR_LOCAL, + port->cpm_base + XILINX_CPM_PCIE1_IR_ENABLE); } /* Enable the Bridge enable bit */ @@ -615,6 +632,10 @@ static const struct xilinx_cpm_variant cpm5_host = { .version = CPM5, }; +static const struct xilinx_cpm_variant cpm5_host = { + .version = CPM5_HOST1, +}; + static const struct of_device_id xilinx_cpm_pcie_of_match[] = { { .compatible = "xlnx,versal-cpm-host-1.00", @@ -624,6 +645,10 @@ static const struct of_device_id xilinx_cpm_pcie_of_match[] = { .compatible = "xlnx,versal-cpm5-host", .data = &cpm5_host, }, + { + .compatible = "xlnx,versal-cpm5-host1", + .data = &cpm5_host1, + }, {} };