From patchwork Mon Sep 23 18:59:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13809931 X-Patchwork-Delegate: manivannanece23@gmail.com Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011037.outbound.protection.outlook.com [52.101.70.37]) (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 9D2E41A2632; Mon, 23 Sep 2024 19:00:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.37 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727118036; cv=fail; b=Zs/fDmrN+jY/w0DCRME/xqXqnvccnqbYLmeWZjLV0dqj8A3lSrRSXz1HHdwwzRil4Il8RaSDPc1xzSd8AFxVZ2gnITg8VrbC5bnCrhJpxuQSklVUqr1HIVJx2C2C6fcbF26tc+eVLA1bXKywhHqJXxw+e8Imm47l4fu154/h8nc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727118036; c=relaxed/simple; bh=HmHQZfq9L8UmM2u5lYQ3fG7uWgmbd7LJLFR4sCzXQBI=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=lYk4sjucUnjddfmtPxXSJXirFAanXYQgs9SUDzMykDX2X7PWgnrtsMkdDrcqCCbSnKEplkwHU/EuAcrpWaZFd0UF5WXr5vxcROtI2E4jSisajM8YNXcU3lrnawQt91dZcr3E2HCzaisaM6mHK48HwHP/rGdLCys2RXkMU0XrhL8= 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=dpSd2L0y; arc=fail smtp.client-ip=52.101.70.37 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="dpSd2L0y" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b/Mts+X+dQr8EZUMqbHFQu+/w5HxZMSXUfneDd88j0NmR5lV3sHoxJDPOgIaWTYgqvpMkiZ2GjNC1Zn+T8YxhoHHegx+d8Y4WGgc20WQAnTnXtfEs+7tdDu8EJSqeBrKpFTbad5xMCS2mfKeV0yK/WmL3FzTo7V32oiL9cLs1y1Qp2QbaQ3GR0uKYvlZMtEXtWO7Ah51mHmmsnk58+G/OAf+IXgx2M+QS8rU5G0isHOYnk6mirqqDNWZr8gw0Y7nVx3A5REptR3TYvaQT+E6v6VSgHoD2Nxg9I567aaiidX8zoinlTCJrWiawyphSN/rmKoGLJYdv7nF+ojbKpGa4Q== 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=hNBQub/0c6XKxnoL1eJNqowuPC2/Be9FImQcc7+deUA=; b=huP+5l5392pzN7qkZYicB06bufmn10JtrStOlHir0hCcL2E+jJELPbwBHhkSlDe5RPQcazAaRGv799eEL5ceQXCmVgQ3qSWlegGhOxefHiQ7/L4tuiJAJttbHoLpFMnJnaO9wO7KCf9zIVYuoU5n9TBxeg8E6FKQkQQXOVCD/AQGB3pFTDTdDhQJ5ivr5czOHM3FV6ty7ZbydWbaDLuPEjJ8+rIqevaW16ngNdg5Rzcgr1yKjdCkrnFYwCL9dX6JKSSdPHzxRLQ5q9+DF+TtyDqVcp1PArlXl8dGS4x5IqRyQ0RS4xZvnDrNJ/xn1zJ5S3EAuBXFaFWOow7raGpewg== 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=hNBQub/0c6XKxnoL1eJNqowuPC2/Be9FImQcc7+deUA=; b=dpSd2L0yLSH65GCbN1mlNDMmrDgdVUA5DIZIZCTWxRx9uUds2UF4IdfTtvu2ZYWxVt3qOLyLMBR/roLhJpTQGm7gE5PEG7WMHIgGfFs7Q5I2DRMLxiEXRio3xGQ1apXC3Ohf8og9FCBWMxjN3Claqr7ZD7tWLuQatXPkjH7E/iHzK0zeMSfdIkULkti68MBpxtHeW4Z1A3bNLn5sfAgBAM9BPDql2lrW5UIEiPkP4pi/SIsuYaAqTmQzWGNaB3teqk56U0owcQHMVkZoDtfaZdukPwlfJFw53GudVNZxOcOLqbWwYf2ECX3O0yrcBjS/ldJmNkaOjkvbFKsm4m3fJg== 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 DU0PR04MB9562.eurprd04.prod.outlook.com (2603:10a6:10:321::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.24; Mon, 23 Sep 2024 19:00:26 +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.7982.022; Mon, 23 Sep 2024 19:00:26 +0000 From: Frank Li Date: Mon, 23 Sep 2024 14:59:22 -0400 Subject: [PATCH v2 4/4] PCI: imx6: Add i.MX8Q PCIe Endpoint (EP) support Message-Id: <20240923-pcie_ep_range-v2-4-78d2ea434d9f@nxp.com> References: <20240923-pcie_ep_range-v2-0-78d2ea434d9f@nxp.com> In-Reply-To: <20240923-pcie_ep_range-v2-0-78d2ea434d9f@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=1727117997; l=2309; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=HmHQZfq9L8UmM2u5lYQ3fG7uWgmbd7LJLFR4sCzXQBI=; b=BnflfNkgIwTmbgTStGai5DnLd9Tn+4c6USz+hjoFnoHbBCh+KqffAKh8tYUR0tLthX125iwHb /OQBnkp/KYCABs4BCn7J4f4MmG7hE4HRXGCGidZkQ687nj4j5Uq8X28 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0065.namprd13.prod.outlook.com (2603:10b6:a03:2c4::10) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DU0PR04MB9562:EE_ X-MS-Office365-Filtering-Correlation-Id: fa589a06-aada-41d2-a397-08dcdc01fc68 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?6nSC/zLbum1z8Mz6UFb2V93d1kgkwAO?= =?utf-8?q?TiwOxthF2WkpqA8tw7UC19bFU5rdLfAHxCB3QkkT9MKv3CCxOvQgG7hx1W5QUqzIb?= =?utf-8?q?GXVKaqNbPwAx9ekVxd9QvGjdh84SH06Em8he+xys9/MtyuWPVOc8HbAaLIvbXPdqI?= =?utf-8?q?684f7PDgmK1tHu4z0R4TzJYat6gj+4nG4CIjFAF3pe8C8f+5MoznbAn1cewHV4/ly?= =?utf-8?q?n3UxD2xUFIhg4FZ8vkz7ZC+4Is7tv4u7xTjpl6Omfk/kitiXavQFz8t23y5V3Z4/8?= =?utf-8?q?hW8p+BcQnwwEcHBfwVQX2hmDwHGfh61h2b2+I3INzDjw/e0TIZBDPmHIkkRysSQt3?= =?utf-8?q?KXBdz1noEbGBiptLBcgdarUhvu+QFScCiDZo3L6CNfMsHUVJI2wgox5ltaBfnvBgD?= =?utf-8?q?+wenSlSw1tDddndWS/KbukeY2lkNscNCCylzfRP9ysq140vO5xvlE9tPmwLW5MRX9?= =?utf-8?q?a6FQq5hZHX4H79KGgNbWMlw0ltviOdRegHGiNq8NG22GwTimpFmvHDq7JgQ2Zy2X/?= =?utf-8?q?5eO7Hf/lbjr0OM1HdYHYLK5UzUk2b1EmIiJcOj1i7isLXiTi0SLgIfMoMRRccOK5p?= =?utf-8?q?9iLTW4bgyQeMlEUmRKHJB38p+bYUeI1wjQie4zkRGRgOiOLcJX6ZoQEp68Pj6jter?= =?utf-8?q?pL6e0tFL7B07AoLZ/YTOvVGyX4Xl5sQSKpwAX7u+nRlyrxtLBezJz4Q1htpEkDU6f?= =?utf-8?q?ED5rAySN55qakWPgbweqGmvJ2YXcvnny5KgsUEpAEaCAtZZYEJ86hmMpC0ZYOTk+q?= =?utf-8?q?2wi+Ry5l01fBsOVdKVyIHl+0OdLAPO7QzD3Gp9RRBqWr4bgxXBtPhR+te/9/Wr33L?= =?utf-8?q?lAPxKV/42q+0AKvU/DLYNkgWJMbkDgR1JUEUgJBNVr4dlt+mg498B2njSg47IYx73?= =?utf-8?q?tqO6a9S1YdY4EF+q04gY2FoSPDnGQiKyNMyewquHzhRx4I20J8YFNZ5/RrtdURXvN?= =?utf-8?q?V/6RMJCdYxC8v0L87YNuCpaLKWGMOvQHAnvai0GJO+gMR4tMwGP4omLtmPV17AvQC?= =?utf-8?q?UVpXqwyF1Oq1JOBYsrgRyDW1HrRD/8AiQXvR/2LqOzuSbr+PiCyJGYvkp09c8YvL7?= =?utf-8?q?GgDscVz84xoohbLuEZZrUdwbJyHLTsvMNcPqMwtDM4a+SWo3zL0qOHrPruqD4fEbI?= =?utf-8?q?P36MLMK9aoDv4NKjxA4YENuxxvFl8rSCSdcj/xHxxtkdNm1/z0dFkOFSYH0Y6S93d?= =?utf-8?q?M1ym14W9KpMHxewrQPJouUo3rtThijBMisUrhLFcBGJrsrXIxGk+7iu1kdaeL0LuP?= =?utf-8?q?aBNFGGvBt2Qhp3b3f9e0MSmuNfZegIWcUO5fKxfQ3ezZRZdwq/KcnlQ7bpIG1IUM6?= =?utf-8?q?s6vWEMod9ErWKS85aE9hMYl14c6/exPstLc3a3A9zcRTLNa44dlyFdo=3D?= 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)(376014)(7416014)(52116014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData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UNFDL4qkRCMg1weoNRZxNO4yACkqZJo8+HKK+6vp13yJ8fUYF8KVFw0Ufwx?= =?utf-8?q?KCoQE3xJdjF53uAVFUaTFri4LAKrh7bpfT5vwLqJHVqxdZrZCZzo/5crzO4BbBmxX?= =?utf-8?q?pCe6G3c2Ikwj9JRVtAhSfaaN1l+MRm2so9Cwuega7wleBLUuDyXgmGa5bPS0KoflX?= =?utf-8?q?DGc/Ru4Vve0ZAfyyXkxF1w0fCQq/sk9bSXKPLo400ZtbjQws6G5fHKx473RlOoC8U?= =?utf-8?q?rbY0XyYRhPKI7lW4QYOaRqAPAi2sPP3QGH1xtseEhM9O50j1v7kwky4lSZryaWTVY?= =?utf-8?q?IjKbgik9GGEoxI1o1RwlYO10UMOaWawGqAs+rwqqt6xbrbS56PvC6HLNDmwGAfdEm?= =?utf-8?q?AxxmTpDEelHDiSx8C83+6gSg4nd5l9jneKcz61L7pmr9uDgm3jUOGXf8QdRGRtjgq?= =?utf-8?q?aPqaCfWf7Yf/6Dz6/6uf5tHIWZdSIBQsoefsxGCmX0Qm6CoUAixjPUXmpHxpr+HfQ?= =?utf-8?q?LgE8Nny4LRR7ldQm2kxlyFqJf9oUkjl2EFQqrC0zaN38HiPrR6YsPUmBrdfZhSQbL?= =?utf-8?q?2hwT2pz7K9hTDkf/AszR1RwTFDs/msdWlOBwz4ecug7ZpvdsJwC3AluiwccJ7iJVJ?= =?utf-8?q?XUXgXKJr/avMMCOkuqB00BtmGoxvGtiID2D8kg9GqzWn5CEGR5Uuj2HQ=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa589a06-aada-41d2-a397-08dcdc01fc68 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 19:00:26.8393 (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: xg211o7gQLBjfzD0oLvSh51d9Le4VxCq4rZIir2pN+NzkxjgGdVE4e5IXesf5ikg3Ym0zETFN4YKjKE/bpGb3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9562 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. Signed-off-by: Frank Li Reviewed-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam --- 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 bdc2b372e6c13..1e58c24137e7f 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 * ================================================================================================ @@ -1645,6 +1656,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 +1693,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], }, {}, };