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: 13809946 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 04743CF9C71 for ; Mon, 23 Sep 2024 19:06: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: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=hNBQub/0c6XKxnoL1eJNqowuPC2/Be9FImQcc7+deUA=; b=ywz1YcAjIZwJbx/p5wSRfjpDeV Svzoo0NnPIr9UaqERtL+t3Xec2nwuWXCT1nFQuRoL+vzJdc4lAZIDZ4bD3+85qM9Yrq3t95+Mkf2r PA+cHtml7N4TiM0AnvvWw8OHEhfh+5XXY4pNMILADKEFjau0xDnH3e/bjBEdw/UlaxPV6h0VbtDBo jYPEBvLgLcnYd+z+lQI5NlP7s9KFWy8XNW1YTuWRBW7Yxq3pEYDqSLG088ts3CMPHK/wWIY5eIhwk D61AenJE5aayKBn7YLX3PXISx0NI8VNNi0m86aHRzXTIU1xlS7LUzgij00tPezi/hYA4V+3vyf0BL RX01E9UQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1ssoNZ-00000000KVf-2e6D; Mon, 23 Sep 2024 19:05:49 +0000 Received: from mail-northeuropeazlp170130004.outbound.protection.outlook.com ([2a01:111:f403:c200::4] helo=DUZPR83CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1ssoIU-00000000JFv-0bkE for linux-arm-kernel@lists.infradead.org; Mon, 23 Sep 2024 19:00:36 +0000 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) 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-ChunkCount: 1 X-MS-Exchange-Ant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ACkqZJo8+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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_120034_310634_CD1C6F6B X-CRM114-Status: GOOD ( 12.63 ) 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. 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], }, {}, };