From patchwork Tue Nov 26 07:56:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13885547 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2052.outbound.protection.outlook.com [40.107.103.52]) (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 17379190072 for ; Tue, 26 Nov 2024 07:57:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732607855; cv=fail; b=UO5ySwm9uzFfgVuT+82yTDcXtwsJQWurCcDD8QJrR87nHiJ7+EHVIv6yjNdACTPWgU44ZdYi0oXqLMhlLqtwYEAKPp6n+az0DqJr7klhjjrS1jAZO2RBvZ7u7A3UoQgDlap3p33kfFOTYrVffM5kI92Ijf04R/LN87GjW9u3EbU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732607855; c=relaxed/simple; bh=ZYcCRteNnovkcUZklpgpWyVqUFeEFoDgEhVPtnV6pKI=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=kq5ru2PKUcFxP1eHfeFocI6+bPL5wFCBR1wXSYIgbc2IOYHT/17tX5FgPOiE9o5iV+L3XSbECmD/QqsZFPC8xWw2eGZHPABRsrrCNw5BidypbjjQ5rQK053+vWM/17D8BvxDOja/wdE3YNhpWPysEh7UTi268X1PHt66vgm96oI= 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=l/SVKQtp; arc=fail smtp.client-ip=40.107.103.52 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="l/SVKQtp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GvaaGPSTvysQJb64AVbZ4P0ZynBppthIHZVrkz8F+xPLW40yAt1OyiRZafXcrwJoHLLNDLT31LzgC2Uoo8+e+J12dpEtYuinw7GuwQg2mO3kkq2HpgdeeCdyKCwKttkbulJwRL8QFVgNjITje9jB3ybbhUK3E6hHX6j4HCHk/+BnKyFPMo6nIgnWIIDjyuG3sCs+c/MZFfJE+Sel/M9iJtm9kXuTYQkV0dZ1XJoZ0SIpoyHx5XmmdVIfLK+gXr5l6HiRqfw0QikdOLZVWJhsz3DU+m4aQyIGg9b2zQ+xolxiXkmI1d+1FzxOYRWot4ROygOLYUYLPDkiHh4IJPYVqw== 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=TeBaRa4Sp9/BBm14vlkr4aUvWWarw6aoxjDtW6doA60=; b=UtsXDXw63L18acPwRi/LRjLZci5s3IEyLl6Gdohwtb8ysguOYJk7Rxgf8Ltn8D7jTyT2s1SHLttGlvaeiRSHZte8mxp39RkXheEpzk9BM9gCmVChXnraUY87QHlycrTwovOo3pAOV8d+b6wOIpRLpus8R1HhbT2c1fVVG5v0Bs4G7YPti+RCkxwGcVyfNg4Lz+h3sEuCFfOGo5SXYEDG5Eqqe//YCA3k1DAtdEsYE8VOqrOy91yZD90cfj6xucc9cxfNyMEZMxBGsikilANs1qzNpzv5vnVs9VgUYQcCy86w44EwxF2GEb5FRPukp90RHWpS+YTyJJ4bu1DanL4BWw== 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=TeBaRa4Sp9/BBm14vlkr4aUvWWarw6aoxjDtW6doA60=; b=l/SVKQtp8BvGMxHlKdniPdCqnzKJ6Sn7X81PgW4ll/lodRK7kl47IU4WYgXvhsv9nx+uioRqro3UtCXXJUW4RijEXGDnZYCNVIp7JsOmkor0usrXhRHt8aQHouk2rW8K+0pglqs0o5jV7lROKchgWc/WKdeU8JOVYexFYXleHMh65ev7WqDBa7wYzMOtepHfxaxDGPeIWSNCp90UJP4HrtttRt7NbVU4oXZkxJa1tjW0ULLY/mw3V8V7hhdeWxm2K37dYtJ278Xfv3EuxhDzSANYNzs7L+nmmNfdDQiarqO484R958LcrQP/t5EdjzWdDdxsdkZrLrWjR+wiX+aYvQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) by DB9PR04MB9401.eurprd04.prod.outlook.com (2603:10a6:10:36b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.18; Tue, 26 Nov 2024 07:57:29 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93%4]) with mapi id 15.20.8182.019; Tue, 26 Nov 2024 07:57:29 +0000 From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, lpieralisi@kernel.org, kw@linux.com, manivannan.sadhasivam@linaro.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, frank.li@nxp.com, s.hauer@pengutronix.de, festevam@gmail.com Cc: imx@lists.linux.dev, kernel@pengutronix.de, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 0/10] A bunch of changes to refine i.MX PCIe driver Date: Tue, 26 Nov 2024 15:56:52 +0800 Message-Id: <20241126075702.4099164-1-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 X-ClientProxiedBy: SI1PR02CA0060.apcprd02.prod.outlook.com (2603:1096:4:1f5::17) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) 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: AS8PR04MB8676:EE_|DB9PR04MB9401:EE_ X-MS-Office365-Filtering-Correlation-Id: d69472fc-b106-4fad-9592-08dd0deff98f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: fvCOX7P6qU3zNUia1GG79u8MoJy+fC4F6S3mBUkR7jr5FpfSvpe/tnjIReph1k2oaZQQrgeNKzU/rQQ3iCZkS9v7IOx6nSUb7Of3teFcHMcGrITdePdzeI7LqqVqdHTQ9EjcHh+JBy6/Tk1UVulw1IwaHaXVzDDxYjPxViTZjAl1rJH+eQL2SEqVUSP2HZgoA4AKE+62kbOptpVWGkZ08BQBLPvq59kalJv9zK+Yo0343xJm5eql3PFqn80DvgaTLEmCP4xqx4eKfTf8meFj3W7LRwvo5jwBRzvwRzTpR8nozEMjFV1C7QjAABnoRX/zBxfXHt+16ClqtTU8C48fLrHk1TQkEdiGOCcAZrm/5swCnJ6TpDmwtijy7eIa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V:NSPM;H:AS8PR04MB8676.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(52116014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NZnaB10S1EPXqHll3rg/c70QfK2K0N1f4AMYQ1hDrmyKjq7WCmVkO71OHnxspaAUdBJEpoX38CmMWn3TDVLgm2AhYdqyAvEB7sD5mgjX3ne6Ip+/EqokWODx4QfRa8KvROEDx87Eitu8fCUhjhGrdnlsQD5vGS41bRe5x5Y2ueHd4pUmq99dS84lBGuPk79YUE3IqiZzjT99vRz6f65x34iAyZM587qoffNgcWO8/nVSsCI8Tt3wyeMY84CjBQriRYkhl6noH0B/jwaRoyTESUZpTzrE5qLjo45Hx88p+a3RpYtfm/3dYL24iNyzQXPI7PwWIFfrxrV3G2fa+ieih8NfxVWVGHKQyye5iS97GH5ywfFDqyfV4o+nP7YkGckKoqN31yZ2wNQ0La/w01JIdJPSeZtMJBDFgyTzdAJ/z/JRyf7waE0+i/tpTbvRaCn1S2h+umHsgz6DigtLrwvPdT2I++3bSrWd9PXqFVxSpaJqoT+fWVcRdmelFM5nCGTC0Q3JPzKpI/N9mjp/I2srswOmaXAeGLLNXl34XrbN33Sx9NS5HV/Tt5uIVi0x4KMIsxlREeZBtbqZqCHp/VOT3Bn1ftYqmMhBZSlAlmSR2orj83BYGtd/11yVDXLSRO3Xrf3PnaDIU1SV1H6o6q298VzYGw30rxkvHEh6NluVMm2x1d7Tt19s+OO2LY9eQ/7CTVKrhhhgAEiClcGyGRK9MYR6pxWyUWMw5HEZW2GJLTFoO/35qzza6a6Jw1KHAaljTsDQv35S2U+ILBVK1D4FcLgMkL9YFV4c8TtF0SIa/Xa48jcQvxEKVWLk8S+XHHSPBSPvLDPOvIuFHcCXBzuIt6bZAy9HO6xlSb855pwRdZIYe60gZilOcNjvrzXl/gH7StJxiRgjS0obC/UOYnSUBecB79xmteAkJJ1zknorv41MV2PAhLt/ejHIKrzxzKknxzPwsOW5IQW8eTFwfMouggnXlf2B8O08Daeg3UwJ3tWt9XYFdzXZfWYawK29BDWFxONdFbtN1GPCRp7N4vsh0hw98mxMFwdlitKA1XkH1fZmUDCEwDCTA5Mpa5Zzq8owStTru/bz2+Tuw8Ek9/UUxb/OLRuY67QQTYwSpEcuHlwaqklpf3PcjJjZSIU1msgWUahxFYpgRINmTuoXpAQcPdqFZzY9S3cxEBenn3F/z/jDil5LRMVP9YfOzQ9T/hNRJPEhYFHI0D2sCYWuxH1nrL986x853OE+yWcPg7lcTqoZzZmhOy8pCE3VdNtz4o6mnQFGZNzIZ3FJI4fh4J1QjS8Rp19Pt5QJN1Df4xVNkwY6fOLVKImzsJVXdHiEXBPVJTafJVh5b1GiN8fg09mxtzIwIYUzANl6bvDU7YA2s/oC4MUOg/ku/iOTE2ATtnr4TMmubXT6e/cgZOP0Jba+OXzdS/9srajBa5cr+SotvVZVDSQ0c9LTIYt5xg0oiiMczZmF9XCyfHQK0/tb+B7ZtW95hRevcY6pH54+nMpBU3l5vE1AE0hQI3SwS+CFot9VlCxzR0YcNcot3saE8AeIpsvHkymfYILf9qHEBsX1rV/O1Sc5grd+zpPeRDft69Ff X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d69472fc-b106-4fad-9592-08dd0deff98f X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2024 07:57:29.3701 (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: jmreukYYJZHYyD2iGoQ5QGNPy16/lrsWOTpOZzEbs+wHLeQrjhzfqrpOxh3jyD8aKgIY2ei/OQqPfJP1VUrqag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9401 A bunch of changes to refine i.MX PCIe driver. - Add ref clock gate for i.MX95 PCIe. The changes of clock part are here [1], and had been applied by Abel. [1] https://lkml.org/lkml/2024/10/15/390 - Clean i.MX PCIe driver by removing useless codes. Patch #3 depends on dts changes. And the dts changes had been applied by Shawn, there is no dependecy now. - Make core reset and enable_ref_clk symmetric for i.MX PCIe driver. - Use dwc common suspend resume method, and enable i.MX8MQ, i.MX8Q and i.MX95 PCIe PM supports. v7 changes: Thanks a lot for Manivannan's kindly review. - Rebase to latest pcie/next with "tag: pci-v6.13-changes", and with Frank's v8 "PCI: dwc: opitimaze RC Host/EP pci_fixup_addr()" patch-set applied. https://patchwork.kernel.org/project/linux-pci/cover/20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com/ - #2 patch. - Update the commit message - Use devm_clk_get_optional(dev, "ref"); to get the optional clock directly. - #3 patch: Update the commit message. - #4 patch: Add one Fixes tag. - #5&9 patches: Update commit message. - #7 patch: Refine the subject, and the commit message. - #10 patch: Replace the dummp_clk by one fixed clock. - Add Manivannan's reviewed-by tag into #3, #4, #5, #6, #7, and #9 patches. v6 changes: Thanks for Frank's comments. - Add optional clk fetch, without losting safty check. - Update commit message in #3 and #8 patch of v6 - Add previous discussion as annotation into #4 patch. v5 changes: Thanks for Manivannan's review. - To avoid the DT compatibility on i.MX95, let to fetch i.MX95 PCIe clocks be optinal in driver. - Add Fixes tags into #5 and #6 patches. - Split the clean up codes into #7 in v5. - Update the commit message in #10, and #8 "PCI: imx6: Use dwc common suspend resume method" patches. v4 changes: It's my fault that I missing Manivanna in the reviewer list. I'm sorry about that. - Rebase to v6.12-rc3, and resolve the dtsi conflictions. Add Manivanna into reviewer list. v3 changes: - Update EP binding refer to comments provided by Krzysztof Kozlowski. Thanks. v2 changes: - Add the reasons why one more clock is added for i.MX95 PCIe in patch #1. - Add the "Reviewed-by: Frank Li " into patch #2, #4, #5, #6, #8 and #9. [PATCH v7 01/10] dt-bindings: imx6q-pcie: Add ref clock for i.MX95 [PATCH v7 02/10] PCI: imx6: Add ref clock for i.MX95 PCIe [PATCH v7 03/10] PCI: imx6: Fetch dbi2 and iATU base addesses from DT [PATCH v7 04/10] PCI: imx6: Correct controller_id generation logic [PATCH v7 05/10] PCI: imx6: Deassert apps_reset in [PATCH v7 06/10] PCI: imx6: Fix the missing reference clock disable [PATCH v7 07/10] PCI: imx6: Remove imx7d_pcie_init_phy() function [PATCH v7 08/10] PCI: imx6: Use dwc common suspend resume method [PATCH v7 09/10] PCI: imx6: Add i.MX8MQ i.MX8Q and i.MX95 PM support [PATCH v7 10/10] arm64: dts: imx95: Add ref clock for i.MX95 PCIe Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml | 4 +- Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml | 1 + Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml | 25 +++++++++-- arch/arm64/boot/dts/freescale/imx95.dtsi | 25 +++++++++-- drivers/pci/controller/dwc/pci-imx6.c | 178 ++++++++++++++++++++++++++++------------------------------------------------ 5 files changed, 110 insertions(+), 123 deletions(-)