From patchwork Tue Nov 26 07:56:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13885561 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 BE55DD5A6ED for ; Tue, 26 Nov 2024 07:59:47 +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:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1lEthi81Gsz1Kd1TZJ99UEX/wS69W9ebgwoPRJ+SDZk=; b=09CJSBikAsG2M9KC+2zXnPRLlq HbYQVT3laYsZT93fNWFwWUYl8RgHFKjZ0fIVW3m0ID7qt2yuWToLOsYfwWsH6NbwNDq3sRuwpjpzA C8vuQ1/3vEfPwpRYvY7A5ygw0LotSlhNP9A0WxgcAo/SetDHoVa1XjdcweCoFAoEuKuPwU/yfrima psZ7p6nTpDLW0xCxe2Vyu5IQvsVJbR3z3Jjdd8+EChJ+Z1gRv9JdQoqLrvczaW+a8BvN7G1mZqeOk KXrvbd0gWXIP8B/ly2enlgygwcFEPMIEpYGjzGmhRLBkHjGB0af0J72GiCJg+c6eFV/ALBLzKioAz Nnxwv9Bw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFqTt-00000009u0f-2bvg; Tue, 26 Nov 2024 07:59:33 +0000 Received: from mail-vi1eur03on20625.outbound.protection.outlook.com ([2a01:111:f403:260c::625] helo=EUR03-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFqS9-00000009tSN-0DCh for linux-arm-kernel@lists.infradead.org; Tue, 26 Nov 2024 07:57:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NJwk/5Qfje2vDGri7Uxo/IsRXRglUMzvaEc6QMiDDEwM3LLucEWN0bJ2u4smRFezpQo3EyrfVdZMFrp09V2y65B9G4X5WkfAd/YM9CW5hz9CU6wxr7aY3pFVoUNuZ3Ltwqt0MNPdKUMrLTvOApMROTvXM6rgRqKVqoQL18xA62EH765DhKE7kqsI99jfX4dkc9sN3MDCehgZwGVd0U5xOnepRf4Szr0P54ydGWpUhMOAIkVb0dWMuVFU3MWiNjMoaviLWUe6cE/B7K8j/1JNJt16sz4Z8Dp6/nHx61LkaMKKZaQxFP2WJHvJQvCab/lU0l8AuPX4GIxZXF2yEI+l9g== 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=1lEthi81Gsz1Kd1TZJ99UEX/wS69W9ebgwoPRJ+SDZk=; b=BX525OW6A52lWrk4WtNGozWrSTjtAZZs1Y0yDnNuwev4HxjG6ezZbq+rZcg+haInwbye8pE7DptMu2IkRrpW6HK+K6ba+Wc7fFi8d6pXN3LD0nG4x5vIcxB2KWPRIf1SckSWjZ9TFLQAuuiUL1e9Ui/IpgD7CoksgjFtGiN9MGJPyj2uhCB7lrhf3UllvTkz5JdES5j0w4PUiRdyD9sZ4gCZ53HfNr1q07kScmAHdlWZxenWwTaEA2Kz8VZCLKF1jJPSNakiX9nGdOvlnDPcrzV6ahaF7oET9Vh4PfnLae9HwLYkbCZHQx6ZtBQuv+VuLxmJsArjzkxSJpnTE57hLQ== 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=1lEthi81Gsz1Kd1TZJ99UEX/wS69W9ebgwoPRJ+SDZk=; b=Qyuja7RKhErvGHe5V7Yq4GLf372I1N68w/hRzaRmvaY16FnOvU3nCQmaGgtWyfGpl/GkxEPLYgpPVMTsL2OQm8I1dQfX6a2lDgSYqWfmATvOnT7C7hlpbApR1CbXPnJuZFmxRzzt3Xr4AsaAQnCkO9+EIpEmRBTw11G+9aVFTmJdpFnei1F15eHEKHWj0jI7WlZ4Hh08ScAb2JMgGrQ1aMOV0Qxr8mxS/ScP3H9y84b8O5UL5bIAqR/8/DQrv5Nvd3U10iWODJijvPYIbbLHQhOehuRklVDMe+zYgAJRclP8rh58mIjVqMGJT9rP3AbodHHXsXCS4PhFP+Rm41xzWg== 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:39 +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:38 +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, Richard Zhu , Krzysztof Kozlowski Subject: [PATCH v7 01/10] dt-bindings: imx6q-pcie: Add ref clock for i.MX95 PCIe RC Date: Tue, 26 Nov 2024 15:56:53 +0800 Message-Id: <20241126075702.4099164-2-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241126075702.4099164-1-hongxing.zhu@nxp.com> References: <20241126075702.4099164-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SI1PR02CA0060.apcprd02.prod.outlook.com (2603:1096:4:1f5::17) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|DB9PR04MB9401:EE_ X-MS-Office365-Filtering-Correlation-Id: 865cf392-f374-4030-b1e5-08dd0defff25 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: /b/QkmvxPUwqxg5zhuAyCj0brZMfhMm4LGxQFV48tJwE7oyWQ1Kz3IeywVS3TGwFWy0aTNwhoT4ZkvYOpWrg9fNCUh7IEdy7u11iS1ZskBflEY6dgepWnJQhe0T7OM5XCaNE+WUP2K3Y2BrbPyITeGlmAvQuL48lsjixaVrGGw6QyvbovD4rbVfga8RCORmHd6R96ne6er0TPqdpbhA8MR4owgP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HOlaGYmvWsCYDJrLXttvFoEEupr+EYkS3B3PJ69vHJwO0NQuUnIWbdEhh2yIPLqShxfgyu07brVkxbsdKBtAZSVuaTvonOMO+obolK+5Kg+UGDefgLD9nXGH68sQm9D/aO7dv4JDwKOE8t2RTMJPEg6gI5K8du6Z+oaaqoSWVg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV: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: 8sVrHGD89rXAMVzzi2IREJs6l+dF/0L3EN0qgJ6mic4NGw7zudktfcV/MuBOzq03MzJQ8toZ50gzYBohOcRdmMymwPdafVWS9QpCrs8qx4yoJEki/F0lBYSV/Ez0BL8mkKnlox0kn4p2p2/Vs9xw0LZDctuFmFd+YRYd1zFQOuMa0qr6879EaC+5AbXmn8d8JwwpGB3ho+mWPt+3k0SJU40lPB736if0fQs0Aj6nLXMc4DKi2lqsPaX1CO8Z1L/B3rcgWoSAI/XnLMnHyosSHynbMIriZrOQxTduMg1xE28MhSAqGsyNXyAlZwbAK8YGjsVj9fXlLU2c19B0EBZkZBREzgeMGaO5LKd3LK2Y9Ij8KF8TTMol/qrQ89QkbvumA60Uv2cbcrPIsTlgbQ0QbjQzjGry1SiIjAUIQppYEROBaKOkjy7tUfVGNwVA+w06mfWbCA+aEDyz3RU9Gy/O/RAVMDV51dIPjwN8mcX4Jz4hsH1Qs83SL1AGL6tB/PhHLDvKW3D7Z/il/yn39PUX3pikQBfbY0iAG9h/l3UjkMA5USUeXD539fOXX/z4gcWUtDxoTJFPby2Tu2ca8wJjgpUkYxg5xoOOY7sprOW0LeXc7BUi6HEPd7uopzVcEGY+j4k5tXQW1TGImbZysmdXOfebd5wFqVRoxfHf/9JlP7vWw+uL36IAMTcfZ3WeBjibGE1sPcJ8QgzfLPzDe1NJAvVfh350UNr62UsCTKFydFwcTYA3bG+ZBA27SArEVSThSHheqzFbflew0BkaOS4sJYYJlMRB+s+9+FnU8sg58DPFbtVQIkVnX0mStRiLNaUtDVW0G7ycZjAY8wG5q3qhivc0XC3WMdDFvm/VXwkGGC2++pZAv/QhY0fNAe9sTA9zr5peH7MibNPaT12Krys1Q6izL3KQFWtPIdtNHRDR5sVSH0X1LJUvImBCYixr8G3t6h3D8nq5HcDQM4jSSr2cTsuRF83t1brcVEHpaCUg5iaIqWNJO9yxyOw1JfPoXRW7/7osBT07vG+n7cgLUog/D6OPHT/Xzi5NIp6/q1WJyoKhbLxRoXKBNsGfsH3x/lO/kCyr8x4ytWtU24qxLJiatq7tMyPMfYZHJeeSu4sJXUKYT2wGKWeoeQxVu8WR4HBm86MPYKnT22Z2n2fm9GOSjjviOnw4a9vyiN0Hw6bC+3WNksoaBTtwaYgmh/0XmH85kg6X0kjvSyXNewhq4UG2lhH6/8BQtYYrU4JjMFknhyrOgbFbXit6jFdbKk3iaMu9ZQTaMxuE45coBe3qhAivED6EDz9rYNyIi9jmZIc5scgk6z3NCHij+2B93218Esac5ij/wvDwz+TPknsi7Et0B4shyuVEeeCYXDolVRZTy4Rl4B3pz+HHv4On0AaAVMahGQ4Mrgq2A5uhVlwsX6L89UFwOafY6SCAnNxj3Ew77gi9EIRvv2WHP/VueiVslCT7mdG/c9x6lZpCiGTUSeC1EPAmdkZnNWkUD7HjxdhQ79R07L4x1BFCRwwgmBcMB6HG9mYDfwHyDn+64zuz5mgwZvyBml8iOkWkvL5AsvJ45Pfla7hWuI+nFQ5aqOQy9WI5 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 865cf392-f374-4030-b1e5-08dd0defff25 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:38.7517 (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: Dmh8Anjl67+9j1Xzq6HlRlJuP/SruxtQdIO18exoy8Ax2kYjm3cYJShgaWJM4KHzcGBnwM/cMSvxWVi6tJ+68Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9401 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241125_235745_087596_1CA63533 X-CRM114-Status: GOOD ( 12.01 ) 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 Previous reference clock of i.MX95 PCIe RC is on when system boot to kernel. But boot firmware change the behavor, it is off when boot. So it needs be turn on when it is used. Also it needs be turn off/on when suspend and resume. Add one ref clock for i.MX95 PCIe RC. Increase clocks' maxItems to 5 and keep the same restriction with other compatible string. Signed-off-by: Richard Zhu Reviewed-by: Krzysztof Kozlowski --- .../bindings/pci/fsl,imx6q-pcie-common.yaml | 4 +-- .../bindings/pci/fsl,imx6q-pcie-ep.yaml | 1 + .../bindings/pci/fsl,imx6q-pcie.yaml | 25 ++++++++++++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml index a8b34f58f8f4..cddbe21f99f2 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml @@ -17,11 +17,11 @@ description: properties: clocks: minItems: 3 - maxItems: 4 + maxItems: 5 clock-names: minItems: 3 - maxItems: 4 + maxItems: 5 num-lanes: const: 1 diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml index 7bd00faa1f2c..0b3526de1d62 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml @@ -118,6 +118,7 @@ allOf: properties: clocks: minItems: 4 + maxItems: 4 clock-names: items: - const: pcie diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml index 1e05c560d797..4c76cd3f98a9 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml @@ -40,10 +40,11 @@ properties: - description: PCIe PHY clock. - description: Additional required clock entry for imx6sx-pcie, imx6sx-pcie-ep, imx8mq-pcie, imx8mq-pcie-ep. + - description: PCIe reference clock. clock-names: minItems: 3 - maxItems: 4 + maxItems: 5 interrupts: items: @@ -127,7 +128,7 @@ allOf: then: properties: clocks: - minItems: 4 + maxItems: 4 clock-names: items: - const: pcie @@ -140,11 +141,10 @@ allOf: compatible: enum: - fsl,imx8mq-pcie - - fsl,imx95-pcie then: properties: clocks: - minItems: 4 + maxItems: 4 clock-names: items: - const: pcie @@ -200,6 +200,23 @@ allOf: - const: mstr - const: slv + - if: + properties: + compatible: + enum: + - fsl,imx95-pcie + then: + properties: + clocks: + maxItems: 5 + clock-names: + items: + - const: pcie + - const: pcie_bus + - const: pcie_phy + - const: pcie_aux + - const: ref + unevaluatedProperties: false examples: From patchwork Tue Nov 26 07:56:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13885562 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 96EC2D5A6EC for ; Tue, 26 Nov 2024 08:00:42 +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:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9RtplwTf1bFd33pQHVpt1klLT2D1dRyQersGj/Z9EQ0=; b=owwErVPF8s96CcT68G2kYKGLsc Pc2ck1iq6GMDzH+QmofSYKS4z2FHk3MLzhAIgg7IfnLC3ja7YP+veZnqUw+cIgpV4Mbmkqjg4Jo4L g6+DUJX6NaZSyWAii/qS5eSNwkZXnnPS77/6bKhjYKx+TwSjz9lPa/MZK7+EHHOmkRaH7uYRQ+tLx 4A32Nzth1kX4SHqeTkTyGlmfAhBJSo7dumoR0CRL1KlEOePKAiQFQEyQ5vltd1DYqy3GHF6TD6YOI BI/UkQ+ZeiiZbIfu4aUYlvnTF/nJChzbqfOdoexopYEpv/7HbHy1PgEoGQxWPAklL3CbKcUhvtK3v 29IZ+ytQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFqUp-00000009uIp-0z9M; Tue, 26 Nov 2024 08:00:31 +0000 Received: from mail-vi1eur05on2060e.outbound.protection.outlook.com ([2a01:111:f403:2613::60e] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFqSH-00000009tUo-3xqY for linux-arm-kernel@lists.infradead.org; Tue, 26 Nov 2024 07:57:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XmNSPEBzS2Ki2du0e/F4U/UoZtipE+p3KJdWMlJNX2900j1ejYjRZDv+2GDW8VRQC+ZyXGuoxas6OlKLFZ0iI7WzcumfrcNVjCtOj0RWqYCPrNoERz3GSKSes6apHUWSIU051G4iczs0+ezAPE0e42E6tYgRlPTfdY/6Yy3QlyL1BsDhum/RdBdOCCFqar/ZPQUWGOMpnO0JjeaeX3tc/N3h6SRm/Ty1yExxz4u5BoAQUmQ7u1a1I0NTE5Olnmo2/dtqL9HmnmmYuhKkHX6E6IkofYVLw6Me36aLHTyGCgqlx1K3psppwNw7sWm2Rak5o67a26LKMNXVoXCTmO2rDw== 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=9RtplwTf1bFd33pQHVpt1klLT2D1dRyQersGj/Z9EQ0=; b=lPW4YCMj6HnaVQLRAxL7lVqucUPMeSdunedcy983lLk8FsgC7Ou+P1mwmTsszkGZNhJv5G+zYSqWrnxfRx/biH6uOr2C8LPTDmnwXkOGtb7dV5WfpW6EVQAFy753W3wGT/I2rGAOUE6IcctMkkbSBZrKaswmvQAXhQoM0FtXqQzpTEzbOmB0DHTOPCvC+mKvTPzmZDiSC0BmRxXU3lrcTaCb5BSyUkYUpQpiUytn6V5Rw+P8FTNaebue8swQgTZ8/VzDem+ror/aiVWb2gt6cgYWXznExeWD8agwdjoQQ7V+BWPJieCIjyLewrTtiwcTS+xoB+Qt8WcSiowUbonnVg== 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=9RtplwTf1bFd33pQHVpt1klLT2D1dRyQersGj/Z9EQ0=; b=N8q77mWzAfz7VRIoQ/PwGRf/+CBgN9+0xhwChVmrO2GGVbQaf1IK6PKqB1BTTCOyO8c0P9C50iUBKQPzPgtiSwg9ehZkF034BvwD8wwgLGTASIIN2swqNRFkBzOrWIswS2nyWOwYfssDM/f13WVVlCGlipMrqqNOEFbUXOcw2neaee9crpv9Qi8fIZiLXQ4Zs7Nyu1KOBIbmn2+BGPCvaK61QiflFU3vUaATl3uR8Gcs28Bsop0K+utSBf62v7pzgbWwTa7vfCzOFJIk2lC8M0VvtLRT0BoSlxkZMMtTKZiV7zH4KPHy0oLtT0v834zK6foW2gkczhCfpgKtxD0EyQ== 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:46 +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:46 +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, Richard Zhu , Frank Li Subject: [PATCH v7 02/10] PCI: imx6: Add ref clock for i.MX95 PCIe Date: Tue, 26 Nov 2024 15:56:54 +0800 Message-Id: <20241126075702.4099164-3-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241126075702.4099164-1-hongxing.zhu@nxp.com> References: <20241126075702.4099164-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SI1PR02CA0060.apcprd02.prod.outlook.com (2603:1096:4:1f5::17) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|DB9PR04MB9401:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b5f351c-bd11-4320-e658-08dd0df003e2 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: DG71YhlVEv5yX+XQbkobx/7URF9uiDke0x1JUXUsXaCzSSOR0os/KZwM4zS+9vaGmfcsG71DOoD+gtDkoeB6dXdUI3IjV2zYO6G7GdFOF+UsSboLVBBYETQxevWZ4jk56PJMpHrKoVSBCUHv1vuTdOIZvoNUchCUl36WXIHuaAMHNTetgR5YVYaEuAo6eAGWwMWAxsvkbjAtBxm29tOUa3XMMQ7wwFuHzsKPgE6nSe9MECqX+557F27rhoG1+qxHRmoqrePpba7IaG+bls+LtKSWtUN0iiC7uQGTlrrrnVwlQ6KqE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irOzgbC3r4rkFd9oEjb+6OUvsw0reXL1I+r5N8Fec8hPZRoO+9+LAZQtehY7J7HpB5U= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV: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: 3nybBDwzCO7JhkoDtOYNDVVH4m2FQ+yrzdOFaWdik/Z6VXV/lQCT5slB5nEs3jrzFnfcrakzrsepx4+gzexPAdJMtnI204ivKNFnx7U3c/Sa2L6k5SbXuQSazoNTtVEAQl246xp03/lfyVjvCChVZrzSoA0FfPm7zhaHjz1S7Dr4eoo7GFXw4BVzIRE3ha+TNqztSpXudf58A0qd+5fuu2AJLa6EeoWnJ4XlefH8KSVATtoGl3Tv+9gcJh6TVvl9LVFFLpvP8DHPQg73DWMZXW08FttIljcvVj/uE1RQzXaWOplGAZrcElZ+QVDHj/STUd5pwkVOHu1DXhx/k/KheuFn7R1qQpuJplN4ZI/fPQFgvxeCxBwn9e29xq+YxwOrMfgTp796AQexEzz4cPLV9OE4RSP3zPnP6qiwGspVq6j6QoWTteai/6pcGo5X5qXwJXWY/ljBXEFutt+SBz09XSCbMTxAd7ayR7WNRf+GB3bfmNywDRCykwURyaIyN9k0pk5P1PXtwJ2T5THWUgOQjQK++Q6BPELztFW27hvLBDa13OtERgqyij9Kvf72Lrx9HFYIxMLTAlc0dWYYmg/G0/P635Em5RPDvu+e4BRh3ucrDTQO+upV7Q/mwQws6clOHIuhvRHOB92dXO2x+hdu62oGmIjuKD3hc1i8S3x2ze0Ee1IxB2cMH+38t0Tgu5shhNZidbJxkAgri6bmiJ4WUiy4cKY08SKh/16kaMEXymI+6cknHGsglVQIGVFSuuB0iSVJiE2xoKL10EDy0WLJhp1VyhSkTlMWP9qwWSGDWO78+NrhVWAcZV7jeN+Rwlkmx2/Sgt7DeyEGSzYeYuUNCBfpQnRxb7jRVX+DORp0X7XQu64W4HKrocH/5+/lJeE4OPkgX4EUKvXf3sN7HuPRX2ELvrtnq3wzLQP99Q83FmWS7w73GNUhwqFwZUr8vgpoHMEYLvPTj6FVNv/I6JwzOgHCBO1XOS6faxhEI62TcV/Dktfits/cFY16NwjCriCm/OTKes1NlDmD9iTjh04ARHim7bJcXHq92V29cgCwB8hh0FeN+FGXiljzekQO9ePbZ6+R/zUnjb60MIj860Ne+bwaH32nNNjg7QEoO/THD7rqHiiATlCfFveNJ8RO/Ss4Mo7TF6ISL4a3sd5zXEMbWoenNKEILsAtAyUHUhAnmI/BapE0rwihtGAmLRa/d05PmhVyLxIe6cDA4AZ5ovsl98vwYbV4ylvOUyW6iHlPZOtaj3CoUnKpS45Y7ln0R17DvUBoLWzD1i3EcfLOnvx9H3g/K/9OtD1eT+FAWO7DSEjuvyUlGIBVFWSbiR5Ro8q4IMol1dKsFazHp7VIUQCNPl7no8yPU2RoXD3jwrgdG0QQnzVCCY+ce1RAnfCiAirGZkzqBk5dAfLo+x2bpEp0ff+yMvXBCJOdvHU2afqElkEir8XuxMzoEwKPIpzthz5dzOwc3Q+di0rJPO2BdpbLVXoqDUlKkmhhQyp7dts1s2Ub4g4pIMQsigTtXDHZdSnighc/MY9QfOwv2CHlqE+q564do0bPA1M3eZHQ+/e4N11sUw9WvkPtP7k0X0WRRoVb X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b5f351c-bd11-4320-e658-08dd0df003e2 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:46.6986 (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: 4qfTOnJpxBnoxku4IrSgdK4nFJwbo9XWeLBha4Hv++bgQx128MxBBkRK8Lg6EDobYzAHhOmFUBFjK9YZGiAY9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9401 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241125_235753_981966_10AFAB3A X-CRM114-Status: GOOD ( 14.30 ) 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 "ref" clock to enable reference clock. To avoid breaking DT backwards compatibility, i.MX95 REF clock might be optional. Use devm_clk_get_optional() to fetch i.MX95 PCIe optional clocks in driver. If use external clock, ref clock should point to external reference. If use internal clock, CREF_EN in LAST_TO_REG controls reference output, which implement in drivers/clk/imx/clk-imx95-blk-ctl.c. Signed-off-by: Richard Zhu Reviewed-by: Frank Li --- drivers/pci/controller/dwc/pci-imx6.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 385f6323e3ca..f7e928e0a018 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -103,6 +103,7 @@ struct imx_pcie_drvdata { const char *gpr; const char * const *clk_names; const u32 clks_cnt; + const u32 clks_optional_cnt; const u32 ltssm_off; const u32 ltssm_mask; const u32 mode_off[IMX_PCIE_MAX_INSTANCES]; @@ -1306,9 +1307,8 @@ static int imx_pcie_probe(struct platform_device *pdev) struct device_node *np; struct resource *dbi_base; struct device_node *node = dev->of_node; - int ret; + int i, ret, req_cnt; u16 val; - int i; imx_pcie = devm_kzalloc(dev, sizeof(*imx_pcie), GFP_KERNEL); if (!imx_pcie) @@ -1358,9 +1358,13 @@ static int imx_pcie_probe(struct platform_device *pdev) imx_pcie->clks[i].id = imx_pcie->drvdata->clk_names[i]; /* Fetch clocks */ - ret = devm_clk_bulk_get(dev, imx_pcie->drvdata->clks_cnt, imx_pcie->clks); + req_cnt = imx_pcie->drvdata->clks_cnt - imx_pcie->drvdata->clks_optional_cnt; + ret = devm_clk_bulk_get(dev, req_cnt, imx_pcie->clks); if (ret) return ret; + imx_pcie->clks[req_cnt].clk = devm_clk_get_optional(dev, "ref"); + if (IS_ERR(imx_pcie->clks[req_cnt].clk)) + return PTR_ERR(imx_pcie->clks[req_cnt].clk); if (imx_check_flag(imx_pcie, IMX_PCIE_FLAG_HAS_PHYDRV)) { imx_pcie->phy = devm_phy_get(dev, "pcie-phy"); @@ -1509,6 +1513,7 @@ static const char * const imx8mm_clks[] = {"pcie_bus", "pcie", "pcie_aux"}; static const char * const imx8mq_clks[] = {"pcie_bus", "pcie", "pcie_phy", "pcie_aux"}; static const char * const imx6sx_clks[] = {"pcie_bus", "pcie", "pcie_phy", "pcie_inbound_axi"}; static const char * const imx8q_clks[] = {"mstr", "slv", "dbi"}; +static const char * const imx95_clks[] = {"pcie_bus", "pcie", "pcie_phy", "pcie_aux", "ref"}; static const struct imx_pcie_drvdata drvdata[] = { [IMX6Q] = { @@ -1623,8 +1628,9 @@ static const struct imx_pcie_drvdata drvdata[] = { [IMX95] = { .variant = IMX95, .flags = IMX_PCIE_FLAG_HAS_SERDES, - .clk_names = imx8mq_clks, - .clks_cnt = ARRAY_SIZE(imx8mq_clks), + .clk_names = imx95_clks, + .clks_cnt = ARRAY_SIZE(imx95_clks), + .clks_optional_cnt = 1, .ltssm_off = IMX95_PE0_GEN_CTRL_3, .ltssm_mask = IMX95_PCIE_LTSSM_EN, .mode_off[0] = IMX95_PE0_GEN_CTRL_1, From patchwork Tue Nov 26 07:56:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13885563 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 4B33CD5A6ED for ; Tue, 26 Nov 2024 08:01:48 +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:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gK83ClGL/0mzmv1DjwZHG0YlibQLXa5eUiYfMl6Hk74=; b=u1EkYM5tTWmo4sDXJGtLRrDbkf 4NAzb4n8Wf++6jS+voNur2l8vw2sgF4v5x8Y12Ax6ci65boJnLJiXnwSCdPp+gLbVJ7PcOI2PQohU iOT0oO5/CSe71sUU2rlQ3YXrXcus51dWByC0HRYxS7hbkD6mP7poqmVjXJh4rzeysMvJ42QsdgJt2 Z75UqWANVVslOA514pMnadO8pANUwOzlIb6F42paEnOECa7M8LFfGeE3ZUFpwmHK1DJD+uAGRP1mW iRAsPHQyL7peKosQdA0O0VSEiOylg6M4ieDEbYnqSdKKQfBpwwH7z9zJuHtU6YgDN6b6SxgyBanWX LwLErOhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFqVm-00000009uYz-07R1; Tue, 26 Nov 2024 08:01:30 +0000 Received: from mail-vi1eur05on20630.outbound.protection.outlook.com ([2a01:111:f403:2613::630] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFqSM-00000009tXF-3QqM for linux-arm-kernel@lists.infradead.org; Tue, 26 Nov 2024 07:58:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oxf6O90BNQZs9pjOBM1q5z3Asu3NbiwZFe4FQOqQcwHBrtq8wGGXeIi6yJ5dCJhS8i3pFyOEP94lcl1QL3O6GPrOlbslLDZbjVxe324QuM/VebbIdkm2GGpa1Qf/NSZDCOwmi8zYdgO6Ih+alwBBo5gw7FBUfnVVCoSRynVmWFiy3CfembxSIUDH6iNghPjL1FAsu1P49EraYlBflTwWiSq0LbrHYeyflUc602hxyckDZc7C4MYN2Z9gdVI6E49WJ/q4d+Bsc2+PONvZnTQ321EXiNeQxEAp9RYVr9aD7zJipjJI6rYk63VWL2NuSrEhUZyeF5JJBclMeDE2+smDAw== 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=gK83ClGL/0mzmv1DjwZHG0YlibQLXa5eUiYfMl6Hk74=; b=nGaB+rNfjpQg8hX4oa1lXTJLO9hzXbSHXq46b9DlaLWBKCrKO9u+IRULNgHYR4Eq5WfS7KXe3BQWZS5L3lFBHVxhsnYoTRyJzcQNZ3r815kdWkX06wL902DUR9EYnV4Xkx2aQpCYSc6GVig6Mu3XuN/QSLzOkA3OzH1nKF6FRdpbvyySiyRlIYM2PCEHzrsSIk7mdEqDApYkBHL24IuDL1J8dht7Bou9pCALxJLPagnbzxKhiuC+6PcWBcY7xQHslU4/jBju2vhmTF2mq6eHt2zRPhCN6TE+fDOywwHXZ2hvcvqHtzkM+5j2Hl6vHjb8T8JiBclg9DhRcv8VlhJPVQ== 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=gK83ClGL/0mzmv1DjwZHG0YlibQLXa5eUiYfMl6Hk74=; b=QwhFZdHIMq+HoelgxoAQhiLRvu7le/N9lO2Am9UytavuHLn3o5KYrdren//8puCkPAOSD0yBYkostafrPIHDDmv6dWXFziDD5Qzd+L5q47oVBIEocKLRpx7SYwr2ZcNqY812vJKciM56suJJ/tLq87/G10X6pYmKLuoJH2NwHwsexqDOB42kYzzua3cgLXFZlm1NeG5FzdnfbOtMLPJ1TKTSQiAsGvZYHCkyjiQq8aC9GFd0MFAsuE+umq9aaxkqV9sakxI11gIayMRNI3UC73hWvxEY1YN34XA2MBCTCZ8/Y9yh5tE2c7bReXn2OC8BuinN6JkPU7VeNjmJYJ1nZg== 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:55 +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:55 +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, Richard Zhu Subject: [PATCH v7 03/10] PCI: imx6: Fetch dbi2 and iATU base addesses from DT Date: Tue, 26 Nov 2024 15:56:55 +0800 Message-Id: <20241126075702.4099164-4-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241126075702.4099164-1-hongxing.zhu@nxp.com> References: <20241126075702.4099164-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SI1PR02CA0060.apcprd02.prod.outlook.com (2603:1096:4:1f5::17) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|DB9PR04MB9401:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ead1a8c-9fb2-458c-8597-08dd0df00909 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: l48vTPymmDBk1eNUM5Ipcs/ReZBx57XbgI10t5YflDfDxcdYxIHbYIm4+CZbjbguSHLK0lbAohl9bB+EtGW8eD8bb5NTbyXXjCmeBoGOLeZW2lmEA6c9RRKcWBT9lmRcndBoF/v/dGBt9af9tc5a6703s8Bmu5znPeQsTyOW5tMwHo3XAtVqABqqS05lqzmgkB/aZSUbo/B0Xtaa4nzc4AmK/KDnDFOTsKWuqkhEKeTtnlW7wnm2tOQMOgw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lHWt5AoVNLLIhbvxDUqY90hrWEyuN9IqEJx2db33w5hHGbr5wHMgWh7+d7lwc+T8bqGbe727F9W3TjSiE3BLBNpqXhTk1cqEwCw0PWX24NKou9A1mE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV: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: hX3njDR30R1z0iEkZ5Asy4knIcJN3mAfVUM8Z0j7Zu/dR8dTW1xv+JIeBZpeRvsrKUxkmBvxmZWosePV2TtsVUzc2GniL+itVzoT1We/nB/p8FggFhRJd85K/gmuMIvlsVzsTYrzcVAukjcLwcjXRBPEDECqEMQmjHOH9IqM+YmH6+diGvxfONNiEp7V/tdfwDfQGLYtIwXshBcmDxm4RApUqGHN5BXNBrjmeUVbENg2PUDWYPeI5OMDYZSFHQXBTKNVYeBLEeRvh00x2tRcoMy50tGrK23BYROQKfb4ePonUtOVTIRFS22aEzssYDnReWrzUEjWgj/iN5eTyP8GbfE/kn9Rxnn0ZDApve+eDOpvU+fSq7y3dEvymNc2D7GIJfy7clcpg9KP31VVsGO8+ds+eiikhNx6qzbIvVfBdnHOG6qFlWz3O3K2z5Dv/2SC3sS/HywiHzoqW2vzwE56MowzgMQDiseZRblFtaIR6hEeXMU2nS+JgVsgwCSE3fShcjy3oMfjKvvjEgI3qSG1DujdEpRdaQeT7J0QFLyRmyfm4GEhRyJqZ2lDqSZ0TLwE+56zeoiu5hi3PVD/JsCx+yX7BqXr6Vj9CeTorASju4nwZWuPIo+x8IiOF2mu8NlCdSmPxJrK8dxNFsTUtS6vdu5z8pLSZq8H2oiTc8xj9z6P8mOfz2BN1T0PcCMQL/ELHtHmcQbzEVHaqFp12PA3HfPDhTu3iwxG2gO8evMFtbCMCfQc8RYjQY7EcZ+gnTwFOVx2YQ1iMpA8le2hI2tuHfzNL8qlrgXuVbgbfiwyoEcktPx2gvyJg9VP3KbQVL2Qbg/p4MM5Uyn3pd1PEWdRTed0sI+s817HK+jHBx6Zp3H0tZt/3P+44PbxZCWYDq508nvEdYZQK3HoRsbTymz4Hs5KEEhmkddNXL11LwkTRaFuBrNAew6Ndv0uoNiDnzyePNe2drV4asAEmbpwWY/z0xffjSldgwKJ+LainEpn+Dev7LdQQHALcZiS80vv5eihaC90Vaygi0zBr/mKNIlh7qGJsqwSDZMmzxSmIQbThITHypiXRVMuL3TTz2Z/qxzwJF0PcoVr1fnCFXmoM8bNmpy7SeC87+BwQUxUZvAXfuMz+Y+I05w2qdHEGNJBrl/sbH06g9367rauWEgQ/f6+kukUbydU9mrwovJ5UAgkO0a0292kewxFSJNFtoBEp21ejkcUfRPL20ReI1DTSNlc/I83MGoGKGNrIIsrlGNn1iW2GoWfscCimK+wRjqcU7SCDJVyUUwI8IZi3VeK2TVUtvCQW8NXDzJpL9aCuDQ2l8SlG7jf9q+cGWInl9UhJjf7lsr6ZdRsH/I/IhVJmUzNROT5uXDiaBQUWDWy722tk3HP/eAYqh4aMyknEHpANp23EzkJTKwVUjs+3L4gDhTjEDB4Dr7tGu0x81OVaPQ68yeVK7mpV2G5PzRO6wc8yyozKDfAiXP+SZRYp8QWrQfQH++fDAx0jeRGhiffuKNuPQS8WJ86/UePZjy3/xYYQqPRgGjPTTf/mMS7jQLk4WndikO//SdJTstVKbMkoBiRhZnMLcW2CSiqtXma4/XfNviu X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ead1a8c-9fb2-458c-8597-08dd0df00909 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:55.4095 (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: 4mNbWY3SEZxY6MCA9hARZ7QPn96TSpgNCHiTROtC2NFS3TGivDzfP1DwBhvxCG/L+9JGgxJKM420XNQ5tUftXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9401 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241125_235758_855682_7616204A X-CRM114-Status: GOOD ( 12.73 ) 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 Since dw_pcie_get_resources() gets the dbi2 and iATU base addresses from DT, remove the code from imx6 driver that does the same. Upsteam dts's have not enabled EP function. So no function broken for old upsteam's dtb. Signed-off-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pci-imx6.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index f7e928e0a018..81f1f68ccc14 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1114,7 +1114,6 @@ static int imx_add_pcie_ep(struct imx_pcie *imx_pcie, struct platform_device *pdev) { int ret; - unsigned int pcie_dbi2_offset; struct dw_pcie_ep *ep; struct dw_pcie *pci = imx_pcie->pci; struct dw_pcie_rp *pp = &pci->pp; @@ -1124,28 +1123,6 @@ static int imx_add_pcie_ep(struct imx_pcie *imx_pcie, ep = &pci->ep; ep->ops = &pcie_ep_ops; - switch (imx_pcie->drvdata->variant) { - case IMX8MQ_EP: - case IMX8MM_EP: - case IMX8MP_EP: - pcie_dbi2_offset = SZ_1M; - break; - default: - pcie_dbi2_offset = SZ_4K; - break; - } - - pci->dbi_base2 = pci->dbi_base + pcie_dbi2_offset; - - /* - * FIXME: Ideally, dbi2 base address should come from DT. But since only IMX95 is defining - * "dbi2" in DT, "dbi_base2" is set to NULL here for that platform alone so that the DWC - * core code can fetch that from DT. But once all platform DTs were fixed, this and the - * above "dbi_base2" setting should be removed. - */ - if (device_property_match_string(dev, "reg-names", "dbi2") >= 0) - pci->dbi_base2 = NULL; - if (imx_check_flag(imx_pcie, IMX_PCIE_FLAG_SUPPORT_64BIT)) dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)); From patchwork Tue Nov 26 07:56:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13885564 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 CCDC1D5A6ED for ; Tue, 26 Nov 2024 08:02:39 +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:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7XGWJCWBN0jVvyzb9wrLpOIdgdDkrMn1+Do6+UNoBvU=; b=Wseu8xXv2HmAlY1yIdFF86Uh2L Md/xiZe8BMI2Ve52rAdSodjpzdmUi4a1a31bdn/qd/dmCLmrFDJpKmff7uylhJXeTlC1m56DEpvvY 6BQbMmrIjV3ChUoQX+24pplIKOJ6vbbb3lOuRfqA+UWnUFiC3lX4Tgeb3/gUiy13WgHuJfim01uQq HJf13ZfYpYsHqfFA6wJXwgoTnX+VgMw+YzSvuOpprmdOEjJq6qJXYvXll7JefgHFCplF7gSTmwgga AzIED+SiVy43OZxSidRfE733RVa1ZpEU/UR9wPAPyMCbElR2CLDHX/SqDjFcqA1X67EDHnQBDn+6M 02WqkPiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFqWi-00000009uoV-2icw; Tue, 26 Nov 2024 08:02:28 +0000 Received: from mail-francecentralazlp170130007.outbound.protection.outlook.com ([2a01:111:f403:c20a::7] helo=PA4PR04CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFqSW-00000009taf-0FLH for linux-arm-kernel@lists.infradead.org; Tue, 26 Nov 2024 07:58:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DBh1mMwcBqxUKGkXHBLqN670O0KPK9+EUSjpO5xNlVaug1HFoJL3vWVuYE8WiO6fkYUicWcAhwf9ZIVHaQODvC0WGIghguozXIjRxOnGM9HBk17XtqPrVMEBvMGlm3ioegjFto1modXVwiwvJJorA+5qIBP1W+0RFFMra8l3PMEZ0+g9ISsGkBAzkeZKd3DbJqp/EHnPTXMPtFYHkBhhLZHpXDlZAYcQhqGx3Scvi/Ej2j3+Ps12PC8HPVJiOhO53K0SKtCi4zGq46O5496lD+HCOx42p3G/y6UorIltGa22G94FU4OHsQ5lf3TfDuRPkuB9CYCc3TDFWvnTkEggNQ== 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=7XGWJCWBN0jVvyzb9wrLpOIdgdDkrMn1+Do6+UNoBvU=; b=dimtL0Bi8i5Yoy4i6ayft9Fv7x+w4uWfC1d0JjSj+CEWZIXpMNhjDgJ1usoZ6jU4qTFfDj+eRn92eDg+ZMJ9uF+b94dtXEss6Sn/BrRDnrEW0/nkx0qynsL19BjNhfk8oh5yZyXqqh5m2y8oFCGl06+LeqMcO15uD/FuJQKmxfKQw0G+8lQM8GMBt8sJLneKsE+wNdNVDsYmXIxoyY3wDGVCOIAxaKTWbFU3FmBt/iX9qUmWyayVLTR/T5UGQSyhZkwnDEaUbcXHQnR5ZyJSLc+OTkZS61aXw+R9f1B9Ox/QwZHBZumvaXncQ6YQfZKEC6q7snE18lxbbl3pixG2/A== 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=7XGWJCWBN0jVvyzb9wrLpOIdgdDkrMn1+Do6+UNoBvU=; b=JsgvSODtgKi9fZtxZSVxVEzmLlr4hR48rndqSH7F/1pVLxMXtKiHTUf1lCUBR935xBGckNd5tB8a+Y8A5Hmr3z9XRk8EbnekgGEFTKiq0Ai9h2NVyovlPvk1NgaG0lar2JwB6OoSapQax4lbivmD/Uw1eFW7GrvkMSOcXhE3mHkab/K2QrtsTarDLZDq000UB2gibYCmQczrVD07L0A5bOPQoeIPMx4DtBm9ilcBHbmq3BUSZDm9dVdRchcTrgCbKd9JF8E1Ao5w6W64S5Pqa+G3zu2rXrrDwpeqjsgw65iLUVYnHXoSUoK+gJzexdidytH29SMZcrvOVAq4R/4kHw== 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 PAXPR04MB8489.eurprd04.prod.outlook.com (2603:10a6:102:1dd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.20; Tue, 26 Nov 2024 07:58:04 +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:58:03 +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, Richard Zhu , Frank Li Subject: [PATCH v7 04/10] PCI: imx6: Correct controller_id generation logic for i.MX7D Date: Tue, 26 Nov 2024 15:56:56 +0800 Message-Id: <20241126075702.4099164-5-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241126075702.4099164-1-hongxing.zhu@nxp.com> References: <20241126075702.4099164-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SI1PR02CA0060.apcprd02.prod.outlook.com (2603:1096:4:1f5::17) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|PAXPR04MB8489:EE_ X-MS-Office365-Filtering-Correlation-Id: cbc5ddcc-e95e-409d-9a75-08dd0df00dc9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: kua0A8k0kUhuoZH5eEan7w8F/m+6WSIjnHWWZRIzE0kgMFude8AWGv5NFKSqfcmenlYS5heqVGbaJEiQTRvUkk4p8fOhOIVhgEZAT7qZ1Gj/QJ9QoKTA1BeYhBjeWK0kT+zB6M1W233miZRKj6YT3d/ys+1fQCTevyE40HDZdMy5PriYzIDsT+Kc3SeOoxlx3TFvVFLUFO/v0quSG72BxAtnA4iLLrj89mKCTkjBW0mUSQuDIvlK8VM9RSx01A5MhiMXo7oeZtadzbPvvLMOd2Enp9M83P3OmYqpImXDfwPcQP2Yq4i7nNyPYuptli+swZyNKgO8/yHHknpgVEJYlb7uDMj43u9QfI/10X7VHCvB2Cl61VKRXRm21qYRlFE2j2oNfP1TUgGbNPOqRaR42NzfReHjSu2TLKhnTiKA3cyyw+ANqgyRRFED3wKDF162UEDZBgOB2OEZdjFeXyFyd0z7w7VGeTIaXyir4lsEr8BNKU2RG6AhXI+t9eFtOSWsB9eB3TXVTz2XEIqHVU8+bJzLbOjhtzbednFDVkPnc152EgHb8xga36PbCzgt9vxgmjmZtpKE81e3+nSjKElozyZH8E+3eeSON/kpjU138bDBJ6929xRhRlpXXfydvkyKmna0UmBir4Hfxl2SV0aAthxFccQsoyrecFvz4GeCdsJk+C325zMPjIzmFRQ7HOpVFLtJPubghI41lufVVUv98fOv7I1fwKWvp3vFy+zSt2FT/FeNEhslemvaoipMmwuoZemV89GNK44UaAMehPrWkhdyzr1RRMPSSvxFss55fdJ5x0tBmxZRDjLFxU7avRyU3wVi9qQ5UWgdqjhkK1HpVkmDNnT4ShV4VSQnL1H5z4tteHpy87TWt97ALEYp/Qsd3NPALVk2mkYgha50e3Tp9FebGI8q2ssALhxN+55lAkTCZ1gNB+Yjwglq7cU8lu4wX3T0tel42StrwCELVj9ZXS7l9p9wVGG572t2iMONOMouRe+DwO49wQuaOey0L9MFRY1wV2v0nMrz8CiwI5+i9lawyvPlwPDkG5I2NFJqiGMFx5S8bp48nlZnbVf5c8Oe22RO4si70Tq3nH6b5lNAx6B5hE+TecR62Xk+a+BcwZ4aI5gSF3kMPsq6UzAlhRJ5ISejxdFUC+NKMzEDcb6mibMyYkzP7+GXaXzC7/fEH8/XysZ5zamahqk8oO5m/uyCHTyu35kdTpDc9Y6l9shKTE6W8cCCzQgO/cFHBHdoyMoy1odxRjb6grDFIYj71dnbY72jPzid5H2NpmyHGuM9fl3a8e1XuEoDS07NTd2/KyYf1cd9YTFUwYMgIM9hKzAyEIPTNBuCkS1+8otJdJNAWdKMBEdVaklVDQyulo84IqMZU7ZvmKbth1re4oVgBLxaKoezMhO+OQw+0Arr4YvRANObHbhMyt4NMiJczlaCOGU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8676.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vwhzQgn9O44x3TrSKzgR/qMWa+chiM3U7ez4UzSe43+MLrbSOqsMbVX3iKxpmAjYvPsFQ/84WLbV/FYh7G6HAfUr2iCu7A18nwyFCLq4FiIklMI43ZcqbABUAx7eq0QPVYUJuDkjTK1o/YBN5zjRT0nplVkZ+KY43Y4EnYFUsRWqz/TM2YYgf7fXojZpMtLVkESOviEeAXAbt5QL0Hdv83PY6Nrkh3CMtL7jratTQ+S4CRr37cEOghc+cdFCEtJWn2qBkbJQyq/0vi3+bjkRmohYxyTrhtroHio5iqrouV9RkJ68HQbK3/XTwqeNc1ehtyLwR36jj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n46rbMTfcNHUqAiP2Nxfal7t6N53Qi8LWZjU9McEyekA6WHS9gA9HJXHfpIbMZCmklVVAXwYPX9jXsA6t9KZ7gaJpYm7X9V1oOvu0/UffyFJfDd0k2BG+3gNhUJE3lsp5L4kW0RW4bpyqN/W7cLDUNnH51rC79tODQNmYWM4NGUNifi/yhLFFZzufQ5h0N8V5Nyu7eXu X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbc5ddcc-e95e-409d-9a75-08dd0df00dc9 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:58:03.5035 (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: 1q7rC6o37J6RpUM8uCIgkymZzZDc4xn2ENNRh73Aoke2xhPIMx+SNeHEFAzB8HRBvnLq9wUWV/QjLDcAQzzfYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8489 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241125_235808_095000_80446218 X-CRM114-Status: GOOD ( 11.70 ) 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 i.MX7D only has one PCIe controller, so controller_id should always be 0. The previous code is incorrect although yielding the correct result. Fix by removing IMX7D from the switch case branch. Fixes: 2d8ed461dbc9 ("PCI: imx6: Add support for i.MX8MQ") Signed-off-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam Reviewed-by: Frank Li --- drivers/pci/controller/dwc/pci-imx6.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 81f1f68ccc14..3538440601a7 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1367,7 +1367,6 @@ static int imx_pcie_probe(struct platform_device *pdev) switch (imx_pcie->drvdata->variant) { case IMX8MQ: case IMX8MQ_EP: - case IMX7D: if (dbi_base->start == IMX8MQ_PCIE2_BASE_ADDR) imx_pcie->controller_id = 1; break; From patchwork Tue Nov 26 07:56:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13885565 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 660DCD5A6EC for ; Tue, 26 Nov 2024 08:03:39 +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:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CxI4VLAgO8GCMamGaj7SYQwMPhK96gaRu9Y/7KCJ42E=; b=t7Hah4ZauZ8IFtkD1IvwmDFJYM 7I09welZIoJgFkuUrz7HyGvFD78ecvSNFVpLBa0agwr+5eU41rJexy7L6Dq717nUBMtuyD4dUJGho rzxCnQd+QwtMp9seWTMY0p4ZvtSkZLSq3I6BYLjVpHMQHZy1CBRnTR0fKd3Y0IHSTyjK+8D9fqJnF N2v6AaMdaEufmN0Smm+gdraXw26AvVOUS8RHrMtgJL1I8erjsOXTbTxrrivmR+amW6t+muE0gIK0/ MwPYN34DQN2qOcaCmJWukVZLHT38ZXOyuSRAODjMKlxalXwAnENokMJEW1xXKi9A8ISY1JeT58TCP KEkiW+9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFqXe-00000009uwW-116i; Tue, 26 Nov 2024 08:03:26 +0000 Received: from mail-westeuropeazlp170110003.outbound.protection.outlook.com ([2a01:111:f403:c201::3] helo=AS8PR04CU009.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFqSd-00000009tch-2FmJ for linux-arm-kernel@lists.infradead.org; Tue, 26 Nov 2024 07:58:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N9M/ic3DiUosb3LIJuxT7C2S3DgU+SSTbgEGiSGox3fzOgz4aGY5/pjf/HcdN5dwQfVFazBZPBYwx73EsmKFceERuaS9SB0ClBz+y48WqEg6FxEmaVCE7F9V/fDQY8NzdMZq4UpqbghdyG6GqoJnbLegqlA4r8jqVqSGssSthn2HElnXlRLx50eI+XEIHFh+u+fzzmtWcI096PtpRBHS+lrRwmqfxzZoVMcRyvBUu3kCsHHg02uFiVBIIcjRz0urmTcF/v2Jou/bz5qdwWVAblt2HTqDfCR5WqNyChwOMtRgi6vuda+W9yUjJ7jAQ8kVUN0tMfmnV4UVvLzBaxpr2w== 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=CxI4VLAgO8GCMamGaj7SYQwMPhK96gaRu9Y/7KCJ42E=; b=f3sV3BwCT+YgDA8EySUXbPDojhYKd/6mQMZWiE1TnXazre+5QG2+BaQMMbx06WsYDZgUw3AbHh5RhA6Id6YWoptRGwySCPjqoBNw1LngbPwbctWiazf3uD6otEgblrOWcvoqEbF9DLFpQE2kBxf1nXBpKijGt46iOXwueQLbW0zVD521nPIg0ZL6fHZiTel8cO1ZxIdMAULLpulVRU3A9Wk9wzk73NADPz5sKsBnL1M5pZHPvFdiqOWweuOcYZVhxAzkcGY1lvuPDMl2zfTHoKKpMeNJ3NNSphKzK005ESOv3dcZ0OAkKHofeZqQa1MDPgjd7M0pVpBHnBXQtnOLcQ== 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=CxI4VLAgO8GCMamGaj7SYQwMPhK96gaRu9Y/7KCJ42E=; b=B/OVxgxIrjwNIF2rBhgdORDUNJvK5PU7mbD3kYSuXyiNdDiu0/7BL6+7wwCrOBWANdoyi0W8j7a7/Gw4noqSNeAP3V926/ZXJDXTK/JRqOYc5XR6+tn69Rl1rmoniH9TWbEIroqDCIsVeDvkEuSKzpTCP1q3fx2VQDHHap7tqiEA3Ijxip6tWscWHcikYqn76cjKy5xfHVq/0szUrX/MrIU33YGdYq+y+PDbvtOA0szLqAw4ef0YHMs1W6vlpJTboPYbA8tYnx00fwN1NJ1htyjj11++Elb8um4yfi0GsRm31PeyaU175DLwt1x8iO0ZpUd2IzgdE77/dKrVZ84oBg== 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 PAXPR04MB8489.eurprd04.prod.outlook.com (2603:10a6:102:1dd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.20; Tue, 26 Nov 2024 07:58:11 +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:58:11 +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, Richard Zhu , Frank Li Subject: [PATCH v7 05/10] PCI: imx6: Deassert apps_reset in imx_pcie_deassert_core_reset() Date: Tue, 26 Nov 2024 15:56:57 +0800 Message-Id: <20241126075702.4099164-6-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241126075702.4099164-1-hongxing.zhu@nxp.com> References: <20241126075702.4099164-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SI1PR02CA0060.apcprd02.prod.outlook.com (2603:1096:4:1f5::17) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|PAXPR04MB8489:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b550961-c669-4ac9-923d-08dd0df012a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: XDHjEt3T/XhZvdR9x7xa3xtG3+mtWRuaVDN3diq6bqcV0r7v2yTzs4TbFWFrRDxpx/ImmZUFnT3f/ZctjjlqsnaNO/rpuW0nRM2NW521dh4eAWa88Xhg4NoY/6iPEwEmHOKx8fkracTEkESL9OP2pFSPtZqhFZzvuL4QB8y3PS2I/Tct8ptMjf5+rrvmb7ZjoF5xntCETh72px0MWbA54QbLBKiBlTEUSQJ0TlgXLLxu9SEl6QthBNbG/DdlsL9SN4yfVRQapeUpuR2STz1h/iH4GErfIcw5wwXopd32OF/hO9c3k+gV0nBeS1X8McIDrtI/Q4xywBjGfjiUcIK7OmEkz3ZUcjlCOp49oZRllEYShmVjWgf28gpReZkY6gT4/CbwRhsqAPHM0rL17w7eTaE8sFWCj+3+SUKzhyZRrCJS1YL+zTazR8xJ+1zk7IZ5Su2/M4vOWfaxkxISwWGZFrZJ5Xx5yu6eyF9ap7ZAKLkjkH3USviEVj2nnuK/o1tTz5qHtLmTqHpRRXOgveGOrunFIZfDm0WcmJ/EQW37GsUWbc1bkuADPPhf7tAE+9pcnZO1P7pF7DpRHpEbYHs6KPQw/uSorIpVHVTqtLAL9dLhqazxBqVOzmoYuNNFiZJRkXU2UWm45gPOuxpF7aqNfEDp19yKjFGA2tk3H56zh5sNrD8VT+uDe59wG3c0Rb8oPuzQG1mHUK396lWLzF4H7isiwzUKPpYRW1C5GwIv3c4UI3nlRXeCHFlFecNWieAJWR8Wwo0tC77cZL+7Km6ZNASKbACHSH0QHDCnTKFtXSZPNelsdFs6FiyjKedmd19v8rkuO4Q18CcKMondv914bmiuK8gENyNirQy599t6OHz1DQaKK+6AVFc0nMaRlSseFf8MWKmyugEqENpgLffHQzys5oDPSD4gHdL0kimsz74ySWE0IO93gfxem/8yeUXGPhKT1GAFotauQZV7m2qqNH8i1YOD59VrSg/uS+Sr7LLbiJRhgy2y75xKMjEiFHCVjs2RO9TWXy2K64g2X5vBBEgs07HFeI3SAzVwJRkV6KvFKWBTJfA7u3weoBZ2vVtbRvVx26lQl4xTsWht2MTUAT2Ip6S13zUGsXZoyq965NGJmZaicYje/Fg48IHJ8/IlcJ36wi5q8W9Yd1cYmgqQcaUlotXofQc8zTWYfz7jmJPAo2JxfA4T0FhRQ7d3jcx9miZi6gg2CKAO3o+ctU29hRuy4gxwNVajZena4YoORco0t6PlBXWE8wAhN3lanY9T5cXFF1YTKXzwptUbgx+D2d3WuYug8RyrJ3zJTSevx8zEH9t/KKi3OJA9VRBZ/SruHF0Qxdbjal5OOZbhHvjApyJtwKYcA01aPymqbRtotvJTwzuB8ZRZvFkdwqvAjegL4oiBSBDah9E9puiDlR/Ow9SFWevu0vmb+AlHEaOAmhQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8676.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: adLTZHBlYNMjIUuQCbWR4vzh/EP8Lg/wiD/RQCIs2V7nkX0iH0cFtV6qnfreFdi/I4dZplDzHMpV5LCGesijI+/GVAeiNvFakAKMUffCiNLDcCHraJXT+QnOSGnq5FXsd5djx6zYkHrge7bwfKU50UXkOLS64riwAC3Dv5HTJTSi0VnCVJZI+Gla7JB8RwxHtEIJRQyV3851WuUvJ2rx2j9Yb9hCERnMeiiboHjblOe4u/X/6MaNQWPXPHGjuh6u/rjsffL8pkrX3et4aIQwo3kA8KwgKFtdDU2UTWuRakde0xyrwRrs5HAYcaEEvRiXOTFSAHjkezIB6UWrf4JyjmNdhHi73Z/ZnTmJYwfBnbNsJVylq/HkcyYK11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htu5M1ihazx/NFVsH9B774ln72ECSF5R3GztxY5BlkFaNf4Tw5SuQ/5XQirdr481jMSMKvZR8/faLllsP7MTgACmxzG4d/79eL4q+gfFc6FNcZqr6J8xPHbcB7+6hAUIAuyAH X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b550961-c669-4ac9-923d-08dd0df012a9 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:58:11.6370 (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: JGC6B4VeL4ZqWlSGcnGQSEwzqv8aOmlFD8uToYZWgq+ZU3OqExUFEMSlDgkxtIayo4AecdRVVcMc1V8GvSdR+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8489 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241125_235815_574115_953FB5AB X-CRM114-Status: UNSURE ( 9.86 ) X-CRM114-Notice: Please train this message. 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 Since the apps_reset is asserted in imx_pcie_assert_core_reset(), it should be deasserted in imx_pcie_deassert_core_reset(). Fixes: 9b3fe6796d7c ("PCI: imx6: Add code to support i.MX7D") Signed-off-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam Reviewed-by: Frank Li --- drivers/pci/controller/dwc/pci-imx6.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 3538440601a7..413db182ce9f 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -776,6 +776,7 @@ static void imx_pcie_assert_core_reset(struct imx_pcie *imx_pcie) static int imx_pcie_deassert_core_reset(struct imx_pcie *imx_pcie) { reset_control_deassert(imx_pcie->pciephy_reset); + reset_control_deassert(imx_pcie->apps_reset); if (imx_pcie->drvdata->core_reset) imx_pcie->drvdata->core_reset(imx_pcie, false); From patchwork Tue Nov 26 07:56:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13885568 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 70C45D5A6EC for ; Tue, 26 Nov 2024 08:04:35 +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:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gw2GdgKgzxq5HSKx9n+vRdiBQcPlh5JwuYYecwcvkAw=; b=qjF/+gk59joSDrDHnWxllDSdVl hEiHVmXiB7xsN3Te841pwIt3gDvbIqlN1/VnBu1EeIN44iu/1K+rGSh6JZoHl9rhFZlT8QASfJGH6 i5tenL9GApuRwFeglCFXghV/WVZlX3fwWSU1kfGRxX0rgR/HBR8bg9jy6hAgQHoKCg7htG18ODesN c4c414i9J1OeW42bHlTbYAFSwC0p6jfsbj9MFjnPy4djOVTih2CT74PrUu6kYvh44FxQV+VeZdoqp I5QQvJ7I4gXF6nxy43n+6n/Xxx43lqs63ithl6bUlPER9TOAn/PSVQ93VA2mQAH2KUmUyPT4IMlbm cU52pi4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFqYZ-00000009v2a-3rl0; Tue, 26 Nov 2024 08:04:23 +0000 Received: from mail-francecentralazlp170130007.outbound.protection.outlook.com ([2a01:111:f403:c20a::7] helo=PA4PR04CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFqSl-00000009teq-2NVe for linux-arm-kernel@lists.infradead.org; Tue, 26 Nov 2024 07:58:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=P12dig6tgFJkrXDO51C+qHkErt90BUGaePKGXNRlqOMM0wK2HddRUVpE3jQH507he2ksWH2RcZZtv44GoCpzWLuaf6yw4b0DHWQkYj6Z1gsznKI43hSg2h5tHHjKcEnj5YcSQBavRAhrhfH4QnD89wTA1C1J7HDZ+WRbmR9AR5xQ1ZOj9wX4vYGFy+YEOw+W44RUw0uFkGvY2Y1SccdjEVxn1cYnlb5VdcFSvK4nJRQJGdjoqP4R7bc5urT4uC1t8pN2WhVaBaUcFCe33xfo7TZLagSHfe6T5KjG8sAoG1ziNuT3qAasoYXY3ZW3M0Fx/3QZuG1qRk6EyqhkDWcalw== 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=gw2GdgKgzxq5HSKx9n+vRdiBQcPlh5JwuYYecwcvkAw=; b=tLl1WaRFzfru8l7vELIY7Q/XbWIu139osFoMzSpNY4p0gg5sHNzbvCwrY4IaQJ4Le0f4dWBKPWPfmVehJF1Blmso/ZHtJBEjOLOgkKeOdrq2a0POVQZfjzkZkWcwoPW94UNnZyXuXsXt5Cecs0K+1HNTr+5jT0iVi3GUS7lXargG12UWAH0KR6xMjF7ZdVgyqAaUf75jZ9AugT0HKhcs4az1Shdxid09seRCXNVsIW+57Od/4SPgq2QVC5TtwVQ/0IbYu1EuzFQ0frc++6i3u+MMq1CVF6lK1G5Qdg1O0H93GWmPKMKg74ZDLMsWIWi49S4rZsNO2w1bo5IKlR5zbw== 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=gw2GdgKgzxq5HSKx9n+vRdiBQcPlh5JwuYYecwcvkAw=; b=Z122owBxm3Q/xOnGyoVAoRA9E9by67yLopa/YhtSl1CqkcbFqDzE+1UtKUFbYWtdYpk1cVV31L+sGUsNtG5HWgU1lURiuLd++j8io+NHwjVtbJ4lmop2dtHtOHXcS2/OzD1+1fq01vpOni/EOj0qv4V3rRVfcOzXiYbL81G73kwf6jPh7DJRqJHrrrZ9bA4mumi7ExhQUftOVuBI3nDooG2MjZlr1mWCse2sZKvqElBjUTy0caoXq1GsFk10juuVbcXd/gHz9KIWcrp1vzdBWvHi9GbuFMzWNQQUaHgmEV6h+uR64OEFzwPcAVekg8ZxFpkDASM8gUpYdSJ+smBzMw== 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 PAXPR04MB8489.eurprd04.prod.outlook.com (2603:10a6:102:1dd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.20; Tue, 26 Nov 2024 07:58:20 +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:58:20 +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, Richard Zhu , Frank Li Subject: [PATCH v7 06/10] PCI: imx6: Fix the missing reference clock disable logic Date: Tue, 26 Nov 2024 15:56:58 +0800 Message-Id: <20241126075702.4099164-7-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241126075702.4099164-1-hongxing.zhu@nxp.com> References: <20241126075702.4099164-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SI1PR02CA0060.apcprd02.prod.outlook.com (2603:1096:4:1f5::17) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|PAXPR04MB8489:EE_ X-MS-Office365-Filtering-Correlation-Id: 2aa0831c-1c1b-4226-ac01-08dd0df0181e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: w4UpRNiE6U8rUkbpBSSOchl215Y4xU/gtwaXgqMRT3RSzU9meYpf7YJ1RPr0Us6N4x2Af41czVdGg5aAW27OfIpYIWXy+G+KnatyoWNiRMo4qHu5lsXOTZK0E9CLDwD9U9x+rv4GGV1pUwpbxbQhUgsRUwpC/VTclnjV1HTfuuZ5vPJIjKyck5vWk2DFayuSp0agNzIybDm1gzf/QVFRyYwiAiDHkS8jE/sJDYV4eoqvG+sQL+Ry+kDh/PdkSV4q40BLPOhB40KCxPxDFPe3+xdJ+cgBbocJj0Z9DSnBS60KnnIoCUsXsdFSIDLaktCwYjYZIKH55CJz+EikfHXgeat+0vJBQ1/lqscqa1lbYjTamIa+cz5wzcdOjAlqQQQw2OM7s8xPuan83KrL6LsW/e5WFcHy401ABOYpTF45e1ajX4ALwCfZsgIFfH1AJsk8OpIdND5aLiSVN20lrXc6/RaKrW+OzeyVukMWQYxxMen3THiZEMwDjTdJBCw3hoIar7dstHoOr1YhUg5jT0RUgsearf0BWlBHqt49rU1FDGRHTTKN6NZG+L6fLyGiw3NDtRWR9S9QLt8S4VYYgkJtHrNCYq1pwEzeDVAan7mTyoiiuoK2iTnzvycvHgeNpy90AnyUJ9YFOVzlhma8K1myB4rK4YaoY6aY6vKIPX65iLwjFuIu0UgKXdh8LKoydb6TpVD8v6cKvhpjiz7zfii7LWSXPo+T94So3lrC+wZgfniqFevGG9DuCuXcg/n9tGTO8zx5PNF0llCcMAoUyPUmRw5F6EsROIJ+Sqv3x8eN98/Knu2tQfZp4L9MeFkE86MJXwCZ8SuOf00EjZbRT/S4qWE8pkBjsxQTj6lgC9QrkFHCJ9uHrBrcqbFBB4z/m379YNIqCXzRBvJ+MiroIpiXtiptEEZXuQbE9fxxVMrIZ1GMKFWsL/wnNtIIVoJCxb/juU5BwqVE5piRNM/sOHIkkKEWgSBH20idd8nhnRpG+skZaxPIIxeI5pKsKUzj2O7JVnOjpoiC2F4UtP/imuwtQ3fBgo0JkFYUtdTs/j4achEx6RfCz7aQMDv47CHJnuoG4+UMnoDM0wCMw7cz0fyDkxkds/tutJPvX9iVSIsj9OeMab+RTt8ssI+QPExAQZv5ReCGwKXxKfC3ojpqjJJL4JONgB9aCZkFrfBGe06e9nvriawY8zS3tRQM1jjw/mXqQmhOXArdRZcSPzd54OBIFIdA0mn0eqXJ7V+1Zl+RX+UHC0O+H/J5lUpXBfsWnSjMWwkh+I4TvRrlmm24bNCdiHHRu+AhZtDXRYFFc/WBJuE+aWa8uILg0VSFBIkVTgsF3K6DR2NTqPujyByQeXFBhO5frEPghC8yHkrMbU0shSXlyxQ7/RNuI6ez4V06Sk3O3ubnc72g7o5dfGdbB5PLtb46X2IFzn7P1948yRbzakA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8676.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ok3N50o/l2ekSoPqSnoGH/328NRxW+HzA4WvGd6hOhnvX/mmxhhc2mp8hL/gqMfwY1nIvtJ2txY91wYjX2WCOVAeBKWV50JOxbdmTVfcC9zHcGFBj2gRNUWVQpjW2mQ+cnSnb8iGFQZ52UoHH3Xc89HKHfbzM6m9IH/aLGhDzwChSAg37qf0A9bjTomsN+0gfVMZ5xt4aXKoj8FsdsUkAz4tuDmcVU0R4vUKKfaVFveXADZDKtr68G9275USI/wfgVCEyAoFyP89340CAJ7fdFLMA9TwFXZdhSOSbREe0cNpFIQ5/tbvYLtkzM1yPKBwp90gTmS4PSlspm092sXE8h09S+2YT/VIaePyQN6VNTZze+HOM/HIuvg3aVM/J67bOpVmHkmekryJLKLDjNGtDIoSCet0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X1I15evDHRnV/hCYsQdqvxO6GhKXDZtMM090rTN6BYt9FB4LPShZW5jhtLSrLnjLSPtHGE485mNeoZT0IKICNKpBPsPLu76ObLmodMh3yqhIBKZqu5zE4a X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2aa0831c-1c1b-4226-ac01-08dd0df0181e 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:58:20.6690 (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: KTYJovi5cncek4WfgNMnw3OwMdFh2HdXAfjY0mV9aDeVESHIvAjZVv2QgkkxjikKJKL38q3ImaSoqpn10gbQQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8489 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241125_235823_604489_0FEE1991 X-CRM114-Status: GOOD ( 10.72 ) 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 Ensure the *_enable_ref_clk() function is symmetric by addressing missing disable parts on some platforms. Fixes: d0a75c791f98 ("PCI: imx6: Factor out ref clock disable to match enable") Signed-off-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam Reviewed-by: Frank Li --- drivers/pci/controller/dwc/pci-imx6.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 413db182ce9f..ab2c97a8c327 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -599,10 +599,9 @@ static int imx_pcie_attach_pd(struct device *dev) static int imx6sx_pcie_enable_ref_clk(struct imx_pcie *imx_pcie, bool enable) { - if (enable) - regmap_clear_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR12, - IMX6SX_GPR12_PCIE_TEST_POWERDOWN); - + regmap_update_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR12, + IMX6SX_GPR12_PCIE_TEST_POWERDOWN, + enable ? 0 : IMX6SX_GPR12_PCIE_TEST_POWERDOWN); return 0; } @@ -631,19 +630,20 @@ static int imx8mm_pcie_enable_ref_clk(struct imx_pcie *imx_pcie, bool enable) { int offset = imx_pcie_grp_offset(imx_pcie); - if (enable) { - regmap_clear_bits(imx_pcie->iomuxc_gpr, offset, IMX8MQ_GPR_PCIE_CLK_REQ_OVERRIDE); - regmap_set_bits(imx_pcie->iomuxc_gpr, offset, IMX8MQ_GPR_PCIE_CLK_REQ_OVERRIDE_EN); - } - + regmap_update_bits(imx_pcie->iomuxc_gpr, offset, + IMX8MQ_GPR_PCIE_CLK_REQ_OVERRIDE, + enable ? 0 : IMX8MQ_GPR_PCIE_CLK_REQ_OVERRIDE); + regmap_update_bits(imx_pcie->iomuxc_gpr, offset, + IMX8MQ_GPR_PCIE_CLK_REQ_OVERRIDE_EN, + enable ? IMX8MQ_GPR_PCIE_CLK_REQ_OVERRIDE_EN : 0); return 0; } static int imx7d_pcie_enable_ref_clk(struct imx_pcie *imx_pcie, bool enable) { - if (!enable) - regmap_set_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR12, - IMX7D_GPR12_PCIE_PHY_REFCLK_SEL); + regmap_update_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR12, + IMX7D_GPR12_PCIE_PHY_REFCLK_SEL, + enable ? 0 : IMX7D_GPR12_PCIE_PHY_REFCLK_SEL); return 0; } From patchwork Tue Nov 26 07:56:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13885569 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 E1614D5A6EC for ; Tue, 26 Nov 2024 08:05:34 +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:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1I9xxrN2Rh/xWirdR8GNL/HnNXIkRjyXKY9PxRLBtd8=; b=HoynFA8EwUyqtcIabSHXlutkEB xMUUQwuhXELDg9bxDUgkvc0I/yHE50/+Mfp+RmoutO/dredXqnrNwzLRDvOq1OcDOk+h6H+5ZRYCO uU379oZOvoGbnsR80rygHdtU36MbKO3DuFWO/wkivMdqN0oT2lhVcHgsbszlr12hFD6P5AL531MMS ygX1m0kd28k8MN4AYfajmJMg1SXdgAXTmgerhOIFYcqcsRpSKkTSl/DgfuRC1ECtkqKDmZQIC3jxB IxOJimeZUfRvt6rMoOjJmOoruaL9eXjbhALetUtpstSIzsGhtfhPibsbFqzKIwMeREK4cxpVnxuqy 5Mx9YxfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFqZW-00000009vBx-24ax; Tue, 26 Nov 2024 08:05:22 +0000 Received: from mail-westeuropeazlp170110003.outbound.protection.outlook.com ([2a01:111:f403:c201::3] helo=AS8PR04CU009.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFqSu-00000009thb-2nxd for linux-arm-kernel@lists.infradead.org; Tue, 26 Nov 2024 07:58:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ALyB6yLJ9VWwjsV57T8G2Apiagbxt4f3omTshYhZf17QDjfYDAMH5XfbfWUAsGLSfvVjFTZKWkIMLDg5WW0IThaTlBuzEAdtkoMloIvq8NI5Bky+zo9LmSxSCxjNq9ysVCNcsI+vJaEDMKFvVPUXyU5BhSQ/5dvydZgk1gX49Ki6Jz+n5awOtk7X4czjXR5D5QZo3qJF5NxRWsFFFvpXrXwf0d1+5WXK8/7cp/S5wQgLk5dyWQQuQ1zcq6wj6XX7k2L9H6YB6PJza1It+1sD+ZWDW2oVHzkkL03bvyAyC+LyLVVLYZYShapeHScn9JN38D5LK8jAj6JHkDeSUxiVpA== 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=1I9xxrN2Rh/xWirdR8GNL/HnNXIkRjyXKY9PxRLBtd8=; b=v0868kTI/vJiKE0dGIVY8uwZY6SsM+FytRw/mhcrTWuil9h7zESmcvh8PcwEo8nqp5xg+HA4dmThT0ygO+4MNsmdyO7WQ8df0bE0DPbz8WSRvzETyFB2ecL4Tub1dXPvh3viWhWG/HsNmjq3UJmi1U4tVcQX63O9fGvT7Z8wBw9cMHw6+jhpzfI69XXfBwpbU621n7lcBGBon8uw7+WfwSXTUkknqMA+k5fMz2aWfXZSlYIRuYTs7wc7iM2nMm9YwxG6wnwQo1DnLkDr3v1YD/GJhFVBoMHpV9sLhE6X/lUZDr66O5YKtV4EGHaiSdR4Ao4hMThg4T7wen+DHUCYdw== 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=1I9xxrN2Rh/xWirdR8GNL/HnNXIkRjyXKY9PxRLBtd8=; b=MNNu2BGXO+ibiCekeDeFenSI3z3ewqblhyxGxV0X2gZWAwlGi+1pwQ/kJEHRj2fYm2CUqOchr4SDiWna77eUMc9GPVctPoEFQ4yvCVR6ezFzvau3ATXBNvVlpeZtWmq/TyCfG2DD8qjxkN0jJdqxOEfnXCPf/iJurew9QaXu1BqXbbLKNw3eKAVFfTbS0IBdE9VS/w8BAo+dSOEgzP/mu7rPIGKBsDbSaYhiVQImIBNprSSCB0VGjyxTf1hL3Ar1I8GAoqJ0vNzWO+hwXQSSs78XmvvszJFeCx0yo0bZy2vIyrkbtktA1Dz4DDKoNz/ka3QYmkP+kHLK2x0KxfBWaQ== 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 PAXPR04MB8489.eurprd04.prod.outlook.com (2603:10a6:102:1dd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.20; Tue, 26 Nov 2024 07:58: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:58: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, Richard Zhu , Frank Li Subject: [PATCH v7 07/10] PCI: imx6: Remove imx7d_pcie_init_phy() function Date: Tue, 26 Nov 2024 15:56:59 +0800 Message-Id: <20241126075702.4099164-8-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241126075702.4099164-1-hongxing.zhu@nxp.com> References: <20241126075702.4099164-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SI1PR02CA0060.apcprd02.prod.outlook.com (2603:1096:4:1f5::17) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|PAXPR04MB8489:EE_ X-MS-Office365-Filtering-Correlation-Id: 9660762d-6c8d-4228-a002-08dd0df01d2b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: 47QHSo0ZUPdeqDAPyWBhFsfCDWHpBVPI3IFtrQqs7M+to/PuWUZ2UJNB1YwFbD3NmKLd+CxLwqJXoqccBlMcjYkfrGUigcLpO4T160mOnzX/eyFPprSMD2hMX+temB6smI4sbdu19QCbO88BzCzIKjtYaRckOLQd+f919F736zf4sJRnIGSqSbp8pCZhbdsVe7awPsD+/KZTUrNd3kUyMtlxJocaR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Ff6yWfNDG2wv5NAJbVQVi3798I30lDcEqnvxCYxW6JO91epWjBRLQ1y/l2I0ZyQqLPl+RsGdvihDXk8lZGVLWLiiEoMgnmwnGQWJcomo8DCGfYhOklh8Rut0tsTzv7gcuqTaGSQmfY+89r0kENIjw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8676.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8fz6R+wYm8rzfBtp/ImH0MlvcF5PpQn7hN7hOm5FzxYPBv0k4W8T6IrwLqzNdVldvMdyok1U1o3VXEfmPexdD5e0zzdmlzgHkfua/CxJX0xfAhVd1reTFSVZa7psx0XKIae66l5USqjbtVlN3/OHzsOgBZE2PfW7IO4XKbGLzZ9cLWTRRCntYa3syNumRnW9DsCzqnTSw/lcZ1MmGakJWbbXYKUdhMICKm1UAqhVEOYP09UNbRQ3XNXcuOEGHXZv7nyrERDEW62whvla+CM5hdAwokIldF30JiQKjAn4jmh0MlQ+wYUBUEsGIpjqD61+Mk6uDtghHq4RPVXuZ4z7Aq0CTDjzvphc7wAqK5GSyi4DHeEMcHEe9rze3udXifWVmOpygw2e7MxhawFfefnW50Yw27nNYTrh8JRRWjJkrfpm8D0OAcG+T75l+oIShBzXoPgzeGnQXt4cbFsdaTlD0YvORAND/aa0rQbHiCLo79qRytUhPnxfCen4V4I0Az9YPNXxks2m21dnidQsQqYQPxSwFECXteq6gXmIWRpuzWsX+F9vS6aAYIPjbYC4oz4rgJw+Oef5Er7tG2fQHJOso9wi/Z4lZPoe7D7A+vURVRssTYks6Jlg8IDD3xSyejeCClalWB0VWUz94y7iHAWJxckAZRvBvyzVaRUQrOZGnvmbzhAMPN44VfhBPKS96q5Er4oRxSTQBZqxagg3a0DqFlZdSkaFoCTIW9jxmGAUYhIJlRyA7vdJPPNZsI3ctFdLyuVHp/wYd26HycOsBcDvTktNKWenh0cL29JYQZj8PxuB2CM9mmDTfuSiPz5bMy4iwTBWG+poHpsku9jUmNFMoYNhqq0vFeckLC4H9ug6GwXirpGBarqJ5eW54e/+LgFFy9SNo4DXpUGGHuK/3jTqaBgih5jkb/jkJbAxyb8vywaEFFixNXuAQ1MQsHpMQfaI8Nn4RzF/lPoKSd4t2k9EI9rRD3LSW+M8vXeWSI7pHsWfHmFtYKrrSpRjB2IWs2JiF3Q/bxmGg/KqWdGc3UUAWybzi6Zg1iheTlZv99DPIFgRA3SDTJ1SJcfpBqx2HTBqAa7xeRNWoheCZRH0e/26Qkaz1ISOHTkxY8nm6NyQsrr9NoEuK88rp/5IbhAhKpZetWlHhZmaIHx0F//7VoOjqlVsCy8jBF8Kcz4mKI5R4GvmkT5qfwo+WZMteqr2FhyeU6lTOEIP3WdJjq+5G/NcnZxcD1c99R2MdkXyblb0cvxfS5Ru0vLETVKiC4Otrb6a+aJQH00Wz9YRSHN/yhaEQ8/mV5hckjtFCirT3lY8Z8UqY6t2mZg7LkJkrwnUHTIaXfnqYr3Itczm0dqlhLzT8YZNzN0LkjWz+03rORWArG+0NT1ySyTE0jWovXn8uL3oKoTrvUapEAgrR42C7094rXgTvuPMiWDllQU6j82eVc3m+8c0IwpHuPrrTn5a4yzQ9YKsHACqJxqXQuD/3fenEPwLOlhp576P0OMN4fLS6ZjoUg5z3SY7OCKI1gupbsspigR2r9ybRcI9BsqKBqETsHon8TazyKBiolye4r9RFI89pbimAog9iHBI/ll131c3 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9660762d-6c8d-4228-a002-08dd0df01d2b 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:58:29.3235 (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: UErIZcrJHrGP7PwfuDJp4FGeqvIVYWG1OcnyNYLG1nOnwQhFx/xJyMs5aKGppMneKa6SL+JJgAEBN++cMCHdRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8489 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241125_235832_963544_0A1FDD30 X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. 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 This function essentially duplicates imx7d_pcie_enable_ref_clk(). So remove it. Signed-off-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam Reviewed-by: Frank Li --- drivers/pci/controller/dwc/pci-imx6.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index ab2c97a8c327..743a71789d17 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -394,13 +394,6 @@ static int imx8mq_pcie_init_phy(struct imx_pcie *imx_pcie) return 0; } -static int imx7d_pcie_init_phy(struct imx_pcie *imx_pcie) -{ - regmap_update_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR12, IMX7D_GPR12_PCIE_PHY_REFCLK_SEL, 0); - - return 0; -} - static int imx_pcie_init_phy(struct imx_pcie *imx_pcie) { regmap_update_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR12, @@ -1554,7 +1547,6 @@ static const struct imx_pcie_drvdata drvdata[] = { .clks_cnt = ARRAY_SIZE(imx6q_clks), .mode_off[0] = IOMUXC_GPR12, .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, - .init_phy = imx7d_pcie_init_phy, .enable_ref_clk = imx7d_pcie_enable_ref_clk, .core_reset = imx7d_pcie_core_reset, }, From patchwork Tue Nov 26 07:57:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13885570 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 B9348D5A6EC for ; Tue, 26 Nov 2024 08:06:31 +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:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=w+OKB8DzfxagjRKA9ol6U2fawtn/kUe8NHHBHTyWjvE=; b=G905CpNo/XfTK4jrrz1twNxcJl ipVgv/9CVNS+DfRqCQuJ5pVXabZTskt7Bww90KUS9THpaJnpEATx88RPYoUJD1bpqg2xvelwggrus ywHo6PGGOkTzrGC+15UPEJ5/587SiQHN6ymoK65+oFEBAgY7VeukJ8Qo1a3xTAyISma5um/gJxMgc il6zlH4XWTvprDCnKYs7IzhRIFmzAAZXw5PA/eIqOKxGBebEXZ8k/4udYX6RDncUbplmosNzUTZMq WWlxryHCfYCZhRzmiHG3xZ07Uj+bULPM66AaYtqcx1iyc9oLBfAgloqdwtqOg1dP/Zw+Yc/NLuasS 5lTNru3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFqaS-00000009vMd-0LWo; Tue, 26 Nov 2024 08:06:20 +0000 Received: from mail-westeuropeazlp170110003.outbound.protection.outlook.com ([2a01:111:f403:c201::3] helo=AS8PR04CU009.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFqT5-00000009tl3-33RM for linux-arm-kernel@lists.infradead.org; Tue, 26 Nov 2024 07:58:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=S1umzTBTdUxb7yzJ437qJXHlUCHrmq6semEt+hfGxDCwSZiyzXaXIcGyQts9gx3VVMcnxCDJM1Qovh2We+Ql5Txu/t4bjzW23knyGmW5zTJVfdrO63AuO+j/UItvjZwqb5A1CiAjfmApixDBvScXHoSerx4wpJHbOgo9UdGD5+QwIIuctEGTgTYnL3wrhYY6X8mbyDKppt1ANGP9ig1+RaVn1XplbmvOeUmD73PqocyHOF1vYpSmDxPktWEsDI0DICCxa8eXYlEb6khmvzyouf09GdhNSs5anm60W7fAsS0KB0cS/HP8iDHfFwC/woZaKo+RoQ0JSKG4WtkdfuW57g== 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=w+OKB8DzfxagjRKA9ol6U2fawtn/kUe8NHHBHTyWjvE=; b=sXDBYTgNNkA8Qjsqux0zWnc1laZ78wlxKJ8UTOpVluFCRSQtUZTmK7B0le8QGkrzT15ev7fTXQgqciB3aZmmpTRELnpukL8jC73J/jK73YzJgxelI/T87OUb9e3xdbuxF++D798FPp95sPdth8O8G9NunpVri62ouQtoVJqRQyQUNEOOMuVCvI7GdguYP5SG6X1yYhi7oR7tSSXZkLkDWvmrSj3aTt+H3bGsEV/reOXGMsI5bW/z4UXb5Kqpig5CdER2QX4wktS2D9aZLO7gZ+/yRlOQl5mlzrHqBCVz/2AHsDFHGLsgNRmFIbJI33dPp4bdWj3FrSGfdi66liiBSQ== 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=w+OKB8DzfxagjRKA9ol6U2fawtn/kUe8NHHBHTyWjvE=; b=KByZizsdS+6SBmxciGLE3UMVTE9RekkFB3040Zw8/4kS/wUBcCNhszwDvqRNRJy8CqDe1O3XPOpslgk+9uzwgmLmoFrzyL7cOPtLwMtWvBs0dkSxz9LaQGHbfLYiLkHT1PbZBXFnEo39a07Vn5VGm0Tdy+hJ2LzVclwNvBd0uvxxIUXS8T5r12X4WqB6kwWniB9ofDcZtZ+Jrve+s2j4Hy148BU9ritdMZhUKS4XgxiHw14a2vhaGtn3rUmd4PcCk51O5d+WRe0jxIq16Ga6YxXBSH776pf7cFHozrBmX9PqRFj2nEuLJmPfBBNCKJQmXqrGdJ2COQfH6OQucp2fMA== 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 PAXPR04MB8489.eurprd04.prod.outlook.com (2603:10a6:102:1dd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.20; Tue, 26 Nov 2024 07:58:39 +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:58:37 +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, Frank Li , Richard Zhu Subject: [PATCH v7 08/10] PCI: imx6: Use dwc common suspend resume method Date: Tue, 26 Nov 2024 15:57:00 +0800 Message-Id: <20241126075702.4099164-9-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241126075702.4099164-1-hongxing.zhu@nxp.com> References: <20241126075702.4099164-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SI1PR02CA0060.apcprd02.prod.outlook.com (2603:1096:4:1f5::17) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|PAXPR04MB8489:EE_ X-MS-Office365-Filtering-Correlation-Id: 9600350a-d2ba-45b9-2f49-08dd0df02219 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: D2yHNax5RTCAgL/neX7PXXTJCRotTbDlxrpe4yrxF+Vwx50wwk4S8ENFklGO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aoQEMjWNE1CPJCAQYkExxde2AFTXnZeXuMiTb1UC2UFEHbPhi1pljPHDo4MUKWjpHWIciUc27ptpuol30n1G5QkGPkZMQdpBkCFofomiBhc8AoChk8Ii8Va+oYWqZ3w5eNgkV7E+kG31ZyJ4+C77eT4A5t/uU7CuXN3kxMd7+ZbiJ95NWeyfx1XlP6cdYj2B2l7hl6VQZwGoSBP+EVdRFqvWWmpVu3G3WshaNANgYxwEOIOhR4pV8YPw8i/PnSOrpyqgRbMb1Pe/GyU9hDKpnutGKtIWtedc9NtLRDvLO6MvX8L/k9Syk4TMcBzxV1Kfs= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8676.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WuEhwjlj1xnlJOWD7f97WU8QFJNzoNQp7AF9Z6K8FZqIZVx3chURSzK6qc+KioydpZyXgUg2MFW3Sm9xLgEGH2xeQq/+wLgcess5n8SJ3SN0zqLR31En7XO1LFqq2HFfwJV75Ghj3u6JMLqvL01GAS7c807Jc9srRyfPWuUnvGEhAlTDrGxNc6/FuEM0VXhWwcACwYHhjiyOA4oCddGgEadhkDWhBupFxVuiZlFAH4CmqaoyDGYxAiVEgZQFfkidtnwFzf63d/99u4L9Wda0kIjaRm08gPqRkNKmNbX/7GKSLoNqKMCNC2QsA6WIPFsW9DXHvvNYjVwVR+lQdWYBbK7Of2okAuf2uzEDxc+WkgTGk38tVS36DyfPFS5U/A+LzggQwz7Faz3RBMi8b4iNljPvKUiTAqzwVLu65Ua0aaZMAzNBohhQh1/LUIKV99FFqpDVADuDJnowfXZB9hmv0k1akVQQBGhhPHzP7+jGPRzOYoxyJypbD3JmL3aH5JCad4CK/6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riginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9600350a-d2ba-45b9-2f49-08dd0df02219 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:58:37.4304 (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: q8Wx+AYziR1x9uLuEKsv/bvWp0Fj3P9weS5nQA97eZmAIEB4kGfZIZHbJe1CH+6BXIhIUYFNG19GFlDmCwuwnA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8489 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241125_235843_921384_2EF8AA6B X-CRM114-Status: GOOD ( 19.03 ) 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 From: Frank Li Call common dwc suspend/resume function. Use dwc common iATU method to send out PME_TURN_OFF message. In Old DWC implementations, PCIE_ATU_INHIBIT_PAYLOAD bit in iATU Ctrl2 register is reserved. So the generic DWC implementation of sending the PME_Turn_Off message using a dummy MMIO write cannot be used. Use previouse method to kick off PME_TURN_OFF MSG for these platforms. SRC(System Reset Control) interface is used to toggle 'turnoff_reset' to send PME_TURN_OFF and since the DWC implementation is used, it is not needed now. Replace the imx_pcie_stop_link() and imx_pcie_host_exit() by dw_pcie_suspend_noirq() in imx_pcie_suspend_noirq(). Since dw_pcie_suspend_noirq() already does these, see below call stack: dw_pcie_suspend_noirq() dw_pcie_stop_link(); imx_pcie_stop_link(); pci->pp.ops->deinit(); imx_pcie_host_exit(); Replace the imx_pcie_host_init(), dw_pcie_setup_rc() and imx_pcie_start_link() by dw_pcie_resume_noirq() in imx_pcie_resume_noirq(). Since dw_pcie_resume_noirq() already does these, see below call stack: dw_pcie_resume_noirq() pci->pp.ops->init(); imx_pcie_host_init(); dw_pcie_setup_rc(); dw_pcie_start_link(); imx_pcie_start_link(); Signed-off-by: Frank Li Signed-off-by: Richard Zhu --- drivers/pci/controller/dwc/pci-imx6.c | 96 ++++++++++----------------- 1 file changed, 35 insertions(+), 61 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 743a71789d17..87dac4ac9d10 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -33,6 +33,7 @@ #include #include +#include "../../pci.h" #include "pcie-designware.h" #define IMX8MQ_GPR_PCIE_REF_USE_PAD BIT(9) @@ -112,19 +113,18 @@ struct imx_pcie_drvdata { int (*init_phy)(struct imx_pcie *pcie); int (*enable_ref_clk)(struct imx_pcie *pcie, bool enable); int (*core_reset)(struct imx_pcie *pcie, bool assert); + const struct dw_pcie_host_ops *ops; }; struct imx_pcie { struct dw_pcie *pci; struct gpio_desc *reset_gpiod; - bool link_is_up; struct clk_bulk_data clks[IMX_PCIE_MAX_CLKS]; struct regmap *iomuxc_gpr; u16 msi_ctrl; u32 controller_id; struct reset_control *pciephy_reset; struct reset_control *apps_reset; - struct reset_control *turnoff_reset; u32 tx_deemph_gen1; u32 tx_deemph_gen2_3p5db; u32 tx_deemph_gen2_6db; @@ -903,13 +903,11 @@ static int imx_pcie_start_link(struct dw_pcie *pci) dev_info(dev, "Link: Only Gen1 is enabled\n"); } - imx_pcie->link_is_up = true; tmp = dw_pcie_readw_dbi(pci, offset + PCI_EXP_LNKSTA); dev_info(dev, "Link up, Gen%i\n", tmp & PCI_EXP_LNKSTA_CLS); return 0; err_reset_phy: - imx_pcie->link_is_up = false; dev_dbg(dev, "PHY DEBUG_R0=0x%08x DEBUG_R1=0x%08x\n", dw_pcie_readl_dbi(pci, PCIE_PORT_DEBUG0), dw_pcie_readl_dbi(pci, PCIE_PORT_DEBUG1)); @@ -1014,9 +1012,31 @@ static void imx_pcie_host_exit(struct dw_pcie_rp *pp) regulator_disable(imx_pcie->vpcie); } +/* + * In Old DWC implementations, PCIE_ATU_INHIBIT_PAYLOAD bit in iATU Ctrl2 + * register is reserved. So the generic DWC implementation of sending the + * PME_Turn_Off message using a dummy MMIO write cannot be used. + */ +static void imx_pcie_pme_turn_off(struct dw_pcie_rp *pp) +{ + struct dw_pcie *pci = to_dw_pcie_from_pp(pp); + struct imx_pcie *imx_pcie = to_imx_pcie(pci); + + regmap_set_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR12, IMX6SX_GPR12_PCIE_PM_TURN_OFF); + regmap_clear_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR12, IMX6SX_GPR12_PCIE_PM_TURN_OFF); + + usleep_range(PCIE_PME_TO_L2_TIMEOUT_US/10, PCIE_PME_TO_L2_TIMEOUT_US); +} + static const struct dw_pcie_host_ops imx_pcie_host_ops = { .init = imx_pcie_host_init, .deinit = imx_pcie_host_exit, + .pme_turn_off = imx_pcie_pme_turn_off, +}; + +static const struct dw_pcie_host_ops imx_pcie_host_dw_pme_ops = { + .init = imx_pcie_host_init, + .deinit = imx_pcie_host_exit, }; static const struct dw_pcie_ops dw_pcie_ops = { @@ -1143,43 +1163,6 @@ static int imx_add_pcie_ep(struct imx_pcie *imx_pcie, return 0; } -static void imx_pcie_pm_turnoff(struct imx_pcie *imx_pcie) -{ - struct device *dev = imx_pcie->pci->dev; - - /* Some variants have a turnoff reset in DT */ - if (imx_pcie->turnoff_reset) { - reset_control_assert(imx_pcie->turnoff_reset); - reset_control_deassert(imx_pcie->turnoff_reset); - goto pm_turnoff_sleep; - } - - /* Others poke directly at IOMUXC registers */ - switch (imx_pcie->drvdata->variant) { - case IMX6SX: - case IMX6QP: - regmap_update_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR12, - IMX6SX_GPR12_PCIE_PM_TURN_OFF, - IMX6SX_GPR12_PCIE_PM_TURN_OFF); - regmap_update_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR12, - IMX6SX_GPR12_PCIE_PM_TURN_OFF, 0); - break; - default: - dev_err(dev, "PME_Turn_Off not implemented\n"); - return; - } - - /* - * Components with an upstream port must respond to - * PME_Turn_Off with PME_TO_Ack but we can't check. - * - * The standard recommends a 1-10ms timeout after which to - * proceed anyway as if acks were received. - */ -pm_turnoff_sleep: - usleep_range(1000, 10000); -} - static void imx_pcie_msi_save_restore(struct imx_pcie *imx_pcie, bool save) { u8 offset; @@ -1203,7 +1186,6 @@ static void imx_pcie_msi_save_restore(struct imx_pcie *imx_pcie, bool save) static int imx_pcie_suspend_noirq(struct device *dev) { struct imx_pcie *imx_pcie = dev_get_drvdata(dev); - struct dw_pcie_rp *pp = &imx_pcie->pci->pp; if (!(imx_pcie->drvdata->flags & IMX_PCIE_FLAG_SUPPORTS_SUSPEND)) return 0; @@ -1218,9 +1200,7 @@ static int imx_pcie_suspend_noirq(struct device *dev) imx_pcie_assert_core_reset(imx_pcie); imx_pcie->drvdata->enable_ref_clk(imx_pcie, false); } else { - imx_pcie_pm_turnoff(imx_pcie); - imx_pcie_stop_link(imx_pcie->pci); - imx_pcie_host_exit(pp); + return dw_pcie_suspend_noirq(imx_pcie->pci); } return 0; @@ -1230,7 +1210,6 @@ static int imx_pcie_resume_noirq(struct device *dev) { int ret; struct imx_pcie *imx_pcie = dev_get_drvdata(dev); - struct dw_pcie_rp *pp = &imx_pcie->pci->pp; if (!(imx_pcie->drvdata->flags & IMX_PCIE_FLAG_SUPPORTS_SUSPEND)) return 0; @@ -1250,17 +1229,12 @@ static int imx_pcie_resume_noirq(struct device *dev) ret = dw_pcie_setup_rc(&imx_pcie->pci->pp); if (ret) return ret; - imx_pcie_msi_save_restore(imx_pcie, false); } else { - ret = imx_pcie_host_init(pp); + ret = dw_pcie_resume_noirq(imx_pcie->pci); if (ret) return ret; - imx_pcie_msi_save_restore(imx_pcie, false); - dw_pcie_setup_rc(pp); - - if (imx_pcie->link_is_up) - imx_pcie_start_link(imx_pcie->pci); } + imx_pcie_msi_save_restore(imx_pcie, false); return 0; } @@ -1291,11 +1265,15 @@ static int imx_pcie_probe(struct platform_device *pdev) pci->dev = dev; pci->ops = &dw_pcie_ops; - pci->pp.ops = &imx_pcie_host_ops; imx_pcie->pci = pci; imx_pcie->drvdata = of_device_get_match_data(dev); + if (imx_pcie->drvdata->ops) + pci->pp.ops = imx_pcie->drvdata->ops; + else + pci->pp.ops = &imx_pcie_host_dw_pme_ops; + /* Find the PHY if one is defined, only imx7d uses it */ np = of_parse_phandle(node, "fsl,imx7d-pcie-phy", 0); if (np) { @@ -1368,13 +1346,6 @@ static int imx_pcie_probe(struct platform_device *pdev) break; } - /* Grab turnoff reset */ - imx_pcie->turnoff_reset = devm_reset_control_get_optional_exclusive(dev, "turnoff"); - if (IS_ERR(imx_pcie->turnoff_reset)) { - dev_err(dev, "Failed to get TURNOFF reset control\n"); - return PTR_ERR(imx_pcie->turnoff_reset); - } - if (imx_pcie->drvdata->gpr) { /* Grab GPR config register range */ imx_pcie->iomuxc_gpr = @@ -1454,6 +1425,7 @@ static int imx_pcie_probe(struct platform_device *pdev) if (ret < 0) return ret; } else { + pci->pp.use_atu_msg = true; ret = dw_pcie_host_init(&pci->pp); if (ret < 0) return ret; @@ -1519,6 +1491,7 @@ static const struct imx_pcie_drvdata drvdata[] = { .init_phy = imx6sx_pcie_init_phy, .enable_ref_clk = imx6sx_pcie_enable_ref_clk, .core_reset = imx6sx_pcie_core_reset, + .ops = &imx_pcie_host_ops, }, [IMX6QP] = { .variant = IMX6QP, @@ -1536,6 +1509,7 @@ static const struct imx_pcie_drvdata drvdata[] = { .init_phy = imx_pcie_init_phy, .enable_ref_clk = imx6q_pcie_enable_ref_clk, .core_reset = imx6qp_pcie_core_reset, + .ops = &imx_pcie_host_ops, }, [IMX7D] = { .variant = IMX7D, From patchwork Tue Nov 26 07:57:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13885571 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 A3D2BD5A6F2 for ; Tue, 26 Nov 2024 08:07:31 +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:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cpOhGQcAawMozKbRyjDWd0TWIGF9Mne0xxsU7xd3RJs=; b=MqK+82x83T/1bdUcvBKBFc8Xf2 XrikMhewPmS5BtN1qcpPUjF1NhDvBaVI/jnNSGyOwFmY9WJ8Mi5tm3S4rA7WasWQdwD27S7bzHSZB Ud91s0Pl5HSNcIBQimNMIM6DEY00aL0naRKbOnVGO0gBMMcvmC9LrWn0b7sdSJujb1W4cMSaji76P ZvCM01EB2UXi2J2dwxduLv3BVIQiNP7IkwM9aSach324we8FTTm1DIyfmkCbXYIO6faQKpo77qL7M ec1ndm4TkmGrHkyN7PpJ0o2BhSTlAatcp9nguI4V18AjRc7RmdbRO73zLfVMK6YxDsr8UL6fZ4b1L 0fTSxYvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFqbN-00000009vX0-35pn; Tue, 26 Nov 2024 08:07:17 +0000 Received: from mail-westeuropeazlp170110003.outbound.protection.outlook.com ([2a01:111:f403:c201::3] helo=AS8PR04CU009.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFqTA-00000009tnV-3nJF for linux-arm-kernel@lists.infradead.org; Tue, 26 Nov 2024 07:58:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VO4viJuz00Z3pKfMlbw/yF7WujeTbNE4VzMLB3PsWz7lN3xsm5d5yFyAlYoOt8Y51YqELYgKlUE7YH8c+FxaI4A1+f1NNVj0abydhtewjlKnG1O+w93lWnwx/VYwfEF93kXtHpCKTPPvKi0yjnaHo5oXQxGQZjILOXH15ND32n9XCrTevbQTeei9XKjXy8rrX+TU7/fawWUzMK2MwCq9LuqYll/Bu+pnsTR92FhnVDmIgqyboRhE2jbT8uotzlKh4OCTNZxrmgcRJo5QfBQl5goyLlKpLJ3/GTwnqnT/3E2xv7eQicSXg4eG3jOrxkAcb89OddRRD8ZMWUi/82P5+A== 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=cpOhGQcAawMozKbRyjDWd0TWIGF9Mne0xxsU7xd3RJs=; b=aRX9VvT/F+pmheAS9qoDu9TbNQMLgReRi7PLVeYjqcadWOmCH5CvOUoAJ1GkY9+ni26kTm9IBmgfRh9RKhsC3pPyFwDNmnqeTwHHImXDzNNkKdg9q2jq46cd8TMx/g992m2XpY6WgYLOS/pDU+MipHDbOg1Z02HxDGummr4NXhjZNOHsu4PnxIVRQ/pvBP22k9hsFYGQf9f0dXO+vcJvvEaKDzEX2AksdRTozcSWszWtSz7CVkFEPQADfp+ymb9R+iL7OgQnMMPO1iAlnfGgT8UqYdCczpKJ9LLsJIXvSXgXLVdNY+bd/Zm5ACBYNciPv892s1xVlkhV+rPUOenULQ== 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=cpOhGQcAawMozKbRyjDWd0TWIGF9Mne0xxsU7xd3RJs=; b=lLj46h3eOy8RNiDviRDY9W/PYWh+C/tW1EoOpV/HDYm8v9aE4o15JXtUTOJ4i6YsQLU54zSv+mzuZzT1Gh5ULklrX8tqqRjdLqgFWvVps9hKfTA4rtqs+tTOy0Vp4ggwY0CrXL0Zv8duOngF9HUbb1V1Fo5o9fi/NhCzVBQeAjz1QPWA4SzG+7YByfe54Ls3pcQ+oAGln07sqLMTO/5QcsRWMwk/+8W+krZI+9TPbl7iarrf5c9j1R9ShAKmNAIh/0xum32IacqgM8aJv97gEXWb7RwpI146yMos0b4vnhma/0+cVvEVsg+mFokrez4U/yhH8upQBL9EQ92lUK0+fg== 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 PAXPR04MB8489.eurprd04.prod.outlook.com (2603:10a6:102:1dd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.20; Tue, 26 Nov 2024 07:58:46 +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:58:46 +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, Richard Zhu , Frank Li Subject: [PATCH v7 09/10] PCI: imx6: Add i.MX8MQ i.MX8Q and i.MX95 PM support Date: Tue, 26 Nov 2024 15:57:01 +0800 Message-Id: <20241126075702.4099164-10-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241126075702.4099164-1-hongxing.zhu@nxp.com> References: <20241126075702.4099164-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SI1PR02CA0060.apcprd02.prod.outlook.com (2603:1096:4:1f5::17) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|PAXPR04MB8489:EE_ X-MS-Office365-Filtering-Correlation-Id: 1cf81fa9-812c-4412-9f40-08dd0df02742 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: 55qdYDCGMOLNjS80w2i3Jpx/B99ar0VUVP9xF0kIwjHcKAT2PTwbAdvqFlHyM7H7u1nSwY3Av1rVev/zOjpjOo0liBpliw7uK4ZXP0d0ClOummWU2BMKI+7/FmxHT8pdR4vJMR/OM2LXHvMadzi46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UHFapkIRTwo1Oe6fS8WQj4+2uIRGf6tgSgfrzrlH2g0DkaijCS/UjpNUzzCKoG9ZyR4+zb0QhNLbiO2rGCQeku4HF0aBPwpzHGplKGwQ8bNJ+tEJKW9e5ZNmQfsuo6NWmZACogqLqI2fS4HAWypoGIPZg4z9FDFqL4DRkZs+ttlraJfbS+zEAFNzdJFE00WHKYFC+ZYm9i2joBpKfS3Tac= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8676.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aZeSyj6kLIS2zQ7qz2gaA8vMQNJC1x5axyOK6A2G+vw423iwj98SRWOHlojaJ9z47kvfYyHmOZxkHqDNKjd5RzPG2s52rnM6tDva0/8R9+MfPbk7ZBc2+COoJLLemttTTYvDf6p198REScIT7GynJNkufZFcZMhbaPXxSZ7T6v/CMtw6agFkJz3jDZZHA2o6o+zxF7DPI/ocPA9lqwkfPQy3x+NTRiLZkdbB2cQSTRVs26EsRAs53LGb7s+jLICF7UwmfwhoCWNZMVRi32UAkM15GaFohZ8sEfo2YBCZQy7ABDc+KlslEyX2gNTV3B8yo0qGk9vMWY/f3sspuaBFbfo+lVwj3Dkkr6YY1OE3HP3qfXzM84p8oKfiR4UAPH9xhBm6J+Q38sNacIc2sn8uKhF6A9qNHHzHNuMFZZbV+lB7MFfjmhEbk/zWnm4vBokOaRDJMBYdWAjxMV8vbsahToJWpnjzo/868GB+xHG/wyGG58NT0xVlLzc77ObKBBOB7T6tr7mp+zx12YP7u3D8IpfUu/SFW1Rg/NKBmn+5RI6DBX3NofyasLhjE9QEl9KP3W0lkB5q9iifUhAi5kqpKlRa2SkyPvToFxCeElgTSNjvmKfN4e/pToCm10CjZL3fon9Me/eFjsTq0Jb6vkYJkz+3hSH0+CKsvkXTqxa1WFU19PyC/98y9w/+Zj2qCziFf9juzQ0ftnR22VRKJ5HDYU3Q7ILwns4uXxvcKkoar7mvDHxCx/+HOo/h50WbHcPgi00vBV8F4sVnTo6Sm14WPiI17YrzZwoeDo4SpQnDjCU4/TT9iOoJk6rAYd6GCrLMTFm+fWElFVq7bsmv1EDgkNOYVG3qI4Au19hCF155uPAyAC765jcsjLghvUWn+sk/8AlZfFVAP14pGligC22m+Y8+jTesuRqQpC1KcPV59ulLhSejS4ld/PGS9SElolQlK2MJRBjLei+NkgoLNMwLQvG5SF7rOcynLtWPQDQpUkdOjlirdDXYyw6Zcc/1xqvCpdd8gMw6Vsdl9toVgEb9gKYPWZO0a50f5PQx/ZuYvUBI7lbAu+VHCQ66gS8QVxNWmywIJGkzpute7ZuDwtXhgRKGFOwzeCJ5jGiWX+J1ngroQQ9AicQ4zFxuw0KsDMPnck1dXobWFB1cl+KCs1scMu+bPCH74mTVSjNBlL6fLXNlPZD+3nok0fdqllZjL9DGrCCR3lNurGv9zehEizWCFLtEWVPK68Soc3WY2hvdlsbHVaLRjF5hpkH6CZkI8KFlhDfGTc66buyw92lpOm3QWORKnz/RkVsWECno1WDCCo2WoYhJujLtRZ5ohlgMw0fpOB4akXnHVOpUcW4ouuDH6+BIA9xtvCV5Trk3gs6AH32giAeQ5Xk/O8NkI46Av+VluVVV6qNYMgLiDNWkTzAhyDxEywDoZCJDp6ROI3MgGFeCVnFq3db0/F4NvLy6f8jY6Ir41Ag7F9qxdCNncHtDd1oK7wdpg7aMBo3B+4CytEcG+pZpnmtLhP5Cy804LHk4Eb2nE4NM7GbEibItUWjksaRks4nIkqN07lf6HJDa2FcgLPbHaoo0WUOv7iYc2Siy X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1cf81fa9-812c-4412-9f40-08dd0df02742 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:58:46.0864 (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: yv+19qh0eJM9VzPquUc7UNZ62jaa23xG6aBqM9h6UZ5l6n5EMQl1/Da4ZsciRuHN1ecLuk/rAN4MTP5TD9GLaQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8489 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241125_235848_944506_287D6D6E X-CRM114-Status: GOOD ( 10.88 ) 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 iMX8MQ i.MX8Q and i.MX95 PCIe suspend/resume support. Signed-off-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam Reviewed-by: Frank Li --- drivers/pci/controller/dwc/pci-imx6.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 87dac4ac9d10..852b34572bb8 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1527,7 +1527,8 @@ static const struct imx_pcie_drvdata drvdata[] = { [IMX8MQ] = { .variant = IMX8MQ, .flags = IMX_PCIE_FLAG_HAS_APP_RESET | - IMX_PCIE_FLAG_HAS_PHY_RESET, + IMX_PCIE_FLAG_HAS_PHY_RESET | + IMX_PCIE_FLAG_SUPPORTS_SUSPEND, .gpr = "fsl,imx8mq-iomuxc-gpr", .clk_names = imx8mq_clks, .clks_cnt = ARRAY_SIZE(imx8mq_clks), @@ -1564,13 +1565,15 @@ static const struct imx_pcie_drvdata drvdata[] = { }, [IMX8Q] = { .variant = IMX8Q, - .flags = IMX_PCIE_FLAG_HAS_PHYDRV, + .flags = IMX_PCIE_FLAG_HAS_PHYDRV | + IMX_PCIE_FLAG_SUPPORTS_SUSPEND, .clk_names = imx8q_clks, .clks_cnt = ARRAY_SIZE(imx8q_clks), }, [IMX95] = { .variant = IMX95, - .flags = IMX_PCIE_FLAG_HAS_SERDES, + .flags = IMX_PCIE_FLAG_HAS_SERDES | + IMX_PCIE_FLAG_SUPPORTS_SUSPEND, .clk_names = imx95_clks, .clks_cnt = ARRAY_SIZE(imx95_clks), .clks_optional_cnt = 1, From patchwork Tue Nov 26 07:57:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13885572 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 180C9D5A6EC for ; Tue, 26 Nov 2024 08:08:27 +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:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wGLz3HynYw6TOgvpjS3u3DsAamlDcAkH/ZsSrZWh6/o=; b=IoXXsYMJiyyvihER1iyvHbwAEt pOYMvQ4Pbp2vfcD50cu4Ig6c+KZ/aqYC6wJ1hdTDT/dmHgm31vEX/abs+IQaawOz/5y9G6uP4ksC4 qBX0JrXHzRcpcPzVpz1tfhlbTEvoMMaT21LsXi8fKlZQ+z97hR0MZy29EygoRkQ16+DCfPlfcYOaM rFStJJtBZri47V708QzaEmtARvrDfp7xEDumizOvyUGa+2XkexMOgBh3HrzAWXdiAeNViqhBsdg80 kvZuv1vIEJ6mE9C1VHss7qr79s1egpNpS/8nXyXs5ZqqN7+DGqK52tJVCbVefSDjSwjYbn89YjjJN rcMH2hZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFqcK-00000009vga-1Nm2; Tue, 26 Nov 2024 08:08:16 +0000 Received: from mail-northeuropeazlp170110001.outbound.protection.outlook.com ([2a01:111:f403:c200::1] helo=DB3PR0202CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFqTI-00000009tq1-1FOA for linux-arm-kernel@lists.infradead.org; Tue, 26 Nov 2024 07:58:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LYsWZVLKG+unLiB5FRFIQ9vB/ApOw6Zc7NySS836aDdwnmdo/swbj/zIOtUAOSzEpqsCspcFeyEXmtpZ5WPb2y9KjmYUWN/ac5VueTrvqycwGrp9xOIzgVY43KvIeshvQqBQHWMpg5zIzD5uRstcU+Z//TetAtwWTqPWLv26h3/N2eDZm5KCjYQt9IL+amzVCaU+RHlnRPn/oSL6TUg8Mmqd+AVulJ2KKT09C3REdiD7a4iElbmuqe1WVfBNFxpjLClHb3mS/EePNCGKbE4yxcqAgVcDdUcs3FsNiL2tU7x/4izMbpVHX8ez82LFN0Sv+EwIbp8avwo2FJp/HlEtDA== 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=wGLz3HynYw6TOgvpjS3u3DsAamlDcAkH/ZsSrZWh6/o=; b=hEauDj67USTtvcl3WOnPJ7crTeHU2pj+0KSXj62nDanH6TqCj6srigAlL0NlH38u1A8gKHC+CShfk73tVe6ZeDKBBIkQeGJQK23jRjzqwVYk9kzZbndn2TFbeRExb0reWuOQ2GrpZYvo2zke6aOSZjp4lzCI/QMmS87q5roJF3f3iNDHrvOAROJGYwnq43k/Th5hgHGs0Z0WprrAUrNQb5rOrKGhKj+dHAYRpXW6pIFY0+d5yppBqnSRE+a4UCTS58qJVwSzcsYeNxzi7xnEu/m0k0glLQBcjq0e/l3D7KAuiJ6OWqiQruuxt3jmyv0Nu41uMnAhXwZ20yGBySxK3A== 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=wGLz3HynYw6TOgvpjS3u3DsAamlDcAkH/ZsSrZWh6/o=; b=emvWivAoLuMRtkEzW5Sg2HUOlCPeI9shR33uGNTn/WnNYFdYylZoYq0hq6P8p+jiWx3j0QwUnLAVFrIiP8NZ3F8RruK/1ziPKoqhMskm1ocFDASaYjRBJpmnlYp/BNEQ1S6YQm+GCpisxsjx/EKRl4u4P+nw8o8GUlvhgoCn5t4zm4zWb3Zb55dxI2E9MDzlEuSxq+0lQEzjkq6cNzDsO8O9Nftvz7ZQ/5fpqKDTBYSvQaeHD15FVeE3QhIl/9m7GUgmPCWiJzjqAoDfS3pCHvxd15FsVskGLWrD4T00qqeZLtfuNAD0tDLghUDb6FBqjQVWlMEpxPLtJLWanUZ1Lw== 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 PAXPR04MB8489.eurprd04.prod.outlook.com (2603:10a6:102:1dd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.20; Tue, 26 Nov 2024 07:58:53 +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:58:53 +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, Richard Zhu , Frank Li Subject: [PATCH v7 10/10] arm64: dts: imx95: Add ref clock for i.MX95 PCIe Date: Tue, 26 Nov 2024 15:57:02 +0800 Message-Id: <20241126075702.4099164-11-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241126075702.4099164-1-hongxing.zhu@nxp.com> References: <20241126075702.4099164-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SI1PR02CA0060.apcprd02.prod.outlook.com (2603:1096:4:1f5::17) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|PAXPR04MB8489:EE_ X-MS-Office365-Filtering-Correlation-Id: cfe12062-92fc-408c-f6db-08dd0df02b48 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: IwaK9qZj3VAfHueOyvbpjhB3ASgft09gGWn3S9ZzdXPC84pk7E9OU99CYB1l7eFOJVCp9Rl6TgParsAimxLs0zfK3N6Y+c1Q7aUgbpgKC1XNMnhFz1dQFaUa6s9nlVaBR1F3js3C2rv/DL5EyNi+Wy8qfpDm5v6TlDR9Anz6QqkizwKWwUgUGS4FI3dukKR4egzeLjd6rsi9VlwI1annVF4IYpZ47pkWhpGRFxR2zfNynzMvG2ofGiNcWQPgsq+U3h7g+pIyqWGWrNbn32Tkaw2D2d5gYeIwO3k0bifZFBeRwlr0F0PZNdtQF0MZYspU2bN2ruCdzY9SgGfS//Ck5HGvOYHgqq2ywx1aFnqJles/V46TqFVzkEFBFRFjrE7JgshCTyL04ddYJAj88f4keVInnl9GMsudK5EIgwZPHPftan5kPAc1VDFActZBuCmYxSmoPpy9vUx0HtyuKxDdLqH3cEuOhuHj16GhJLSqUKGUwOgZdM8g+RHzPYqZu3nbQtOkjT3sEij/l8nlglyDaqltGK3sOpSbo+DfBexTnHv0UjylkePQW65L1uCxswz0FDUwrfloQvgp0YTLGnui/3w+xNy8Ky5PWD8jmqPKc7rc3SsG28FeQydSBuOhxno1aJ/lgj50x6OcOBKoRcupfb5LURsTHKNwJK1KjFhMcXyDQdrClsbbe5/lKGknWDgSDse9ZzO7o2h5pvGosRTt9j6Zlgk3UHVPTy20lbg4NKkwI8cVUhUDX+65HjfjsJLmb6jfUsqpaFzOuYUCbNzK5SipUb3XADKQynVtT5yJGi8FEgrffyxjBFTBCWYtOGDMetLjIJ0I+gF3PVctmcaNxxdP9ev4hvCKLWjeeNRItUH7sIqxmH5MaQmW+v+FV83pn0uF1zZ2IGCmyzK7pSGKvANW3/7fl12k7vQLB31o64nToHYeqWrT29cPAJzrNyddnnM9zVI7AJcdI99MrgeXI8Pd1v7hbfHFbHdM84DxekUIgw4EFmY0Gwy8jK8PZfC6hV0Z/CWJcQveFmwfI6VoBe4EQ5o/ho1izlJgc4puhW1CNNZMMpZ8RN6g97eKyUSKtnukHik0WMhOBy747ZsI2gGmaZwKzFEw63tUVUfZKL0WqXZMCUqDnf0xnRBbHvjVrcPWbF0IhqL9Ehk4lk1o0fdPCStGvKGsIW13rKKrGSpB2GFjEP12OHSNzHBBHAT/qDeAstpWPbuMyurJvdZHcEBvtsvCqXjFx5oqbjZR/UtXEuRhJMQpGyVVY5KVVx/r9/uxG0cbPH+0CG4qcqVKuZCfJyAmSFtUCO4ws+SjIZOLgFZ0LXSCuA3djgiK6NNGbRkgSPdwB1gusTZZca/CMFZzB5gO7S5TEIzZyx/rZ4Q69Yt7MOXjnJ/I79y84QzIWsR0CxnFbMo7SN/z+5T5VPnsBcquLfKwB5X+GRl5R4o= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8676.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fH08ZeeIUg7XCYYfrAmehuTGT1k7+3kQT4M/tNSBI9TkpFXXcYjS+ADsd/luFtCmw4n0QM24DZIzcXoi9NXaeI/3bQGOlW0+BUYF6CtsufBxDy+iMdRuXwdK4Blh4BKrH11m2yLZupmFd8BOqSJesE9q1SPaltMibupZHl3XhhxGGYbbmzhN+GpdXy/iLXnTFjwKPjizmTnvSyHHCA9Kuh/I5dw3gfp95qZqEiJz1uCg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Om6L7c1FJR6SoX4Jqdf0eTomqHSjy94w//OsekVUzxISdJqgFR+3ihH/Uga9/tpXJizV4TeirMbQbGfZ4aFjPciDIR39EtDKPaQY6ii7jKdpRGFJ01XfiintixFDbF7xvhWXezeFrwdKmFb6rAaRglarfo1pL2VNUGRcDEJdZRrYeEbD+bE4xx9DkRguFsJ4ySP8CH91UNA8w3+FsMUxjtr7d3W3E9Z16SMUDgxErL18mVQ7Yv+w7JxHvOsWfPisI9dfyxbt/d7zEz9qOlmiR X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cfe12062-92fc-408c-f6db-08dd0df02b48 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:58:53.0345 (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: 5jdXS9AZ6nINIUjJcRLmNbVAcNw6BFUIqMTZW9oodZ2M/YbVsIvWNnUGe96wnMr63V+ML7OA0HVctv7WGZewHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8489 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241125_235856_333852_96B6D9EA X-CRM114-Status: GOOD ( 10.44 ) 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 ref clock for i.MX95 PCIe here, when the internal PLL is used as PCIe reference clock. Signed-off-by: Richard Zhu Reviewed-by: Frank Li --- arch/arm64/boot/dts/freescale/imx95.dtsi | 25 ++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx95.dtsi b/arch/arm64/boot/dts/freescale/imx95.dtsi index 03661e76550f..9951d2c84799 100644 --- a/arch/arm64/boot/dts/freescale/imx95.dtsi +++ b/arch/arm64/boot/dts/freescale/imx95.dtsi @@ -236,6 +236,13 @@ clk_ext1: clock-ext1 { clock-output-names = "clk_ext1"; }; + clk_sys100m: clock-sys100m { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <1000000>; + clock-output-names = "clk_sys100m"; + }; + sai1_mclk: clock-sai-mclk1 { compatible = "fixed-clock"; #clock-cells = <0>; @@ -1473,6 +1480,14 @@ smmu: iommu@490d0000 { }; }; + hsio_blk_ctl: syscon@4c0100c0 { + compatible = "nxp,imx95-hsio-blk-ctl", "syscon"; + reg = <0x0 0x4c0100c0 0x0 0x4>; + #clock-cells = <1>; + clocks = <&clk_sys100m>; + power-domains = <&scmi_devpd IMX95_PD_HSIO_TOP>; + }; + pcie0: pcie@4c300000 { compatible = "fsl,imx95-pcie"; reg = <0 0x4c300000 0 0x10000>, @@ -1500,8 +1515,9 @@ pcie0: pcie@4c300000 { clocks = <&scmi_clk IMX95_CLK_HSIO>, <&scmi_clk IMX95_CLK_HSIOPLL>, <&scmi_clk IMX95_CLK_HSIOPLL_VCO>, - <&scmi_clk IMX95_CLK_HSIOPCIEAUX>; - clock-names = "pcie", "pcie_bus", "pcie_phy", "pcie_aux"; + <&scmi_clk IMX95_CLK_HSIOPCIEAUX>, + <&hsio_blk_ctl 0>; + clock-names = "pcie", "pcie_bus", "pcie_phy", "pcie_aux", "ref"; assigned-clocks =<&scmi_clk IMX95_CLK_HSIOPLL_VCO>, <&scmi_clk IMX95_CLK_HSIOPLL>, <&scmi_clk IMX95_CLK_HSIOPCIEAUX>; @@ -1567,8 +1583,9 @@ pcie1: pcie@4c380000 { clocks = <&scmi_clk IMX95_CLK_HSIO>, <&scmi_clk IMX95_CLK_HSIOPLL>, <&scmi_clk IMX95_CLK_HSIOPLL_VCO>, - <&scmi_clk IMX95_CLK_HSIOPCIEAUX>; - clock-names = "pcie", "pcie_bus", "pcie_phy", "pcie_aux"; + <&scmi_clk IMX95_CLK_HSIOPCIEAUX>, + <&hsio_blk_ctl 0>; + clock-names = "pcie", "pcie_bus", "pcie_phy", "pcie_aux", "ref"; assigned-clocks =<&scmi_clk IMX95_CLK_HSIOPLL_VCO>, <&scmi_clk IMX95_CLK_HSIOPLL>, <&scmi_clk IMX95_CLK_HSIOPCIEAUX>;