From patchwork Mon Oct 21 20:07:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13844611 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2054.outbound.protection.outlook.com [40.107.21.54]) (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 D881D1FCC7F for ; Mon, 21 Oct 2024 20:08:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729541288; cv=fail; b=HthRIQo7pSkG+2ZF0QPl30gLsThCYGGLD7PmY15hXpw70LwTvkzOd0ME4Wc3ohOTh7kSz96LWjQ3t/RxTznR8LAkFGPhvrWaSqFG4swwY6W1iGCfAnVUeYZCGzPSL/gqilfkg+qA6P7S08jft+kp3TmFXJx9WlMu983RPCtzLag= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729541288; c=relaxed/simple; bh=BLCZ2PxedJ8sdH0+OO2S4L0OwBVlKQm8vFUPblDgBs8=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=vD3Ij100eNz0lcT15DEvhyzwoDDHz8CGGECfD8Kq+b0hkHVkPQAwXG+ejWH9cLTEg7MrkpbuJz4Wr2nmeMYhqb9CqdryHZV8IzINg3FZECK0NFlaGSIY4lD1MBEGNr/oJCtuwWUczxAW3zX81X6Q2aqjHqZqskvMOPVCUGfpvwg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=lYmXJDMr; arc=fail smtp.client-ip=40.107.21.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="lYmXJDMr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nBtgyFeEcG5A7soUlVllARJCh6L6WawVfy9SEnQDckXPSjjRXs2R+39QEh9cCjVLdsYoZD2tWaQCQMg5w+UNbw51MJr1t+jskgF/qrcLaE0I14AHEEyB30gJGxi3X65NNYrZI0kbNg9O2WJfZWlrtLMUBgEdNh+ZUe6G/QRP/HHff70Gyj+PfxlLSkXfAZcmx3m3zqMUdwyKGjBecrLwbJccnjtXpx7vc24LDzIMZ9gxXE1nCe/iU6Cu/EUhJBJcGZ8yNJET1j1hofxkDs88ETCrCmtQfOS/dYvBGXfVafTP8XdNgnEDXVKhnvCcQQiZcqhWWNQb3kre/bzdS3V+iA== 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=9PyAIWaOdZO0FeU9DlPkmrVDHjIO1344fxwDNX/2GJo=; b=fMGhLNsfW4xdNvO6I9i6ROTpkSmTp2Gdkx9SHuFnyYvYyxj1Spy5yHFU9QVdatu0QTLDcYOMuh7M3yCl0wz4QQEhzqiE6aUn241T9N+Ap/pvnaqVEbybAOBcelhYM42ZtSCXUlD4nKdftVuE1iU5NYoIJrQY9sDy//SGlOvAlH0IOvXwkKcmVmiS3LIOo92O7YOAW7lqb5j/RPeE8bbYDxrRgmIgIE1FkCFKEzXSpMedGKC2fp89yyR6bOeUFjHG5CTwG+fnyYCattLM+BexrOrQ8S9OS1hd/FSzv2OMD8lK5UhOM+UuWUBILfczkzRwvbTA81e+X9CFna25o1JANw== 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=9PyAIWaOdZO0FeU9DlPkmrVDHjIO1344fxwDNX/2GJo=; b=lYmXJDMrq8LdN7l4XN4lNpgvjNshB+E2q3xohRA+rlSz4nd5geB2jhaXIbkEEHFBubn+d1mXlHUTqJuUdATy9NbLUHt2vVzeS83t3jl7VeTZQ5GNcTfzkYWo10YI9R+UywhnutPiaHG9wtG4SiBV8VyOZPb8EoviOW2Xp40WZLPKXVUcEZJtjSOKYuKPPpC0DUHNm2nwPElTR5UHf08L30gDWSWcjhYNm/E0zxp1fIIvYgfLSMTjI4JzeWWXGQ8J2kSfK4HRqSgL5gwnajyMBothHI+OLZzRTDLfJf00hnHLMoN1sX9ckPaldjbf1sM65HPC6XygNxQCC7V6FBFySg== 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 AM0PR04MB6882.eurprd04.prod.outlook.com (2603:10a6:208:184::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Mon, 21 Oct 2024 20:08:04 +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.8069.024; Mon, 21 Oct 2024 20:08:04 +0000 From: Frank Li Date: Mon, 21 Oct 2024 16:07:39 -0400 Subject: [PATCH v3 4/4] PCI: imx6: Add i.MX8Q PCIe Endpoint (EP) support Message-Id: <20241021-pcie_ep_range-v3-4-b13526eb0089@nxp.com> References: <20241021-pcie_ep_range-v3-0-b13526eb0089@nxp.com> In-Reply-To: <20241021-pcie_ep_range-v3-0-b13526eb0089@nxp.com> To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Abraham I , Saravana Kannan , Jingoo Han , Gustavo Pimentel , Jesper Nilsson , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, =?utf-8?q?Krzys?= =?utf-8?q?ztof_Wilczy=C5=84ski?= , Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1729541264; l=2779; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=BLCZ2PxedJ8sdH0+OO2S4L0OwBVlKQm8vFUPblDgBs8=; b=I0Y6HBxi83M21mJruo/UF9A9/P79iglng8Vq/leSNmuBTVJgb5/hHk6IspsBWf8mdE1ifzvX7 fFArpwcY8/IDx/GMhaF07h1l3DIiltAhF6NJflP2H0zWRZ1ryhgZnmi X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SA9PR13CA0071.namprd13.prod.outlook.com (2603:10b6:806:23::16) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AM0PR04MB6882:EE_ X-MS-Office365-Filtering-Correlation-Id: fc65adfc-fdc1-4f44-2792-08dcf20c1248 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|52116014|376014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?/YbLuPTXjRd91bQWOz3oK7vZItGA3cX?= =?utf-8?q?gbbPydaCSu6lw4N1UbPWNujw6jvyqH7yDUxbFMMAe78B05u/S9MUW0Juq1obJ6uPZ?= =?utf-8?q?VSEBTJDtm3axOrRkP8Y0zrljQMpDJ6mIBRs7Y9lbiVaGvX7MgAaxQhvgOtL4/Eq/d?= =?utf-8?q?cUhJZ8Imaw7OH4lve1290x6lQoAtRRrZKprcKrJ6hlLccWlKa9PNFyZJEzfTtkF6f?= =?utf-8?q?nZrtVM9k3NPJhwCBcDS2bq/RhFAu5a2I1SJFR8kcIC7j8cl0naVz/B52HH6wx13Ue?= =?utf-8?q?DCahBJ6haVXq/YOwd7X0SxKcxd2uKn0U05rqettGiigbY+kS4wlg9SfIXiR/IZtZd?= =?utf-8?q?1lVMMr1kftzg10SM0XvkuijwyRT19yQNZk+5pAfj7vBWvHprgZgSy+V6ZoZDct3/M?= =?utf-8?q?8tRxAo/9bApP85xCoId8jl8FU2alN522Z7XYcf/ap8Z6DPbzi3dP1p+WkHLvO9PGv?= =?utf-8?q?4fM7WhRzgsvZmYFU8OlajToG898+QOtRnuXAsQRsmn4e9jAMbZTBqLm6H7ktcSJAh?= =?utf-8?q?3UXbunuiRCwUzAZCg3FUNOfy1VB41nxBxWgXohhxJcXdrO16p1Md9B7FYLp9M2AJP?= =?utf-8?q?TKydDyzLO1Ww1qE/JchEKJTTwQ5CaPaVsvcA5l5jzkhiHsHmgVyj/kEly4LaHL5Xv?= =?utf-8?q?W7wW3+MitMHUQUi2A9Yo0exSo+IMJC4fwVfk+CQyuX5AysEHAGmfINwqTNn4PHtec?= =?utf-8?q?l8JNdm/y/dLH8Njmvc+cGq3mwxfEMUU86Bg22Q76sA9RmTiCMpmkort6RiPiOv8O+?= =?utf-8?q?1eRzUcKVaHeGXBKI7NvSsB1wMiIc3T26SluTQJQBliAPk3GYoEIXX2R1+flHVe5oc?= =?utf-8?q?3gjGz7QpiI/ik7L2Ae9tq3c+Xz4bQF0rEvrLqBgdd5vSranW2y1M232lNjWXJ9n9o?= =?utf-8?q?df7gRIPauQOEmJ8luu+BU1QIn7amU2HPqL9ohXtoNV6ZBvQIQPIDyEmwWe4wrn1Ui?= =?utf-8?q?hAx9PEGEp2QMpS950iLDG5uAm36LyGoT/747ahfMhDFrJp2WrEQ09o2VI33I3GvKk?= =?utf-8?q?MQ2PaciqeNVsrrKnEWI7h7pVLAcLfqdzDGJ92/WPeuOE58hadG38xavT7/12GJzkW?= =?utf-8?q?InpKI+8eRN7XeozEX7toBBTmYEj2bMWyMxOls4dx7oRNfUpPg3MRUHeQdiXleVit+?= =?utf-8?q?MNTldXPbTkrLeFiXgSZRD3dQGNFEpVQReibFWOCaFhWwb+1ZAbOdJEHRaSUpZfld1?= =?utf-8?q?xb7O6c1hjnA0sxl+4WMrpg15FkbG0s9CmC30lwEYYjCt6vSbzcyufnpkM/PyUVwMg?= =?utf-8?q?EgawULFgtNiokTjT24YojEvyBjuJs1EKQzKJ334Mw6NEvlUzXF/SrHJKeA288Y5BO?= =?utf-8?q?0OTmaweptoih?= 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)(366016)(7416014)(52116014)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?QR9CwwbhtTM+mumPszmk9Vn9fXXK?= =?utf-8?q?3sKxk9Zs8ns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QL0t8nOGZFdePvmRpwKkm+vcT4Yv3HvP5?= =?utf-8?q?luL2nPo4zZknynT9FPxvf1GCd4kLY8fJ7JqdCjlXEwGulD1+G2yK1W2K8nC7fzZrb?= =?utf-8?q?zPBm31RzSw+0rk7Nwqeu0tcxnSXg1CipXd8lscNgoiHDeb46Uoub4jHYCqbLrJ5Pq?= =?utf-8?q?2xHWzxnEpDM/ICQYb1sQn7eiDXSyymfUVokxcc2BZjGB80cSX5UV/Mu6+2+M/6IF5?= =?utf-8?q?CrGZTjre/eTPezAym6AB4gLSnLJmBkN62ug7C/xQ7n7/66HLMtrOwV5NNueFw7dSV?= =?utf-8?q?qHC2Uq7nHv5JoiInSWW4NzBVj8TVJDDP1at6kgA4zUvgl/dvub7htZI2ztHi3VbVo?= =?utf-8?q?LcXU3BUYfrDyy5Rc1cHProHLRzmVFu7GCbpbdvNvUwi2HTR6jo8niFns4ZbmwMZAA?= =?utf-8?q?kGZ11AkSEebPzVB/lM3K9jf/HZfZ95btyawLyYa4U4kMa/hN9PK7JLypngX7jldxZ?= =?utf-8?q?h69hzOAu/Hr1M6+MLhfLAo1dqsGAyyBII25vRZlKWM6vOLhAjVW0VYPayukPJYWBw?= =?utf-8?q?tuxeuK8XiwxyA7mOPYJgoseniRIv/1Bj/vLCYFexd8NCxr180f+FwgqLe3uYc3oW6?= =?utf-8?q?GRIDphULIkjh?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc65adfc-fdc1-4f44-2792-08dcf20c1248 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 20:08:04.0771 (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: qUlC8cRfjyuzpJ0t5YnrrrN1Hu4s6s9NcJJMS5gHbwrpYctWUYLTdaIi2LGQj8Kwi/lAtSdRMU8QBp7yVdCnGw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6882 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 --- change from v2 to v3 - add Mani's review tag - Add pci->using_dtbus_info = true; --- drivers/pci/controller/dwc/pci-imx6.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index bdc2b372e6c13..5be9bac6206a7 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, }; @@ -1079,6 +1080,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 * ================================================================================================ @@ -1448,6 +1459,8 @@ static int imx_pcie_probe(struct platform_device *pdev) if (ret) return ret; + pci->using_dtbus_info = true; + if (imx_pcie->drvdata->mode == DW_PCIE_EP_TYPE) { ret = imx_add_pcie_ep(imx_pcie, pdev); if (ret < 0) @@ -1645,6 +1658,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 | @@ -1674,6 +1695,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], }, {}, };