From patchwork Thu Oct 24 20:41:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13849685 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2051.outbound.protection.outlook.com [40.107.241.51]) (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 C33B42185A1 for ; Thu, 24 Oct 2024 20:42:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729802562; cv=fail; b=m32NWKrveRJ1A0UOlt9bzdMz9dtqG7maLFmGfT/abH9sM//qfoNzxXKezRoUqWMdWAo6OvTL+hwWM7FCRdC1blVPDF1GWSHdEkE279f0sel4erdqhULLnUjWjBTgohWP0ooPF2zMBftB46oMV3/axOVXTvNOmpJgb4vaOlyI8rA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729802562; c=relaxed/simple; bh=i4d7sd3yQU/0Cg6+DkY2bKY+7qcWwb5wLX8OMJ1co/w=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=aABoXAM9zR6ryyXFTYzwr2ZAaYBVdAq52bVfzUiQ+REkDElMovFLljGvPtB+b1srmoHzV5rDTRySfJpjRxCx4kGak9VmoRKRdDMhp1FKTjIVpvUsHMTEA1dDx3AbeofUR5INe59MsQM7gAznGPBhq9+e5REsU4gNVfmp/so434s= 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=OTmoVbSS; arc=fail smtp.client-ip=40.107.241.51 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="OTmoVbSS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Gifn+qoJuVMTh8ayl2p8U9HO9/sgBTlQbOHDco33+GrLkSSXZ2DkkE0fUVuZxqjiav+I9/MEpBiJ8rui2CgebUyX++VR1fo13AJcnOyJdjMBQilN2JfqC6cRdr8XA55d4MBtSpEHm8ArWHNbP6QEEGcIxc2HuZsNdxCLb8BHUTjqOPeBAbN4RXeqY9h4+AEDiUzflTQdovtknAz2JiH9mus0QsMOvMKBgaMBm77lLzCOMbiVy2Ng7TjMEBD+a2cpteDD/dpwr8dGmDzuGSzgeoUEZ/l/oNTwOvHte8wlw51BXBZQF9QXXS6h4T+OnyxNBD5yv/D2Y5jpdubyceTfDQ== 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=6Aii/uNy6ZXcLmek1tL8aJJUKXUMsseRVTsqG7jcHas=; b=ZOeoSSMPQ5Sot6qOL8kJ6EJCJ+koRkhXI/gwjy3KAGsEwJGg7BPDxAq2U3IsE6o5d+TNztsFGRMSW65DUHKERTENRJm6mI5Pk4DrC9WDufe0OHNbCuwv9BFbkSVqVJgNyTKRNCMoqdhOIAc3d4h3MyXEV+g7JrqGgI8Vm+MotLvCBmtoL8Gr9RmPrawipsJkd3u6LoJgyCuE5TXCsA1YOWUPvP0WKw3qYHrs74mAl7ORYqtrbdRw9Z0rekO9pgZ5VNyZ8RWf+T8xnSKoNds+lDyunU4QvLIt6U5ySoIdB7MGazEp/N/cqiNV0+haf2eCYYaY18jPF4jA/5dvuMv5NQ== 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=6Aii/uNy6ZXcLmek1tL8aJJUKXUMsseRVTsqG7jcHas=; b=OTmoVbSSQH09c/0KQycUIjriY/RkD2LpQlhKUElrI80UenfQkamrMbtuFD3DyAD4TyiojImkmgCLOVMYYr3ulA5Yn2Fs00vZwex8o0K4786GuRtdi+l7tfT3kJbRi5rKApnf/MgfQM9qrLwosET3aYkXbZfkgVbl79QF+6kzq8LanAl4Olk6G5uFro4xB8kWXMITGh0w/2oVwWouMP2T4Yg9DyXK27lIuDcw5VuUKm7aoGgj2PUJjzFVTwmIBLWZb6b1vEGrBruF2HF/iNbStHYjVFBhZtUjQTqHzLx+wswArOFm2u5A+rxs0NT3IdNFur1/NT4NXDcdxsoWKkWCQA== 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 PAXPR04MB8223.eurprd04.prod.outlook.com (2603:10a6:102:1c9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.20; Thu, 24 Oct 2024 20:42:36 +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; Thu, 24 Oct 2024 20:42:35 +0000 From: Frank Li Date: Thu, 24 Oct 2024 16:41:46 -0400 Subject: [PATCH v4 4/4] PCI: imx6: Add i.MX8Q PCIe Endpoint (EP) support Message-Id: <20241024-pcie_ep_range-v4-4-08f8dcd4e481@nxp.com> References: <20241024-pcie_ep_range-v4-0-08f8dcd4e481@nxp.com> In-Reply-To: <20241024-pcie_ep_range-v4-0-08f8dcd4e481@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=1729802524; l=2809; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=i4d7sd3yQU/0Cg6+DkY2bKY+7qcWwb5wLX8OMJ1co/w=; b=n/QBCb8gXv8fK+/RmW+tOA/Iv/5x6pK3TBnUbHuZgoyU3+BeQJf9sj7HTQfn8cvvfG4OSPbKX zPGv/lkpaGqCBe1sMS9bPhdGGVVCWnubxf1Z1Fmui94v4KieIR/ZlRL X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0112.namprd13.prod.outlook.com (2603:10b6:a03:2c5::27) 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_|PAXPR04MB8223:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a75c20d-9326-4e58-30d1-08dcf46c645d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014|52116014|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?2Awmjf/d5JR3jDCgH0wpnJMaY0Rxr2f?= =?utf-8?q?rdOj9fZCgYAG4h5OzkwUIL/k9ksQjLgYY6HUr2wXNpmyaJpYj801FG5bdBP90KE5q?= =?utf-8?q?OuNpkzHcXIznF5Q0Ir1+ycrUOKWqOyGQqi1ssilE9ojw2hYN2XWOFO1ug1jhL9YqT?= =?utf-8?q?/X6Zek4KEmJAuH1eJlOTHJZRZ5CXf5c+AWChGAhelvxUgDfAj7piqhOVWIxpB3uF4?= =?utf-8?q?+JCXvgql9I1Sypx5ppcllmRYevWLn/RSKOhxHETuW761ysz8Vl3sJy9x5YYqXErXq?= =?utf-8?q?VrWdJkROCjQJCyJjqCApju2smq5ph3VYUNNqB4/bMJMgaqqgoKsC/dVJojaa0uF65?= =?utf-8?q?ufPBbTBV9KTfeAuY4nXidM7Ln05wWCXJasDW+91peI6nlqqPC+ZXiB3vinVDor39B?= =?utf-8?q?hg+DyeQibNqJA0+ETl/TTH4GPas8osjihv2lX8onEyMj8TomK5jAKzJMi1lN2+1Ic?= =?utf-8?q?Vsanq5r6QMdymLHe1wvkb/bmkjr3Qh0gWXsWyIOCTD3cLN9NXlt5CamYbO7UCAi7T?= =?utf-8?q?3CBV1YDZXEdhaXLLCOdZqUHUSvsgkK0tfDduXmLN86uzmjm/IIIgrFf0g4VF/0ULN?= =?utf-8?q?Eyljl+3vRAaIsQq8Jh8zBgKg1PmT5g2rHTj14PoOWepc1JLPmibDZ3w7DRYf/RPjn?= =?utf-8?q?BG9SE58SCFN4tKGVeJs4B7YHr51lhMfaR4dEZ5/vWqhYOMrdj6f/0vgmRDQpFld/c?= =?utf-8?q?yc1CByQJ1FQ7TUh6hbuHa4O/NAe8xdqa3JbcJV9H4F9MFxILEKBW7hkf+/RiRYGRS?= =?utf-8?q?u6J6ffJjmINEU2InPmv5DM+iq2e8tRC9SoB7j8FZvl9bLv9zQbRqS3i5WHE3h5Dmi?= =?utf-8?q?AdZlO6r5x4YJpANXdQKhYDXB6UaIAvBPa9JIWMG8ihVBgBXx+GawgeqFFpg63s2IO?= =?utf-8?q?wunNq8NCLHJKiycs5CYJGtBgV1kiQRgyPywbz8vWFWMC8mTXI7w28ht0m4Xie9Ge8?= =?utf-8?q?ELy3TloqHXXx+uf44JNSXbkCI0ld7gihMbkz+/ihGTxKdiFayxkNYBMcgRst15TAF?= =?utf-8?q?PVBbPt9v59A+XHomGpwjSfjsmy5BCXhqZgOk0knsKcdSR6LI02PzMF0AC2gXigeNG?= =?utf-8?q?o615U1c3OclpzcHv6HXg1fo2WWTzyxu9RZWQ5xVD68tqxB/VadgWQmWBDdH0ljsec?= =?utf-8?q?mQofVxdaLT/+1AUdMCM2KA/Mgp6UoDymp7k1iAdPRypNLdhqX30LR9ynUCAf6AiZY?= =?utf-8?q?qZvZrfJe+Qc/z+OBGitnQGBlA72g0tmmVuEAeO/ps86ioHsOf1Nkvl0v/U3ANLZ85?= =?utf-8?q?yYSrOv/m8goyqBIxBkAiovYkJ22pIhqg6PPFXSKdWJOetB/gdPfC+LVwQJyjcs+qT?= =?utf-8?q?j1sDirOs6YVt?= 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)(376014)(7416014)(52116014)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?SvXYqFGxhZUrMruJW7+sUbRn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9cpsYG5Vp8x9MjmHsZlEXtPG6pSg21tQWhMBfsko3ETWIuVkUZK48b161s0?= =?utf-8?q?Gztn2fNcm4cIfJpqvB/6NK8gD1oY2AEa5wuueUPObiL4oHrgv7v68firvNTYHVpZQ?= =?utf-8?q?/15QMK9S9QM4EdDlF6eC2xsUTBZ2HO6MjhnKvUtsMg6D7J5qTh5sIEhhvkqlj1u2i?= =?utf-8?q?59gPPtQgsLdD+CHzuA/OdKj0jZPYPebQ3iKSIycu+p8NP2kTS+SeOQ+gWuxfA9vdh?= =?utf-8?q?2CSB1qXZm0j+Awgh+r68nGNyWuoqPRedCxPHpHKmqCGpTOvkjMN6eK5YleFkrr7dj?= =?utf-8?q?imIQhvBnyqfHhegk68qOXrnMXI4LD6JzAigQYrRE7jz5J22ifYMsyNWHHuh0KgRYq?= =?utf-8?q?nMbh0CCNbfee4WTwe6AyOwu1S1FENO8wK5vrE3Cm5CamwaJtpPekbj6ilEsQD1muJ?= =?utf-8?q?dg3fEqGeBJgXDeSWAqg3HBK/N49YB+X252Xv3eS4npL3IOC8XM/ResEOcKO/m4r3c?= =?utf-8?q?4pKuNfZyaVUo+51JTDhfwwIWHJXAj8aQ6mTtQOKkOauIrVrFj3PTCaUc4X0kFvtIN?= =?utf-8?q?Ogq0YAu2DAi7q+x6SN6FD6ndeVbjalbXOKXnXXMRAdPzf2ABVuN79RCGnZl3oLKF2?= =?utf-8?q?ebp4EyB27va1?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a75c20d-9326-4e58-30d1-08dcf46c645d X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 20:42:35.8805 (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: suGZ4zzq1NFUkGXoBoOx8sBQM8VckFKgsFmhawgacTE0GXfatWzmDmkLXQuHAjBlwXU3MGqCTdoj4GKbe/cqPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8223 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 v4 - none 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], }, {}, };