From nobody Fri Dec 27 11:44:39 2024 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013007.outbound.protection.outlook.com [52.101.67.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F19D19D89B; Mon, 9 Dec 2024 21:53:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.7 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733781213; cv=fail; b=VkTKlgyxV6Rf9Sg+yOuSHYl7YWQ4jxEVNCU/yRQAX+v89zH8Yz7R6PQSABdZuWlAXwU9Cu+IRBj3xPukFtlURwjHtZ6mtmIpVMohLL2Ts1bB//IURSMCliq+To0WRg7OsRYBSvDlu5t8IcKSsoBNexaaU+71KpV18ebB1jHjqtQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733781213; c=relaxed/simple; bh=r1D6YleI4pfbRMudJcC/mpaiq45dCNo3RsDTZ3TyLf8=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=MKOk5miT4kfW9zgahNcrbSmwRfBmpiKj+9Cr+p5Q4Z4A1AWci6kMNBr05LR5Azve8qa1oGA6VsxJxVgZjcQeBUZ0vtH6nbf7Afb4xFMTbkT/0qX80VlHgEPLRTI8oAEnS/4tOXJ2/ItWzx9Ja1sMwT2W2WTwk8Y1z8D09Oy/eyE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=cwVRATEp; arc=fail smtp.client-ip=52.101.67.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="cwVRATEp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FWSX7dqGC731GCKWw6m8VUFPh6CBoG/9YPtoDVqsp9ZCGmm3q4KuZS22sRqCquWTnpzZAnLyVN9NcoXyA/hN7QLCp/eCb+zvPRLW+VyOmOPum3Zhh7xnxIc9aqCQY8AwLr1jojIjJHVZR4iBuMk7aMj/mApL3RHsddj+cImtCAPZCFajVNdj9gt2EXMgYrncG/24qaL41pV8v9BW+i62RaRI8CmdjmOjHmb1nK3YdyGU+ikUVaPp7+0Q6cvJ7dEirRBkvQRSMokti7X56pnNPVEB0W0k9/7mKWULyzlO1B5C1/qSgXwn9dDxdAGLdPR9Hd5jrsjOPNDKrXTQ4dHBCw== 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=4UwDRaceH7GvnQ/QxRniWA3dsOW7A2WQ6w6+nm1UCs4=; b=suOON05AsPllKoNx8nhPu0aGIihaOA9mJzYgyDv86gba6MLhfMg5+bZQz/Xy4fJLgm4QQdYReRHTSxiMhv0EIZXalPUdV3hKrGP05dURCB6dFZhDuoSxoeuMt0xY11AZlngohfIeDjkKqjfOiEB+7rw84UtGtDmOLTT/sTaQfI5NrvuIqd6g1g9XxGoB2xLqJTFcbisooVLyuOhu0Y4TmMvPBPlGIlP1dom2chkM9/ZhWl7ohVEhTnDxZaDc5oZAIV9t6NyFDN4tf7hBm9BpVwwaurGojl2D/RgtosLW/q1c+HpQcooB9BscTcKMqzMYlAnBT+RCVRtBLczIQe1RoQ== 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=4UwDRaceH7GvnQ/QxRniWA3dsOW7A2WQ6w6+nm1UCs4=; b=cwVRATEpu7tNytxcn/CgG/KlcWIOOw3Lh4FAgxus4vs6veJHV3LyeimJyMJgKqEZ5VFPxzM6Z0zjN2yBIRaAeUAxf6YmVMxrk5EVdQu6xT3588l1cdpFmgnZSHVCi8Ld8gUSrZb66ma4O6GiVcqcY4w5PHXBcUCaTM62GY/fRih5iX+1pqam3/cCENcZJK7CnFW9ykyDt8fNVvuhF3EklP6YWJC698ukIt8POQvG5pmH2l6zY+CO3EQYgtP5m7K80JBZiEKPiR/XQ7W8QciD/6P0snxbByvcd05WAPobVmDecUlAFbVWqL2teann8TRacOxsw17HIor3Caw/ibG71Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by DB9PR04MB9818.eurprd04.prod.outlook.com (2603:10a6:10:4ef::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Mon, 9 Dec 2024 21:53:28 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%5]) with mapi id 15.20.8230.010; Mon, 9 Dec 2024 21:53:26 +0000 From: Frank Li Date: Mon, 09 Dec 2024 16:53:04 -0500 Subject: [PATCH 1/2] dt-bindings: thermal: fsl,imx91-tmu: add bindings for NXP i.MX91 thermal module Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241209-imx91tmu-v1-1-7859c5387f31@nxp.com> References: <20241209-imx91tmu-v1-0-7859c5387f31@nxp.com> In-Reply-To: <20241209-imx91tmu-v1-0-7859c5387f31@nxp.com> To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Pengfei Li Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1733781197; l=2218; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=iVQTtCNDQDMEk1P8NXmCJ6s4gReJ2DPWuwpLblkVduE=; b=pkoOOhbdccrJsmUeD8dR0pITRa5/TbrLr5S24g2XYlWeEGQgIVAihdAPB+3Fd2YjcJ2PmQcLd ne0xpHWkXvxB8JCk5wKj+Q2B4RF+yANH85g3qL+bjLSA2Ge2RFZuYAJ X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0158.namprd13.prod.outlook.com (2603:10b6:a03:2c7::13) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DB9PR04MB9818:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d21bea3-4ec0-414d-f4ee-08dd189be910 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-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O?= =?utf-8?B?UGVWS1FKQmx3TExqbmxsWGlOeUJtNnhoamkwdFdaMkYyMkZ2MFlxZ3lEaDlt?= =?utf-8?B?aVB4b3JNM3RJczBsdkh5bnc3N1NSeWcyK3lMSDZ1S3JlOXN3SFhsamxxTy9T?= =?utf-8?Q?G3InSyPvzsYQb?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(52116014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TnJYNGY5d1NtMjRzWEpVa2FIMlVxcGJ2Wk5IL2RreDRQL0NPMTZSM0Vxb0Ry?= =?utf-8?B?Q2hUeFFJdG5ralBYb1JpWU0zNGRwcWplUTU0aWZaK2lFK0dpbzhUNnpwdkl6?= =?utf-8?B?cE1XMElJU2o5cGZKSGRaU284Mm1ISWdUT2dYUGJBTTA4byswWlpkck9KWVlD?= =?utf-8?B?TE5tZWVBaHRMaFBJcm1kZmJ2ZnlHa2prWDhQUHNwL3BaQ1B6TzNLN21qTjd1?= =?utf-8?B?RnQ4RC9hVkRsSEdORGpwVHB5czVDVmRkVHQxYVlOVGhYblF1RTFxdHhvcy9V?= =?utf-8?B?MHQ0UkdoRjY4VDl2b1MvOXRMblgzalZWYVJnTGN1eFVzZWZsSGVDeTh3Ukph?= =?utf-8?B?UDMxcXpYMUFMdDdURXBiK2FtbWh6UTBEd3U4d0FhbFNVdGs1Q3ZPSFlMSWIx?= =?utf-8?B?Vk4xTGx3amlGOXhhTENza3lJVEUycUFNU3ZudnJ0T3BjUnVSK3VQSlZtTDl6?= =?utf-8?B?VWp2RUI1SW1OK0IyMGZ5Z1ZQeFRkUUh5R1VpdkJPQnd1eWpLbGFnR0ZNaThy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RzVThuYmJUTVR6RUlNZ25E?= =?utf-8?B?a1Q5bjgvcXdVN1YwdHZ0RzFFenJrQzhuVlZkd2VDRUxRNTU0WFBuTzlaVWNL?= =?utf-8?B?U0VpS2hlZ1VrSnJtazh5N0dpbGFRNUhoUUU1bThxOVlQSGpOd2hKNlp2Y2N3?= =?utf-8?B?c1JjRGx0MGlROUYxWkZUcEZwNVRIanhYS094V1pBTWhmN2k5c1VHREFFYkhJ?= =?utf-8?B?a0JwV2NXVDVxOEJwNlkzMHdWS05XOTRhTUFpQURyMzV4ckR6M3JpKzFIays2?= =?utf-8?B?TXN0cWhSaUxsZkJ5YitnN1ZQblBmL2RCck82TkRnY1h2V0ZWNGZ6TGxmcVpw?= =?utf-8?B?MFNUU3U5T3I5ZGRjT1hJME1NbW1KY1huNUtOa29NMjhwWko1QW9MWEV2ZkpU?= =?utf-8?B?ZmMxY2hHQ1k4LzJiL2tDaGJXRHFiVFF0WUxzZ0g2RWdUeFVpcURyc3VwQkxT?= =?utf-8?B?Q3M0TlpzdU5kQmFnQ1FNdVVlbkFkR1Npck02dFNhSG9FWmVQeFpWcFJjU3hJ?= =?utf-8?B?a25YQ2VFRnkzVS9HTll6Z0tuaENWYmdhaE9RSVd2R3ptVzJjRWNsUStvMkp1?= =?utf-8?B?eDlveGlCTXZvT0JtV2hwQ1M4YXFFYUErNHFvbWU3TzFNaHgybkFQOU93SHJS?= =?utf-8?B?ZlR3YUpjWkVDdk4zUTNCV2hkZjgrSHhrUVdpR0xkemF1YkNLZ3huQ0p0L0ps?= =?utf-8?Q?mf/w=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d21bea3-4ec0-414d-f4ee-08dd189be910 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2024 21:53:26.6591 (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: 3fNDkkren3mXRl9ueUifeVqPgiOyAOJR/sltFr7q2PmyCjGZSAL+JorhXbOFnqOFDhM2vgouf6oxfVZaFxm7ZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9818 From: Pengfei Li Add bindings documentation for i.MX91 thermal modules. Signed-off-by: Pengfei Li Signed-off-by: Frank Li --- .../devicetree/bindings/thermal/fsl,imx91-tmu.yaml | 65 ++++++++++++++++++= ++++ 1 file changed, 65 insertions(+) diff --git a/Documentation/devicetree/bindings/thermal/fsl,imx91-tmu.yaml b= /Documentation/devicetree/bindings/thermal/fsl,imx91-tmu.yaml new file mode 100644 index 0000000000000..f5898db1006c6 --- /dev/null +++ b/Documentation/devicetree/bindings/thermal/fsl,imx91-tmu.yaml @@ -0,0 +1,65 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/fsl,imx91-tmu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP i.MX91 Thermal + +maintainers: + - Pengfei Li + +description: + i.MX91 features a new temperature sensor. It includes programmable + temperature threshold comparators for both normal and privileged + accesses and allows a programmable measurement frequency for the + Periodic One-Shot Measurement mode. Additionally, it provides + status registers for indicating the end of measurement and threshold + violation events. + +properties: + compatible: + items: + - const: fsl,imx91-tmu + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + nvmem-cells: + items: + - description: Phandle to the trim control 1 provided by ocotp + - description: Phandle to the trim control 2 provided by ocotp + + nvmem-cell-names: + items: + - const: trim1 + - const: trim2 + + "#thermal-sensor-cells": + enum: [0, 1] + +required: + - compatible + - reg + - clocks + - '#thermal-sensor-cells' + +additionalProperties: false + +examples: + - | + #include + + thermal-sensor@44482000 { + compatible =3D "fsl,imx91-tmu"; + reg =3D <0x44482000 0x1000>; + #thermal-sensor-cells =3D <0>; + clocks =3D <&clk IMX93_CLK_TMC_GATE>; + nvmem-cells =3D <&tmu_trim1>, <&tmu_trim2>; + nvmem-cell-names =3D "trim1", "trim2"; + }; + +... --=20 2.34.1 From nobody Fri Dec 27 11:44:39 2024 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013007.outbound.protection.outlook.com [52.101.67.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AC2E19DF75; Mon, 9 Dec 2024 21:53:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.7 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733781215; cv=fail; b=G+jtz8Gd8njdGiHGkuqrfT6l4B9Ad4IdIm1Ip9GLWYvO77vYPGo0UPdEsINVxazF7TKIqZK9/F3mTaqK/LxiHXPRd6JYRHmsgJo/bFQv6dmZ33drOdBoRj7wF3r/25HL4Q1c8jXQ2iBclnG+dPv+mbBf3rCQmUa8BnpFbkcYI9Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733781215; c=relaxed/simple; bh=sFExiCv3YKtMjHKSnTrqvKkjdtXeDGb8mombA55K5OI=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=N0egRURz4xjD0yk9uajyCOjvKgc5uLk1JhuLlSoO2rqvEu4CbTCA8nZSHO6OAIxcA/zyH+e3Jl5qZAhsfm/ImSNXeq6QYIuV5S/r5KGLFCHrTCci3GWveEE1I067Jp2V2HdhOFC3KvozK3ckp49mfXW5fWII9/Fqdzr2EaRhhck= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=eeH6EBtg; arc=fail smtp.client-ip=52.101.67.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="eeH6EBtg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qNVJBQHFpR8N/k2RFpJiUVHaiPc72vxQog+t1WY3EKZ0+3ENSfmQ2jq0JUPTDELjtj0qQTnDdXJII+RIekJ8MfcrxHeicbVw8fPFOlLfF6aOWU3/31QKxfmV+dOFEwzZZckdSYwDztZlN+94Xhyt2RsbuxmT/0u21edQHmz1cN7nhUjrrQz2VGnpyqSp6tPT8o428XQASMp2QyPVfSYshZC8NbAXeU3nNa+itEu6fGEcWxSR2juKjOJiTniR7xEsOhDpJ8eTM2M+9dvE505BPfRrMvH8MwCv/5G/Kzpg7Hr+Z/7Gy8Hx7nWlRudDrYY276wrDqw8/jysrlaiIl8C0Q== 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=bgtMCLqyqGK1BODw+TI3oOGUb6f940l4cn1sIEKmyyU=; b=m1eCSYlR0CwUVNcRoXId63gZjunGufWy8eJX4H84+SCNVvMmz0OB4C7QakpPC0MjOqpXgSp4/B61flve9VnBLqzWoOFcjQx6QWS7jny/RoOBNtUGbQbtwCJSXkFIL1uSFmoE6ZAT5G4lqmd229GRynaiOljnc+R2WE802Lnb34T+gGSNuV6BK2d9nnIDMPe+bPjMZSkzSs19Fh09/dum+fM94CyFaoaUJ2hZyAtylPQneR2H6JSvHMTsdPphUNT1GMQyzagB1u+l9Q8Ntc84Dy68XguhaU52mJ/z7mk+h1W0THlDttIO2iTGq0fgbwkrWHokiVEuHgs8xfOJih9TRg== 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=bgtMCLqyqGK1BODw+TI3oOGUb6f940l4cn1sIEKmyyU=; b=eeH6EBtgWzEafmvWonaYp8LeUG023nxwUedi/fkgUB97sHHflIwBOtZAeYBSnHeGvJpFRucuP/EzH7t5HsWpsOYWCD6bA1aI9OWLaYhviLjNpYN2U0WPcz6Z1tLJoIo7uTGExsXkNCVj2q3c2kxU98mhxo59GOyTQK0bD3VsJ9q5tdR5CiqQS8gpU+6ZK6xBgfMxmGwyDwVc0LBcSnx3FySOPcPsPIHppNAJ9uMGGeJtorF5qubSjfqxwm+IqJYBFEk3oLcG7IwDTPbTa/hDEWtwDfkYn4dcWpkufDrVZZAUjuTmayt1Xbv/p5Sx3Ox3roO066P5T2qTWAKFPNp9/Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by DB9PR04MB9818.eurprd04.prod.outlook.com (2603:10a6:10:4ef::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Mon, 9 Dec 2024 21:53:31 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%5]) with mapi id 15.20.8230.010; Mon, 9 Dec 2024 21:53:31 +0000 From: Frank Li Date: Mon, 09 Dec 2024 16:53:05 -0500 Subject: [PATCH 2/2] thermal: imx91: Add support for i.MX91 thermal monitoring unit Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241209-imx91tmu-v1-2-7859c5387f31@nxp.com> References: <20241209-imx91tmu-v1-0-7859c5387f31@nxp.com> In-Reply-To: <20241209-imx91tmu-v1-0-7859c5387f31@nxp.com> To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Pengfei Li Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Frank Li , Peng Fan X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1733781197; l=9745; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=nNhwjFBwQVTIDJisSK0WnxFeaeyXNS38R647unJN1/c=; b=oKDonfw2+8yyM63EMa1d/vz7hxajUM7XNdK7zgSes1nQEgHo8FtpgzPMgQ3vBPGoQV7wZbdbf bUBNxv9PS+QBO3Cq7FOIGonyDXvWMiyXspI2LGhmvX2ciFQuE6Gr8uP X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0158.namprd13.prod.outlook.com (2603:10b6:a03:2c7::13) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DB9PR04MB9818:EE_ X-MS-Office365-Filtering-Correlation-Id: 7df96c2b-6f5b-4b01-86c7-08dd189bebb0 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: =?utf-8?B?KzN2bXVua01mY2Q3UmxIcFplbThrd2hReFQ0V05aMktQU21WTTB4NUl6MkNx?= =?utf-8?B?Zlg2UE52Tk9kN1JhVlluQVh3dDdZWTBXNVZiaU5SYWlZVHJ1TWFnZ1JrbDVP?= =?utf-8?B?RURIbS9pUVJPODdqMUpGeXFnRnRzRm5mdmFtbXQydVlBdTNqSmx0Z0Y3ZDNC?= =?utf-8?B?VSt1M0tIdVN4RWxiRDZqa3lWS3JEM1gyM0FhZkJidFU2czcrdVBMTFRlZmdS?= =?utf-8?B?Vk9WdGdDbVFsRlNQM1NVZWpOWlVhb2xaVjdEdSs2bmJyZ0x3enltekJkak11?= =?utf-8?B?ZXRuclErVTJTQ0xQRFVHUWtIb2c4VHBWeXJ5emRoZi9ick4zbVFtQ0xBQ3VL?= =?utf-8?B?bmkveVNHLzVoYTFLSWxxNE9JNG91TGF6NXk4QUI4VlNSbTM1d0Z4U2tSL3Nx?= =?utf-8?B?MmNKL00vNHFkTVNaMm5IVjFnT0FsOXIyVnh6N1hSd2cvWEJrY3RUd2hNdkF1?= =?utf-8?B?SFF5TFk3ZjFqMWRRVHBhYlpDZFFDNTVWSmRkeXJYNU4wdDBUL3lFVk4wWjZS?= =?utf-8?B?YVYvZjlHdkZueGFDTFJDV1FsbjQyNXVFOUpiQTF4alNwYTdEZHRTNG05MTJa?= =?utf-8?B?WWFtRTJsY05lK2NteXpOWDJ3elBNS2RzWk5LRzZnRGZZVFJBK0JhbU80WTN6?= =?utf-8?B?YithbHpQMkUzaFE4TmdrZHdpR2FQZjYyeXRJRG5DTVorWVRVNHZ1VUtQbHQy?= =?utf-8?B?SUJhYnhaRzZmTGZNSnNaN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RnVBWEtsQmxtbnNLa2V1OG1sOHZrRXFET3U0WjJOS2R1NC9rYzNDR215?= =?utf-8?B?VFdjTUQza2lVdjI0czd5Y2V6Vm1EVWF2Tm1NdFNjL1VXVitxbElGSDZpVzZ2?= =?utf-8?B?cVRmRHYxMkczbDVvVDZGeGVmdFNIOUN1SnNmZ0x2TWExVWRIWTgyUDZKdVVl?= =?utf-8?B?bXdOVGI4WVF2T3pra0hJL0xsdU1QYVVzZlFFQXNsb1FsT1RvcXFpcy9FVWFa?= =?utf-8?B?THlnMFJmMDRpUXh2Y2ZBMGpPSlhkTlVhYjZrNGhlNkNjTTJwOHV1RDM1aDRF?= =?utf-8?Q?i7f/2jxpAPg=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(52116014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZHp1cHhzU3hGdkx3N0NyRkwrZjRQYnFUeXhTOENvWGgxKzFZbE90aFFITzM5?= =?utf-8?B?ZkNIdEljaWt0ZTZONG9XVi9BeVJnMzNLdWdNWlJiU2l0bEtocE44OVhUWTRK?= =?utf-8?B?d09aK3BuenBQVG9LK2NScUd3QjgvVEd3S01oZGZqNFBTMG83SGtvaFMvejFL?= =?utf-8?B?R2t0WkowTDBkZERrZDhiSUR2RjQ4WWpvWEt3Q043V1M5MkkwbFkwYnpudExQ?= =?utf-8?B?TFRSOXpESzFCQTd6WXNaR0FlWTF3MkJrYTNyTVI3SlpySG9KUlN2bDlrZVh0?= =?utf-8?B?aU5ENFMyNGEwM3B0WDFqZXA3RTR6R1RRVTBObWlYVUwwNEtIWW9jUzZnMzhX?= =?utf-8?B?ZGI2ZlRTc0xnNHo0ST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-86c7-08dd189bebb0 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2024 21:53:31.0660 (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: XRFnw2C5Vy9xp75nQVlQ4B8PAnqI720i5vepGNA2E4lbgZTHy4aBFQPTBWJJfEY8iFV5U9fmsAoINxZ9Le95YQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9818 From: Pengfei Li Introduce support for the i.MX91 thermal monitoring unit, which features a single sensor for the CPU. The register layout differs from other chips, necessitating the creation of a dedicated file for this. Signed-off-by: Pengfei Li Signed-off-by: Peng Fan Signed-off-by: Frank Li --- drivers/thermal/Kconfig | 10 ++ drivers/thermal/Makefile | 1 + drivers/thermal/imx91_thermal.c | 281 ++++++++++++++++++++++++++++++++++++= ++++ 3 files changed, 292 insertions(+) diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index d3f9686e26e71..da403ed86aeb1 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -296,6 +296,16 @@ config IMX8MM_THERMAL cpufreq is used as the cooling device to throttle CPUs when the passive trip is crossed. =20 +config IMX91_THERMAL + tristate "Temperature sensor driver for NXP i.MX91 SoC" + depends on ARCH_MXC || COMPILE_TEST + depends on OF + help + Support for Temperature sensor found on NXP i.MX91 SoC. + It supports one critical trip point and one passive trip point. The + cpufreq is used as the cooling device to throttle CPUs when the passive + trip is crossed. + config K3_THERMAL tristate "Texas Instruments K3 thermal support" depends on ARCH_K3 || COMPILE_TEST diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile index 9abf43a74f2bb..08da241e6a598 100644 --- a/drivers/thermal/Makefile +++ b/drivers/thermal/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_ARMADA_THERMAL) +=3D armada_thermal.o obj-$(CONFIG_IMX_THERMAL) +=3D imx_thermal.o obj-$(CONFIG_IMX_SC_THERMAL) +=3D imx_sc_thermal.o obj-$(CONFIG_IMX8MM_THERMAL) +=3D imx8mm_thermal.o +obj-$(CONFIG_IMX91_THERMAL) +=3D imx91_thermal.o obj-$(CONFIG_MAX77620_THERMAL) +=3D max77620_thermal.o obj-$(CONFIG_QORIQ_THERMAL) +=3D qoriq_thermal.o obj-$(CONFIG_DA9062_THERMAL) +=3D da9062-thermal.o diff --git a/drivers/thermal/imx91_thermal.c b/drivers/thermal/imx91_therma= l.c new file mode 100644 index 0000000000000..19c4dafe9c7a9 --- /dev/null +++ b/drivers/thermal/imx91_thermal.c @@ -0,0 +1,281 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2024 NXP. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define CTRL0 0x0 + +#define STAT0 0x10 +#define STAT0_DRDY0_IF_MASK BIT(16) + +#define DATA0 0x20 +#define DATA_INT_MASK GENMASK(14, 7) +#define DATA_FRAC_MASK GENMASK(6, 0) + +#define THR_CTRL01 0x30 +#define THR_CTRL23 0x40 + +#define CTRL1 0x200 +#define CTRL1_SET 0x204 +#define CTRL1_CLR 0x208 +#define CTRL1_EN BIT(31) +#define CTRL1_START BIT(30) +#define CTRL1_STOP BIT(29) +#define CTRL1_RES_MASK GENMASK(19, 18) +#define CTRL1_MEAS_MODE_MASK GENMASK(25, 24) + +#define PERIOD_CTRL 0x270 +#define MEAS_FREQ_MASK GENMASK(23, 0) + +#define REF_DIV 0x280 +#define DIV_EN BIT(31) +#define DIV_MASK GENMASK(23, 16) + +#define PUD_ST_CTRL 0x2B0 +#define PUDL_MASK GENMASK(23, 16) + +#define TRIM1 0x2E0 +#define TRIM2 0x2F0 + +#define TMU_TEMP_LOW_LIMIT -40000 +#define TMU_TEMP_HIGH_LIMIT 125000 + +#define DEFAULT_TRIM1_CONFIG 0xB561BC2DU +#define DEFAULT_TRIM2_CONFIG 0x65D4U + +struct tmu_sensor { + struct imx91_tmu *priv; + struct thermal_zone_device *tzd; +}; + +struct imx91_tmu { + void __iomem *base; + struct clk *clk; + struct device *dev; + struct tmu_sensor sensors; +}; + +static void imx91_tmu_start(struct imx91_tmu *tmu, bool start) +{ + if (start) + writel_relaxed(CTRL1_START, tmu->base + CTRL1_SET); + else + writel_relaxed(CTRL1_STOP, tmu->base + CTRL1_SET); +} + +static void imx91_tmu_enable(struct imx91_tmu *tmu, bool enable) +{ + if (enable) + writel_relaxed(CTRL1_EN, tmu->base + CTRL1_SET); + else + writel_relaxed(CTRL1_EN, tmu->base + CTRL1_CLR); +} + +static int imx91_tmu_get_temp(struct thermal_zone_device *tz, int *temp) +{ + struct tmu_sensor *sensor =3D thermal_zone_device_priv(tz); + struct imx91_tmu *tmu =3D sensor->priv; + int val; + int ret; + + ret =3D readl_relaxed_poll_timeout(tmu->base + STAT0, val, + val & STAT0_DRDY0_IF_MASK, 1000, + 40000); + if (ret) + return -EAGAIN; + + val =3D readl_relaxed(tmu->base + DATA0) & 0xffffU; + *temp =3D val * 1000L / 64L; + if (*temp < TMU_TEMP_LOW_LIMIT || *temp > TMU_TEMP_HIGH_LIMIT) + return -EAGAIN; + + return 0; +} + +static struct thermal_zone_device_ops tmu_tz_ops =3D { + .get_temp =3D imx91_tmu_get_temp, +}; + +static int imx91_init_from_nvmem_cells(struct imx91_tmu *tmu) +{ + struct device *dev =3D tmu->dev; + int ret; + u32 trim1, trim2; + + ret =3D nvmem_cell_read_u32(dev, "trim1", &trim1); + if (ret) + return ret; + + ret =3D nvmem_cell_read_u32(dev, "trim2", &trim2); + if (ret) + return ret; + + if (trim1 =3D=3D 0 || trim2 =3D=3D 0) + return -EINVAL; + + writel_relaxed(trim1, tmu->base + TRIM1); + writel_relaxed(trim2, tmu->base + TRIM2); + + return 0; +} + +static int imx91_tmu_probe(struct platform_device *pdev) +{ + struct imx91_tmu *tmu; + unsigned long rate; + u32 div; + int ret; + int i =3D 0; + + tmu =3D devm_kzalloc(&pdev->dev, sizeof(struct imx91_tmu), GFP_KERNEL); + if (!tmu) + return -ENOMEM; + + tmu->dev =3D &pdev->dev; + + tmu->base =3D devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(tmu->base)) + return PTR_ERR(tmu->base); + + tmu->clk =3D devm_clk_get_prepared(&pdev->dev, NULL); + if (IS_ERR(tmu->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(tmu->clk), "failed to get tmu c= lock\n"); + + tmu->sensors.priv =3D tmu; + tmu->sensors.tzd =3D devm_thermal_of_zone_register(&pdev->dev, i, &tmu->s= ensors, &tmu_tz_ops); + if (IS_ERR(tmu->sensors.tzd)) + return dev_err_probe(&pdev->dev, PTR_ERR(tmu->sensors.tzd), + "failed to register thermal zone sensor\n"); + + platform_set_drvdata(pdev, tmu); + + /* disable the monitor during initialization */ + imx91_tmu_enable(tmu, false); + imx91_tmu_start(tmu, false); + + ret =3D imx91_init_from_nvmem_cells(tmu); + if (ret) { + writel_relaxed(DEFAULT_TRIM1_CONFIG, tmu->base + TRIM1); + writel_relaxed(DEFAULT_TRIM2_CONFIG, tmu->base + TRIM2); + } + + /* The typical conv clk is 4MHz, the output freq is 'rate / (div + 1)' */ + rate =3D clk_get_rate(tmu->clk); + div =3D (rate / 4000000) - 1; + + /* Set divider value and enable divider */ + writel_relaxed(DIV_EN | FIELD_PREP(DIV_MASK, div), tmu->base + REF_DIV); + + /* Set max power up delay: 'Tpud(ms) =3D 0xFF * 1000 / 4000000' */ + writel_relaxed(FIELD_PREP(PUDL_MASK, 100U), tmu->base + PUD_ST_CTRL); + + /* + * Set resolution mode + * 00b - Conversion time =3D 0.59325 ms + * 01b - Conversion time =3D 1.10525 ms + * 10b - Conversion time =3D 2.12925 ms + * 11b - Conversion time =3D 4.17725 ms + */ + writel_relaxed(FIELD_PREP(CTRL1_RES_MASK, 0x3), tmu->base + CTRL1_CLR); + writel_relaxed(FIELD_PREP(CTRL1_RES_MASK, 0x1), tmu->base + CTRL1_SET); + + /* + * Set measure mode + * 00b - Single oneshot measurement + * 01b - Continuous measurement + * 10b - Periodic oneshot measurement + */ + writel_relaxed(FIELD_PREP(CTRL1_MEAS_MODE_MASK, 0x3), tmu->base + CTRL1_C= LR); + writel_relaxed(FIELD_PREP(CTRL1_MEAS_MODE_MASK, 0x1), tmu->base + CTRL1_S= ET); + + /* + * Set Periodic Measurement Frequency to 25Hz: + * tMEAS_FREQ =3D tCONV_CLK * PERIOD_CTRL[MEAS_FREQ]. -> + * PERIOD_CTRL(MEAS_FREQ) =3D (1000 / 25) / (1000 / 4000000); + * Where tMEAS_FREQ =3D Measurement period and tCONV_CLK =3D 1/fCONV_CLK. + * This field should have value greater than count corresponds + * to time greater than summation of conversion time, power up + * delay, and six times of conversion clock time. + * tMEAS_FREQ > (tCONV + tPUD + 6 * tCONV_CLK). + * tCONV is conversion time determined by CTRL1[RESOLUTION]. + */ + writel_relaxed(FIELD_PREP(MEAS_FREQ_MASK, 0x27100), tmu->base + PERIOD_CT= RL); + + /* enable the monitor */ + imx91_tmu_enable(tmu, true); + imx91_tmu_start(tmu, true); + + return 0; +} + +static void imx91_tmu_remove(struct platform_device *pdev) +{ + struct imx91_tmu *tmu =3D platform_get_drvdata(pdev); + + /* disable tmu */ + imx91_tmu_start(tmu, false); + imx91_tmu_enable(tmu, false); +} + +static int __maybe_unused imx91_tmu_suspend(struct device *dev) +{ + struct imx91_tmu *tmu =3D dev_get_drvdata(dev); + + /* disable tmu */ + imx91_tmu_start(tmu, false); + imx91_tmu_enable(tmu, false); + + clk_disable_unprepare(tmu->clk); + + return 0; +} + +static int __maybe_unused imx91_tmu_resume(struct device *dev) +{ + struct imx91_tmu *tmu =3D dev_get_drvdata(dev); + int ret; + + ret =3D clk_prepare_enable(tmu->clk); + if (ret) + return ret; + + imx91_tmu_enable(tmu, true); + imx91_tmu_start(tmu, true); + + return 0; +} + +static SIMPLE_DEV_PM_OPS(imx91_tmu_pm_ops, + imx91_tmu_suspend, imx91_tmu_resume); + +static const struct of_device_id imx91_tmu_table[] =3D { + { .compatible =3D "fsl,imx91-tmu", }, + { }, +}; +MODULE_DEVICE_TABLE(of, imx91_tmu_table); + +static struct platform_driver imx91_tmu =3D { + .driver =3D { + .name =3D "i.MX91_thermal", + .pm =3D pm_ptr(&imx91_tmu_pm_ops), + .of_match_table =3D imx91_tmu_table, + }, + .probe =3D imx91_tmu_probe, + .remove =3D imx91_tmu_remove, +}; +module_platform_driver(imx91_tmu); + +MODULE_AUTHOR("Peng Fan "); +MODULE_DESCRIPTION("i.MX91 Thermal Monitor Unit driver"); +MODULE_LICENSE("GPL"); --=20 2.34.1