From patchwork Sat Aug 17 02:22:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13766900 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 0FCC4C3DA4A for ; Sat, 17 Aug 2024 02:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=6l4V+tPetYj0vJDDBngn17kSfyj2OAEf8EECS1kLVeE=; b=CyzHj/p3oiL8Tn yc1bsFiJxtjv2nLM2R5AZN3HoEMENXmvtPWpsDEtyuvZGIzzpzzKlyVPRqqGkcAJMU+CIZicCjwJF ETFmSztj4yw29IlQd3TpZwdmQWLTvefInbwXBxeUwAjvk/3dZxVnZa9FqLRZl56QYMe24jKLGti0F +hi/yVvKofM8M351X3kzkCCzUPCsMNsiexqghFxLWH/tIAO7iG+SaDmdsXusiEYuguNnZSyuXIFYx 4yfogWxbvKHQlexzHV7vxiTQtX/lDQBPYJOPBKNqVbF7EbhT5nHP/q1k8e/II3kBl9o15Zlg0GeF/ S2jhIi9GsHsWPJRAU3bw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sf96h-0000000EV1n-1Qt8; Sat, 17 Aug 2024 02:23:55 +0000 Received: from mail-mw2nam10olkn20812.outbound.protection.outlook.com ([2a01:111:f403:2c12::812] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sf96e-0000000EV11-1C2c for linux-riscv@lists.infradead.org; Sat, 17 Aug 2024 02:23:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CGtxLzJ+n6RWa+rhkwyFTc/Nh4pYeU/JR350NzU0APEB1wKZfcaSyUm7v2zqnoAE9+vR1EDqoFIQy3p4LFryd63gKKVdBAKlt0SOAjAv9GO/O5nX14lElFjse+dpOtlv6NEw5OmB3M8nxYjnfBPSVbAb/EvnqA6kCdysabQQlxjUqv+XxXbwC2CSk7Lmn8kfGGK3Iz8RUhsgKblz4EzyYxDWwcqvVMhNQJkNTb6uAOWXMsPqJ9mE7IGU16/AZ5JVKA+4+1COyBxtXmG8zOmH1zJgPgHqxYpyQ8DholI9L4WP9VC3PTlLWpTTCe8PZcoKzHXdAvhBJbce+7CkO6f10Q== 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=pYrG99WMMaEn/7nhZeUcYwO99UpIRAGGmfiQygB+tpI=; b=KvRLuX/aLzBkOrX7N5wEXqliBRvu8gw7m1g/P6Pl9d+YI4XSTGaWz6P+gnpuENOF6DNphCePEyCXdgtwsnyJIehL2S+RCGMrhHyZGmrv8/3XKkagyCNLh74OQP7DOqtptPF7H6+VbitvcHV9nZJbIMvwuIyYSmPkr37fQgxAQjonZTkG0/t5enEoOxKyhkSDdhFr+Pt4SLDLET3QeNLImgqzEv/xO9FsQXOai4J7hh2QDAEHzA1aOoecviQKO+SKOmefYgdI9g2SUadfzXC0R5YErnBXKaS7SQG7ZQBY/Fb9iWebBgTfs9RLgOqq7FMIX/DH4z8cGz2EqMYX5HNgHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pYrG99WMMaEn/7nhZeUcYwO99UpIRAGGmfiQygB+tpI=; b=avymZNI7D5drUYSrkuQ0eyN9/TPg5jlD1fU2ogB2hkE2Wj3ePebqhQ1+EuMmOjjq3YGLgMU1WO8rvD8kLC6dY2HM1fYlhaoyhE5XVDEWty/2KJssDPvofp2my1ydLIUls78uNVoWla2LGOG8xsxdWwv5udp93ZWX3gk6CNiEua5FpPppmSXB89EO/QvDEh0u9rku9fQxBRz2opmn1jV8QgZ6Ro9l8lYioPeSmXfEMkwsrjbW57uuRQBdOQLGteRK8zo6gMabh+77DFk/ULLHEG92T9remI0buMZ+FpklViU/HHTB/EQSuD2eKwE5sSFYipd1uBxBH71rfN1F4VKOIQ== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by PH8PR20MB5337.namprd20.prod.outlook.com (2603:10b6:510:1bc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Sat, 17 Aug 2024 02:23:44 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::ab0b:c0d3:1f91:d149]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::ab0b:c0d3:1f91:d149%4]) with mapi id 15.20.7875.019; Sat, 17 Aug 2024 02:23:44 +0000 From: Inochi Amaoto To: Jean Delvare , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Inochi Amaoto , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Chao Wei , Yangyu Chen , Sunil V L , Anup Patel , Lad Prabhakar , Hal Feng Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, Conor Dooley Subject: [PATCH v11 1/4] dt-bindings: hwmon: Add Sophgo SG2042 external hardware monitor support Date: Sat, 17 Aug 2024 10:22:56 +0800 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: X-TMN: [sZgOx4LY90fm1NeoKmv5GcfHXPm0LFlHq0x1cZhTlbA=] X-ClientProxiedBy: TYCP286CA0212.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c5::16) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240817022300.360949-1-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|PH8PR20MB5337:EE_ X-MS-Office365-Filtering-Correlation-Id: 5cd3e26a-db5e-4f6a-dbe1-08dcbe639de3 X-Microsoft-Antispam: BCL:0;ARA:14566002|461199028|19110799003|15080799003|8060799006|5072599009|1602099012|3412199025|4302099013|440099028|1710799026; X-Microsoft-Antispam-Message-Info: xa1vZG1VvzLvT3ubBmiUpDC7ed3lRpLgTeUeY53uPcdGOEYVb0NouWNDoioNuYkJOyEOY4z5QXjSkLbWKwMpd2uyLbzWnR0oqmiZqkbzAZgKLKfLvgO2Col2h8iu8r5+R6pxXh53JwGAUrDhYnzr3BR6weDmsIUl0icVaWGIyS2ZxnP0QPZKNZ4G0R2J9p2VjRQxoqKKWFJIiR3XUwLRKjEDOlR4XjVZV0BVWP8pN1zR9pRN5k0CZaZwrNepwVep7+5A1GIRExkSmG5duKyhgHgK8xGha553utseuCYSCONovd2rSm7Eo6oMVCsQZh7bED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1TUpfiXGCB8eEBO3hftLfmhXoCVtxbD3y0iwsHMXSPfhvCIXb8THrkdfU8Ji2+PjMJwoaUlMR1IlAJeqljOVAf+iScO2SxnzjuyHoc9h+EBT3S+Y97jPmAtP7jhdT21HMeaNYrZQ6B1CjNpPFoMOtfdXhwombNoBt5+ETqp/mgO3iWNW27Dq0RzA+tqrcGPKlQLub9FsTeLF4UHp6t3ZkaxTykj/8MWUqFAJ0gjHR7P07uwYNDfKggldl2XWo1fRs4IYlZ1LbjOxZLDOk7mvyUD/N3YXvEozAEsynxyrTPzx5B97w3xuUWyr6pbHRNNfr/17T/3/jpuJsMguyrJnXyKK04aByI+184GjNMgGDzktsQufu9Xlpg2z2DKXTUaAUIM1OuxCYuLL9Ji061igjlhI3TTHukfHjehDhhJQ3DeDyATnjAXzEmM9Lb8Wk+fYGfYMyUSCLUVIxuvG/Jzdf8UOGMBHsdE0AAM/nO3SWx5QZeN9YD7R4h2P70Evq65g0NvI4Efa6PLPyU6KynHSX0paEOmhOZPopVpCT0K2AT+o3fJizRsinA8WBYSU3O/AAeF2ucVAqmH9jNMGohRMYrM74msJJQxiHjn4RAceyDabX4njPpQWG+HCDvS+TkHYSrCiPiBS+HxTbPOoJVoVKpIkGGp9Sn518ChPHN1kCsbwbUhwKD/e/+ayy7NBlgXJd3MYM4e31HFpbXBFU5D5T4rdnj+5pUxOqO3x+dx++nx+EbpK//XcHFA6Md8/adRqkRhPFR210vEXVxvrYh1AmAEgW5o+17k1dHgZ7 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5cd3e26a-db5e-4f6a-dbe1-08dcbe639de3 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2024 02:23:44.2702 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR20MB5337 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240816_192352_352209_AC39A207 X-CRM114-Status: GOOD ( 10.17 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Due to the design, Sophgo SG2042 use an external MCU to provide hardware information, thermal information and reset control. Add bindings for this monitor device. Signed-off-by: Inochi Amaoto Reviewed-by: Conor Dooley Tested-by: Chen Wang Reviewed-by: Chen Wang --- .../hwmon/sophgo,sg2042-hwmon-mcu.yaml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml diff --git a/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml b/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml new file mode 100644 index 000000000000..f0667ac41d75 --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hwmon/sophgo,sg2042-hwmon-mcu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Sophgo SG2042 onboard MCU support + +maintainers: + - Inochi Amaoto + +properties: + compatible: + const: sophgo,sg2042-hwmon-mcu + + reg: + maxItems: 1 + + "#thermal-sensor-cells": + const: 1 + +required: + - compatible + - reg + - "#thermal-sensor-cells" + +allOf: + - $ref: /schemas/thermal/thermal-sensor.yaml# + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + hwmon@17 { + compatible = "sophgo,sg2042-hwmon-mcu"; + reg = <0x17>; + #thermal-sensor-cells = <1>; + }; + }; From patchwork Sat Aug 17 02:22:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13766902 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 912A4C531DF for ; Sat, 17 Aug 2024 02:24:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=eKtbPSzaN3KDZD0tCPP71IhH86CuzPb7RowYVJqz6WY=; b=g6y4PL0+S0+m/i ewn4FzdlefNldj0YqD1c4PXIj1CKaS0O7k4LcT2asn8gKnxCwzompUvGkeYoWG5ze5eUpplMvOsVH JF457O4T+JmJxpH+GhMU7kSCRPb4tkgzKS01koZ4uJuz+cjPNFohQrWaW6On9r/DkkjguIR7JT09v jVljoWFh/bTChG/fo3hIb4QCg6bTeRmKzOeyIgkcHpwrSp8ExEisUHZ6itVv872bAgYZX5rcFfzHN cbqiCgKrbWDdrXMygiNpIj1J5aXagEZZHXD3yvoNpc1sKK3r3yXe9Jsbq0i6pjEjOWLsupREK9Xz3 5vQuNdqjmOtdRnXBshtw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sf96k-0000000EV3d-0bFK; Sat, 17 Aug 2024 02:23:58 +0000 Received: from mail-mw2nam10olkn20812.outbound.protection.outlook.com ([2a01:111:f403:2c12::812] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sf96g-0000000EV11-0pvv for linux-riscv@lists.infradead.org; Sat, 17 Aug 2024 02:23:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ucLOvFuL/t6nM1LWyvVR716LeZrXljuWx3H/VUikW8mQc8YSOksBgu9+R8Fjpao+vhNyJw0rP0b6EYG3mzrIpdKBq+4KPAMNgllZjs6+JipSppLG1SduetZfWQVlUkIxU6SaCg9SlFhezsgmWddhEN82viZoMOnmX+LfsURTphyGqTwEHerQLmhYdXPYPTHuScmpY3Hv7vE7zNMtEGmS0XZTYQE7eEBVzbl1Bt4VZCCyTpq4qtoL8TIs4m5D4itNlfeIfzg54qrOEdbywtXnz+l9jSf58P/lGxZ0g0A80jfPvGgk+H5/0TXSlyrgum86KmQIQKVYV0Nz3o6kyqeZug== 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=yGDBqRcdABcxTb2Qdm8FfhMH1uLiPg8wYMsiJiuFA1M=; b=qLx4TZnO7KC9cV7VRvXqwr1q6U9cDTFuWXW2E5qtCBN/uc2GftpaCLfnZVZIPqVz2BGGSMP5QpcGsEUhKb33axOksF45WJHjddkn9ycVGh8xf1qmabHAh7ipVs8c50+HMokogeT+oNgXT/yefIbOnFnoqv3fGNrZcGQ50R66KnvJPrGmEfR+GsOLcF2g5YmMTSpNF1zL4MSOSGbH5YLlIvnNEnE0MlUf+FeEz+0vLmhiUWGhi15247Oefn3QTS/aQHJpCvFV7YQzUosiqmemUDeuVdMioqia6oOiVadR3uPUUb98s19b0rP0G+iczdnvDFj9v/+va66Ki0dil7GQDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yGDBqRcdABcxTb2Qdm8FfhMH1uLiPg8wYMsiJiuFA1M=; b=jUo2/xttE+laxrPOOESHjWrTIXo/3lYADc7Cw7gz8/Am4xgyo14rigpa/d11t8VXnxZjgZ4e5JogMW5hPuYt2Q0iR8eVTHCzos8lCTuFdhz8sZeElYwSCt67PaLaubP7cnb1OQj4rldqRZ9wZJcCc4+Y9eGTDArh0rnLEKNpRmmiXPd0Ly/cRRE2bng44TsSnb4xC16p6H0Ug5+0FbQtDyflAoYdldJTBx2PbNMNBEBGYe4gY8f2IHyxAXEsCJ+WiZxbb7x2m5+bwViqWn8ParLDRmEGSofF49o6TN/V663ybKy2RxxmhBbVqyfK1gdWfBzkq87imjzeaaX3zrUrcQ== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by PH8PR20MB5337.namprd20.prod.outlook.com (2603:10b6:510:1bc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Sat, 17 Aug 2024 02:23:48 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::ab0b:c0d3:1f91:d149]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::ab0b:c0d3:1f91:d149%4]) with mapi id 15.20.7875.019; Sat, 17 Aug 2024 02:23:48 +0000 From: Inochi Amaoto To: Jean Delvare , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Inochi Amaoto , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Chao Wei , Yangyu Chen , Sunil V L , Anup Patel , Lad Prabhakar , Hal Feng Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v11 2/4] drivers: hwmon: sophgo: Add SG2042 external hardware monitor support Date: Sat, 17 Aug 2024 10:22:57 +0800 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: X-TMN: [JaK5aj/3TFCDifrVLZUYgDGivP5qyyM0RjqnTsXSUXs=] X-ClientProxiedBy: TYCP286CA0227.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c7::14) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240817022300.360949-2-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|PH8PR20MB5337:EE_ X-MS-Office365-Filtering-Correlation-Id: cc796215-4c4a-49b8-3c7c-08dcbe63a09e X-Microsoft-Antispam: BCL:0;ARA:14566002|461199028|19110799003|15080799003|8060799006|5072599009|3412199025|440099028|1710799026; X-Microsoft-Antispam-Message-Info: wpFq4Z2oe/Mcs4nzHq8RBC3mUNtEzKdo8u7ZZZMzmDUfS68tQragjW7hmbtdPRMEC6MaCtCZzpPM8491galeBps54H/XBzZ65LYLW0qkDd+YLcRG/SoGAu8X7l/MF5gnIO5GoVYTyDJiKx3IY5cAtJOT8eSTYVBFODzM5o6MmQaWeD09y/QNKjeKt1lCqGZ1BdSTglkiD6rgc+dQXUDS/9iycWv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IM+jnPKnEBE2ruSR6tnb9KP9VEuQKHUa2Z3JdjWzLX+kYRu6KfWuqxO0MDDZiMLVLy/wOaDmBiUL9CGd+l4CKFufHG4tIaGOvhFHUODo2u5vQaS7Yik8xAzYhoSG/mwxmMIuNILNzLo8L5BG6od575Y3/KzMAgTI8X7HF9jyLQRuPOsGTuIZnzgn6+mRc17XnsjlKHhhMyN/uIsl5DpjrX4+0GBsHecui24pzwBbYDdk6F+Uy3t0sngXiD7ueQR3TmIVxUEXAcWWyI5jTyeCrvIO+OXdVHGERDQhh6FXEI4YvhBRvd4aYN8/lmKL/SlKemXWt3YYS/lsnneMMW0jG9Wn54DfAgFWI0NLMkJakTzRZPkff600IHz8xPZXsnUPuSUJOk0JCHVCFE7gyTQwGg0GN0YMtfCuj91gUViSSeK/xHd0VR/ZjbnwD9wRfz05oiCxBvjGcz9w5b9olcpfSHy61byrmxwz3M/N0O5te9IBFCEfJWnixL7DZkn8EH9HHPE+tSdwi3qRySwqqoH8PxQCNjAT/km3OPAjc9Or9y7rppeg3LxoCKdE4tJvQu0LTtMBxdQjAtJpejY4HtqXGITu8JNozm0kSA/d8Za3hm7IBwtsL2MfJcrOXp5VYYbYUfCaiJ/hCB/80W2evvn0SjLHPYmbWHaOuMiFIflonuMT4ro5339L1AvYQsispZTuv1imbV2Us0qbKCwj/8lM6su6/SqjbfKBQ7eLQXnRWC54M+x69uBl2G0Kxzx3EF5xPaG5xQaz4o+OmzD6nXPMobj9 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc796215-4c4a-49b8-3c7c-08dcbe63a09e X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2024 02:23:48.8739 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR20MB5337 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240816_192354_451795_5AE4731B X-CRM114-Status: GOOD ( 22.08 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org SG2042 use an external MCU to provide basic hardware information and thermal sensors. Add driver support for the onboard MCU of SG2042. Signed-off-by: Inochi Amaoto --- Documentation/hwmon/index.rst | 1 + Documentation/hwmon/sg2042-mcu.rst | 78 ++++++ drivers/hwmon/Kconfig | 11 + drivers/hwmon/Makefile | 1 + drivers/hwmon/sg2042-mcu.c | 388 +++++++++++++++++++++++++++++ 5 files changed, 479 insertions(+) create mode 100644 Documentation/hwmon/sg2042-mcu.rst create mode 100644 drivers/hwmon/sg2042-mcu.c diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst index 913c11390a45..ea3b5be8fe4f 100644 --- a/Documentation/hwmon/index.rst +++ b/Documentation/hwmon/index.rst @@ -206,6 +206,7 @@ Hardware Monitoring Kernel Drivers sch5636 scpi-hwmon sfctemp + sg2042-mcu sht15 sht21 sht3x diff --git a/Documentation/hwmon/sg2042-mcu.rst b/Documentation/hwmon/sg2042-mcu.rst new file mode 100644 index 000000000000..077e79841d2e --- /dev/null +++ b/Documentation/hwmon/sg2042-mcu.rst @@ -0,0 +1,78 @@ +.. SPDX-License-Identifier: GPL-2.0 + +Kernel driver sg2042-mcu +======================== + +Supported chips: + + * Onboard MCU for sg2042 + + Addresses scanned: - + + Prefix: 'sg2042-mcu' + +Authors: + + - Inochi Amaoto + +Description +----------- + +This driver supprts hardware monitoring for onboard MCU with +i2c interface. + +Usage Notes +----------- + +This driver does not auto-detect devices. You will have to instantiate +the devices explicitly. +Please see Documentation/i2c/instantiating-devices.rst for details. + +Sysfs Attributes +---------------- + +The following table shows the standard entries support by the driver: + +================= ===================================================== +Name Description +================= ===================================================== +temp1_input Measured temperature of SoC +temp1_crit Critical high temperature +temp1_crit_hyst hysteresis temperature restore from Critical +temp2_input Measured temperature of the base board +================= ===================================================== + +The following table shows the extra entries support by the driver +(the MCU device is in i2c subsystem): + +================= ======= ============================================= +Name Perm Description +================= ======= ============================================= +reset_count RO Reset count of the SoC +uptime RO Seconds after the MCU is powered +reset_reason RO Reset reason for the last reset +repower_policy RW Execution policy when triggering repower +================= ======= ============================================= + +``repower_policy`` + The repower is triggered when the temperature of the SoC falls below + the hysteresis temperature after triggering a shutdown due to + reaching the critical temperature. + The valid values for this entry are "repower" and "keep". "keep" will + leave the SoC down when the triggering repower, and "repower" will + boot the SoC. + +Debugfs Interfaces +------------------ + +If debugfs is available, this driver exposes some hardware specific +data in ``/sys/kernel/debug/sg2042-mcu/*/``. + +================= ======= ============================================= +Name Format Description +================= ======= ============================================= +firmware_version 0x%02x firmware version of the MCU +pcb_version 0x%02x version number of the base board +board_type 0x%02x identifiers for the base board +mcu_type %d type of the MCU: 0 is STM32, 1 is GD32 +================= ======= ============================================= diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index b60fe2e58ad6..7aa6c3f322e5 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -2066,6 +2066,17 @@ config SENSORS_SFCTEMP This driver can also be built as a module. If so, the module will be called sfctemp. +config SENSORS_SG2042_MCU + tristate "Sophgo onboard MCU support" + depends on I2C + depends on ARCH_SOPHGO || COMPILE_TEST + help + Support for onboard MCU of Sophgo SG2042 SoCs. This mcu provides + power control and some basic information. + + This driver can be built as a module. If so, the module + will be called sg2042-mcu. + config SENSORS_SURFACE_FAN tristate "Surface Fan Driver" depends on SURFACE_AGGREGATOR diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile index b1c7056c37db..0bbe812a67ae 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile @@ -194,6 +194,7 @@ obj-$(CONFIG_SENSORS_SCH56XX_COMMON)+= sch56xx-common.o obj-$(CONFIG_SENSORS_SCH5627) += sch5627.o obj-$(CONFIG_SENSORS_SCH5636) += sch5636.o obj-$(CONFIG_SENSORS_SFCTEMP) += sfctemp.o +obj-$(CONFIG_SENSORS_SG2042_MCU) += sg2042-mcu.o obj-$(CONFIG_SENSORS_SL28CPLD) += sl28cpld-hwmon.o obj-$(CONFIG_SENSORS_SHT15) += sht15.o obj-$(CONFIG_SENSORS_SHT21) += sht21.o diff --git a/drivers/hwmon/sg2042-mcu.c b/drivers/hwmon/sg2042-mcu.c new file mode 100644 index 000000000000..141045769354 --- /dev/null +++ b/drivers/hwmon/sg2042-mcu.c @@ -0,0 +1,388 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2024 Inochi Amaoto + * + * Sophgo power control mcu for SG2042 + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* fixed MCU registers */ +#define REG_BOARD_TYPE 0x00 +#define REG_MCU_FIRMWARE_VERSION 0x01 +#define REG_PCB_VERSION 0x02 +#define REG_PWR_CTRL 0x03 +#define REG_SOC_TEMP 0x04 +#define REG_BOARD_TEMP 0x05 +#define REG_RST_COUNT 0x0a +#define REG_UPTIME 0x0b +#define REG_RESET_REASON 0x0d +#define REG_MCU_TYPE 0x18 +#define REG_REPOWER_POLICY 0x65 +#define REG_CRITICAL_TEMP 0x66 +#define REG_REPOWER_TEMP 0x67 + +#define REPOWER_POLICY_REBOOT 1 +#define REPOWER_POLICY_KEEP_OFF 2 + +#define MCU_POWER_MAX 0xff + +#define DEFINE_MCU_DEBUG_ATTR(_name, _reg, _format) \ + static int _name##_show(struct seq_file *seqf, \ + void *unused) \ + { \ + struct sg2042_mcu_data *mcu = seqf->private; \ + int ret; \ + ret = i2c_smbus_read_byte_data(mcu->client, (_reg)); \ + if (ret < 0) \ + return ret; \ + seq_printf(seqf, _format "\n", ret); \ + return 0; \ + } \ + DEFINE_SHOW_ATTRIBUTE(_name) \ + +struct sg2042_mcu_data { + struct i2c_client *client; + struct dentry *debugfs; + struct mutex mutex; +}; + +static struct dentry *sgmcu_debugfs; + +static ssize_t reset_count_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct sg2042_mcu_data *mcu = dev_get_drvdata(dev); + int ret; + + ret = i2c_smbus_read_byte_data(mcu->client, REG_RST_COUNT); + if (ret < 0) + return ret; + + return sprintf(buf, "%d\n", ret); +} + +static ssize_t uptime_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct sg2042_mcu_data *mcu = dev_get_drvdata(dev); + u8 time_val[2]; + int ret; + + ret = i2c_smbus_read_i2c_block_data(mcu->client, REG_UPTIME, + sizeof(time_val), time_val); + if (ret < 0) + return ret; + + return sprintf(buf, "%d\n", + (time_val[0]) | (time_val[1] << 8)); +} + +static ssize_t reset_reason_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct sg2042_mcu_data *mcu = dev_get_drvdata(dev); + int ret; + + ret = i2c_smbus_read_byte_data(mcu->client, REG_RESET_REASON); + if (ret < 0) + return ret; + + return sprintf(buf, "0x%02x\n", ret); +} + +static ssize_t repower_policy_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct sg2042_mcu_data *mcu = dev_get_drvdata(dev); + int ret; + const char *action; + + ret = i2c_smbus_read_byte_data(mcu->client, REG_REPOWER_POLICY); + if (ret < 0) + return ret; + + if (ret == REPOWER_POLICY_REBOOT) + action = "repower"; + else if (ret == REPOWER_POLICY_KEEP_OFF) + action = "keep"; + else + action = "unknown"; + + return sprintf(buf, "%s\n", action); +} + +static ssize_t repower_policy_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct sg2042_mcu_data *mcu = dev_get_drvdata(dev); + u8 value; + int ret; + + if (sysfs_streq("repower", buf)) + value = REPOWER_POLICY_REBOOT; + else if (sysfs_streq("keep", buf)) + value = REPOWER_POLICY_KEEP_OFF; + else + return -EINVAL; + + ret = i2c_smbus_write_byte_data(mcu->client, + REG_REPOWER_POLICY, value); + if (ret < 0) + return ret; + + return count; +} + +static DEVICE_ATTR_RO(reset_count); +static DEVICE_ATTR_RO(uptime); +static DEVICE_ATTR_RO(reset_reason); +static DEVICE_ATTR_RW(repower_policy); + +DEFINE_MCU_DEBUG_ATTR(firmware_version, REG_MCU_FIRMWARE_VERSION, "0x%02x"); +DEFINE_MCU_DEBUG_ATTR(pcb_version, REG_PCB_VERSION, "0x%02x"); +DEFINE_MCU_DEBUG_ATTR(board_type, REG_BOARD_TYPE, "0x%02x"); +DEFINE_MCU_DEBUG_ATTR(mcu_type, REG_MCU_TYPE, "%d"); + +static struct attribute *sg2042_mcu_attrs[] = { + &dev_attr_reset_count.attr, + &dev_attr_uptime.attr, + &dev_attr_reset_reason.attr, + &dev_attr_repower_policy.attr, + NULL +}; + +static const struct attribute_group sg2042_mcu_attr_group = { + .attrs = sg2042_mcu_attrs, +}; + +static const struct attribute_group *sg2042_mcu_groups[] = { + &sg2042_mcu_attr_group, + NULL +}; + +static const struct hwmon_channel_info * const sg2042_mcu_info[] = { + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_CRIT | + HWMON_T_CRIT_HYST, + HWMON_T_INPUT), + NULL +}; + +static int sg2042_mcu_read(struct device *dev, + enum hwmon_sensor_types type, + u32 attr, int channel, long *val) +{ + struct sg2042_mcu_data *mcu = dev_get_drvdata(dev); + int tmp; + u8 reg; + + switch (attr) { + case hwmon_temp_input: + reg = channel ? REG_BOARD_TEMP : REG_SOC_TEMP; + break; + case hwmon_temp_crit: + reg = REG_CRITICAL_TEMP; + break; + case hwmon_temp_crit_hyst: + reg = REG_REPOWER_TEMP; + break; + default: + return -EOPNOTSUPP; + } + + tmp = i2c_smbus_read_byte_data(mcu->client, reg); + if (tmp < 0) + return tmp; + *val = tmp * 1000; + + return 0; +} + +static int sg2042_mcu_write(struct device *dev, + enum hwmon_sensor_types type, + u32 attr, int channel, long val) +{ + struct sg2042_mcu_data *mcu = dev_get_drvdata(dev); + int temp = val / 1000; + int hyst_temp, crit_temp; + u8 reg; + + temp = clamp_val(temp, 0, MCU_POWER_MAX); + + guard(mutex)(&mcu->mutex); + + switch (attr) { + case hwmon_temp_crit: + hyst_temp = i2c_smbus_read_byte_data(mcu->client, + REG_REPOWER_TEMP); + if (hyst_temp < 0) + return hyst_temp; + + crit_temp = temp; + reg = REG_CRITICAL_TEMP; + break; + case hwmon_temp_crit_hyst: + crit_temp = i2c_smbus_read_byte_data(mcu->client, + REG_CRITICAL_TEMP); + if (crit_temp < 0) + return crit_temp; + + hyst_temp = temp; + reg = REG_REPOWER_TEMP; + break; + default: + return -EOPNOTSUPP; + } + + /* + * ensure hyst_temp is smaller to avoid MCU from + * keeping triggering repower event. + */ + if (crit_temp < hyst_temp) + return -EINVAL; + + return i2c_smbus_write_byte_data(mcu->client, reg, temp); +} + +static umode_t sg2042_mcu_is_visible(const void *_data, + enum hwmon_sensor_types type, + u32 attr, int channel) +{ + switch (type) { + case hwmon_temp: + switch (attr) { + case hwmon_temp_input: + return 0444; + case hwmon_temp_crit: + case hwmon_temp_crit_hyst: + if (channel == 0) + return 0644; + break; + default: + break; + } + break; + default: + break; + } + return 0; +} + +static const struct hwmon_ops sg2042_mcu_ops = { + .is_visible = sg2042_mcu_is_visible, + .read = sg2042_mcu_read, + .write = sg2042_mcu_write, +}; + +static const struct hwmon_chip_info sg2042_mcu_chip_info = { + .ops = &sg2042_mcu_ops, + .info = sg2042_mcu_info, +}; + +static void sg2042_mcu_debugfs_init(struct sg2042_mcu_data *mcu, + struct device *dev) +{ + mcu->debugfs = debugfs_create_dir(dev_name(dev), sgmcu_debugfs); + + debugfs_create_file("firmware_version", 0444, mcu->debugfs, + mcu, &firmware_version_fops); + debugfs_create_file("pcb_version", 0444, mcu->debugfs, mcu, + &pcb_version_fops); + debugfs_create_file("mcu_type", 0444, mcu->debugfs, mcu, + &mcu_type_fops); + debugfs_create_file("board_type", 0444, mcu->debugfs, mcu, + &board_type_fops); +} + +static int sg2042_mcu_i2c_probe(struct i2c_client *client) +{ + struct device *dev = &client->dev; + struct sg2042_mcu_data *mcu; + struct device *hwmon_dev; + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA | + I2C_FUNC_SMBUS_BLOCK_DATA)) + return -ENODEV; + + mcu = devm_kmalloc(dev, sizeof(*mcu), GFP_KERNEL); + if (!mcu) + return -ENOMEM; + + mutex_init(&mcu->mutex); + mcu->client = client; + + i2c_set_clientdata(client, mcu); + + hwmon_dev = devm_hwmon_device_register_with_info(dev, "sg2042_mcu", + mcu, + &sg2042_mcu_chip_info, + NULL); + if (IS_ERR(hwmon_dev)) + return PTR_ERR(hwmon_dev); + + sg2042_mcu_debugfs_init(mcu, dev); + + return 0; +} + +static void sg2042_mcu_i2c_remove(struct i2c_client *client) +{ + struct sg2042_mcu_data *mcu = i2c_get_clientdata(client); + + debugfs_remove_recursive(mcu->debugfs); +} + +static const struct i2c_device_id sg2042_mcu_id[] = { + { "sg2042-hwmon-mcu", 0 }, + {}, +}; +MODULE_DEVICE_TABLE(i2c, sg2042_mcu_id); + +static const struct of_device_id sg2042_mcu_of_id[] = { + { .compatible = "sophgo,sg2042-hwmon-mcu" }, + {}, +}; +MODULE_DEVICE_TABLE(of, sg2042_mcu_of_id); + +static struct i2c_driver sg2042_mcu_driver = { + .driver = { + .name = "sg2042-mcu", + .of_match_table = sg2042_mcu_of_id, + .dev_groups = sg2042_mcu_groups, + }, + .probe = sg2042_mcu_i2c_probe, + .remove = sg2042_mcu_i2c_remove, + .id_table = sg2042_mcu_id, +}; + +static int __init sg2042_mcu_init(void) +{ + sgmcu_debugfs = debugfs_create_dir("sg2042-mcu", NULL); + return i2c_add_driver(&sg2042_mcu_driver); +} + +static void __exit sg2042_mcu_exit(void) +{ + debugfs_remove_recursive(sgmcu_debugfs); + i2c_del_driver(&sg2042_mcu_driver); +} + +module_init(sg2042_mcu_init); +module_exit(sg2042_mcu_exit); + +MODULE_AUTHOR("Inochi Amaoto "); +MODULE_DESCRIPTION("MCU I2C driver for SG2042 soc platform"); +MODULE_LICENSE("GPL"); From patchwork Sat Aug 17 02:22:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13766901 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 E8214C3DA4A for ; Sat, 17 Aug 2024 02:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=6vUMtlfDjRqedZ+3crUKuSJB8bBs1NvYAcJy+Pnx/uw=; b=D0CroebEQDUjw8 VFdyWqbcmy5TTUuB96eGmDv5e5rffKQtH5oBN5DxHbEFw3JImAeL3kTZD83Yr/ZmCCPkDr9vLqCG7 ZR4zeIEn55zlg/Dw0FdbD+zyxVRSWrFgIZAeTHS7GPngDg9xsb/f+JAPQrURLnBmpyACX17HdW6Ay g9hFdwuASFNSrkVrM0eQmZdWf9ov35VP6ipy9g9p9lsYSgFPQxrGDUbwHbTKOc10UnD7vWaVWGOHm rz5PdAcpMOMZoSK/pWi4PrVjjt9hQUQJ0b0HnXh2kiIqdTsP2V/XPB6RCIDOpFk6X6YJzopBUskhQ 0b6DPftcd1nLNUKg2u+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sf96m-0000000EV4e-0lvN; Sat, 17 Aug 2024 02:24:00 +0000 Received: from mail-mw2nam10olkn20812.outbound.protection.outlook.com ([2a01:111:f403:2c12::812] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sf96i-0000000EV11-17vv for linux-riscv@lists.infradead.org; Sat, 17 Aug 2024 02:23:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nx0iJVZISCdh8R2jO9rOTzk/JANNZeZe52u+srKIPL7Nop3IGvh5fuMDFKDEnYpeEqF2xT386emv+/qoHROnB+8alf4mqhk7LT3WJJRfVujMkwM49hmi5VhfxzYYXc4cObUeebFQ8j/hJsTqy+vugFZUdDqC3eLIqJW8kti6Nvs4hhsHw0pTAkvSa8Z6W/yC4H7+meW8lz+YHw5ZbONtN/H7lUnDj0kx2OmgAVfaz2e8hVAKpSX7dxr1iMeU3TLzgPN2IQmIwL3G286zk1S0SkKCaogYFYoA93akFGGJP5P8BJj009sgIsdnpoCKXtyULemyQ6W2l0XTKcG1Xfl55A== 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=FHEUQngGJDx0vOokAPvghmYJe9j03nCnYapbJwhGE3s=; b=gg76BOOYeSTttXSWWvKRdmeMKPpvdsRAY/tjid18ranXoC4WCXWUJR2fA4pNjGU4yfK1hBcJAnW731VCXqlcTm5aJ/mlSoyukskOBe/prk9hotDTHBVQvYMfaI/a3UMv1cnO2oxVXDMDRRBTUm5FiAt0oqrMAc0uwuPhsdu2kmIf6Sa3A6eKgxXV4GR58j9vlfwpmqL3Oa4D1y/qCGk2rGIzzZ/w7+D2w/h0ZMouGoHUrR8UeNYSBlRX9KHX+g6RLnJA6Qth0KDJ78OoQ+wqNFxgvPyEW1qHiykK7uwGLhzdhg/+VRiwaYM3dWlkbLG7DM/4oIQ2DpTZvD2w2as2vg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FHEUQngGJDx0vOokAPvghmYJe9j03nCnYapbJwhGE3s=; b=EY0W3MHwI5fsWnYHKNJ9NzTyeSZzmZPK1G1kvCizdb1oUl0ZQ/DSlTGCr2kxcgNCCa6j1D11xgMysdAMeVjvUmeJ7pyP6nypl4xxCSxnJyiHj9wk5BYef/92ax7A4NREoKVOzmdixF6SXZGjOi8/FaR3B2lFwk4krmvM2cRXkOGGr2lr4GbYsKBWUhCyQztFX3223ElxlWBMo9uJo9o9KGvSKOcZcPU9MNygc0IxpN9ImPboDH9yT96gDqYivNkDaawlW5dryTn5+XJnFA5p2jSgpu3NWnOVafTzmKZY/I9U02LRVleCZOZWKBux5iefnALc1GkdSSX+0GKeX3v4og== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by PH8PR20MB5337.namprd20.prod.outlook.com (2603:10b6:510:1bc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Sat, 17 Aug 2024 02:23:53 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::ab0b:c0d3:1f91:d149]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::ab0b:c0d3:1f91:d149%4]) with mapi id 15.20.7875.019; Sat, 17 Aug 2024 02:23:53 +0000 From: Inochi Amaoto To: Jean Delvare , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Inochi Amaoto , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Chao Wei , Yangyu Chen , Sunil V L , Anup Patel , Lad Prabhakar , Hal Feng Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v11 3/4] riscv: dts: sophgo: Add mcu device for Milk-V Pioneer Date: Sat, 17 Aug 2024 10:22:58 +0800 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: X-TMN: [7UTbJOnCX9xbqYuGyIDWpnboqLlFs9AIh6hoXEFos2k=] X-ClientProxiedBy: TYAPR01CA0167.jpnprd01.prod.outlook.com (2603:1096:404:7e::35) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240817022300.360949-3-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|PH8PR20MB5337:EE_ X-MS-Office365-Filtering-Correlation-Id: e1e7041f-3041-4004-5cd2-08dcbe63a377 X-Microsoft-Antispam: BCL:0;ARA:14566002|461199028|19110799003|15080799003|8060799006|5072599009|3412199025|440099028|1710799026; X-Microsoft-Antispam-Message-Info: ft0hdUAXVmOqK6TW/ewNuthT8Srr6+YBe043s6zWwFiCT/J5vUW8ED1iI9CNtT5NotstU1UHN+pBbzuyIdH70/mvyV1DFoQFNAdAfxuVvdNGSACZRU54dXMqr8wYxRU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bCLz7S1rpyACZ/iTiJiOHcNPcMGWcQycylXXi8uvoaVGVYngnYdIdF/VqHiSF/lZ/g6MmSmPjtFZWBVzp2LNU5hqOtUZzFFFTA6Bdz0Rji2EdfpJoC9+QpGRiP+kvlWMyUKyV5TPiEHXsTXHy/Z0CN8b4vWQc8QWUMJQI1TtaQZq35p4Vf65sPNLPkG+TMwj2htVkiYogvKeb1hIuCnckRX83A0XxI4M0fXvoQf8S3Ela35DtdP/JPkoIzij7EQMjNX4hudDuSGgHmy7QJUXUEt1S9kqDJ99wmtVTkzLEtHKen2j93tLiP96BRblQx4w32yEJ1+VJlepAibWDts6Mf3xI4waNtrDi2UJbTcAIYs2zMr61YLbjgD/BBQ3nqE523h2Usd+7fGqIDQDXw2IRlDMK2UTNpoaaSufNH/xtNJjtq1/ecQvPStT+YtOBvewiddDz/0twUEm9lvAMvAuiPHUbSiJv7yRuO6d+iggBfaa8D61VtmLpoNRCI/LOTcHzl0Xgp/IORcJWur4JR4edP5hL9RWgqlOc2modYOLIPVceX+rxJ5O3go1FU1aicEyLhggrYFDWOdWB0KKGukdSCAwtwgpskBAwWvOOfZiYhO1ThbVEZtlJ7yLRQr5p4uCCpS2BJPmgi/iciLBGiYGUkIoUNIVAvM5YQvJ/fLhiyWEEukT5HqJUzdR2s21LC0Ef2Q94IJndTqv+30bmhAw8etWRV1fVlnf0ZHuPaiSDTyKY+y5W5C3/zlnHwK7ecrgyZ066h3WFEB1rYuOxgNZ8RLIPyZrE6RQXDMwB1JEot0THbEMltG1LV3rp5LdlrVaurGfXpvlUvzajfvewYxr+hzy8Tjg4+KCp0Igj1bHc X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1e7041f-3041-4004-5cd2-08dcbe63a377 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2024 02:23:53.4782 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR20MB5337 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240816_192356_366341_A2950429 X-CRM114-Status: UNSURE ( 7.80 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add mcu device and thermal zones node for Milk-V Pioneer. Signed-off-by: Inochi Amaoto Tested-by: Chen Wang Reviewed-by: Chen Wang --- .../boot/dts/sophgo/sg2042-milkv-pioneer.dts | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts index 80cb017974d8..76375e25a495 100644 --- a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts +++ b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts @@ -26,6 +26,66 @@ &cgi_dpll1 { clock-frequency = <25000000>; }; +&i2c1 { + status = "okay"; + + mcu: syscon@17 { + compatible = "sophgo,sg2042-hwmon-mcu"; + reg = <0x17>; + #thermal-sensor-cells = <1>; + }; +}; + &uart0 { status = "okay"; }; + +/ { + thermal-zones { + soc-thermal { + polling-delay-passive = <1000>; + polling-delay = <1000>; + thermal-sensors = <&mcu 0>; + + trips { + soc_active1: soc-active1 { + temperature = <30000>; + hysteresis = <8000>; + type = "active"; + }; + + soc_active2: soc-active2 { + temperature = <58000>; + hysteresis = <12000>; + type = "active"; + }; + + soc_active3: soc-active3 { + temperature = <70000>; + hysteresis = <10000>; + type = "active"; + }; + + soc_hot: soc-hot { + temperature = <80000>; + hysteresis = <5000>; + type = "hot"; + }; + }; + }; + + board-thermal { + polling-delay-passive = <1000>; + polling-delay = <1000>; + thermal-sensors = <&mcu 1>; + + trips { + board_active: board-active { + temperature = <75000>; + hysteresis = <8000>; + type = "active"; + }; + }; + }; + }; +}; From patchwork Sat Aug 17 02:22:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13766903 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 0842BC531DC for ; Sat, 17 Aug 2024 02:24: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=UyG3s6rP3LDwodsIFVibw1AdTJ3AYK5QTCpICjXOolQ=; b=T+NFyVTrWdl6lT HFOkRSYDWRPlSLjAZyjbNzBlUW0+YLHdH+7rrgVS4DSYAc5Rs3zGM6EqKuHk8kZAcI6iuljFThpsi uWa7XZPgi7E8DXC9pOrEW4wqzWM3OWMn1SwviHeGbBeqcQEiTf6O5x5EO1XgnXf8UQphQIiDHKfyZ CUlnSf0IdBGz9NKiJBWgVyKnSlcTn5vrGHKS5woXG6fXhv54zkAaVcXugvmAZxygV8UHPbAnLAvDp VmCEh9EYVB4+hzME5uAD9tkyHgS8edabpUtVp7g/SI30A7zfTZ3hl0OMIsSId2dGSFolQa5wlD5SK sHcSHxDwyBRbX0I6M1vA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sf96t-0000000EV9E-1Hy0; Sat, 17 Aug 2024 02:24:07 +0000 Received: from mail-bn7nam10olkn2082a.outbound.protection.outlook.com ([2a01:111:f403:2804::82a] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sf96q-0000000EV69-0Ukp for linux-riscv@lists.infradead.org; Sat, 17 Aug 2024 02:24:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dyMhxF+GrintoeJ07+TxvJfBfqPoePmPdEp/HNTnspKMMp8taxc1eau5A0ZKuNWgbSnP0lfxIOt0KmQ2ltbGkHtUKWN3jWyexTeqil55GhjZQmk500AX29OJICVTZKmUkYsyb54RDYfkdRo/MNlh9VC4DkrVTOHPxoSkC+aKLH8pjRYpKwnRQ9F1mq8gBWOHcOkto0sX+7ZbbGM6Q7zp39wSOtDskSthtZZV+PR5VxNhgXuQg3syk9UjgMw65nSe7wDefIMrYVmpgApdZZuLlleF4oSAeHbOlSgfHTBM/B/d4xGcLsk1CUB3vOhmnIh1AiWXIQuTTglkR7BgE7srvQ== 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=t1jAVsTw8hZ/KN1DR2QpYyBsseR5e1kBRaw4LadbN7o=; b=AVD3JFDhBCZd2d4nq2h+WPawMCSPAn+fOiVReJX9KcTnRkwGVTCp7MhmRAKwlS8mQiCFoydOzWCmlpdJXjAxJGacMj1rQaTBIZVWKTZ6akgwHPo/aBFWSbMGM6tIyfjbGTZ16qKoqLhsqMKRf1C2wEEEIGcvtHJlW8DMBIxmHOc95w48lKZwy0W5wybCly9/tw5mWA1A82B0EpolOP2bWZxvxdM1Z8L641ZYbP4qRV5r8ozQTIJAuv1hDXdd+9prCDxK+ScF2qrJh0h6i33YjEGVYYNGuUIuzDe5Db7QX/1t9kLm9y4xRvir/FpQrDYTci4/AY4CQngyNiUBcRRbzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t1jAVsTw8hZ/KN1DR2QpYyBsseR5e1kBRaw4LadbN7o=; b=PXaMvzSWSd1mehsUk2DHlOi40a+Xwf9TLMSI7Ls+7L/6O1diqiBm5EY7n+JfZ48OMMDE8bNJP9EzsKrxIHdKj3S8WY+yiPGxdtTi/GJDGn5MR3gJafGAKgltH6l5t348noOn4+1NYFTTFCWQYRa9Bh5Od6v/8BmY62mfk54f1zIF1qCnE2PaSOdRlSpffI27N9HTOU+mJr+Uk5D7t3vKK1vrwxetDd5X19/6T3dzuBu9FPxez4xim5XxAk9uXEhlDHzrcLsEXO4oiWutDt9oP604Sf/oktRyl3KpClp2mfAHFCiGZqxfhq8pDCf28OhB8WR/r1+LUJEsrrJB98UqQQ== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by PH8PR20MB5337.namprd20.prod.outlook.com (2603:10b6:510:1bc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Sat, 17 Aug 2024 02:23:58 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::ab0b:c0d3:1f91:d149]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::ab0b:c0d3:1f91:d149%4]) with mapi id 15.20.7875.019; Sat, 17 Aug 2024 02:23:58 +0000 From: Inochi Amaoto To: Jean Delvare , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Inochi Amaoto , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Chao Wei , Yangyu Chen , Sunil V L , Anup Patel , Lad Prabhakar , Hal Feng Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v11 4/4] riscv: defconfig: Enable MCU support for SG2042 Date: Sat, 17 Aug 2024 10:22:59 +0800 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: X-TMN: [5R0tRRUm7NMeBpiCw6KXTpuzA5vVN/UdmPgOpU9NPR8=] X-ClientProxiedBy: TYCPR01CA0013.jpnprd01.prod.outlook.com (2603:1096:405::25) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240817022300.360949-4-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|PH8PR20MB5337:EE_ X-MS-Office365-Filtering-Correlation-Id: af1a26da-30c9-4ddc-0c99-08dcbe63a62a X-Microsoft-Antispam: BCL:0;ARA:14566002|461199028|19110799003|15080799003|8060799006|5072599009|3412199025|440099028|1710799026; X-Microsoft-Antispam-Message-Info: ki/O8OGWEHGb3jQt5lv1Fe9Bww2iEXDvg37urMsbfhkR5ZEW0Ijs7pOHWGy+Hfm4iWq16gbLWrbY+sP689zv+uMZUpaLJ54GSjQ6k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3gEbgdjiaZV8lFoCJshT0Y3M1sBxLyT37mpjZ1+YdGldW363Bo8q6fMh8hAV0xTyddqdd44LLBS5ykteCP1u6/Ku5h7/jEGaNhIgwriqit/ORlH4fhMYqQQ5gKvuF2Xk8XYx8SIqIWBmg3eVDFUS98c6UsPIzmXwk2y4vgeLKBlolRJiirmRkl0478ZrOtldKsyZiZn4vynnqaUFPyu+5mqEf51vyIq/8XHzFPNftSoDGP2YNc0OkEZhqLsgPQhvszk/BWIZysCbXBzCT2kR3MoDWTFzI7quWMxi+N6DiwntBauDR/PSyRxyoJAeFUV8VK0a5JajRWUH05EibY0fus4zy+Z/UFKVXiCD/TsbQE6BrTAp4WDj0Nza7UL0WfRkIVkESNsopy+0L8fpq0al/CKvES30SPp+ypqnxDDSDTO5f4Z+Zb0LX2z4DtKOCQMcegsn1Rud+VJZESIZ/guZKiuof5kRdwMB6qlkMDfb9dnHAGq1xLTQDLOT2DpuYgbY0f5WaXUlJhLn700YAxQnQeuUqAA1xRb2XnmfY/K9ksmWCr/KnPqM0JsAkgF/0A/1Bo0e3gd+BGprULBiFySbrdL1kOeKNuqCK30E8w+5cYFtuSf2zUv/tM7frJTD0mnjTcd12DLDuXxqQYjSsTXfgeyrMYuB0VLi9xvMPogdXNmXfli2M65416pr9lTFSWoDK/J/7OpE14gMyaskCz5DnM9aVIZXn8nEou75rdVVm5xT+TLWNFsQEYr5gXsMSi5jaUUCQR0y3pnWJXFTkauarqHMJlhMYrSydsPcotUwV4NGkShg/TswgYusPKii6L2bbE/JPVnL1JxZSQ3KwGaJckhNkNaDVitp2hKGYjT7XALgTMGhvbn0p5KBraPs5iKGObOfKYy6DViBRERO X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: af1a26da-30c9-4ddc-0c99-08dcbe63a62a X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2024 02:23:58.1774 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR20MB5337 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240816_192404_228342_CB3D8812 X-CRM114-Status: UNSURE ( 6.51 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Enable MCU driver for SG2042 to provide thermal and reboot support. Signed-off-by: Inochi Amaoto Tested-by: Chen Wang Reviewed-by: Chen Wang --- arch/riscv/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig index 0d678325444f..a0f346301df6 100644 --- a/arch/riscv/configs/defconfig +++ b/arch/riscv/configs/defconfig @@ -170,6 +170,7 @@ CONFIG_SPI_SUN6I=y CONFIG_GPIO_SIFIVE=y CONFIG_POWER_RESET_GPIO_RESTART=y CONFIG_SENSORS_SFCTEMP=m +CONFIG_SENSORS_SG2042_MCU=y CONFIG_CPU_THERMAL=y CONFIG_DEVFREQ_THERMAL=y CONFIG_RZG2L_THERMAL=y