From patchwork Thu Oct 31 08:06:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13857692 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 BD853E68944 for ; Thu, 31 Oct 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=+6bJ8ZdNq0jbMIzriN3qMBzZw9hotPrRliUnnqNdEcc=; b=Xkl6nXaKFlR0aamap2Si8ck2Mh Ob7lbdWRcOKxhHvVbGex9o2J7h2asBOkP+/AZLoB7fgcJ1SRECdN0ES7/tWSSqO6nYvfiveqQKQLs PJHw417ZypMLZclXiBspnkThcHO1/nyJUfzskQISzTEvJwq9tCwBOO9uql6ZwlvVDzEwLpy2a6TYQ lpkjX/Q7q0yhFMqkoWHccPh5Wj/sbxonysbUcP5qOW6vW50aHvCEvjWpqslIrfOaY2B7KkxfmtlKC 4xZahdUAlF4EMtcO5pAbZxDeMcfrAxzQogA7ZqmDcso5rleqpc2IqAbAyrGA9IC7FOf7ufiBut80w DKQDWpZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6Q6W-00000002sjE-2T9V; Thu, 31 Oct 2024 08:00:28 +0000 Received: from mail-am0eur02on20611.outbound.protection.outlook.com ([2a01:111:f403:2606::611] helo=EUR02-AM0-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6Q3G-00000002rm3-0wRl for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2024 07:57:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Oa0zHIgyEKcswg4Xle2CVg74Zp8EYf7lga58zzNzKUIIrQcM1RZxNmLSEUEjXge3dH8lSGyNzfJ4jKZ746y2VjhtpwPEpT9OVFDrxTGcNC4yPg5+A8GeaLQY+WCYvsrziWEvo74NL56HWRCoK5LUY4hUK5TwjdP5Rdkaf8UYXPEa4EMa5M/IzaIF94UOOl/YXS9Eb4L6iMLgWLDsFk6SNi/duJzLkjJowHY5Nv0mMn3fnXC3G1uK8vdFV3AfyY/l6HiKAv2s/jUUBWGKG2K99hqUuqTtPyIv4uTPvnERSPo4ymHGw+qjggTYDDmIopx53LpsTXVRRWr4K5SqRngG3Q== 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=+6bJ8ZdNq0jbMIzriN3qMBzZw9hotPrRliUnnqNdEcc=; b=Y05Luh3LjPzlJuayVUlGlYWHcFLILYmCRfsoOYZ0KeVJ2GWO207T50wiNW1tNPX2ecUrguOUrn8J+pdszA0R8/FK/NtOBQnyK1cNnIq3KRD1qiYj3GIxn8zI3Xw4SQUOiFe5TZtYZnb2AAgHKwt+J70pC3IE9wl/uIifaxAPvvBwvzgxRzeIDyGv64GPYRFI+BUio2hWK1Eqhs4RcEaIYYdtTJgblZrKQLmhbEQHwpf1AWDNmGm+DbxTArvlm17gSZb+MalRX/YjmwKc2cDByN9KjTtHtq55wohuN93SewZlX5yI7HVfuqr0FZeCBgMaBxkdw1zwo2hZRC18Jl664Q== 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=+6bJ8ZdNq0jbMIzriN3qMBzZw9hotPrRliUnnqNdEcc=; b=Ffq+yGO/oDwIrN6SsUJCsvyDwrhwt8Xk0C1GmfmDn1h0fnlx48OaH2xAhhcW/dHgQN91givYWUh1ENOBI1s1HCtj4leMf6Cynz/AIjvTjTjq9lRmzHeG48Vqr5GZwDKBxIf/rdoslpHt667YYLhrB17C5V3hYgayIbKzzG649Pycj5XsRwZVxeLWIZZ3Ns6VU73TsceMVon9pg4yote/bEi6YqVIrJBEBRT9uJdkclKTmpsIdwNHJPYN0sMVVi23L/RlFNLX+tg7g3aul9yiKjjyXo50ev5hOmpBCEA7iCGlTAerODsetORCk1PR3+zXeDy1oLyom1nlQebnlzApRw== 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 DB9PR04MB8139.eurprd04.prod.outlook.com (2603:10a6:10:248::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Thu, 31 Oct 2024 07:57:02 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93%6]) with mapi id 15.20.8114.015; Thu, 31 Oct 2024 07:57:00 +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 v5 01/10] dt-bindings: imx6q-pcie: Add ref clock for i.MX95 PCIe RC Date: Thu, 31 Oct 2024 16:06:46 +0800 Message-Id: <20241031080655.3879139-2-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241031080655.3879139-1-hongxing.zhu@nxp.com> References: <20241031080655.3879139-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|DB9PR04MB8139:EE_ X-MS-Office365-Filtering-Correlation-Id: 65bfc6e2-c5a2-4c0f-645f-08dcf981998d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: KgtJyVRA/uGEfu5GyBNf1kO6yILWYkZLmqMzfn1I/6dEgTFXkU0sgVvdjbOMCQvP/CRGDSOv+NmBWHNPX4L1a/nF/z/d3SVcP3UIvN0OkwsKpe2/PU1ftbfaH6Ih92qIiuviX2XkC0cjXwXQVXCtre8csZpMEBjxj2Ie6s55w0A/JJ8yk0fyHrGjK5l6T69mxdN7VC7yZk9TnFq8AyaJ7c28gZE5Yni3BbAm1k1DI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KhoquQ/RvHF5bMzjBO6Qz+WjgEh7+qeKFcbGtzb2TQb8pkVelpQMN9QdkyIVRL2RFocbfsh3YhrvRdDQhinhEzIO 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)(7416014)(52116014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xN11qvhyOjHTjLp4i5o2ytvo/RUFex7UrOUZ2ucQQP5LbLRu3AB0SW+YKWudbTwIZg+mRJwqUwC5bN/n4WXDjrMW+W8D8HjPnj7Gu7Qk8HrdI6sgudzzLpGnmJsRBh/oIT+V4CsGk3MHOxzagauf+GayMXZsBGj5xRZItMR5RlOHuyFD8+nnmpSjXIBkG6PLRGyQWZiV4DHTw++ObDWgtTddgn+5PAlxqOQ93o8zHDjCnZSnLyeo8eKFwHhm+bbFzkE5y0yjLpE6ITqFZ6MXEO0ek4kk1U1EarEofGZUV0Ui5sXMsuz8fNBSPlWsPbKaeyU+txMY8MRxx0bW/WSRe14FjjVOnG/MVW1jTXkJupDvoX4Vlek3o/KYi/RMlpuGMgh5YInrIBjxViBYcUaeoVJVU8JqJD2jV08gEGdopseQTk3QbdBX0oHPo2aaBo8cXZw/mvWq6us+sKt9GHup/CvzQIVgPdPhABiDjm93Mc+aca49SgH5cwN/eEfFqOaDOv0eh+7WPux1RtyBAzoiYLkm5FBsu6UcnQCNcIA3fk9s/Z7KXJ01VmmRK7uKuQ6a3/cKgvEXz7Yi+ribca9hw6EblJ+qzgFc7v2tFK3adWbY/1sHuzV8gCenmSOFr9gRC0VgQzR1f6pcW6hSPhW4+2N/Yb8v6lQ4RBE6XXavvs4S+FbKhZkguTxIRp6258qk2fVxUPDnBviIcuZVSwjw49vjutZ+6uZc4a1RkEaRqxFVdjwsaJJR9xYeK9UsMZaRh1j8OQuzGG3VB2fyp46dwwDsk2s0oj5CKCyS0HhA+ltyWv3GFk1xddUpRRaLEinpNuXrBmJi5oG3ECnG04hUpZL29WSZl4V9x4XCCs5sQ4RVPBuEELSCO8pEok5B3gcAWHrczOBvQcfrXPK3qQp1FMOHKdZ8HNh3vp1zExnhP7joO78cQcZcp2A3T4gOhCdf83cvYJNk2E5xE3BdMKp9hGiHK5IM0ukcvJ/+FymYH1g7SBpoEPTKdknuwtM5c0gaTiOtDlbMnAKHA54mrCavxa5cyGulW7Qyvx42OFt0r5Ejei7/SgEd3mbKAxMXIgY0DxLzo2zpfAOvJFFZOR9GH9E8rJghl6b2IrjfUYAESuQiKhVNheLPGUCJQcMNsO66Re65ysysCye7ax0D7akVAF1od0n5rvO+ki0/EFvd4GUMMQ0FNjae+pwPKtpCot9qzBsxfZs2IGOIGL89cfh22PuKmiDuXKxsDn3EiZWAie0awu28JFtO0OuF5i9mtB7aem/grdk3TMqu/UBcdYkUiK/LLFB/01IrBy0/NKLgyQrC5iCpHQVb+Iwlv/Wves+Amz5Mw7Rn5uOW0HE6ZeviI802wv5uX7SYLV4Us1FmE5tGjPlJ7BTYHQ4GXc+05d0xNpS6jDKVjuwqj1kNqRhR/maCQuInMNzluRJE0Rq8RJbGI99tTUNRgQSPt3Va+8OsD3N1rqUMkScYqM34F6fRXrkHrzPh3BRAzCQG+wVEFgX83awmnZLZc0sMZINM9AGlO20UWAAUM5LPUWafV9j9BkoJHx2LVnlivHQ/607sALOhURxU9h0DTChf+okhP8XR X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65bfc6e2-c5a2-4c0f-645f-08dcf981998d X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 07:57:00.4118 (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: V4TRK1L/w4MzD1YCLT7TuFYlYUxAIKhi2xtTB0ORR4jFjqpy6SBj5k0J0FK0X55YW2Ep4oDT3fQoBTkeA6cOwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241031_005706_292644_68CB13E2 X-CRM114-Status: GOOD ( 11.43 ) 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 84ca12e8b25b..f41f704c6729 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml @@ -103,6 +103,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 Thu Oct 31 08:06:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13857693 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 00AFDE68944 for ; Thu, 31 Oct 2024 08:02:22 +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=HkWozaYB6c4gmku3Xai3zp9D5hIcsNaCS/eKBvHqTEM=; b=XoB3/JNTzp/9vE08ljk6ha79P2 pwmg8yBwgNXy8DS+2rZhxy4V68tyzNMVavJ74JLf19XMsh4POZKeyD5vPPIz31QkzposMnjMw5yry QwkSf6QUSbb9bMRZTuzKSk1f/gQa502E+6XX577tTX6jYD0Gj6COyCum5xeFdy1gZKdZHbn27QBOv cy1MjOg7saMIaiUPvky22Ia+mTgsc6hZ6feTLsQT9L98GKRKNeUHGy9wehfLaIBTyjn0ytfAC4dnA PeqAxoo7GWAVcaTns5NJUmmQ0gv07mf97il4e1SgigjthHQeZ77MCjIJIr28IEgS2Bgzokatq2da0 ijspCZ3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6Q88-00000002sxV-39ct; Thu, 31 Oct 2024 08:02:08 +0000 Received: from mail-am0eur02on20612.outbound.protection.outlook.com ([2a01:111:f403:2606::612] helo=EUR02-AM0-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6Q3K-00000002rmh-0YHS for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2024 07:57:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Yy2A2Epom73rVMPrjmYQxSX/9hU/Rg+oyhuu0h2WsM6iGcj5VdubKho512SKCp2490kXI7z4rC/V4qGJffsZ6ehZH9mhv6FOhLA2S0BSZDNJftr/sXPTIx1uaNnd9aWj86CzzvX6t14oAwWu7nuw+9gqFEZVTaUxvPuXDQqFSXjqYi07yWha77+ErhVRIEBKvvsLon42EJ1X6sNjNi3lDwioC2ij7Y7nVcHGhmyvHb+ayzvyU5/eD2me8pe/UtSXdPteF1tGPq7b8adBSNjjxug369bWrMFDfNIRF+7imfHvQU2njciyY4Fx/zauLm7pPWthuQHM1GBMuBc1eWfMMQ== 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=HkWozaYB6c4gmku3Xai3zp9D5hIcsNaCS/eKBvHqTEM=; b=BUkZvmBCAe22K+OpbTEWSx1e9RwGzG//UwBVEC62A2IcW82S4QARDZx9fM5DaU6gTh/pSgkUvLPHfPJlW/S6LI5ocaUDL9Bl0apHggdiis+bidSytRSshgbUqAxExuMGmO3UEbMJFUpN554prsPJyIIsmLhSglGYBU//HCLrJnRt1b+fl9sc1nh3sl/N1t5G1avfpJWAYvdJb+tpZw2VRxPYKzzf03KPAoz/8L7jp9XG4ajQzB61rJ0pN7Be9oU6oqWX//hRqjC2cIXaYxcZJM2xtNrdK42BQZng2ngJVJetXc3D4ccK+D+X5bH4qSn5uNVRk31Plvrbgk7+zwgaYg== 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=HkWozaYB6c4gmku3Xai3zp9D5hIcsNaCS/eKBvHqTEM=; b=bQnFVW3f6h+tO33EIIIqunYI48MP2RorkbMjUQIOPKJ2vxdJVD68KheN9drY/fNW/RcDOv0UtM3HHgPNq0twDsp+FYKYrHp6F8ZgyLD9qhlS/mVrBhDJzaN0XNOQCS2nGHORJ7ZLqVGy9ysr+5Q+zW/OupcB8VwWm4+uwVY+x5/HGM3XkSrWhl1pwTpMFCJo6A5YitLkLGiBUSQ2jBE85cCgY9AY10bkFGobZxgelsQMZknCTmS14ylVF7z6ZBRMvboKzHC2oO++MuaEMyzX/j3OP3sEFAVOmMRZzYXR8aJvtGvyP8giOftBeRSqHBM1/fSFKsPr8xcGxu0LvkSIcQ== 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 DB9PR04MB8139.eurprd04.prod.outlook.com (2603:10a6:10:248::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Thu, 31 Oct 2024 07:57:06 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93%6]) with mapi id 15.20.8114.015; Thu, 31 Oct 2024 07:57:06 +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 v5 02/10] PCI: imx6: Add ref clock for i.MX95 PCIe Date: Thu, 31 Oct 2024 16:06:47 +0800 Message-Id: <20241031080655.3879139-3-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241031080655.3879139-1-hongxing.zhu@nxp.com> References: <20241031080655.3879139-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|DB9PR04MB8139:EE_ X-MS-Office365-Filtering-Correlation-Id: b2fd7a23-eb07-4190-c2d0-08dcf9819cf8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: csOaY+bnHa6WFnDqv/vQpszWPoWLgknzh4BWdK212QPq0rtWK7JGuDEIcDkSd+tNA7mMKckvmo7Rxrmr94zn3/qWLqSruBoylx71yMITpdZifRvE56T1gicr0jKGryNEG8Tt8UsDaf4aF9jXgYnO5VWQQO135zgvKXeTPVkgmoSx/2raBlbilqzTghl1Q33G5vBcsAownSLpe1pYVD3ZydNE15y27COTUdtED9dnCcfF3CryMYb0A4njiDGFZh46a8qhFAykOMwHtGb3HHU9XFJxWri+yOxzhmdum/Zwa7cVNaL5vFVRoNRk7ymOFMGWn54RJS7wTPek9XLwRRdaoI9hym8xHSoyZ2+ySX/sUIRXXhkdy7IYUAMJN4h4zOEFHofVTYKJd2KlWLhRo1wCaqb92FVhXgRC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urprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(52116014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gubltHupomvLCQc9jZ5v7iL2McudcAkTu07T7dx7MGNgOG72XJaAAK7zcDfI+oQTQqztJtS5cdxZPQtoh2JJZ1ldrAH4vGJfZjtEkl4ZqN90/q1KWbgOPy574VYLUKP9w6bQajXatKXdCQ3Vg1jeKVP0YI7hwlrg60liBqoxc7st713huXM4EsG+DEuvwfPW5L3tQW5TJpwTJkec8TpGWaoU84hLj3YY5V4c3fv5SxSskYjzvKxhCytrVUPQAnnBA2Th750mMkp5MdCyVPCuRNCGrmTvXLNHDe1rzA1svwnB/NR8ntjYZR2sgCWQMMMP27Ular1veYCobqIz9Mg8IN7PaeOMaZE9z6pCSYs0m1wtxIpmI7HHGHG3CtO1rnFWGoWKGe1b3e17s8vZnFz5xj2DPIm3zHvyLGLwr1GM+WG6lR8nGHjL7vYf86PPH9bsVHuGjkS3XxzUxn9/M2LS8GxR/76bPrEM8TOkaCZTUJMP9f7AWNXUjhsN6tPT0UZErRvwIleQ2nBYX49htST3B7SnUvkN8eN19Ni9Ak0qSst6aGWsHdtYITljFCGV0dgbNC6u/iaBjB72uYCpqikrwLQOy0acBNcZew0TIRsry+jqR8g4K5B/BFXmITVMLdbdVRq4jnlo+wEZ7TkDsOHuw4WN9dtUton3ITGeuOUVbmnMrEBQPz0rjlaXiKcSIp3DZY0Prk1tPy2/8OIL9PRryysMnxGbvpt2USLf/S6cdsw5GLljuC7r1tE0NJHAlYJQfl+eyKb1EokKEYU4DuyMKI/cta0fvQ4H8eEfiGaDKa+wW9Y7k7D7tW/FcL4cDsN76qiJ2BLQMZW0+8Iwf80k8VopaHhYFhmQtmbBMDDAK3B/UDIPFQvRQQk9Wca9ovVr8Iz4I7EYFacMv0nX5Vq4UFE+8og9PiVa/iwoRgK/oNhEnqOQcacWJH1XVRFgxXS3yviFJH1pZFaKyeVwVer6QXor6JMHx5VjRZrQoSly0eWb17QHLLmkUL07v9DfCmOMG/0za+/N3m9izIbfiFx3PiKOGSTm3nrYkomo5AP7uQPh27+fzJzY9SoZunCzBuJwNummH31rZuSnW0ndvXY9M8iavuM3GaDUj/vwLZcly2iLxFP5EzsuLGcm+xrNHm3pLo+JM827igc+LubacItdjHEz776/iO71PJlYoL4ErYWsSp/GXRcnFOFXoSsE7ju1bHE1CijHf2/EhJ2zJ6E4id1XRtGgKp/28aT7hum7BcDhRlP/SaNTJXyPJlA6MMVe8CUDN7jbByR/8e3hwu70SJOJo8wHOpCEl7iwCP4Rikusvd9kTsza0OkJ+QdrYjbOBupaciOExTa4/49P6lnGNEvRjREsZ2v8zxtNAelqCPxMwRgBbJ1Wi25DJqcoyKRUpUoNXFaImbox5dT1ecds6sp89eSgYHx7exsUEBH7rC/ruyNKI8NTor77jw2yOjLw0nfuledJQH0LvnC7227clNPIDNYHT76lkNdnKrUw53mqVGUnE9WnznNBEPFqAtxdGY7eqmTEtGlHhbgv8czPPkUfriF2Y215kE4bY/ZTPFg+Weooi7Nta16g4sRJvXnF X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b2fd7a23-eb07-4190-c2d0-08dcf9819cf8 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 07:57:06.2352 (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: rzMD5tupll80yODrMMz9F4aSzBiIfc877Jv2qOSYatXFi/9sv80cnJoCAZmnJMVbrE53qdkqvrwDhcCTym0SFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241031_005710_199515_C376DEB3 X-CRM114-Status: GOOD ( 12.78 ) 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 the DT compatibility, i.MX95 REF clock might be optional. Replace the devm_clk_bulk_get() by devm_clk_bulk_get_optional() to fetch i.MX95 PCIe 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 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 808d1f105417..73cb69ba8933 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -82,6 +82,7 @@ enum imx_pcie_variants { #define IMX_PCIE_FLAG_HAS_SERDES BIT(6) #define IMX_PCIE_FLAG_SUPPORT_64BIT BIT(7) #define IMX_PCIE_FLAG_CPU_ADDR_FIXUP BIT(8) +#define IMX_PCIE_FLAG_CLOCKS_OPTIONAL BIT(9) #define imx_check_flag(pci, val) (pci->drvdata->flags & val) @@ -1330,7 +1331,12 @@ 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); + if (imx_check_flag(imx_pcie, IMX_PCIE_FLAG_CLOCKS_OPTIONAL)) + ret = devm_clk_bulk_get_optional(dev, imx_pcie->drvdata->clks_cnt, + imx_pcie->clks); + else + ret = devm_clk_bulk_get(dev, imx_pcie->drvdata->clks_cnt, + imx_pcie->clks); if (ret) return ret; @@ -1480,6 +1486,8 @@ 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 char * const imx95_ext_osc_clks[] = {"pcie_bus", "pcie", "pcie_phy", "pcie_aux"}; static const struct imx_pcie_drvdata drvdata[] = { [IMX6Q] = { @@ -1592,9 +1600,10 @@ 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), + .flags = IMX_PCIE_FLAG_HAS_SERDES | + IMX_PCIE_FLAG_CLOCKS_OPTIONAL, + .clk_names = imx95_clks, + .clks_cnt = ARRAY_SIZE(imx95_clks), .ltssm_off = IMX95_PE0_GEN_CTRL_3, .ltssm_mask = IMX95_PCIE_LTSSM_EN, .mode_off[0] = IMX95_PE0_GEN_CTRL_1, From patchwork Thu Oct 31 08:06:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13857694 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 1B2A4E68958 for ; Thu, 31 Oct 2024 08:04:05 +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=Gz9UKRtTNRCDO2SlwBfibjbgb6pWyEkAXpbyXezHnpY=; b=Ym2njUqGlQKkFFe1Nv6mI8oSWZ HBs3lo3J2fjXLeOy068iv20dTM95EtDl32jLuxzl9Kc2ptsRywZ3H2DOsj2cNXqD7uG99KkLUtwxv BqzuCH4Qu+EV8WkZPv4QYkOsyHY34uvcmkcqjzTaOOdSMg3VEAGrZToOQ/Z1ry6gx/gS/GsXdhW+P T8lHIecvEttxUdCRwuYLU9WiJHxNwEANkWaKotQvKFmgk29uHjA9fypEV/jzSaxX8xBAp+Tiucerc 40KyQ1ZDVnyHbkQU3UCpzA7ykLR2QSudplTZVYz16V0SiIyc4GrmmrxkfoAOWXHboX4SqHk7Arqpc iTwcdqNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6Q9l-00000002t7I-3tL4; Thu, 31 Oct 2024 08:03:49 +0000 Received: from mail-vi1eur02on2061a.outbound.protection.outlook.com ([2a01:111:f403:2607::61a] helo=EUR02-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6Q3P-00000002roZ-2xYA for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2024 07:57:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GbIp7cPvNkd1p+y6O8AET669nGLujN9HQulKNyXddxoUvmx7fYkjcm1Ds884No99HzJOBh5an8jNVA6VsDDAi2SwFtom6KgHcw+Bn0RfQvGkkAi5nP2ImA76R3opNwzPNm+QTWBAI5gzst/WbpLILcBHLPjBxIhC3RlegdTlZXJONfzLBQqLDmZgWLVo8hA3Y1yhW43wfQdTrwYbUbzhK3OVsST3wyi1V15o3yraBP5XeMBVBgG9sBpsf8Ofla+xgfmde/GjzrJLNTsKQZnlWr6XuaRSztLTB41/xHUaNo+fn/0tNmlYXcOblgddzNQ6AP1gzDwuo7BhbDSG8oHmQw== 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=Gz9UKRtTNRCDO2SlwBfibjbgb6pWyEkAXpbyXezHnpY=; b=pTA2WdGuCV/R+vKD/I77umzhGn1V5iT34TcK81ZMs71uBnq6DaJBTkxs4OatBVWb6nqtwTfidbJroWYriSGPIM1p0R0jFKlSh+88lCiyiSlf2DS3a2tK5pkYEeSFTbhlK4h/uwr/NgyQhMB04XHXEd+JCXm2QhN59foXfpgFTc4XljaMWGAyD1br6V/JxyZ+Wuc8oDk3toTX5uYhSUBYP4U3mc8W5Hfj+Yn7DOhCIe00TMZ67z5c9vKhOVx0uzF525db6wyF9P5/x3ODZ/68QajQsU8ev/7LPmV3UrdkU5WIjA6sjRXUrRAjiuqSTwa9g7waJKjOJwJz5aEEsJXc/Q== 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=Gz9UKRtTNRCDO2SlwBfibjbgb6pWyEkAXpbyXezHnpY=; b=A8opTlpRZyUcqPjgV0HC25K3hZanonMsfO/YiHy0kZjm5ikF1MjaTkhRh+79sdCwRLehLl6kbOD4RFAHDe4I8Ee4SPxdFP67Au56QJrv16wPDKFmntD2/H/O4YF3y/tRov/ZX8Of3jXeetgHMUQgaktdeYZiZCAiA4SHE15dp8GUoLeKQ7zbKRLkf2gVgDyL3UsbuesFzqd3kWeqifpKUg4YCM+hiCYlO/e8WENkdy7Kt4XivRRsr9mvSklphvt79NHbztF1AoUa5qj/fE+RpV7HlTiG2ZOtpoUuC1zNqhc2W/uDoZwB5lNZu1OTwJzjbe7qQqiZSnSvxklPhr2Fdg== 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 DB9PR04MB8139.eurprd04.prod.outlook.com (2603:10a6:10:248::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Thu, 31 Oct 2024 07:57:12 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93%6]) with mapi id 15.20.8114.015; Thu, 31 Oct 2024 07:57: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 Subject: [PATCH v5 03/10] PCI: imx6: Fetch dbi2 and iATU base addesses from DT Date: Thu, 31 Oct 2024 16:06:48 +0800 Message-Id: <20241031080655.3879139-4-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241031080655.3879139-1-hongxing.zhu@nxp.com> References: <20241031080655.3879139-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|DB9PR04MB8139:EE_ X-MS-Office365-Filtering-Correlation-Id: e560d1e8-bd83-4cf1-fcf0-08dcf981a05f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: IwhnpRSLKOACGygO6QkpNBW/GDPW/QGXfsJF0+qtoLPcmzvAO1I+0wR6y0CMwbOFP5tPuHi8gdN6KMkFtTCGDFofYbjWjB7fJzaTqKHSWatn+oovCYY3M7w5+lGn5GQI92lbE02xwlI0y7KsvhGo99Ns/Ew6v7hhvliMrKO18GuNuOiIFpVJuSlDJA6cZeWdUF/TunIN5sHRofgIt/rGeOOijXHd+YycWYr6nUFaEgqQBQ0GsT2+5wDyKEsrsR0pQP7IlnbimJXeyd2qnDK7zaLYDIMj04/IzPXb6z3SRt0eG/1/TojJdDlP25wEDXUalJ/vqT7xY3Vd9rESJyE/S1IQGafihzKcslnYlqoqJn7n5kKJVeAvIidFydgQZU2hQH0gtJbofjT62ovfE2EhsQ9vMfrQB6nnZSEIXIXhEORArT3eg+vFoYRsIb8sH/ZhiMGsDFzaTVRPyPuNgIIragbKWaIosr5BbrFZwOelc+sCd895bYF3NgPe2+CNmair7t6RFNp6PsqGNNuIcwlt9AI8VF/hYhkBPC9afSmSKI/1uO5HLW+tgkrCDEI0S+SOZ5oQPb9GO7I0vEloZopghkOgrMfruEu0cMMgYhDzGS/OWDxljcenkygmUi/VcKm4kDwE/Jlj6f1j3sjo9WpHPT7LkWFAJSbURa2GEzsBjLVam0dDRxLle3ECMokYb5wy/rUz7klatFcnbjsrtp97VZAjCRd5MeKKjXVBsEbNbB2+yUcUcLLw7+fytCozAtMbXkVXoKlpoYByb9lk6bcXzPwIMPD9o/5hlFifijD+1iVsr6wS8KeLuQYNy6ZvB+eV4NvVws2z78i6RPRPAr22LSOrXGLEHXjIWBOVCGBkE3L+CudAatjUQku4Qxhj/yYl0kbXpDxxDH0OcETSjrHSPUqG9kSVO5WQhh3j21eVwYgDutan/4382BWcDe3U731EozmOujOA+VJi6ZzGQ1vkPHzl/yN3QNf+yBUj6kqa2EExCrghgLwQoNXoWMgqB9mXTyqDHal/RdK5PJTy+kVvu3pzMJd2oDC4c5aCpq4V7Qyfwi7VnxdjA/6X+Dziu6iqCtbFwHgk2lvgAW6QKswWZz6HtgCRW85Ix6z29JH3Io177+LGV0om6DtE047qJaGK6/ca4FEI/4nWVT9iRUbbmCuLofH0JYBxihdU3RoW660Tvwn59VmnJMkE460vsqkLZ4l5n5qcECnJUBbI98CCRnRyB69Ojd75op0t6dc/siffZUYUZwPM2/pqt7wcJjmW6mcPvfh9bXz9SAtv6comR9Wtjui0EG+15eau5FC+LpP3lkv0mGyfVDuc4BqJGx2Gq3gBsA6f8X2Ljr9rINj7UwA1407ABJDnwJO7g6a5ZvQeP/UK3TrtazAb0NCWeOGv 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)(7416014)(52116014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exch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nkQDNFiAW28NFt8m8vRjvEkAouFuWj6r752gQ6jYPGNOUKlRvHxP0Mj7/ZzqODHDffYH9OKgJhT/hCawrqwXWxSAdq7iw96Ir0xvWj7fbcxI4MNkGVqqHnhe9Ndgj4khNQietxWEiAebk2nOxUWwGfPNEJKhhidh3OfUjCj363T13ZEkwOMNTe9A8TXU3FNZ7c+2OPGY0GxY6K1hNsHqd5RYhyD3dEQsYi+KwY64uAmjL3Y4Vfa2rIcA0IAoHyXl0u0Le83iNCl9EkX5c8gC5FI3ztcuhl1/+PTXft3lmT7iZRCDXW13gY+iRO4wfCN0/WS9SBoetcizIaHh6lhYWsm6I3F7F+QpaK9ERk7QT6yhBczKehcpwf039c5NFDG50DxWUNLEo0O+1mPAxPZHzSuyZ0TjmMZu7P0IEUApuY1f9clBZpcKjt+KhmrcxwVWp8iv/ni7exfm8BhffqN5R+Fhdg4T+AZ0sS7Ddi+cbQJjVbn1EBSAhFFYyzZHXVrLDqVLeef8nLU+eHZSDckMKKI/nw0w1ksOKLtB4m81Um2qXHsxe+XT9sR X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e560d1e8-bd83-4cf1-fcf0-08dcf981a05f X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 07:57:11.9120 (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: 5G6FG1752Ciutz78HW4C5OphHcF0/oukxNT6b9JzSYQI8xmBtQpkSB5LW7Y8znoyENijjeI5xNNTd6qgultZ7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241031_005715_780851_5E8F3999 X-CRM114-Status: GOOD ( 11.23 ) 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 dbi2 and atu regs are added for i.MX8M PCIes. Fetch the dbi2 and iATU base addresses from DT directly, and remove the useless codes. Signed-off-by: Richard Zhu --- drivers/pci/controller/dwc/pci-imx6.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 73cb69ba8933..d21f7d2e79dc 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,25 +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; From patchwork Thu Oct 31 08:06:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13857700 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 34B92E68944 for ; Thu, 31 Oct 2024 08:09:45 +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=n/foMJLXbrz0qbnxNQ57gS/EpLf9dk983dskH5fpV0w=; b=oO/FT2OXA9q0WTrcmo87FuYBZ8 lR75HtT5erknzrE1btl1C/eIAgMVpbme8c1lY0mmYjqK8IhPvoScBXLMSXDiZxpDglMilBObGT8+d Da8zT/+wEAAL2jdnJFta/EDR6l6qFJGsWPWztPdK551OjQ666NMyMdvHzR9znHI0TeLQ95DBwVkZr gRi9J7mVeriPB8yoSV6oJCBa82WiPtGQ7maOFbifQaeObr+GjUmhDgKQgpNhtslmVWTBIOVgmLX0J /wZX1hNXGvhDPKuLWNOpg6l0blYmjKVVjl7y9iXzHphYtn4lSNoAVUStJlp/9CVeBYPKTlyg5mjZD QF4uTkEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6QFI-00000002tfV-3XAL; Thu, 31 Oct 2024 08:09:32 +0000 Received: from mail-db5eur02on20614.outbound.protection.outlook.com ([2a01:111:f403:2608::614] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6Q3V-00000002rqd-0uhI for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2024 07:57:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bNr9qi1Pkfz7uJpM1bS71dqcUjkJNUJmssEJ0Po/7/BFRdhc1l2uo+tp/6IXMpPAVjAEeTGQqlUXzPg6yjMw4yg0j5+yTfbfFmovOSQMiNZEh5KlJppXW6QXs4RfOw7wwUArBUxOCUWg2rs4h0BmEj5yaLzCfNASu+wjyStXWcvH6XjXoUNrD+C+7YU2BQeuGyX7cEXsF3TyMy8pN8n1F8YDbYYfTD1IbN09iRLfG5vukzfBBqSmJAcX+/NzIHFhfE4DuMU3dMefw9tprCa6EwZBTHjgqoom11EFZc+Fc0mKemUfBjzhQDV7DZG3Vc+XB7ptQ/TDgQBBPT3SVgxWLw== 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=n/foMJLXbrz0qbnxNQ57gS/EpLf9dk983dskH5fpV0w=; b=hYk3BCpz/QycFgaXKbWe4a+XDTVxeagaS+RWIXHECN0gkTRwa+xq+ejpAH/an5e8Duti/Q04LeKGLQ6yyplvtQL4ghvG9RSJNcrDS2huIsI/F7bYKWpfD1tOjHOoI4TWdmnXLFSR9ouYazRNsI7WVIwjPaIjgolRpl22nWdm79lcjEOTNxAn08eKAPiFcM745tv8OON1fbWcLV49iNJGAoWawQA7gkHyv2EM50LCpg3c1ZLETuLJAIIwdKarfz0zSHzUxMRjkVLkqEYVx3yPbWlVpSp5f4y3sC81X0qLJIQhXlIPja4+ZIL6oyZ13JoNeqTGoFyDS2meWWHK+02PCQ== 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=n/foMJLXbrz0qbnxNQ57gS/EpLf9dk983dskH5fpV0w=; b=gPTM4lE33rv7qriY0jiI/4w1BKgXtV8UdiBFPghTJ63U8utzNd5lEVnSTSSrpgqUMfEG9Wn3AfNFzEEAZ2xISAdxwazBEcZM8OorFXiUevbpozvmlJ3SH5Rq2otBqkh4IZXPcEInI6lDWZZ2Gi90CDfUriDyaS0A1tbBbsNGDJWpjTjl8kV0QWgtWOfvUC1CmwS+ilyLDR1NDK4AldnIoj9Z+6I2X4nx8EcV7bVhGa3vg1KeE/pbPYJWlodhnsTV3cCI25mdpZL2s3JtTWY2vkc/HvJiJm31UpPLtvvIrvGPEUZgFxoXulKHywutA7z+VN6iqJIkvrNTxXTvL2tYnw== 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 DB9PR04MB8139.eurprd04.prod.outlook.com (2603:10a6:10:248::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Thu, 31 Oct 2024 07:57:17 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93%6]) with mapi id 15.20.8114.015; Thu, 31 Oct 2024 07:57:17 +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 v5 04/10] PCI: imx6: Correct controller_id generation logic for i.MX7D Date: Thu, 31 Oct 2024 16:06:49 +0800 Message-Id: <20241031080655.3879139-5-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241031080655.3879139-1-hongxing.zhu@nxp.com> References: <20241031080655.3879139-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|DB9PR04MB8139:EE_ X-MS-Office365-Filtering-Correlation-Id: d9cfbcf3-d6ec-41b8-f257-08dcf981a3d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: d4CMnpC6izbMfSo3TsK15okcFcMoq1KOpf2z/zZMdOWPQGoUaQ+JWiTgF3EU1sNfclBR5Xn2I/QDifT5ksJauIXYs9Y0xdlGmebslNI8Bv7x3498FwsZ7QPh3P9KC9xHVTajIk8C8EVtfGBNRCDF0c7ElVroDRAewg0sRZrpWiPvtE72cpK7bcLcbVCzlicqtTSFSl6UMYTjIE37IGDnLWXBpLGNAesQaaXjRENehtgFEpp5XpLZfyIocsO/XXuBOi2pImUq23uc2hErqiyZ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6Rfdqh2YE6neVSEEEdFUPF0x13nVfoB+2KGQRgAj 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)(7416014)(52116014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mSiEmeNe2fDiwLyXILcwqsBWwSV8/8R9sbekQeMcUZCw5u22nB4ibW6o40jnKL3ci4sk2RlWiKivtcPZZwe63HQEzot8XoSfk3t2+Zr3PaKGYD76VlMTWlEuMeoxG0Fmqiwccjv7MTkg6P7lMuFL5IKHjeK6fGc6aVUGe7DqbH1E2yldJk/tmCxjW3NQOWZBR6eiLabw0peSS2M3wIUzI9IbIGfmhcKYnnDpy7gDYzqQq0kAfhQ+mK5Ov+J4BlDrLcMf/SgsTGUTEdeOJAOmz2+8oyNlAGHj31fa/RsrmD+9dcFT6aBcbQa3ng7W14aqQkz0rYw9h4rPZaA+RQOCV3hTCRcNfBIoZ/cC/Ua3j4Kuo+UUfvAshTzcZvvU/VyLLdCIMNT/U2lnS6z+y8SwgvJquexfX5GbZAtpVJq9gmkwLT06g5ZFyHitszJtfSuMhHC0QwxUYmUcR7yPMk5Np1RkH6+oaREbpfiXgNq16AhnqS6mORyNDxX/mOX0eymrvq/YmefWNauQDJNwSOmR5x7eud8fank2c4wZuvYT6v3dHyWgH25EcZ/qQ/oojp1lyfD+WqAIVpIQVpJcfoX99gfTlPOJH+ox0UbrtPViGBTow6HVViCTp7xDjoW7IXIGVEp7UOINGiciCtsJboM+/3e28VWBL87/wH8/6DwhIuEkSnb4UUXv3Y7COxGwIY/z7luq3ZdFYJdD35Gz76ZWbe7IzHPfRCoJCM96Wze/JxwQtxeXMBeYAORB6ZuCguSj7g4El/EHdXRd3VZ+/nkGmNAOqSGlnQMBpAy3llXFOmt4berpOitf/Tt3T7JxqMkBIbyqr4m5UBT22yaZt2YzUa/h2WQjZpf/nN0uKrNalK/7LzG7T46mdPx4G2eP/mTynIBmL2MvuOmA84n473HoeVgmnfhJ54EeXVYGhJsqw8EXzXyR5w29cOzD5VSdSwdeaMqUy4X6IymBNTVCQvow50yA10TeseWh7pwVcJ9s97QTCv97aZeY5yK5p74xQj3YAT5swc+PUPFv8WN+Sd3pdBDZjMniniHMz/w/vYRVh+VJtirFgm3mR1PpcDBQEwF3iEO3HzggEYd9iJ8gpavmmhdETfoS6XNBiL8ftaXA0IiA/tpvQPo6iupK+v2ubzD7OeNTEK0oZCFSIoo1nSDHY7OdWuije2pNKanaf11MRPXZdxCUDgd+bsU0qmOGF0Q2dUVqShnONg8sDfJS/rgvPAC4DzXai00ELr8DalzmZUdf+uZtFJsOA+bnLE+Y5jDMbPvFEUCr6vtJFbfNFO1IBDvUSVHAQyhGXEeXxcRS/DoFUTDdfGyUe0gIFXbiD20gFS/Aimsn6UsiqKr0/Bu1rn1EKEokvTP38Rmvm7/xn3BbRWdFJ6E3QnWdmnI6KuBWKvEL++qrRKQX7d5WZb/+OAMwQu3BCQdrjlKjWD8i5kMzCcgSIo9GQnih/5uN9StTMZ3ZfEQtJ3FFcLygv95/6DpO9OwZygqe/w78eA/Z+sey7gViOdAhij8O/Zvd+BTGmYvQxoIGd8Y2mZB4qb8WAty7q8QW32RA21cmrCL5Xn2rRDXuCvT8wDPzHFcbIn+8 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9cfbcf3-d6ec-41b8-f257-08dcf981a3d3 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 07:57:17.7557 (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: 9XCQMS2KmhpDXyEt6+5jhee3PuB6/NReMTmvSLjQkHTEzYX6qXa21jIRXeoHeIcgmXqBCRPMSd0q/kDMBFyBvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241031_005721_278339_3DAA519D X-CRM114-Status: GOOD ( 11.22 ) 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. Signed-off-by: Richard Zhu 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 d21f7d2e79dc..7479d3253f20 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1344,7 +1344,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 Thu Oct 31 08:06:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13857701 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 7E894E68958 for ; Thu, 31 Oct 2024 08:11:25 +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=8cJuVE5Oe+ZUPDPWv61QsRWeGGpZuNOJWUAEqPFt9ig=; b=s+N6NCW1pAHLeMhde/ISuQLf+x 4tJ3x1hXIgAqOiJFIB+7yJFA6gk/p1SAIEZY9cB5efQMn3s9rXYf/ppcjQ59aQdcFuQ2piRhY3oxe lJef2BVO8uLIYH7Hyyutn3WI3jPI20FFTgU5SQGHwsRLt3HgwTzNOmKCGBnluEmnT6wLqiCpA0yIW yvFOKACw03Me9T1+S7pibE7HLiOtTGVPulJIc9nKqFgO8HKiji/d8YEGSsiRyrNSfzwUNE5y3SNHx fN+xmlM0O+L5tMymat0ZjH7S5LAW+7Qbk3p8kSc63F4xRneClSgFhedoAKplJjWD0ow7cXmulEjNm fdEhaihg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6QGu-00000002tvj-49jg; Thu, 31 Oct 2024 08:11:12 +0000 Received: from mail-am0eur02on20618.outbound.protection.outlook.com ([2a01:111:f403:2606::618] helo=EUR02-AM0-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6Q3a-00000002rsE-4Art for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2024 07:57:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rUO1A+sTIzFVcyjY52OvUypIqcLFk6ZlXWe3seYIyODQSs2Yxgp6EGYVV3kMnKyk+XaMwKGlR4kJKoAQ9nJGQElXaDTFmxYXqym96m6lJriz78J69ewBLAJKmjPPMOARhpSpImLdpEgSSswsKF16TbbQJoBMx4RP9EP7SRTaiG9XBKw9tTS+o69l7YTkCqVotKmT0ytUHHc0xF0hJqDeZykm5pAulHPQScpUYVbb0m+lNK1+GeRO4+rPpbZk7iJ+mlqTN+MJ3Jm9TSm/Sxm5Ksq1K9gPgsuAYiG7UJEpPfGeSElIRtqKyUYkfmSEk6NzU4wI0urMSz3CzNhWS5Iu3g== 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=8cJuVE5Oe+ZUPDPWv61QsRWeGGpZuNOJWUAEqPFt9ig=; b=R+XIO3BhpFfy/J2h4m71q1xHHiOJUkDUZHVQVtKYWpLMoyYGTGzexhUISrIRM66WJlW4oqCH67dK94VVGSaDY0kfPJhOoUM7yNUCuDWIHM50QEJQfWwEMAfQLpX/vyLtuiH6yoKpJqyFVoFGv759pSRIrWzfCioZ86yV9KUqF+AIJaMEdVQ2ryjyNn3oyjCbeoucAccrTC2bSyPd3c4AUkimCpWtdRFs2NogOCcTvW6XbG94DQIYHpRl0NVYnGJBOG/aTK4JYp7lIIRwZUNZ3dEHY1xqb0Pezl3vO9pndJYua28MMzK60iDaU/vtkO+t4T2lHpsIQLBCBrd13EA5ng== 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=8cJuVE5Oe+ZUPDPWv61QsRWeGGpZuNOJWUAEqPFt9ig=; b=de9UF1f91dsrJJ8zbR4Hm2NBIWyeiyNsGZIiNN55bgRHeVo0cNkAxz6A46F4wa4QrrUEvpES4sV63jksI1GsI9PTKLYwqpDgdTpO/AydloOJHOS6A7EBb+iHQlGOFhg9KkSmv3xQDxbQe0+BBE5ojFRr6hC+xBy4rtzRiROblPF+7M52iYfJhuGJZqeLrJSi03nmXF/5646vmtb38sv608Kacjmc7LlFcWLqCx01yFCuhW0318nIgTDg/T7jPfgTOzjhlc8+2GPQk68a09OQVumalH1HQRZMSEkM5eNTBoF3gDOAacK5SborwfrR6EvyPUDLgZF+X9TSIOlh/0gdkg== 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 DB9PR04MB8139.eurprd04.prod.outlook.com (2603:10a6:10:248::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Thu, 31 Oct 2024 07:57:23 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93%6]) with mapi id 15.20.8114.015; Thu, 31 Oct 2024 07:57:23 +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 v5 05/10] PCI: imx6: Make core reset assertion deassertion symmetric Date: Thu, 31 Oct 2024 16:06:50 +0800 Message-Id: <20241031080655.3879139-6-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241031080655.3879139-1-hongxing.zhu@nxp.com> References: <20241031080655.3879139-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|DB9PR04MB8139:EE_ X-MS-Office365-Filtering-Correlation-Id: 386763df-00ac-40e6-76e0-08dcf981a748 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: wpNjrIKRQdRVRuVpOTFDeR1Sm4YYI6jijwd9W0D7rIGsnfgsAiLDOYUbJjHuUisOuzTej2x1IFth1hP1jtSkc89e/uT1vBeEdA98YCJIvNSYbdtlbcDI7xTjnA/5iTC0KmYYsZyw8P1NcqK4fNjgy/3Kq64geUr69F9zrcxuBPWfm9OPSuKdISicEVrpH95gBgnt9uEeaKAYGG7cHjOVT7OxZFzuXDezntVh/7/PVvTKUlb6WhL/jzPQCykNVbBHez3xGhG772jyhnPzA44kdjnj3Z64pBX1ZtgcfYbsGztuJoeb0dfYw3Yb9/AfCTZEZQPHkbGh4XoXfsEdfBy5UAPJ9aqoAjl8ulE8kZMnBWWZqFYrrLM/CzkI8AsgfpWeyKH7gHaX7qoZILGgXylI5r3gELp4UV4ebHpl6/Dvnb0/Uv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MB8676.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(52116014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: P9C629F2pPWTO91wfggqjM56IcqPlppp6VCByDQA5Hk8usI7mmVMfwDBPb6M/2OTN1qAFDBaFwn8WMZ7P8q75glDykROOvNMSHke83d3eIz//h7Uac1DwR44v26Im7UxysPMPsN1gQ3wKM1rrK2T5YOBDBAIAsphdyEpcRAl96MqrRzQ9ITT9xjWhD3Yhn3S4vAo9cSMYR2YXkUIxSolnl1Hy2fZKmVLQyu9ya4VM3eaWN1ZJUPwDtsPCHSoKE14ByEhyqKpeoYTsRXLNh9PFftGydNgyHXvaAjK1Ok63VojvMApoDKGG5k+VRvPFZBXWX3j6q7k+N41ebEzcoRXGvPQAebgHZwHxOx2s+GTh7l4ohISyvUJaSNhHDgTKpLuABmYUotkfm9AZYXt7xXW/aENT3cuxzkN4FGNelcUK0PXpcxsZpDU9UbmiJzU6HCu+YQWEx5BqKzAccSpHGcg2FDI8nGS5pK6VlMNbrc5hBZNzHuU8ITRfrsryN/x0hxLLwhpYm/aN65KZK8af2Rlkdn4Wh3yyBb5F88nyVt9WBvJb3jM+e0W3A24uu8nUSowil3FVpBuCAha5sWvbWJB/2BwxvUmsSqCN0wwhVatgLWCr2/zpIUH6keu0Ch1TcPSNY+C3x/HxVeLFIlq42/PfFwZWHdTC8JaYSBs1svuI2W87HYZYcpg59OLw8ni5sRLCeh50t3lKoLVryLERoQiAw7J2BSp1ctuon2Gy+lbaAvbdzWC87yC1rp3lkWBVz2mIcTTJx+79452juEZriJUqNY/Q+bHGwqFYjhn34T6eIMuGr1zDG2MoG/IdMfxCbS62bUidZ/L5RHiEqPP9t3t+OJOeQpbkyyTkAGpgCRFwOFiAEFOcn6CM38WcMRLW7jRefXN7PH8aWyeyebPodvO76etx5gGQzAUATw6xHl6uZmSbAmSwTRHVyIfnoCWlMySmuHiSEssgzmIdYNx3dmy6OZzad3wxOOfET5zB+dw7x+SjlMx9hpJng2SSXYRpNxC8lOJI7ezDS9+GFmGVIsFf5I8gXLb0yuledLlImZjVwqP1tXQ+k3qwgFEBV3pMC3ICly1AZgbshh7qCmhoYJqqxzzLeLivkG9en/mQnm5BT9HzAY5lK8RDJ3naME2fB/DoYczfP6q+kQ8R22A4e/J+13XqUNjY00MyiCGQIWcfkUYLsRNcMalFI8B7ibOzH02FA4qQjAMfVFL9punlPvvzkqJhftc8/xvAY7o12indDVCcTKKFNJA2BPJzc21PjlH6eKyJ+v4UwrFZgLLGpfc+M/EI/UCQeeAL9LofAmhJNVTwoWUb3TC5ngOyeeCUKi8mvoozdPQqlo8gxPZJNS5du3kb8UPoVNVA4vnuQ7VRiSivAqO0lLr8foeIvX2T9vFM6EISyE8lRWqhk1PXkRcPUPO9F67wn89Fcqz/Gle8TWS4P2liJKkhL06u0BlcL2O/H20F8CJCI8+Wknt+kEKX9SMkUkHT8naNH+Au1M9bXojiygLV6feBFCeJa7YTNt1TBqr5nZVxmPyMJ9u5DOHbuGLkb2nTq/ZKbeDRUz6mVcojGTOFdSfMv3Tbz4SrtBA X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 386763df-00ac-40e6-76e0-08dcf981a748 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 07:57:23.5763 (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: JYVtaSf6C6h8vEjdk7juLdS//FcFxpOki8A3wQMI27kSKgBjCXTFZ+VEVhGQbCpbuMtcSJSzoQqpu75vzjvOEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241031_005727_064908_23500AFA X-CRM114-Status: GOOD ( 10.82 ) 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 apps_reset deassertion in the imx_pcie_deassert_core_reset(). Let it be symmetric with imx_pcie_assert_core_reset(). In the commit first introduced apps_reset, apps_reset is asserted in imx6_pcie_assert_core_reset(), but it is de-asserted in another place, in stead of the according symmetric function imx6_pcie_deassert_core_reset(). Use this patch to fix it, and make core reset assertion deasertion symmetric. Fixes: 9b3fe6796d7c ("PCI: imx6: Add code to support i.MX7D") Signed-off-by: Richard Zhu 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 7479d3253f20..92f2d2536ffc 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -771,6 +771,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 Thu Oct 31 08:06:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13857713 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 6D52CE68958 for ; Thu, 31 Oct 2024 08:18:10 +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=fnSkLIV9obQZuA+bG5vyt9kpBfeeKXGJOSCwD4qlG5g=; b=I5AbMkjf6Wq/N6d6WorCou8I7O R49eQo8KUmoJsQLbLEf9YEFILAjj0McCbPqUzU+e1m7uFtH/i1+5Vv5qRyVGq6UpNmUJnxWPupUVu BAzmbZ7VtaETyHTnG/2FN0IUfkz2f7XTztn/9kOWbgnzNtbLXufunlz9nLJx65vrz2IFfDDke6dMB 0LFOY8gY29eJjp7zMEMMI+BjNiGZEfPTtCjLY98oINOjk4+f9FK2mr3+yRKBzNxC4G2xWC0Sb7w3v pJCK1KUhSxWR6xYpSj4smhRXvLj99SHP7886sQx1AkGxh1UxM4QlZtYVDOe+b0LR/WwYCL7vITIu9 BLF2U+vQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6QNS-00000002v9c-3Fe5; Thu, 31 Oct 2024 08:17:58 +0000 Received: from mail-vi1eur05on20606.outbound.protection.outlook.com ([2a01:111:f403:2613::606] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6QIF-00000002u1z-07Yp for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2024 08:12:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rVQqPhhFzzAD58Y2w24FEyJO9ykbP9iM1APcTaI1bSkjs81fHd/BDUs7qe3uqHmcr/IqkrhmYyoQhh0mQcRmjBl7FLaFsXyPNrrLGSDzhLSOXI9tfUkVan/5AK6n2PgnAfZuAD1HWQzzpQrbTPFkWhyoz2qHyw5ERuzXEcIY2OE9AlAQchPeR70f/Q1waCH2mU1LH1PZeY6bpi/+2jtdvfH22KicmCRHcswbCiLP7D5PupdwzJyrKKf/NI5L2NvPbKtoq43ExIy07L7L1vRrelMfWUH+QoqGgMG0/wAC1fbimX2ry396+1KkqcWvhoeRzSVXlMuDfFoGwJ1ChsuDJA== 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=fnSkLIV9obQZuA+bG5vyt9kpBfeeKXGJOSCwD4qlG5g=; b=s6QCwjLV8okhJuYJmT/PPzde2dhQ3IABL4rYCqnRKit5EZeRBC/lH77H0lWonSoYqZMKI0lr6+ufASZCX9Akoh9mrvl8g4NFfhRyk9Ursok4sPXpZ3qHTOmUVfceXZZM/xbZCP17Dxt9iEMUCJVwdPXhx2moOx564tsfCAAOPZjXJIP6MmV6MTl2HB9A2demI7U/KAFYGmiXIkzr39YSDBG5wY2yqWhFH1MNsGbJ8RMy9s2UZWxPzrGIMNCdi43OhobGZb8SniML9pI4a2gI6GbvkjPrS+R49WQYKNh0HLQSIfV4APdql8pqtnRmSV/eK3pr+9tIw1faNF+KqAInqg== 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=fnSkLIV9obQZuA+bG5vyt9kpBfeeKXGJOSCwD4qlG5g=; b=GSCFxlUMWhm0dYTaPLf/x4NDgyY8fKc00hxK49BAbZ7HgFGqvLap0Q5jE1iGhp/1ULrLVDWRl76tGwBtdYdPZT9hJ4oagApG0LrTHmb6sj1bHrMyOo9S2d8pTt5EseMxKpO+BkylmA5tgsQcK2V24e0FO5bBXgZ6XMfTWDWfOXQHHHPCqrvik853lP3YhkK+4kLJU8iUKqpPzmlxTsctXgZQcJJVxNkr3rtk+ZC6uKozqaCU2G785oYCo7ickPKB4Jve4AqltZQNj37zmTMoF/9pRKTv3xViVV+FzdYkjORm7gANxM89Ipw5LNAkGUVLngAYhyU+h7UnHzY0LNnzSQ== 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 DB9PR04MB8139.eurprd04.prod.outlook.com (2603:10a6:10:248::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Thu, 31 Oct 2024 07:57:29 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93%6]) with mapi id 15.20.8114.015; Thu, 31 Oct 2024 07:57:29 +0000 From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, lpieralisi@kernel.org, kw@linux.com, manivannan.sadhasivam@linaro.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, frank.li@nxp.com, s.hauer@pengutronix.de, festevam@gmail.com Cc: imx@lists.linux.dev, kernel@pengutronix.de, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Zhu , Frank Li Subject: [PATCH v5 06/10] PCI: imx6: Fix the missing reference clock disable logic Date: Thu, 31 Oct 2024 16:06:51 +0800 Message-Id: <20241031080655.3879139-7-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241031080655.3879139-1-hongxing.zhu@nxp.com> References: <20241031080655.3879139-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|DB9PR04MB8139:EE_ X-MS-Office365-Filtering-Correlation-Id: e0e5dc12-5005-41e7-65e5-08dcf981ab0a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: DK7YjFBLbdKU3dDTXkAg7EQj0Fx2B/FqZOwQ1ThReJ+liwIvnFMLaN+l1ABxminGuO9aU1YjWmE0k73PoATCPimBsZMdN9a0w+WyXjA0rvi5HMsY3WYeTMI6qewUj1epX5acv6HPWCp/IGu2RjdN1QcUTsrPxa1Jj0ACdfUl1xERpsi8zkf5mL2nhV0iSiGUAzwoC/fMM15w8pTHidk15F5e3GwCRetdI9/sZyU1tGbpkpuM3Rs0TUDXRU/+9V9l9sreYmFChGV2tJAstR7UA7+Uty/DGR+CbUVABh9D9sUoX648DyxcgHqdPRpIWh3LZPyhkYCO8j0SavD7dZ81ltjIdwYZ+CxELZDd9R6DdKBPn4QVoZQ4rpWcOYCcjuwDsLW/e2suHHz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AS8PR04MB8676.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(52116014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZyheOXLonZ6mxBDDXNe4Qr3MluvHbuqGFRTT/pMPmTKMUfPrNLfCWS0VVs+Y39vCcu/+IJgGI5ipWZNsziGekatuQBNukpnIgGwxUJwkzY03UT8lsQwfE2yzG9Opv6R+DuHvpx1KALJxVleBnpBhjGqan9HB2FU+qLTmi1Rim56qK1nmDnAb6TMiAt6qY3ZZjTOj7vHhuubZZsg4VLBEzfLK3TNb0z7Enj/GCLfYjv+7TJZNC/Yuz54PaNyBBuCO8BQ6GfOoPEl4r/M1vvVj8ebP21wnkaUY7l/hwScJTlTNox413sxXOkAP2raKtRhKlSzriGBGe1LV6xQ1hrP2uE1NjYel8sKP1iELQfrbBoJo/9Tu3HsU1YCG2GWH6I2lbsd7dCaeNXxYdKOlMF3QY+oRunPUsd1wCxHtHPOOGjheT6Pu9z8/U0IUhgkHbb2iiTfbvGYDQzqvaDrZZ/eu7J6hMOzEtMQNYF0Kqjd+gNFE+E3pbdjNK7O7/kgvuZtpHJG4S2WaJZF/l1HNRH6w3la5TNjXbpHuD5YDGd0P2aowWLVkRrs4pvfI9gXs5gNavpe4BpH+VczOx0p1xWsVOMrTXvYuWRsjzKaTFV0qhtwQEzhg/anTAQya2Al2TeMxQI1ej+iOKHbplUvomM/5S8BN5SHRw7H1Iau2xpJ/1/IlJLVCpJlcTzQuJOufI+9WWZthbaGTMwmGWpLCqSwzNYMBoFF+jPtpMXSE9vD9xgQbvvjZHqrsR2F7622COUX6FukncNVDxYXbr56G3jzZ0c5b4LgxoxbGuWWixRzH6fbwzHFpzQ7lBC/fDcBoPGACUR9wZhpuIo65h9Q5WvABE3sYg9qIPNasTKlf0XpeBu3tt9e9CNLCPKB0/a2OSEjB3x5lNFhrJDWVkQ/G5RjOo/4ED/EG+jc+XexJBz9kOszH6PAO27ukoptJMvFl7WvhuRYDjVT1mLRvocfDfpzwcqLSci8+ewNu7m3LTpE4b0dk81a7ZRjREKhVOtINGfrl3in4KyzCO4gxeyEdCKS1DLd77yzko7BtoLpKEzf1olkeQLMU4o4m4sTxCYGTbsQSbZzTMU+BcYRika5blhEzdkGnLaskk3pQcCSnyWJMSoUtHZGTkaPDp3GKGacjnKe27PVJMxRGRQnLOnLPGPS2+taTIQNGgqP6NxkJwCFnFIkwriDhkDzUgF0aBolbG6gLYUcjhu8EKVgPMTvK+yRZEFItSZamMnGuV4MMbWMTWLHuNoL0J1rvCwR2lHUMvGOchJtJC0iktMYI0sjTjEoIcYcBgx5ic88/bYqsIw5okNtu5vQwlBtZmYqJCXXsUBKixXwC0Z19coe7hWG9Hip5QHDg9SuF9sE1fAVeu/5E1thbmzze+pjNW+izD0a9BtufTkDLA0DOzBJTwcGnb0T7QBPIJoPb7PYu9LjhL4LEY9Cl85s+n8RncCGNN3fVZprjJlo3h3x9RF/BKtgHfcz3lJ/AiIOhUqBXb7OKuRZkEYYfcXoCoMDLz6J4S+Dvzh4TTL+BwkYYtjxJZfFOEQYbimofO8kfVb6o57NWXRzDCkf97Euoa0Yy/XsY6oGJqFWX X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0e5dc12-5005-41e7-65e5-08dcf981ab0a X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 07:57:29.7304 (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: ZI/pP1JPUuIOqD0e0ofjIEb1mqpJFXW3NJ8XoNgLT+xVzM4egTAlGohJkP40rEHcau9u+7ppy2YKJ6u3tS9Z8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241031_011235_081426_8D0F4AEE X-CRM114-Status: GOOD ( 10.46 ) 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: 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 92f2d2536ffc..e696dc9381cd 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -594,10 +594,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; } @@ -626,19 +625,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 Thu Oct 31 08:06:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 13857712 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 1990AE68958 for ; Thu, 31 Oct 2024 08:16:30 +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=Cm53bTy4F05Efkoub0PfGe5TKog53N+URySblXqbzdw=; b=OEEQYrakkdlLP0oNs6pmSEWe2C WoBDpe5ZXHySjaByhOF1eY2uf1j/LC6kYG1egxzOoD3oi734RRmok97coZc4cWOZXiqMITag5Q71U pjycACibhCbeBA4PY0rezQFld+n4crbRcd09NI24gCuzZvuGLXnv5lyHe/feMzr36wr1VjFMkwTX2 q2mMX3DIpsVfJIQF/l/xYB6fbviHcXclz/RTfi60TKnMvvvB0R4Xie+VPVt6g0IhvU5uRhITN3tgz RXVmqMNCzWHh8TpVciFqhZMI+wmGMkP7tPZ6TiSvatFLda6f/ofi+eAA4b9Vg2miHDnECow+Zo1rM uXd5xBbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6QLp-00000002usA-2h0H; Thu, 31 Oct 2024 08:16:17 +0000 Received: from mail-am7eur03on2060b.outbound.protection.outlook.com ([2a01:111:f403:260e::60b] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6QHW-00000002tz7-02VO for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2024 08:11:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Xp5tb0uvvd99Ds0LkG1c5d0a5PSzQJ3zb9R8oWSiKCrZgyIGxVFLkKnkhD6wVicKzNokrZLGpKzkqnpMZDPm9f3ENZAKJMQt14fHA7vMNOYlu3u1g+dOnnJm9QvzgTK+wOF0L3jzWLnLG0NA3C1Ay4S2l0nLEaeuEwxAovjp4h0haORYFhRD2F70fxeoaacNoDsuKEhfRy41fzmE6HghT65Cc2mP8//EtmmIWYKiBQlhmjf10IbVHQ/QpYXWYWjtRLwgcrgJAWEtnvhjZ4UEWiTYBCngL/590b6a5GBshEKa1DmsyNziyalpYBv6YdEfj/1Jdb4pXusl8TU24HGaGA== 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=Cm53bTy4F05Efkoub0PfGe5TKog53N+URySblXqbzdw=; b=Hp6BGvjOhkdlTEDsjWyUwpPS4vCM8EtOxtmfcsX27HSLpvs7mjtIuSCDQ5Dom9FXtOC9yIzLXbXnJB8F2uYt59Wn6UvZuDWekDjjWNnml0uOHg+xaYRVaxuGN97rPyF1DmDF+os43v/3PqAxUPqGWUr/9EhwM3IMfxRpu3j0gl4jiXNxVvcEKpbJWyLrt1FbvxosglQhCODFZS3YX+js125DN6QaZfgWBD2oGwtqM51Py6j6XOcXEQyytLJwdlpuyb7fm54PniqdV0beAW5xD8X1NNKuzAzTMZSVassuQsj+YctXT789OCnzPiTtt6c9nJb2lkdAFy5VuplWbVxTdw== 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=Cm53bTy4F05Efkoub0PfGe5TKog53N+URySblXqbzdw=; b=SMoAf3FZDigii/z07flBzot7uTDGdJCo/erOU3uvdkNKqV+WQdsU5+jTmkohj9sZ9g/dQksWLY9XVCUE92mbTWLgOpUmiImVtJ33EuyM66qCgUtyLM2xYa7V+f36rWFKRhC/sj7A48UUQElT2PqLxnORBor2dzS9EnLDyb+aoMKuulZYQzyCJvucLKTSn7ms4VIUVVsIg/NcCkkEbOWc/7uBKxESyRbL1Q2T35PFTWcdaOP+E7TEgXeobfxN9jGkawrglboimPdVmQxTtcUftNoSmWJUsMA0W2157D4VGWOf1VW1lwmEgYdj6pYsduHhPem6roZ05HZbpmzi5wkzJQ== 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 DB9PR04MB8139.eurprd04.prod.outlook.com (2603:10a6:10:248::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Thu, 31 Oct 2024 07:57:35 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93%6]) with mapi id 15.20.8114.015; Thu, 31 Oct 2024 07:57:35 +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 v5 07/10] PCI: imx6: Clean up codes by removing imx7d_pcie_init_phy() Date: Thu, 31 Oct 2024 16:06:52 +0800 Message-Id: <20241031080655.3879139-8-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241031080655.3879139-1-hongxing.zhu@nxp.com> References: <20241031080655.3879139-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|DB9PR04MB8139:EE_ X-MS-Office365-Filtering-Correlation-Id: fdaf70c6-5e1f-46a5-df24-08dcf981ae68 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: P7HB2YxWU+nKbhY0ZnVns2YF4QMoZw+OKZKoGWiAXi2UatGH1yrINCl9ou3hQvlY/NDTIGbdEaAacoJl9tkgXKb2WqU+hv/bgNpLM/RxpPInrJsPCBf8y0U6oeUiUCSotnAm4Nc0V0B401ItxND0582JASRv0qNRJmciYWG6lQbKG72uXeA2XBGeE+5H7AvF907Lx2JbtKYR4LzYERsb5XdoZ/CEgmQ4h+hR2sCvL4r40NNbsxGqr0TWI66B6topup0gBJlFwc8/p5Ayd8EL1ba1XkMpO70mlIzOT1CxlPhSbiq/sv0+ZT7uvX2lFLzU1mpJEXHMUF37uJOsETC6lEKEx0ocS6S+JJDSlNPfYZIR+OCVKQAnp6kyakjRJKk7cIuMsyzCp+A6iSIF/7o/nOUPLifXAuFukuaPAZCD1bqHFeT95oZbsr4cycs5LvE0CUtMbUHayjoWym+DW1rbaLvlTF0xU6bxmbTQCK2xhRS5kNqzXsM43ZwIPyE3YBOwWaivLGUgDuC7f1xIQQAdc2Luc3bhCZBY8Ur4Y2q3Naw/Qu4gQJdBrequsVKBFjpPY2ay+Ho/WeYtKIVXJqNINTxMrACwXLxP8Eo095xC0y2b87D93iPB6lCgVv7TzPzD2SmrdybKSY55uNYERJO751Wo6TnL6vzV6klCa7PveTndjuKYoHx4WjXYsnsNcNrGVyBSZ3oi07r1M1WToIhJuZCiaq8CPi34AS9mTMj0GVXZR796ewfbRtm6QhIXuU1ts6kqoUxyuPDCq+/iY3p6xUM2lETWivleAmkOhdq14SgbPDqJ068wxtJu3LyMQuvR5MzN6Op3A1CpTnywNMzN0orcdWvkHi7DDNj/XnL/ONsKPuSvXYsWCWGtkZHQVDi1NFxUqDrwNeqw3HW2MOSySAqNnW3yTxP3U/0Y1tx7KTSNyxn04/JAwYoA04Z22mCLUbvMwc1yVTJfapgHw44XgtKrmgVssuPeL4KpfS2Wh4mZtsixfV/YXGVKAY9mIt3cAZfzLlPknXFMc3QsUnLVNZUULkz1jVhdjr6Nz3KF7ydoTbqFCFQAdbn4QpsiA7JfoBPxt97XqEhBUCMC/Uu7i/PH3pz76EVR0lHSn0Xeow1+93NSdxPO/s2v++3/R/GaXuH3Ew/6b0rm1Y1oLtf1jw1aCTxqyNEgezLdyMbga8tFvv1H+uI9FoKk2JvjxDrDdcbENNbYhIANR38kZBDlQkV5wGv5uFN2l+nn4FNYi/CpeKh0e2vR2yDYStC2aHks7uoqfLNgJc60RzBDImrMREXANPySM5x43c0a137T7U22pChkb8Yi4BtbEe4uErTtSVe+2apjz9Nnhw+DQXVUmP28xOy6ClLkMseIt8g1wRORmwsYzLcYBw01E2dkldZl 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)(7416014)(52116014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6tC76tzh/ac2O6/nxjWPCV+6cPJWCCPPuuMthrTZhnBOi+lSCgirAGVBsZphgT5qS+HD49T51wmXXnzS4UK3//ymc6krIrjaO3GBzOcCnmQQFfppv5sAOwXj/EdQckJm/2QCVTJFPsOH4aUESbKGxx8aWtwcVI8tQszcXManWWL+Xz0nHfMIm/xzDmoanukTFfKbgAU9idybVGRgFAqnMIft534c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95pMk7mfbaZlMBCYGP5obTHsL+1LIdIW8zlJsQUQ/A2HYd9ovbUDtU+JES3I1142VbeKp1zP95YmESItuO3CB0CGmonkedxtpjZ4ZrCFyW7vuJ0LayrzzvQnDdgeRD8vrH1hNrsTbBtJMNGUVv5/E9n4J8mJDJAdREIUeCq4Gsgo0xTgBiiGUhbbjMFi+uXJVjLPX5VhtXPrEuHaQ8Vr9iey0BGA7GeeqWhKsH2beds8UP/5lR/YJjkaaYSOot7mAEKrAUCgz+LXPGQLJ1MYIFiJ5JTA2l2k3TB X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fdaf70c6-5e1f-46a5-df24-08dcf981ae68 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 07:57:35.4829 (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: qr48JUOOEQ+PxflcjpJVpJjqoNW+fXN5/AacqhDx5GD/X8g4OKS+MCzg9c2/ChujlTyR+/qlosr2ORdHkHpKjA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241031_011150_060103_5AD0382E X-CRM114-Status: GOOD ( 10.38 ) 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 Remove the duplicate imx7d_pcie_init_phy() function as it is the same as imx7d_pcie_enable_ref_clk(). Signed-off-by: Richard Zhu 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 e696dc9381cd..dbcf22e440e2 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -389,13 +389,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, @@ -1529,7 +1522,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 Thu Oct 31 08:06: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: 13857711 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 E95FAE68958 for ; Thu, 31 Oct 2024 08:13:06 +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=2x8nh85QHQ0gLLkdmuNiEltCwvMvKZrkBbGJybKd5og=; b=qjP+XIuG73pNYiFB82OxKwOHY3 jWY1oIObUJDHzrFh/TZduWcNewO4TuFP7HsVcCQC0izERur3W/XmBycWlBp2JWg5Kp2X89bFKZRY/ 6uwYzPlpTHeV0m8cWx7YavZje9dHYvYFB+7KAlqVtq72LPcWmvCA+RKOz/KD2bX/mJU4TXL0jGdyE amFRSBp7zvPv2Xsrf0f08ut1NdWb976j2VzodRg9xb5f6Dodl+lZ7DUyyemKfebWOuzryR8fobyBY py92JCNVuO7dySjuLXisK2oGAJ/8mahC4ESueqYYRcLrzXVW9teBna4iss0iAmINO50MiFpaoECLZ LzmpQ0Nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6QIX-00000002u4h-0eLO; Thu, 31 Oct 2024 08:12:53 +0000 Received: from mail-vi1eur02on20615.outbound.protection.outlook.com ([2a01:111:f403:2607::615] helo=EUR02-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6Q3s-00000002rxI-3JqK for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2024 07:57:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bJ22O+HmrezJnvxvXPJwp7lEhlQCYwIYCFw2zCCIqcyZH4nUxbcZ8pqpn+9cPUs0zsI/rRpMvDrf9vmfGTHrYbc1iqYAuDi/yDY23aQB0WZcPqx8YSEZidOmw28wOLavAa8Sti2DOYF6NB+wO63NcmeZGrn+Ee2rvlYppzBI7VbTmrKUZLPgs6Jyk8K69CVqOXl27NkDeUIdS4BxSXt43pPIdmNk8NQzI1Vb6U7i8i+KHnF7EPTdVyucjSmazLNFaxxGDvwHBOkfCN3edemTN3YC/1KytChIUzy+/7keZFJnSDa5rpx8eAU1183p7bA7QKFvQg8ghjj+4ykrb/jsIQ== 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=2x8nh85QHQ0gLLkdmuNiEltCwvMvKZrkBbGJybKd5og=; b=PfR9Lf26Et/GtPH0MLBovmxa4Juy2BvySIY2emOC/r70iTpvftmpwso8jiGlemmWVFKBuO6Y3cK7eRQLJOkMFOAJeUPpp0hSqLlMDGPHFdwlpRQyrHvVueivXwFSjYXxZ6N+F0+Qe6zBBD82M70GWgYJSEdpSyIuJho0g9c2WFtZDPB+RlPKRTHFmUbUp6oM0tENWh0jsn02Z/fJDS1MYI/p1Opoj8L2WAf+GHjbmCZalH+HdAyWeheRlvAlpBoYlvPLiolH6qO0Q1y/ZCKs1dGulDsVyEmZ8HFkdGlIBElAgyBwvxCHDRTxecH+IBP/nDupBtlIoOaY2yihkVWj9g== 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=2x8nh85QHQ0gLLkdmuNiEltCwvMvKZrkBbGJybKd5og=; b=jBZ2GizhmhkNjqtEFReazZesP38M4h5iGXSBpwnL3aoyQrBQHqM0pGZS2ScB5laIETlH/qNJwFzBaJAyMKEniXe+iYu5+tb999yaDM+oBK+B/xdbaKCUmkrBSDS9Dp5ChCgrbN1MoRu2+FAv1cyGNEvJ2KnrUklQtJH0k+nP9+G+FrAxmE/545QxWC2XaTcVT3IGeZu0JwuX+PVTv7T3RPgwysn5anv5DRbXjoDbg/jI3q1+g7A/07s2kYbybWpJR7RqLr0txmHI1dW0lrrNKcZ1WVzPx+HntGOu+hmv5zOOIx+295koVB3XkmMAaAhQxoymhhxFOGuo4JnozLJkTQ== 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 DB9PR04MB8139.eurprd04.prod.outlook.com (2603:10a6:10:248::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Thu, 31 Oct 2024 07:57:41 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93%6]) with mapi id 15.20.8114.015; Thu, 31 Oct 2024 07:57:41 +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 v5 08/10] PCI: imx6: Use dwc common suspend resume method Date: Thu, 31 Oct 2024 16:06:53 +0800 Message-Id: <20241031080655.3879139-9-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241031080655.3879139-1-hongxing.zhu@nxp.com> References: <20241031080655.3879139-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|DB9PR04MB8139:EE_ X-MS-Office365-Filtering-Correlation-Id: dcf341c7-0648-4fbb-e6c4-08dcf981b205 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: OXWnsfpL3U0TkUvy5O5VIH/utxvVYCT55T8yLB2Bbbynapqal43sd460IFhqpBJxgiH3lxueTms5meLpUjGh8btrLOFMDvg3/IH0OF/ilCUE7m8T+6Kv+hPuES8YsdRaYcWkp3CMnQShXvE64whkFlUxLxO5Zg2Z7W+N/4aD1SuPtDOR2YUb7nT8xI6xXsRkwNQ6arrVaW5atlPKTiH3+Wij6g4x9bvUAPodaulZun5k9BCt/DdGakzxsajKyMqipS/fNE8Cpa4nVv6YZSRhH0ZFXCc1pIdiqbo1iY050EfUURG9OjnmxQ+D2qavstv45D9oLw27Ys53V2AvMHsJCv64WSkIRVBzwQ+8Y7B32PZVt/COt6fhen09WY385ELetB2A4Kl9wiev1ijlGLBYMkxQY8xeTVMCKYi1F4duKuxQuSx4/HuvlhTklPlj9RaWWxGj/+iYmH8FQngTLvCq0lusi5IHO4lSo8b+6pX6xE2opsERQ5ohjz7uljz9dxf9Q1MlGI/ze9ETKqJ+aqcWj4vzmke6wRP7SY5mvLzuskQhWlqkkzSKRu9biP/+PT4yMCXxCdEcbh1oRtHAKDi5A+6nAwBGXkWTdEAeGbmLg/lTXHco1Gp2fhksXINUU3unDCWIR/m0eUk6HwPdrMUl03kLFAiRi/mC4gImQWeLgqLdoTfa4iYCamJhhgPvGYGx2LaGY4pWa9j3qEpbHvxvYDySyfQFL/5wfAQCo5HEHN1WkRyrUG3aoDqStOJ2KPJ/p/cXcV5asUOZS1z1jUr0KW54YYp3VLBrgjcr6TLlE6De9lKAzpy9L9c+kN50lqMQhQWZTdSXFqMa51ig4VgE39ZI9vOiMfpPg0gPYeZAYr2aNJwExIA8aueJl2Qrjz/Y6lT0LJqx9FgJiSpJHxAhuU1hpgXFiTOxwVDQEPX17IbBT5oum1xV1ouCAB4O55pWqpMcokWm71JSP10qvlogiS6U+UiRUt5kaH0/3HHVTQ0DZE3KP9KP/FpGclp06m1SHv6sZ5hUoR379fgdT0bH1vFzvLMZ8cp2sytdQrb1fX7ROSb5KJP0y5L6IaevaHVXKBxPY+V4cR1HijYb8tmuKWNXYigkkwmRUvyPX2+1mUWhberx+gWK29POSfLm2lkzPEpGxU8fgsPDfamm4laVk9wadHsklr9YgsWCRtiiuRFZMRiAwITxHGq9vt22S7kRr0fqgN0B/eMdMSPqBZGgV4J3xWOhixkkMN9RgO6E+g6sscrwywDFQASw1qOibyNJcGFWXK/DiQ1nfXSarVEns3aYKUnGBPH9jiRqISciAGFKmCV++DiYSxWuy5VGIzxkMCQAf2PECGZ8nNPwv3/mBX7PGcmMVZfJ1ABQE6uPENoTr4l6Zfb0MzMCwg8RRzMt 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)(7416014)(52116014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fjRY7+qEKYHPtnsY9J4pqOG4OSpEl+0q5Ejrq1wLcfXFkj7ysqzrrXVjoIiz8+ePIMcF3s46dDBeOk0sNhoHgNhgJ2J1yhHRSCo0RKO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2bScwsUlMhXxL2S04U+TxeZGmth5T7PPMbE/zgKQhK7cSMu1pB5HMqef8MnQFgNjbrxpDjsEvuI5s5UdvY79it6sRjpKvahcSHy0on1TWpdfGEDIB7KxlSQ4Hqg3nErkGi6t/MAD75Y+HUFxhxXUYNVTXih5oDSqcHjZJAO+aLeuKII/AeJQiTMj8lccpyRL3yioVkcWKqfuo3cqbZEkUAQEZCuC8lKRfT5ZNW+tJjX0HaHamwBtMPDCN9XVzEIzHEx0kUu2X4uSAVP6zLPNaLMHnca9IcX/lnMMAl1Bt6JweLyOdgoNrvUVJJm3V5zrnLev8Tam12w307fGRXwlvdcOv0pG7zbwaHzNTkbGrX+yFYPkFRbxmPeXl3qYVjlH+sYLt5yqTr0CfBTan91UPwpxlSGNBYU2iKdTG X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcf341c7-0648-4fbb-e6c4-08dcf981b205 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 07:57:41.4990 (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: DtXLmAZzonssS/YwtKdLvTnNnY4TQ2ZdLIP+p2aWjyrIqzDgXl1uVJ+B4/7zjTgCHk9hxHEnbP+LQC7FAE4CVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241031_005745_043665_766F72F0 X-CRM114-Status: GOOD ( 19.39 ) 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. Replace the imx_pcie_stop_link() and imx_pcie_host_exit() by dw_pcie_suspend_noirq() in imx_pcie_suspend_noirq(). dw_pcie_suspend_noirq() dw_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(). 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 dbcf22e440e2..410a31e5f82a 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) @@ -83,6 +84,7 @@ enum imx_pcie_variants { #define IMX_PCIE_FLAG_SUPPORT_64BIT BIT(7) #define IMX_PCIE_FLAG_CPU_ADDR_FIXUP BIT(8) #define IMX_PCIE_FLAG_CLOCKS_OPTIONAL BIT(9) +#define IMX_PCIE_FLAG_CUSTOM_PME_TURNOFF BIT(10) #define imx_check_flag(pci, val) (pci->drvdata->flags & val) @@ -107,19 +109,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; @@ -898,13 +899,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)); @@ -1023,9 +1022,32 @@ static u64 imx_pcie_cpu_addr_fixup(struct dw_pcie *pcie, u64 cpu_addr) return cpu_addr - entry->offset; } +/* + * 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 = { @@ -1146,43 +1168,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; @@ -1206,36 +1191,26 @@ 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; imx_pcie_msi_save_restore(imx_pcie, true); - imx_pcie_pm_turnoff(imx_pcie); - imx_pcie_stop_link(imx_pcie->pci); - imx_pcie_host_exit(pp); - - return 0; + return dw_pcie_suspend_noirq(imx_pcie->pci); } 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; - 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); return 0; } @@ -1267,11 +1242,14 @@ 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); + pci->pp.ops = &imx_pcie_host_dw_pme_ops; + if (imx_pcie->drvdata->ops) + pci->pp.ops = imx_pcie->drvdata->ops; + /* Find the PHY if one is defined, only imx7d uses it */ np = of_parse_phandle(node, "fsl,imx7d-pcie-phy", 0); if (np) { @@ -1345,13 +1323,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 = @@ -1430,6 +1401,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; @@ -1494,6 +1466,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, @@ -1511,6 +1484,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 Thu Oct 31 08:06: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: 13857695 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 B9966E68958 for ; Thu, 31 Oct 2024 08:06:26 +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=z4dbuamOPX2gdANO1GjTEOYffHw4Dwbo03rVE2EdQWo=; b=2KGPce0cNFtoGsFf5gDhv/YAnD cRJnsiFIPBpHk8BzVn30vDMw7O6A9eg5rn8H+NLErKiwnQzjcT3K4igtdl4IdbG7Jx3lson5spFU0 g0D2XFLYURWKZpzgZlpa5yqSj5hFL3vBW9IwCE0PEcHJnJdThokcK7ycjMgJ9Is95HEX1629xOCh/ RDPMSXatFtr3VNg849YHf6hwyXqSE/arrqWcMEKngFbDXd2Z80ixhXLfSXpD/KSoT3jf/aYlAWVIe SOKH2Tx5eVdZ0DRI0/6KSu+rugSnYdYAq30rH6sQj7udzmv3Gz64F4OMm51Z8TW+9yubheueAqENT Y0gxS8uQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6QC5-00000002tLP-0Lfu; Thu, 31 Oct 2024 08:06:13 +0000 Received: from mail-db5eur02on2062a.outbound.protection.outlook.com ([2a01:111:f403:2608::62a] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6Q3y-00000002rzX-1dMl for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2024 07:57:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pNO/OZZz3YTWhe6e2D3OLTZefZVI0mZgN/VSFe6fxxSfEMmSIT4EjaiKJMppXUOSUKOx2QA2cFrPXj6dEWJFmpHrCKawo8oOdS1jNGx562KlS1KNAtPP7jTMAF5iH8hQnMbkNKcoqfZRQMHhPI2Iq710OC8ViieS4SVON9yHTPrY21wap0Qae0PWdFFARsdcOeFU9jafISGRw1QLaN50eTJ5U0E5k8SBAmyy5Gp99LY0NGa+cdP9BuyfF7nyHSD973QYmlKb5JnfFiLteZ9coqAwIaNvCcv6tsuZRv18OZ1pHHXPviUw46Tf706GCDxgm8KUI7JYm9aShj4j/bnbEQ== 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=z4dbuamOPX2gdANO1GjTEOYffHw4Dwbo03rVE2EdQWo=; b=Ay+0/VnTFSYU83GP4eA1N3YedCOIaeR778AT7NdnuyrAEcAt2zGhUDbTKnKj3Pr2HRe9JW4RAaiiilL6Y/dMKoKwb9aHhfO/LJ/ggB61MD1PUpQQsu7OyHbae4/X+kMNlhWvqcwzzDajxHpbA7SeWbnk+1mQODfXbpSyzc26bac09mntyJHEBOjAr6orwCP2qNQmcPMmaRQCmC/pdHm9e7wKrfKwFqX6Nnu1vsgAYpeAXIjIQo15mjkINvYa0Z+w9Q25XfvREmDoXh7L9FHGF5liyrh5N9z53lyH4uTvH3rf79xk6TBIf8dkI+xehgmsTnCKGMaM3TAjFi9eFGQmcA== 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=z4dbuamOPX2gdANO1GjTEOYffHw4Dwbo03rVE2EdQWo=; b=Bee0TbN+UhODqmYgAJ8FtQo9zrltlFOtvoEsX3itj8Tpgs0+aQ+SB55NVeKteLrl421ZDaqIVs1+FaBPdhz1dFPxxRN5UeOlXy75sahAHMXiloce+GChCG4s7o48k26okV/kIN/9lM57up7hdEHEpQJrjjYjiNIWJwSnc6r3ON/d9ZyVXBwLkylzsmgo3HXufZYTB8l7HTLvjo85V+NsbrtvjpnRbL1m+td3sJQX9g4DBJuZSy0iq0s5jZGLwESJV2C7kAoCUqkl6jFx+UO+b4cnBC2nDXFdz/l1cynnXj0pXCJZTZyXahOUmahMJRlplVcNWjBBoGZE7y0HH73nJA== 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 DB9PR04MB8139.eurprd04.prod.outlook.com (2603:10a6:10:248::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Thu, 31 Oct 2024 07:57:47 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93%6]) with mapi id 15.20.8114.015; Thu, 31 Oct 2024 07:57:47 +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 v5 09/10] PCI: imx6: Add i.MX8MQ i.MX8Q and i.MX95 PCIe PM support Date: Thu, 31 Oct 2024 16:06:54 +0800 Message-Id: <20241031080655.3879139-10-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241031080655.3879139-1-hongxing.zhu@nxp.com> References: <20241031080655.3879139-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|DB9PR04MB8139:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fc0c5b4-0548-4ec9-af55-08dcf981b56d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: 0eSbVJUJT/QKkuI5ywkOVp2ILnTTPOGVOtUkKVTfAROrGoLliPNHWf9Heug1VlxmJksTrib/fY66qIRc9WiIIraxbaUXkj3IJiIjb5fCoa7ELz/Wh7HIjwAbmlGfUv64k1OXeJ9JYFEcOANaNVH2uXsDDWsLmhk4cAcp/WUOTI35Y9dN0clZi2qIulFEJIJV6DCApwQvNixMomKMDUmjJbjTmZmkWHXPvIw+X0kuXjQnoAoXH1W0aL2U6Xx0de/C7iH6at8y3KpHkO+/9I4bRmu2PpmSoYzhgr5sVOV4kT8Bx/mFO8MfSJZFciynqTAInYAMF0wmWnVOjhqpSBPsyE6izURhoq1PDZCKttMiPa2mQcY1mU+U3qCm3Jc5IpdYPuD1Rt5LAhD0oJIQpsfwaW1lA1AQHrxN8TRkRKJ4idYRJ8qRn06KicqhMnv0jMWls4cfJ5j5fzZ8e1BITj057MzJojK0vwoQ8TxVtoWnc3Gbvv+ZXnhk0iU/5b+7pkn/z+V2VzrGcQJjR5H8ixp+foQxKk3e7ADFbYhI8VcFezHdROGHqV7H8MKPdrmQLwnm7zu7ejzIsTv1EeAaKaRLUuuqwVw97LRcqtY5GYR7ON9eA3LNbxRLg0ybDZabr/mqeWDiiApWFrVzrNYXZnQs+F4fBTkwejjS0uuI1XokOFgC58ATT2bhs2BpWQIyOE8INjoRV4MeHPBiqQQYNlIUN5/L/xI1Yhz6FocXxOnXRIlIpPIqF8aFeIf65ep44ZuXmdLqMqCIIbK6qBb7ikNMJHkHU4supG7EyXIdyNjjHeaqLRbCryIIKFbA5H80Q3ZCSP5WPgTlvmf4rKtTftCxcKM8Vjr+W9o9Z3Y5dGKGfdL7Wi10Jf/bZ9Gh3T4f4RQFVTa4X1kCdrWqjwb7NWozdYmux2epUXdLT3rXGkdGH2VB7UE72eAX+NyJfy69icMwE4sO4IIlM2cP2958S0t7GyCCu2USLdoMapuMm3thNER7qCi9xmutQK/ASUPPntUkHl2LZo0OVBp/ftON13oJTylTCrb997louPe4ph4AMecHQIz9mHXoUljI8MSr4d/Bvs4NlvR+CR8qmt6r+QOM6zPVgYR2diARUFrY/iv7kirQedDmU9XeHyH1WyCE0RpsgFCgfGVv2SFxVLcmCJAYSnmxXwwR3eErFrJjVygj/rAwPCZWPn6NEdbjOC+Rkm1sBSrEWBI2o0t1FHFLt7Mvc7rVqkmDyy/BS53XiMkV5o5S9mbR9lfTVZlbsOPKzev9XzuYhPVN8zNnZ8GoqyPw9MCt1BHMR+Q226tBcTsD/W5tWwGhNE4pIfiqhY6TRw7mrCf8nw1b2TbqQ2p1jzeFLYFaf3h1gXdsbQPgTEJq957R6ELWwYuDZTSvbLpT9Uqs 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)(7416014)(52116014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YpE05U9vaaetzbqDC9NG7I4I3iB7SH6x2DT5Q32uS7zbMsGIfVugj2xr5A50Nh6YZkakAgkMoZR747kOd5U9qJmx/wCJX7AW8K69AokWp18unJ8NetajXe7vJAt5ePZKrJJP2Kw94OhTB8vKAfQz1WZUO1kCw+6A/6v8cA89D7Rw0HsZ8yTC1a21SKFu4EJJs4r8y4x+muL1huy0BbfTdsICVU0DRgCy7ZAhVOPciSXqeRiSQ0tCVjb6zfycfuIikWfLFeeDSBo3BNZrMcC11Ap4ZjYjsCaO691JxDt6SM9qFdcJNj68ifqupSVOAgDTfWfPDvK1RFfFwhJxHdXDFC0lSLqQTERfYSGDT3ugbV/H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utP1FkSBlV4pACTg7LS/vTODiirGlG+zQ7JlVbSqjZd3OQoBRKiY6zMLTsaE4HmEYcAVmh1hRiVdI79kVjmr4eySVy7usmUOEW+WU1G3PtbQwpCVkgxe8pvhcRfDA3PxRI/mKu+dVJeSV9yBUjUAb63Tz2vz X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fc0c5b4-0548-4ec9-af55-08dcf981b56d X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 07:57:47.1461 (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: tfKhCrzAMzZsbW0m57dDECVEkF4kH1BJvD3xuPLNAjy7k/j0+fQ+Ie6MtYM4LnBN1i40cxHDNQ5mm8DR2tiYOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241031_005750_456483_07117BFF X-CRM114-Status: GOOD ( 10.15 ) 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: 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 410a31e5f82a..f662fbb45626 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1502,7 +1502,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), @@ -1540,14 +1541,16 @@ static const struct imx_pcie_drvdata drvdata[] = { [IMX8Q] = { .variant = IMX8Q, .flags = IMX_PCIE_FLAG_HAS_PHYDRV | - IMX_PCIE_FLAG_CPU_ADDR_FIXUP, + IMX_PCIE_FLAG_CPU_ADDR_FIXUP | + IMX_PCIE_FLAG_SUPPORTS_SUSPEND, .clk_names = imx8q_clks, .clks_cnt = ARRAY_SIZE(imx8q_clks), }, [IMX95] = { .variant = IMX95, .flags = IMX_PCIE_FLAG_HAS_SERDES | - IMX_PCIE_FLAG_CLOCKS_OPTIONAL, + IMX_PCIE_FLAG_CLOCKS_OPTIONAL | + IMX_PCIE_FLAG_SUPPORTS_SUSPEND, .clk_names = imx95_clks, .clks_cnt = ARRAY_SIZE(imx95_clks), .ltssm_off = IMX95_PE0_GEN_CTRL_3, From patchwork Thu Oct 31 08:06: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: 13857699 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 26C16E68944 for ; Thu, 31 Oct 2024 08:08:04 +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=tFu8k5XEfFAMWiNmTVFR3yKiKPpe/MW6NewXVId2T4o=; b=aXmBYTqs9Hp7rWcbiRZb1BM9ZN aKjy2eUpYIPSTaSn7Ext7DcYPw6yS4KpUV3UZ6fh7Fn+VURI7AEB2aHJkmV+x8w/KtMvvn6BFSQAS wobsdsHHMGhu9GlnLsT8SZgaF0OQyHgheaMiqFJSClXlOpFYE5tn/C/reQSBSjMPI5ydnYVUr8WNi tu3tKLDbWH10RbFtlVRK3x2MZKacwLByYb+pxR/krNSOh1okOlzF/Zzd/QYmxFmCND/nHhzm+JcTw s2nBbX1plf5wl/C4xQQMx5WTAzgdzlJPqJ4+Ns0rK3qWONpcsgSvGrEc57rx3wzH7M82Pi4+p7jAh rKtTA1zw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6QDg-00000002tWd-1DIU; Thu, 31 Oct 2024 08:07:52 +0000 Received: from mail-db5eur02on20613.outbound.protection.outlook.com ([2a01:111:f403:2608::613] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6Q43-00000002s1j-3ugJ for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2024 07:57:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YCKZc1bvs8ppLzPQ+IAQ983L3OoTYfS8YvJH4b++YIfoYWRM1xGeQlvKZhPsZZNbKLDl4vYuv0KklGggPAP9odi/QwENTlSgnTmY4WGp8HzccgsppofBgBdM/AIZfbDcV3G16RO9xEvl5HpG1gv9VPOTsrEHO7fNF7sD6N3VtHECLC0yihwLPmv30KE7t+AcqZk3djSndWPXs0xkRsC/N8CalW3aSeVDowGNr/XXil2eYmY/o2x51SK9NoPFxm0GNx20QQVeO7QbHWjA+doWJcAPQvAwUzgcsVR++JAUE21JCg2+88ufsoGVPbHPobg2ziGOOpHvUJMtFvRVFD5LFw== 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=tFu8k5XEfFAMWiNmTVFR3yKiKPpe/MW6NewXVId2T4o=; b=kv5k6P43uIyQTjT3yX26MrdfUrBED7zYkyfJXjxU81JYZCRyX2WRKnMLY6mDpwTuZ4TmxWeKQYf95x9zO5aePAIubVJ8EKxX0Qg4t7U/PGbxDsyqIxrGktHIKw0NrovqI+6JhA7JGYvFl2H6FF/W1TpxGpAWR40O9dhSzHuSdMKdQm9GOYr2cjyhRarYARRrAEx4SdN4Br4Jm+R0QJ99Cy88PnILp9Iq6/wB4D3jCPtsrjYqzq4zbcuMOdTA2dJG0vAnpus8LRm1Nw0l3SR/bCZ4o6oU+MKjJ5VtMkWhFTvhTsV8Efzr2NzI8amZcid230d7nOpQpo6KQKfjn35BSA== 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=tFu8k5XEfFAMWiNmTVFR3yKiKPpe/MW6NewXVId2T4o=; b=e3BAl2TliHBTJ42wQQwDs+p665t3FN9ybHAVsVh8bxLRJBWSR2GdMirJaFGGLD3JwYf97y4c1dg9k9vkLkrhYB5KvZPsxO7a6C1crkfy0vO1bWN3NZfhsnvWdvYEkrh4fOA46zq5HXs3jECAzzIom6+UCvlbTusbZ8y3zvmAVD56alJ7dGXsJ/hHt8ogoYNN5Fj+xLPpr+FmJyDPPMY6bREscguYAp7y+mzOACFBgHUelC4N6w8W959DYYvzxlLw/W66lKo+xjFrtg8ZKKy5ccrIuOMhjBT/RUd5yZTIvfDnS15ERf0b2KQyMWolPPGfAm6lGmhUqS/oYZrXgfsOWA== 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 DB9PR04MB8139.eurprd04.prod.outlook.com (2603:10a6:10:248::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Thu, 31 Oct 2024 07:57:52 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93%6]) with mapi id 15.20.8114.015; Thu, 31 Oct 2024 07:57:52 +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 v5 10/10] arm64: dts: imx95: Add ref clock for i.MX95 PCIe Date: Thu, 31 Oct 2024 16:06:55 +0800 Message-Id: <20241031080655.3879139-11-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241031080655.3879139-1-hongxing.zhu@nxp.com> References: <20241031080655.3879139-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SG2PR04CA0184.apcprd04.prod.outlook.com (2603:1096:4:14::22) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|DB9PR04MB8139:EE_ X-MS-Office365-Filtering-Correlation-Id: f8f118e9-0684-4e1e-0212-08dcf981b8d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: wfDEie4/5QOvqLaBuUPrsaMX68PjmFNRsm1chj/MIyGUYuYP8Im/eZupg87CjGegRgJUpfjAGv6lNGeD/74GS/EEh3PeLErRuMbx7fFf32F/TJfFxnQ4sHE20LM2qLtiYpBucOaKTkepig7FAJZuRM1PMGAuSPQ59f5/r07HmKwS3IF8imkaA3Zjzt1iUZyxT8yFxrsZKuM38PchyWaTF1Gy83E01BuuNQtJjEs9wYzebCaqR3cDHhMN8nn/ot2hQYJ0EnRHoggEjYU4k+IX+KddkNsO9/zQtDK1xDpjHT7Mh27cTrZQIOQH4P5svK+CaPaxASaSNrl8YAWcet9oKczPbkoVh3c6pVag0TkusF4dY4AUyNdV50MTY+KGBdfg5mr/0UbaHfzJV+XZk5gPcpRHDl8E2DT05uPdOlZJ55nyxHpxs/3Y1VacNfDjvuFup/cHmjwfN4SFKIbnSCOS0iRw6a+t7OFBbUhEr6aYtI4yUE+YH0T4bM410CN2DPrGk8DAwvlM6CGKNAGWHuQYApzjOSFEETqC7PPtQxTV/hi2xCqJMkN2kIy3Q06lVC073ry81guB6BLhefz+Fslt2ZBq0M32/l7I5hWeGoIP6hnSH8nTRfkwooXGMILlmmVtbmlv82/wSbizGzKsf0pW6TuyD24qEyCccDcEtIIg3ZNQNth2dMsjdu96beJQliOP7BVZH9q4rJ8jfis7WC5mUw1FcWDGxGjvCrobhBL7ECw5YzR1dnv1QLouWw1mx4Uo83FHacGBcqKDYNeo9pZl78iSn4SdaV5iTWpoSVV6/8dxB/ZvgfNIQz3rY2tD34UPJRAQqRhuAsV2z2uTJp9sIiPcMhJQe2XTL58GG1SFUi4Fey1JTK5fvhgMWECWPQdmbmRYpgPzcupMSIZKCdBhl3UnRMWNPm1OEILkftvh4TFr4RZb9cd/DJpguPFoLcQTHLrPjSd3JkY/iSgRSEj9+pkrDv/NLfVDwgJOkHamt7V9eDIZZSGOaB2qNsq8nr0qiebIzJjj4/1v3nKWTGvamJEbQJTPUaAHEPzg1Ec/00tUkyu4r4101kNuZwxwu9Jo0IgPUEHzuU/dRAGX6MXq+DfYeU1KG90BXdaB8zRERIOgiSpiIsRwbhMHjQhGfdGrijuVkauBnsnc9GUNEUFKKqj7Tc8Q+SwA30cjbn+/hcbs06IP32lEhvO8lSiDJx7eS/ZZr5lbUYYrHMDoCDAwUhZnxX+qGjW4Br8SOBgH9Wt62Be+X9DHaVyyMIwNZy5FreMIZsG8/P9dVS6axLzSyVY+Sce16YfHonmplKLKcdjAkg5F4zHfrEDzp0KvwyL+PmgElVdwEIyxovZeYsbB75qtRw+X09X8PJx6UY8Yk/hcZHj8h2twCcWFwLjmd2Y5 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)(7416014)(52116014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-Chun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8AcMz1mGSkk/z32H/gpF7KdBOHbLBzKniG5ysuUIAUb+KQVhZ3jWu1Nk43B6Dr7n1ilPpzxJ45X8QXfGAsTT6nq47bHnNuMeL3HumYdVtLYGxTaN3zGzEgafiJ36eMr6dshYWDPonGeNS+QLdg7BdwQgBesjN6XhED06l5BvjL6hzfG8Sh/9w9GMhdL3CXrBO1N5tRE7pyqLEvHgVNWCqp9nPmNDzJajdmYhRKCXEt6cjHZOIYGIG/9vsdUopvWOw9vY0NCGkd0aF1G8mSuZjSVeS1Byo1B1DV1WVZCdfTQVajEW7hvvmj9nJg/uqF/tkr6keux9d5SHCnoT5dCgus6PCJBHCdMcsfF8SoFBra847XUEsbz9hpkXuaDmSVplX9MpAcszlM2lGuAy3MX6Lt5mCocOPNQ6x0oY9rP467VyDMqf8nhQTds1Q3NkxP7kHurtX68Ptrbj3553bO/bqpL1yo2nlJvns8A8S+9FrPhpo7L/C0yeXDXBbqnz9bWNOrDJSeKFyJu89MSLQc485/lylNz6IOc6GyfauulkM49/QW2s7g75te X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8f118e9-0684-4e1e-0212-08dcf981b8d1 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 07:57:52.8510 (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: dKtuCgeAG8qM9Rf8HdPH3OTfYr47qnEwBSkfIv9oMcf0GYoiIIWbApLjHx6DwaPfTQz1pYXO0SDjIvZMBRyGUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241031_005755_997198_67942230 X-CRM114-Status: UNSURE ( 9.70 ) 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 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 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx95.dtsi b/arch/arm64/boot/dts/freescale/imx95.dtsi index 03661e76550f..5cb504b5f851 100644 --- a/arch/arm64/boot/dts/freescale/imx95.dtsi +++ b/arch/arm64/boot/dts/freescale/imx95.dtsi @@ -1473,6 +1473,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 = <&dummy>; + power-domains = <&scmi_devpd IMX95_PD_HSIO_TOP>; + }; + pcie0: pcie@4c300000 { compatible = "fsl,imx95-pcie"; reg = <0 0x4c300000 0 0x10000>, @@ -1500,8 +1508,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>; @@ -1528,8 +1537,9 @@ pcie0_ep: pcie-ep@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>;