From patchwork Tue May 28 19:39:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13677257 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2043.outbound.protection.outlook.com [40.107.15.43]) (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 84C6C17967A for ; Tue, 28 May 2024 19:39:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.15.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716925172; cv=fail; b=scjPjAHBJ9a4crgyED4LNHfg7DEceyjdL2LV9uc7sB1FLjiBiX4mRnDdFT99gA+pHFwGsc52n62eQIvUjiD7Ov/3nWRKk4lSRaOx1jnvKlIvSEOf3vGrNi2PfzF8BUM6ukGe++t7Cakb6AA+uFXUCN9ACYGkImzJBqaequDLwD4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716925172; c=relaxed/simple; bh=ru5ELRV+Mel4uF1o37Wl87WKzmUjv21jB3Y1hFLGfM4=; h=From:Subject:Date:Message-Id:Content-Type:To:Cc:MIME-Version; b=Q0U/wTbGvj7ToikUhuqTwObjtHOftfKkIKEEtBIQReCD82tpKSTgzpJZQbt3zibAoOsHKfO3c/KUXTeUFkCyaSiojG8qimEeCjO2AVFpMBdLIXZMXABUu0dREBocPWfpNKdsEy1Z66oEYjazRCGTO0HUtMpehHBw9wuElxRmc/I= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=OoeniFix; arc=fail smtp.client-ip=40.107.15.43 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="OoeniFix" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WDz/01LG8x789jldZAQ5mN/xaEN9LkwUo9O7MZf9kdHS+sjDJP5hd2hBvRmKgLzQpxUV/irfm5BAj4ebjCb1agtLtIpHzqoAB+XEYLs0PkCdI8aXPTUSejU5+C9UC5qhA+vdHRk3CIYZYcpux8XQ1qzfCYJ8fqlb5Ko/iDlED+KgOoFImHBT4a/TGcwriwGAAJv9w1DN+5DH11+m9iiWfwlIoGPpqPSRrz0QcoHQYLMbs9zUQK8kQagYwPXtRkFOWIJdxNZd3L+xHN5OgJj2Sfl7jhT0imvOJzR9qwEYK4vPtb06KnP11q0KebjIMgkmaTgCsIVxfLoR6WPcHUzqkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=1izfknJNScEV+R31c8FQJNqtxbY9z0J0ldP6WklXW9w=; b=JNwoGIia89TsGlAPC5wJLQkmu2eNk11Dc//i7uionPbGIXGUYWf2t0nLXL6+5kS02rzwt/9mI8uMbuINffYfLJNDpyqDe1Nqc+FH1tns8bfdFLZ1XGsaVcDjQbTzcU8jeXzUuESz7n42Wwu1WZdBIFzdGd5oEzzHEWMcN2rWysUmrQ7pmzpfT08fssb09OPJCeI5YhBzDsOeOufTFLH36tgJrcaGxp6RhHmcclTFJW1Ad8pOhSgkzo8py/QlXX56cGBpgbGU/Zc/gwwy/F4ksQ5SAgOo7x0QLXzziWyqkECvEsTjKj7nwVBMwo4d02dmYM6ICZdKIz3gOFaG5xjoKw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1izfknJNScEV+R31c8FQJNqtxbY9z0J0ldP6WklXW9w=; b=OoeniFixcB6sDzvTtA1X/K1V6AR0opdszu7Eu67NUZF1n/ji5PQ4aEgHplzx6g09WGis/u9bepZJ1QU4M/oW1kZX1ueVp2sNt32Ga4fotyZbUloV0MxObjam+7uROvvxYSbn7RmYKC37CCDwcQhi/Mc0yleIRtdv8LiJkJaP6xc= 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 DU2PR04MB8663.eurprd04.prod.outlook.com (2603:10a6:10:2de::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 19:39:27 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%2]) with mapi id 15.20.7611.016; Tue, 28 May 2024 19:39:27 +0000 From: Frank Li Subject: [PATCH v5 00/12] PCI: imx6: Fix\rename\clean up and add lut information for imx95 Date: Tue, 28 May 2024 15:39:13 -0400 Message-Id: <20240528-pci2_upstream-v5-0-750aa7edb8e2@nxp.com> X-B4-Tracking: v=1; b=H4sIAOEyVmYC/3XOyw7CIBAF0F9pWIsZGKDUlf9hjGkBLYs+AtpoT P/d0U19xOWdzLkzd5ZDiiGzTXFnKUwxx6GnoFcFc23dnwKPnjKTIBVIWfLRRXm4jPmcQt1xcN6 LqhZaGGRkxhSO8frq2+0ptzGfh3R71U/iOf3XNAkOvKm0PFpENGC2/XVcu6Fjz55JLhZBfVtJt vZQOh0a4035aXGxdPnbIlkLqIRqfKMQPq1arIafnxXZYJ0Fb0taeLs7z/MD8B4YalwBAAA= To: Richard Zhu , Lucas Stach , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Rob Herring , Bjorn Helgaas , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Philipp Zabel , Liam Girdwood , Mark Brown , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley Cc: linux-pci@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, devicetree@vger.kernel.org, Frank Li , Jason Liu , Conor Dooley X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1716925161; l=5104; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=ru5ELRV+Mel4uF1o37Wl87WKzmUjv21jB3Y1hFLGfM4=; b=19keTB9KKbO5XeR7DH1NE/2vTWK2vcr1RgrKbugTVUDl7w3MqeimhKhY1D8BL+HYInkcl4o3C sN4sJGEOIjWCnadOiJK/hlrSJGlwHjsYouCZkf1zOFNs/M8TNyywV/j X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR05CA0021.namprd05.prod.outlook.com (2603:10b6:a03:c0::34) 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_|DU2PR04MB8663:EE_ X-MS-Office365-Filtering-Correlation-Id: 972dd1a9-9514-4d75-8dac-08dc7f4de2b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|376005|52116005|366007|1800799015|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?UeYmonlDb9wM/18KpCwoLLnSp6fdvHs?= =?utf-8?q?n9GTU0WmNUhjf4eX1p4HFyxASQ0VANZ4Vqt8d/p/41SRHOL9zVKucXpq99UC+gXby?= =?utf-8?q?w4jfF+4GXSKo1NFJ5sd2sm8EOrlO0CFPhlMy7C2slfcJ0yPQl6IlYPNdlg9+cJwt/?= =?utf-8?q?3Azj5D+USAjS1cTlHJNf0stiSFQGJHfv3rdT9/OA3w0i2JDbswsDHAQ62bx6Pblyt?= =?utf-8?q?dFRPEwfyfvo4mG8ezlzOPsTPA44PXSvg8MP356kCJUOESH5IX2DOYPxK+mck4S5z/?= =?utf-8?q?UV70Iu3VO5qH8jy4CFZgk2FNSjtFSwlk58rAb8oqzbhZGTgC90JVVCNh+te5jMJk8?= =?utf-8?q?uUgwuz6tOSgrQkJR0rYDInGDiA+QlUCSXkDt6PaoA7ZDnxtkDWCA8EJmE/u3TrKRb?= =?utf-8?q?hec0cB3VfYTC8roXtylaGIU/ElrAexucFyHibFU0gqAGb81nWmLa0RtkdFV4IG9X/?= =?utf-8?q?L7OtGLB5YOMCtrpgvyOTIXnIkvqIBN8STUZsB5WegTTxBuJs0yGo5OBS52xXwTqyo?= =?utf-8?q?U5J/SAEg+Oid0ohH/Y5cgUgJK5WzOI0pKfW/2d5Du8ZknF9k9wMSIXqdYtqm8BVb7?= =?utf-8?q?i9lYlYxi52r7JabSESrfaQzaRMggz8lPkg1JnEuCvCfb9i9CUGEAo3E9b5m17Vg9A?= =?utf-8?q?JgoPHT78aOmyfmlaD1/UItk2pNJAqlyPOXjH70TE9GnB4zptkn+fg1deJUC2BXHBw?= =?utf-8?q?leozdQqYGgBSy9HGBnMR8D+cLFNg79iZ1q3+Dz4biDuAEu1AZ3YQCdB1l/Gf8mCcd?= =?utf-8?q?PW7+Ysk+muQJWxq4c6KudFBQ0iFAceaAL7P1yfzbWh+D6Bk2jkjSUCrraESk0UqoR?= =?utf-8?q?FdXYRKNdAjZvsqq+33juMuBCLxh6nSKKsWwwzXeaCfCbijt7LnuxLOK3EOQcejsQf?= =?utf-8?q?iLVZC2GwPMaFGoW43h0UDO18cYOLarXVp5RTqHw1Bko4vGTF8xgG10gD4dLppaxFD?= =?utf-8?q?DQpWyFnMVSS79oao4iDtIBd0HCU43nPqTHEX7cwkmaEXz7YL7JEVvKMOfu2xpGik8?= =?utf-8?q?2k3lq9l041oCx3wFSCCjT+QDa5k1owR4Yzca/IkOyEcAfmUKMx1lrvmpUt5tv3Tew?= =?utf-8?q?ZdzaS6K1VGaVaqrwDFNBTpDs4HUZ9nQxAujBGRjcJ0MzCcBij0yaZHggO/6lvhVqU?= =?utf-8?q?p5H7BqjbQISvS6eRBgToYGdhgeISWd5w1VZS1MvEPcpOu2fqCbFShJSZhljxRY06q?= =?utf-8?q?9KZSid4uq1xj/cvwN8lnKqiLe8IlAfcPGa0cCME2HL//K1vPAWlW7fWiA=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:(13230031)(7416005)(376005)(52116005)(366007)(1800799015)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?nJPMnAQT7pXjlmIumYurzA5BPF9v?= =?utf-8?q?gEy4X27Fa63PYJZJCi23iethVmcS/6J+hBxY5XGeDjwtEI781h5G0xYNXvehSZ1mn?= =?utf-8?q?HujyumV9L62XtedcSdWA96hJRz5ugnzQeD/RsL0ILvs991PEQpfG8HBqGFTqSTdvm?= =?ut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-8?q?KfER6Uw3SeR2MgWL0IQubXQciubGoPhfgnwnrmeCpw1TrQ/hxSY3OfZj3hDmP7Evl?= =?utf-8?q?4WLB7E/51S/7j1caR8czkxPY2uib1w+QyZu8Cxmj3+bho8u35yVMUpm/LZkdqyWIo?= =?utf-8?q?sFmQsr318/rdGLtpzk8HfvqvV5ewWSqjnocgw+wwSUUSe+U+bytwT7c/ZCCalCVLI?= =?utf-8?q?IYUDgyKSusKfM/2yLVR1rXFDhimBLw4r7n5sSoNxMnyM/z87bJ60P1DY5qKfuHDbd?= =?utf-8?q?O3FFLd1pAi/WP8HpszKw+IkeDapXo+wqfNZUOJaGsOW5lwAVJIqrs8MmgFQI9oNz0?= =?utf-8?q?J0BYIaVsXXmXkK9n2SF68YDvY7hirSM8/oB/CT0o5y34F2cd+cN0ySiICeTHkk+gg?= =?utf-8?q?Ce/6LV8WZ6ZC114NaWHXIplgz4s82CZt7ugv8MalP1bFghr5ci8/6z/XRxMOVs9K+?= =?utf-8?q?WXAksPemJDCpti8WTCrvWSK1zKn76V+nDot8dbUf3jYLjcOQPYMGrJks4iURtDTfC?= =?utf-8?q?NVxKZs7Jz5bn?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 972dd1a9-9514-4d75-8dac-08dc7f4de2b7 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 19:39:27.3671 (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: DWc2aMSi6+PwlkAoXNmpCz0ppCJvvgb3/ZUuBZIGisu/6OfygUO+cIMNhDLH61V/GeYnW+EbvSFnviTrFI/UCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8663 Fixed 8mp EP mode problem. imx6 actaully for all imx chips (imx6*, imx7*, imx8*, imx9*). To avoid confuse, rename all imx6_* to imx_*, IMX6_* to IMX_*. pci-imx6.c to pci-imx.c to avoid confuse. Using callback to reduce switch case for core reset and refclk. Add imx95 iommux and its stream id information. Base on linux-pci/controller/imx To: Richard Zhu To: Lucas Stach To: Lorenzo Pieralisi To: Krzysztof WilczyƄski To: Rob Herring To: Bjorn Helgaas To: Shawn Guo To: Sascha Hauer To: Pengutronix Kernel Team To: Fabio Estevam To: NXP Linux Team To: Philipp Zabel To: Liam Girdwood To: Mark Brown To: Manivannan Sadhasivam To: Krzysztof Kozlowski To: Conor Dooley Cc: linux-pci@vger.kernel.org Cc: imx@lists.linux.dev Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: bpf@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Frank Li Changes in v5: - Rebase to linux-pci next. fix conflict with gpiod change - Add rob and cornor's review tag - Link to v4: https://lore.kernel.org/r/20240507-pci2_upstream-v4-0-e8c80d874057@nxp.com Changes in v4: - Improve comment message for patch 1 and 2. - Rework commit message for patch 3 and add mani's review tag - Remove file rename patch and update maintainer patch - [PATCH v3 06/11] PCI: imx: Simplify switch-case logic by involve set_ref_clk callback remove extra space. keep original comments format (wrap at 80 column width) update error message "'Failed to enable PCIe REFCLK'" - PATCH v3 07/11] PCI: imx: Simplify switch-case logic by involve core_reset callback keep exact the logic as original code - Add patch to update comment about workaround ERR010728 - Add patch about help function imx_pcie_match_device() - Using bus device notify to update LUT information for imx95 to avoid parse iommu-map and msi-map in driver code. Bus notify will better and only update lut when device added. - split patch call PHY interface function. - Improve commit message for imx8q. remove local-address dts proptery. and use standard "range" to convert cpu address to bus address. - Check entry in cpu_fix function is too late. Check it at probe - Link to v3: https://lore.kernel.org/r/20240402-pci2_upstream-v3-0-803414bdb430@nxp.com Changes in v3: - Add an EP fixed patch PCI: imx6: Fix PCIe link down when i.MX8MM and i.MX8MP PCIe is EP mode PCI: imx6: Fix i.MX8MP PCIe EP can not trigger MSI - Add 8qxp rc support dt-bing yaml pass binding check make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8 dt_binding_check DT_SCHEMA_FILES=fsl,imx6q-pcie.yaml LINT Documentation/devicetree/bindings DTEX Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.example.dts CHKDT Documentation/devicetree/bindings/processed-schema.json SCHEMA Documentation/devicetree/bindings/processed-schema.json DTC_CHK Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.example.dtb - Link to v2: https://lore.kernel.org/r/20240304-pci2_upstream-v2-0-ad07c5eb6d67@nxp.com Changes in v2: - remove file to 'pcie-imx.c' - keep CONFIG unchange. - Link to v1: https://lore.kernel.org/r/20240227-pci2_upstream-v1-0-b952f8333606@nxp.com --- Frank Li (8): PCI: imx6: Rename imx6_* with imx_* PCI: imx6: Introduce SoC specific callbacks for controlling REFCLK PCI: imx6: Simplify switch-case logic by involve core_reset callback PCI: imx6: Improve comment for workaround ERR010728 PCI: imx6: Add help function imx_pcie_match_device() PCI: imx6: Config look up table(LUT) to support MSI ITS and IOMMU for i.MX95 PCI: imx6: Consolidate redundant if-checks PCI: imx6: Call: Common PHY API to set mode, speed, and submode Richard Zhu (4): PCI: imx6: Fix establish link failure in EP mode for iMX8MM and iMX8MP PCI: imx6: Fix i.MX8MP PCIe EP's occasional failure to trigger MSI dt-bindings: imx6q-pcie: Add i.MX8Q pcie compatible string PCI: imx6: Add i.MX8Q PCIe root complex (RC) support .../devicetree/bindings/pci/fsl,imx6q-pcie.yaml | 16 + drivers/pci/controller/dwc/pci-imx6.c | 1181 ++++++++++++-------- 2 files changed, 730 insertions(+), 467 deletions(-) --- base-commit: 50d96936b7b1be01bcc7b9ff898191214ee72697 change-id: 20240227-pci2_upstream-0cdd19a15163 Best regards, --- Frank Li