From patchwork Tue Oct 29 16:36:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13855303 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 11D15D3A67B for ; Tue, 29 Oct 2024 18:47:19 +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:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mAK1jmuAtg0H2cjB9iC8wvlwe8xRsTxVgM94PH4fUfU=; b=BmnOJ6jjVGaD1Q/ej6tDfnkL9q yukIDTqlkK2k55i0soyPR2k2EOJImRYktd/WaOyIs6ryY73Xd8V2DoPIkmp6HM/+LkqX5rg5WofHn qZLZVXOB0x5EwH7bDvQvnwF0SN9UiJ7wp59+nXgZSsJxS4MX7aHRzjIC9JqwfNSbFQ8hAEyofCRI9 xDnokImlkSWpXSRGFKc7Rl6uzR9wxo2WQ8WsT0Z0/Sb5wlFSlK63pxJkaNI+a1+SvUGlloxPwzwLv 8KZEECagF+K1m1OLe2/PqNzrjsseDMsas8l6FQlsY6FcX4UomoAgYQKbiucZNkYWJ/1PElCawiaMJ sA1wsYfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t5rFC-0000000FXzD-0IBR; Tue, 29 Oct 2024 18:47:06 +0000 Received: from mail-am6eur05on20609.outbound.protection.outlook.com ([2a01:111:f403:2612::609] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t5pDh-0000000F8Te-2FPF for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2024 16:37:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vjjUZEtdarYuod/5WDJaUVGKwdlkVZJCPcn/qHnHMzF6abaq0Db9F2EedvLD6xHzLPpdzkk2DtlLrLNjOd+ZjPfZTXwigHbNa3o08/9OcoHxZAoABOknJNQ+8RyU9GWpB/XeT/eB4d09gk4XH/nBTwPSeAR7L/rZ7IN4iZTfEgQ3/1jsj/TCm35FRc5/DkskbbVc9KRyVf2+aNkPD1xKpIvV1sHihxv6F9OzQIA6/dsp7uvYcoVnqWngn28wDP7d+08qxxqAqTbFKV3V52KiMfnCRkeF7vNNrICss5epnz7/IkmYUUSXUiA48NUrElJY9Cjfdf28PiWmGO2zeeN2EQ== 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=mAK1jmuAtg0H2cjB9iC8wvlwe8xRsTxVgM94PH4fUfU=; b=g4mzzs1wEUbIwKBzN+IfK95/zhyNQUCJzU0bK2JNyyOSw8plLUpy29E0WGE6G7NnLI7icPVgrPtTm8RyMBdQiw+ac20Id84q5hcBYaimwrRWEpMZCp1FRF3E8KwNhXA772OSwij5USJZHy6rEX34ZZyn/2d8B/DwvQe5YpA+szgLH6TOAutWnfiEYQbDBAImvSiLqSdlp8nhKgr35K2x5uDTUjdHydriKLSdcpTJN5ScHWwpCOMNAzIGE37T7vXdcOM6wdJqKyWfFU2xHPyVfpdp78kMR/Jp+lenJSdnHsr7W0fNGOHoeUZe2aFBkjaNzh99C4d35xDWXXnPSUeJCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mAK1jmuAtg0H2cjB9iC8wvlwe8xRsTxVgM94PH4fUfU=; b=RogeAcJ1TjXit+FtFRWMnBe/E4AY302awcPm08U4wVDm+CppqQcbkSPHAlU6debBV1Y9zvPhKSQcbGg8wq3e7/gK+/Nc5lHEY08kKJOaw07ZDqhX1MRhQYHIEoOifhrYfe6LHGYT278JwLTHwVhBnN9hrnwt8wbKCHBSTIrfbrNCEV+iH4M4s4heNzo3lNInLQgyCcXBIZMPPAP+MnI1Xf+pllgTFOWlhJMKMJiYz4Y+ruO+mwTz4e0Zj9T7Gj6+ahM1Vabq1eElCbEiZN5rw/C+Cw5N6d58RX2gGSMQkbIg1LNfjSjuiG+9N5KHRSBZvKCjcQBhmMG2i/KrNDz1jA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by DBBPR04MB7577.eurprd04.prod.outlook.com (2603:10a6:10:206::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 16:37:22 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8093.027; Tue, 29 Oct 2024 16:37:22 +0000 From: Frank Li Date: Tue, 29 Oct 2024 12:36:40 -0400 Subject: [PATCH v7 7/7] PCI: imx6: Add i.MX8Q PCIe Endpoint (EP) support Message-Id: <20241029-pci_fixup_addr-v7-7-8310dc24fb7c@nxp.com> References: <20241029-pci_fixup_addr-v7-0-8310dc24fb7c@nxp.com> In-Reply-To: <20241029-pci_fixup_addr-v7-0-8310dc24fb7c@nxp.com> To: Rob Herring , Saravana Kannan , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Bjorn Helgaas , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1730219803; l=2548; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=ixQDYJyXuHUmAmlzLRMBWxuvNvNweOl8KqjaI6bcV3U=; b=ZR6A8qNeIAYIe8Ph71ciCpzXbLqQYWQXs8YoteOpdZhXLGpAGhyXH345js0CyOgwJBiejt6K0 d9zLkq/wclsDnlAUIFVLSq+dWJTJAnmwfeKWhZ76wQ8E2vJlQnGjfoK X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY5PR13CA0035.namprd13.prod.outlook.com (2603:10b6:a03:180::48) To DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DBBPR04MB7577:EE_ X-MS-Office365-Filtering-Correlation-Id: 1606a36f-a823-4388-7cbe-08dcf837f612 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|52116014|376014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?dgV72XZ9tA1jlDLkPDIqEYVUuwaZQhV?= =?utf-8?q?MAVXRiu+grdT/5gbFBg5s6K3GfYSKzHdffNU+YGQnehtmjcaD4cfZlyX5aBKbUIuz?= =?utf-8?q?wEWzW8WKX7KXdKkO90oYbOKF0m/lpl34YZ33dgCfCbOgIO/J0jZqBa/dYEv61uDCJ?= =?utf-8?q?/c7Aa/mWNQmmVyD2F5JLJg/4xLjpjy3gg7Wn9O8zx/ameuexKcytLdIS0RPmtWBte?= =?utf-8?q?tWtrfCsg/kFPhSdEJ/P2wggcYK4bjwLlEURYXF/9Dexso/GFXg8XxT66XNG3NyoqZ?= =?utf-8?q?g0dQLLf0C2PsVAdvW/IIjj5kNyxkE5GhyzhRyWF/VPSUUqFI6q3kXVQIo3MgkjtLe?= =?utf-8?q?wVcjcC+hbDhHq8zuRo23Tvi1atrvTYsz6NP225NoxqtbJFkatjtk3ZRktbZbLhE1Y?= =?utf-8?q?wdDnRiu6oIyM/RDCosP8A/yP/YccMlTsfhYp8Z4ZSVai31mksDrMv94Vli2zUBdir?= =?utf-8?q?Cp56WyzlldY1a21VWxeXjyz6KAwlDgw+0GSw9kqMI09TRgYIBL7lCI79uYLx1yOsX?= =?utf-8?q?1V4eNxadty2G8KbdJ/yNxTMo6ubP8cGlUEnFVJ9OOgAjDvgge33QY4tL9QuZfXjkf?= =?utf-8?q?5aHp+5rOdD7Xn9KeJvOTcolXIZpJKsYyQTy7aQNwFmF2ClX2z+unPVNMTDM3j9UZw?= =?utf-8?q?PR+e+Qx2OHhMddUWKP8Wt4uZGFcXNyLKBtlBkaj7iltRbF/t3OeadMJ7xQ2bbwubt?= =?utf-8?q?0VVNuLiRxHN2nwxTfvDunpaaYUkoz4HVFbealTqeCI512Nq0CeNIiq5+VlkvSGo1G?= =?utf-8?q?TVZYQev0pe5jlLA0SgElnOnGCDIi9h3h/xCw/T1W8dJIlGUMhd065zQXEI0b+yweD?= =?utf-8?q?qczIumfoBg8guMlQmCC51YjFK0/T8k7z3p2sktSd76oOVl9ozZJVmnxZ9FIelc+tF?= =?utf-8?q?APxjhfB2nlO11pzfXndj327uX2f5VntFiIDMNaeDRWRqxNHuq3UPaJ9c916e7Y4Of?= =?utf-8?q?xvpGzBmrRccCC1KX1uMJImy0i/BiE3qhxdyxx1LBMSDDGzAK7HL0Ay99EzlrSMRpX?= =?utf-8?q?dBvTheKmx7pw5ilABqDWP4hStc/26LGuh1k5ykfEeaBoq1e0zGnMw5g2eq/fXCI1W?= =?utf-8?q?gSBZBOOnSauOql+FlyIXdE4R4ofdoZTt/WJFYCDdleJvUPYSQHQZNWqCvsRSjhd2h?= =?utf-8?q?Bhcv/BkuvhARo1jzW+4hYU/exofstO7SBy6dZGe8VJUGsDb5xtinVWWmbPuAQZS/c?= =?utf-8?q?cwVSe+IzjLAUTajxDY/fjMtY0t86bsYr5eH/sxqNCwIQzU6zzBvITsVD2tnMXK0Cb?= =?utf-8?q?1j9hT60y89qizM2b0ekZMHHc+X47GuOrZqDwnhuoN1wRX7L9BEW/Q98shmVkDqcw2?= =?utf-8?q?aLtQzoUEfflJ?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(7416014)(52116014)(376014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?S5LhGJ53PAdHntbZHzHvlVMpL5Iv?= =?utf-8?q?GHezsBoLikUEkz8j/BsxV/XPUUJG915eQQs2avZWE++T67yA6AW3Q89EBShaRXLM9?= =?utf-8?q?qPsKpiwsRs33cf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DRM/r/o2ckiDNcJ+GwQDC5ZjnqQ6rAxz5Le/YySAKoj1Ol?= =?utf-8?q?KUp3nlUnRRXBIH+OkOUC6Hrurq7XaLdPSiq107CpMdjJPs/9DPBmvMcIt3OgMZHH5?= =?utf-8?q?kHCpFiuzdRNs4v1Q4VVny62eML5aSQfibATGm2P4tqUJ8bRy2h0R8jzC/BAwFvfS9?= =?utf-8?q?ysfCHgLF+wHuaZr1uYVbrapK6d1Xr58Xpr8+3Tocr5Tw60ldHMAcdexwiqBm4hGgA?= =?utf-8?q?6nhOqe+JpD7ph6PCTe7vLZz+dEQvgxm/Thv4ZhDRS0apsoMbM+64QBfuiAjO8lONh?= =?utf-8?q?X6cTIRv+H6IimAY9z2FbjCWwDoCji5tIgUu7ITRibOUzxgeDdK895dPG7FtC/ZUtc?= =?utf-8?q?4cEc59lFr80CZMF5ZYjCiVuY0U1eF/axBe9xgnCOQzUKqnSmnXT2AcQjzQqXuA91p?= =?utf-8?q?une8I+oRGfvqeKqj5kz//rslWo8ZkhElmvREjFXtGOwnz221+Q71ZdBM7hgZa4pVZ?= =?utf-8?q?x8tbuH9YnH0wVlXhtbXIefeabDifVC8Bs41U5p6UQr23GFEoFxlEw2OgzqwuPDLGP?= =?utf-8?q?5zub3eSC910J?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1606a36f-a823-4388-7cbe-08dcf837f612 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9626.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 16:37:21.9389 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XNdJ3e5DblFkhIQSATpwjcg+vxhj00ZALCMQ18ngz3vWmZYEprdD6KbzSwuKAOYDSum6HewaVY9O20TtkmP+TQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7577 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241029_093725_613046_70495B3B X-CRM114-Status: GOOD ( 13.43 ) 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 Add support for i.MX8Q series (i.MX8QM, i.MX8QXP, and i.MX8DXL) PCIe Endpoint (EP). On i.MX8Q platforms, the PCI bus addresses differ from the CPU addresses. The DesignWare (DWC) driver already handles this in the common code. Reviewed-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- Chagne from v3 to v7 - none change from v2 to v3 - add Mani's review tag - Add pci->using_dtbus_info = true; --- drivers/pci/controller/dwc/pci-imx6.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 8102a02a00b38..94f3411352bf0 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -70,6 +70,7 @@ enum imx_pcie_variants { IMX8MQ_EP, IMX8MM_EP, IMX8MP_EP, + IMX8Q_EP, IMX95_EP, }; @@ -1061,6 +1062,16 @@ static const struct pci_epc_features imx8m_pcie_epc_features = { .align = SZ_64K, }; +static const struct pci_epc_features imx8q_pcie_epc_features = { + .linkup_notifier = false, + .msi_capable = true, + .msix_capable = false, + .bar[BAR_1] = { .type = BAR_RESERVED, }, + .bar[BAR_3] = { .type = BAR_RESERVED, }, + .bar[BAR_5] = { .type = BAR_RESERVED, }, + .align = SZ_64K, +}; + /* * BAR# | Default BAR enable | Default BAR Type | Default BAR Size | BAR Sizing Scheme * ================================================================================================ @@ -1627,6 +1638,14 @@ static const struct imx_pcie_drvdata drvdata[] = { .epc_features = &imx8m_pcie_epc_features, .enable_ref_clk = imx8mm_pcie_enable_ref_clk, }, + [IMX8Q_EP] = { + .variant = IMX8Q_EP, + .flags = IMX_PCIE_FLAG_HAS_PHYDRV, + .mode = DW_PCIE_EP_TYPE, + .epc_features = &imx8q_pcie_epc_features, + .clk_names = imx8q_clks, + .clks_cnt = ARRAY_SIZE(imx8q_clks), + }, [IMX95_EP] = { .variant = IMX95_EP, .flags = IMX_PCIE_FLAG_HAS_SERDES | @@ -1656,6 +1675,7 @@ static const struct of_device_id imx_pcie_of_match[] = { { .compatible = "fsl,imx8mq-pcie-ep", .data = &drvdata[IMX8MQ_EP], }, { .compatible = "fsl,imx8mm-pcie-ep", .data = &drvdata[IMX8MM_EP], }, { .compatible = "fsl,imx8mp-pcie-ep", .data = &drvdata[IMX8MP_EP], }, + { .compatible = "fsl,imx8q-pcie-ep", .data = &drvdata[IMX8Q_EP], }, { .compatible = "fsl,imx95-pcie-ep", .data = &drvdata[IMX95_EP], }, {}, };