From patchwork Fri Aug 2 12:38:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13751530 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10olkn2107.outbound.protection.outlook.com [40.92.42.107]) (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 CC4EE208D7; Fri, 2 Aug 2024 12:39:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.42.107 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722602357; cv=fail; b=cMnllRnBUL6osi9EB57bhwiTQSS/Vt3YMBV6PRjwB8JaihYuKJrKTmoJEb3i60yS4YgUNZZQa5F3675RMcCmf+ccSHPuC/IcdUlzbPuy0mfVmlAcyUqQtffMg9YK94IDBnpprY63yvU97vuzCoCqrDKsgn0IFVtxWWQ3jlFcIYI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722602357; c=relaxed/simple; bh=pUUlnEYQLKGFDYNNgM7qDiyyi9r4EzIJ9carsmiNCvM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=FdTxOhvFJxZ029rBIdFCj13s1sRBMUCjk8F3sTN7H/H+pO46OiQXgkAhwU9U5q32aPJPrynNnKH7EOwSBKRIpt1bpA2TEatPAKTeXQoKtIPR3C/KR1JHPPbDXnitaFBAn+JNoh8ClxfgjixkdTjqlyCkvgpjm7389WjcNjhCDhY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=mCoXO2sL; arc=fail smtp.client-ip=40.92.42.107 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="mCoXO2sL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=glgdLocOXZ3eID9KMtX/Xaf/ZjMY9yqAxZ0cWpXItz1ZvhF9Bf1BFn2bC2wikQjdCyfcFUuLKgAMLkj9xc4zZNbpuS24Vwd36BnyH/rXqC/IiczgsAktLxobJHZ2CvvPVrV9O4wC3t7bJR3GqNBlV8pPjT3kJ3k0vHnEi/0YhQ1O/yhbUOoi8yHZtY4SHwDbfoL/8cqjz1+H2La1XVLsgmadr514xBshpVN/Fay3ETpGO7wu3+RRUAEuH+oEcIT14B/FB0g9wkt+vXVB/jSR9k/+IKrs4OfXaEp9gjrYT8Gb5snEbh0jb8YAD8Zqi4ysO0hB6X3S374lwwYIav6EBw== 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=Sbj+4yTFSUndfwHSCF71CnBFdWTSVSXYnX65mm+FGXePVcCRMtxjjMEWn2t78g1S13R2YWZyaLfqlikfKLBDvTLLZRwoOPkETI23WS7LYht1MegvdO2LuyOzTzps9s0vJiWT4W0awpHtpOFFUAt0t6goA89ph6lxh5T0qbaAlwbXRofPzPeGwBBFtCn1ErBCdbvw0ID5MAhnIH20Tv5G/ZOXEtSaBUiladF09cEWmlW1r5MfQtdve/E8bu5688HIKbEw7p+cdS5ZJm8MSpOuan0KD289USV2qrr3j956R2GnWHJVDSLILCOG1eaR8FOQFh67tMRRW0/ilgxG2xfz9Q== 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=mCoXO2sLlESRTx+/8gP0q5FvV3LgHG1ScxU93Gke+R1Qnsi0/2xZEU2tL99mXC74V+MZS9lOSf87sVktOUSJ+mhpWsjiPRve5EVDlbY+ROwjOFhbpAqUNjftqWPwoW9d/geBjSIsSfxJKC8N/2l0qpSTHy7flHpBU/WUwfJqDXjoUlfhlJkfiuQqAhfxWKrmIL6LU1tw1wniSFglBNqJYBNqO5o7mAKZ0amR+Xbf9LkqhB2vNewcC5iAW8uP2aXj22kX7UIC5f0iv5uR4e+Tt4xTpFHnJdMQQy9QIsKVRwW6pUC40E//4S+gjL4TVDJL9jHdQKuRXDAlfbylk0UFRg== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by CY8PR20MB5499.namprd20.prod.outlook.com (2603:10b6:930:55::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Fri, 2 Aug 2024 12:39:13 +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.7828.023; Fri, 2 Aug 2024 12:39:13 +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 , Jinyu Tang , Hal Feng , Yangyu Chen , Lad Prabhakar 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 v9 1/4] dt-bindings: hwmon: Add Sophgo SG2042 external hardware monitor support Date: Fri, 2 Aug 2024 20:38:38 +0800 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: X-TMN: [z+H1SQR6E7bOTZOmBlJx/WjDuZGComY8OSJzcZoVEIw=] X-ClientProxiedBy: SGAP274CA0022.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::34) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240802123842.1492286-1-inochiama@outlook.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|CY8PR20MB5499:EE_ X-MS-Office365-Filtering-Correlation-Id: 9df565ba-6034-4288-fa26-08dcb2f01ced X-Microsoft-Antispam: BCL:0;ARA:14566002|19110799003|8060799006|5072599009|461199028|1602099012|3412199025|4302099013|440099028|1710799026; X-Microsoft-Antispam-Message-Info: Mg+RUfP6sPkO3DksIcn4TwpXUdEml5D1J25BBI1Cbz4ty1UuDBEHYpKY2JA1aZh3wsnXYVFESAuV57AJh90b30K4tqLLrCnbgbsXkIzPL2rPhO19du4uEX08PSP6wV+SQu8OD9Dgm5zn2NYVPKYIc+Lt5TvY8v2mmC0ejRsBHTWYccZehstdhcZDjNqvalC/gWYEp4BwXmHB4Km3VmithYBh8BLMxGA/FTrsWdH3NvKp0oiFnxcyKPKbjiCgA6CCkmRibdn8rFVPHUcuZftt1FK4ES6MSAYB1xPznQOAsFkb/P5AGtM9UE4oERCUCCOxaLd8hRhG8J78EOcQh0fcW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Rfy0Fq0nFAQbOUvYlaYuQPs1Sgo5v4Ivau2Ndh+3IZCjcknaRd0jN6YNHyvJL/gZBZfAVsHEUkA/JuupbwRdBMNzOR8TR9d4J4wrkVBRJr1sY45PMwSLoULww8ZP8STmww9wt8qIGbAKtaxWOVh7RXt60GW95iWjz3/gCV9DsX8oFjkh8txSrItsDYJJp0VGIB5ghjLeZ+Tbx9i1bhvGhjHwsHv3icZxHSHEWdtv9H8ktUM6w8Uvh5wx1urTHqqZq4driklOhaA0QsJZsbH43M+db/DYaOXZoxaEBNNcixE+uYQpsBJDsQToUPAr2dOqNi1B41uCo9Pd1mR9LafbIZ7h12Vez7FCjCxVk9DEzZ0g/zMjeauWSpzosX9u99yG3CVAXCGN9rbaEOa6uJR56zjs+h7xkmx1KoHQm0GuKDaGYw6hM9HUqnbVXOQB/2aaGt0QlV4awRsDGFcu5Jfs0lJ1K6AHikhtefW6FrPXgtqlDB5m67mSSk95q0jsiNQbU+7kU9txClLi8WlzBZpjvEMs14LBuTW1cJPEsaBk76wSTNfFMMFH06quy054OlIZxOB9yjpNBqe7gw40DxkWkf+q5kJlpctPeiBPNlGCML014ieKyXnXnCDThhxe5Ep82bmKrKVtLu2/g3LJ1u+PLGDQCHEbAUnzILsYPWhNw2OL1q7kQlWjXVx0+27a3q8SF7twHFQx3wA7q7Gx3RdotKcVDqzBR+vB6SXfJcgV29nPZKm X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9df565ba-6034-4288-fa26-08dcb2f01ced X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 12:39:13.1469 (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: CY8PR20MB5499 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 Fri Aug 2 12:38:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13751531 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10olkn2091.outbound.protection.outlook.com [40.92.42.91]) (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 103301E3CB9; Fri, 2 Aug 2024 12:39:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.42.91 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722602364; cv=fail; b=eufExsZJuhyrpkbOhh55Q5fy/PLsOuNUXYYbD53Npan2xkPC2dh1v29mvIfJfgeWADWmwsiTQPwu1OoMBq4GeyKI8TwSSKmF0a/Qh9rVlbexMU4gGiROPgHWFx3TBp3UYoq3AZ7gr2XM2R2BYow6LxV/GvIZ8gFbbQzroRPUFe0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722602364; c=relaxed/simple; bh=zIssMli6gSPdOvoddu6McVxrDgxRYUPfjhuYsojKDpQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=dMa9RJ14+jqLS/ObtvpydhHYUDaxidU4uY+p3pE3qCXQr1wx5qVRNhUdepxQmzVGz6OA5ZfMnU0ri9KFWRzmRirr4urABQH7eAUi5mO5SfxTr+TV54bFYkwW7kXO7Ov4VWzPrMudUw8Ko52dlbzwYlaoFM+wnH2/ydDiZL3N3c4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=gK0XjmhL; arc=fail smtp.client-ip=40.92.42.91 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="gK0XjmhL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=s+Vx88hlJMQ3T3zTWLdRk0F8ocdDz9FnR5iJpJJxr9kftBR/FoR9h0kbx734BaTYLZ2LewHd+kEZekLo875fKa1EQf3gwPRPO9ldYo70HiK/MSK2j4YirqYJhp2mj++Cd03fL5hz/ZS0Lo9Buukut2z0MnEGqSE6I3GIdxKbrPJ5ZKP01nSAN4r5u2SRVWUKUjXBEMUPXcD9QwXvUE2BMseBfhj36M+z4c/XsfpbAQckKiqSwb346r0iDmaLeebG8boP8R2BJh08QcFcnquAGtrMGIh+Ht1LBagGFFE5YJIfz9zInPoEH/Hn428x3b5BLiD5F+T7bCKP9vqmHfPLAQ== 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=/2CSHyy7i+DZd+ZKW3QZFHAWPwdtONUrir0CDp4KvtI=; b=NsTz9JbVYANzlfMljN426DVqszlVBs0cPxGd+Fn4+aSztMcFwI3NvrOqdOKDeP1HkXWKHvGAit0qiOxHt5S/YTcU8hffH9y2MuxwvoMzmxtW+WnUs4FE97o8YIqjczcnYDZ+m7nm6SNQueXuGKfQl7TwmEqMg67FkFWORA7BEWc2K92/bye0GBuAcYeX/0JbIi1aM5iK7dueRQKxXvlUgRKOItu6Ga60F98FeverTymc9ICO5lgdZCmFtdz84JLrpR+ij7YT7PDXs1gtL+rzSXWjmGM8JykL1hFVusOPRQYkThOWl+TPPwMWHPMgVYQytmF28bOwQaEVdEG3bFt56Q== 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=/2CSHyy7i+DZd+ZKW3QZFHAWPwdtONUrir0CDp4KvtI=; b=gK0XjmhL1Benm61SeQsjNRFjWF4ZHplH6t1oyPXGVkqLpDNml3QuEDsNiau2AxvihSax01//z+frxWXdnO3oEaClqYldah99crjjR/QALhcSC2c8oqY75h7D9c95uQX8NoBdMWTENFl0/TMvlg1pRQaK8vJSf/d/takCr8O0A6/R53a2lYFG9Q7/EbUWVUHZE0T1qdSTVLH/zIu+dzZGHxsZfQH/DU/+v5u4n362qmNbkQv0CmCtLPUBbGyvSH42MOOhFrPzvs5Rebyal9s4e9K0ohjoTBj6thoVxKxnPtO4H4PROmhKad5BLhvD9T/eG12KnVVzu+OHZWaDy/IEtA== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by CY8PR20MB5499.namprd20.prod.outlook.com (2603:10b6:930:55::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Fri, 2 Aug 2024 12:39:19 +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.7828.023; Fri, 2 Aug 2024 12:39:19 +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 , Jinyu Tang , Hal Feng , Yangyu Chen , Lad Prabhakar 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 v9 2/4] drivers: hwmon: sophgo: Add SG2042 external hardware monitor support Date: Fri, 2 Aug 2024 20:38:39 +0800 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: X-TMN: [Cf3teBs1u7Ul07hwwThgwRR9NKUP9aTqykoQVv0vHmo=] X-ClientProxiedBy: SG2PR04CA0185.apcprd04.prod.outlook.com (2603:1096:4:14::23) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240802123842.1492286-2-inochiama@outlook.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|CY8PR20MB5499:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a51d5bd-7ebd-471f-760a-08dcb2f020a6 X-Microsoft-Antispam: BCL:0;ARA:14566002|19110799003|8060799006|5072599009|461199028|3412199025|440099028|1710799026; X-Microsoft-Antispam-Message-Info: R90GDjCSdu6mlNDfCYHZpbZvc3kycg0BaYRVJoeFM3681I73uBHWVaAS4Y9CYlwVin70QKa9uaSmdVqpKbEDGR61kNS8LAwkcD5qkIhcka5kwMg1DUvy86qWtWPC7L4h3G9ycM3qKOPYV+aeg9NgsNSJQH5M0n/NhlGkKOmd1IZut89z+Z/x1DF2SDQtEiokFM2g34GW5eDGgU4TfF6ONrB4RP8/kKBG2FCi+yCvTzu0n9nxEBKQtfVtvDdweQ/2J6i4JysqDuOTFZRrMQyN+65J8k8LBz4uvjSla3FmXXcxiJcBpdHUHYlsqAwpmpEU7Y1+PHz2qIchD5XIZ9TySFlVAIeGD/PO3C893BzA3MSE933MzAo0vmsik+XCD/dWfR+Kg58b6Z1flJTpT4tLWZm3imVHLFTe2jo15j/99c+b1aSljxs5Pg3Dm6mZRKPvykEn4CfOp7jaAl+x8DScPAWnWSPfI3SQ5m/GQfcl1DbxpY5+Wl+cuDcdjVCTbiyFXRjUeG5j7yirxJ8z7YdWecKOmyusgUGNaIwzx790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RFTBRA8CqJFJbfdsYRdHEz4Cuz+YzzSBzs/BPG+Vf2IvNfaldaRA4ogZoTZQYPUhSJ5lYBkAlmszzupmk3JnN4AesFtXit3S7lnQqHHVl46nx/gPpCh8bsYe9+sBcElQxLgexSuqQK87w5DOqTVsmJ/qrwZNuTKjCmWzOmeq2AXyH6/iw0FkrGQlBZwLLaR0+bTlHyMWRjMUXd94MJ3bcHzBT1fN0Ae8ll0yTE+G3Kjetu7zMtm9vqzQt1QCCQoHJkO26ZR9Tg0TcXgIAMEzllErGmMJyK2wy80KGWsjrAEi6Beikw7WVvbS6MpBLhrF4wMatsXhiXX+DbxJa7+kRBYh43YxpNI9cp/8SoBg3Z4fL/mTUHkA+DvCD9vDOXa8iSL/AQFoaX/5f0YAXEBiWZcNkx4cNaYDoQGLkfeBd2A09P X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a51d5bd-7ebd-471f-760a-08dcb2f020a6 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 12:39:19.3932 (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: CY8PR20MB5499 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 Tested-by: Chen Wang Reviewed-by: Chen Wang --- Documentation/hwmon/index.rst | 1 + Documentation/hwmon/sg2042-mcu.rst | 39 +++ drivers/hwmon/Kconfig | 11 + drivers/hwmon/Makefile | 1 + drivers/hwmon/sg2042-mcu.c | 394 +++++++++++++++++++++++++++++ 5 files changed, 446 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..250016b47dd1 --- /dev/null +++ b/Documentation/hwmon/sg2042-mcu.rst @@ -0,0 +1,39 @@ +.. 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 +---------------- + +================= ============================================= +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 +================= ============================================= 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..6d8d677f86f3 --- /dev/null +++ b/drivers/hwmon/sg2042-mcu.c @@ -0,0 +1,394 @@ +// 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_ACTION 0x65 +#define REG_CRITICAL_TEMP 0x66 +#define REG_REPOWER_TEMP 0x67 + +#define REPOWER_ACTION_REBOOT 1 +#define REPOWER_ACTION_POWEROFF 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", + (int)(time_val[0]) + (int)(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_action_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_ACTION); + if (ret < 0) + return ret; + + if (ret == REPOWER_ACTION_REBOOT) + action = "reboot"; + else if (ret == REPOWER_ACTION_POWEROFF) + action = "poweroff"; + else + action = "unknown"; + + return sprintf(buf, "%s\n", action); +} + +static ssize_t repower_action_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("reboot", buf)) + value = REPOWER_ACTION_REBOOT; + else if (sysfs_streq("poweroff", buf)) + value = REPOWER_ACTION_POWEROFF; + else + return -EINVAL; + + guard(mutex)(&mcu->mutex); + + ret = i2c_smbus_write_byte_data(mcu->client, + REG_REPOWER_ACTION, 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_action); + +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_action.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; + + if (temp > MCU_POWER_MAX) + temp = MCU_POWER_MAX; + else if (temp < 0) + temp = 0; + + 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 0664; + break; + default: + return 0; + } + break; + default: + return 0; + } + 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); + if (mcu->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 -EIO; + + 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_OR_NULL(hwmon_dev)) + return -EFAULT; + + 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 Fri Aug 2 12:38:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13751532 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10olkn2020.outbound.protection.outlook.com [40.92.40.20]) (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 B0C781E3CAA; Fri, 2 Aug 2024 12:39:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.40.20 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722602374; cv=fail; b=HuDVCAPix7WjWh2o/pZCI8YrzmHOQcKQVd5fHu587Tg1fowC4IuOq/gvtyENyHhxLLQIKJ91/HZnWf6+oyf7lrpRY0MrSZKmsGoAcagUYboIX9qh4taIxw8exCfm9gJ/BJ1bBtgyp9uf0J9bnEapTrKrjnYxckKBRAJ0qPXnxWY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722602374; c=relaxed/simple; bh=j9aItDIAJCTkp+/m6vVw4RvUAw7Ot/73JH/cEskF7ao=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=dgextnBYBWpQtbygfiYxVQQ9T0A/c18i/8ZzimaPadqOo2oXnPqUU/MGCMuYgVhVO4otODeuEhVTPCykMMCtN20utSUGwvQSCDGj43x/BLOZv3E09WlLET+Dwsk/gROKKOUkn84br3Bes2W3qx73eRQXpChIwbMujBdjzeTRaY0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=ME22Lm8Y; arc=fail smtp.client-ip=40.92.40.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="ME22Lm8Y" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ICWdH8t4pE1sUsZBghnfcx7ZF8kzTseaOWE+XapDBkCVGzDIXYZZqQ/Vz2YfF2F1UjVroIdIowYrvS/Y9U488/RidQvkSQNSdHAWvPcquj1IWfx+dTXhmz9oQul6MAwT/+NzLQPTZzo1nJhuZlTI9lMp43bJpLOGGcpLKSHkDxO5dO104DHbejQz4lcS1Ovnir7vD6IJJ4sPM8amu3rm2pmta2Vwus5oLDO/CmKuX6Lni0BdOU+XPkBRuPdtWyQFB/m+fQaOGwvpwQaqQTOLbsuWSPM/zT57fMsyBBcIBnmtr77kBM5VTwna4cEwHbhblu021xGtAEuhHlETCVEweA== 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=FSi43Gs9SRy6WaiuTGqhZhhKO324I6T44QfcC+fWqLA=; b=J87AZ8DSMmup4zDcSgX2BWrIjarGv66Kdnmrdftm8BKzTQLZqTYipztuSudPeSQrA4nQzkUEer8+2KIV5HZIjT716OC8m2nYV3bEv023j/Y0AGvKp6OMwjzdA43Cq0DdlU0oSvqXWqtKCFJJCBGtTERtkUTPFL/PkzXKFjOBh6F/yq2PCsiAXZlKiBE++0KmLh1y1Vj1lrEXqa1JLY0/Z/AuYEXMKlpyFJQbck7gUK1LAqjOE675cTs+solPyX96XhgzwgHIZTjKXVHhuTCsetrClMTplLlA7bgeLjcQgRaCsqp/txczjCKM05EagKi1Z03jCLrjWf5MvGs8+/6cEQ== 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=FSi43Gs9SRy6WaiuTGqhZhhKO324I6T44QfcC+fWqLA=; b=ME22Lm8YBF4lsi9xRME1mGyU6bBUKJvR280P9M75n15n4ys05WQ/v4G/elxSk1puLCV0SRl+4IAdsU6dRqMtFDHpX4NYL8W5t1t5BWj4yY/E67lJI5vQOC96JV5h/nq5BatU2yIREAG2AGpLevMLLqgN1n890mj13ifHWuxwrn5VqTOn9D/oR6/hXQ4K1inWyuoMT3ywPBIAMsljTEmyyVoEw6MVcB0FN8cR+AdIPppZgQTEBJs2fL73LPbHrkubchTMz2nI8joYzzguOeheMneXPrgOebhDQ7OfZLfFESCTGKKIS48k7QEbUGINvb5ZS7LNMqethgNJ3cqAYB7vTQ== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by CY8PR20MB5499.namprd20.prod.outlook.com (2603:10b6:930:55::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Fri, 2 Aug 2024 12:39:27 +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.7828.023; Fri, 2 Aug 2024 12:39:24 +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 , Jinyu Tang , Hal Feng , Yangyu Chen , Lad Prabhakar 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 v9 3/4] riscv: dts: sophgo: Add mcu device for Milk-V Pioneer Date: Fri, 2 Aug 2024 20:38:40 +0800 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: X-TMN: [PB92+DM/i01iVo2QEvzMVFTfJjwLlZDap928otyEC+4=] X-ClientProxiedBy: TYCP286CA0368.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:79::19) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240802123842.1492286-3-inochiama@outlook.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|CY8PR20MB5499:EE_ X-MS-Office365-Filtering-Correlation-Id: 2aad688f-b250-4564-092b-08dcb2f023a3 X-Microsoft-Antispam: BCL:0;ARA:14566002|19110799003|8060799006|5072599009|461199028|3412199025|440099028|1710799026; X-Microsoft-Antispam-Message-Info: J9DTAsyK/qlpWt1/QaX7+2qq1GUI1yMWmhC4jwkbmf1KDq9QeMff6LM8XYzdm5SMMK/GFli6Lg170jHd1AbznWPwhTh+oACUL/sZN/vb6uKcGb5Sf8VjH2CG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TLcknGwecbjNW4lx8AW6H2gbUKCx+9Vdz5H5AuHiyv7J0IFbgazEm2rot0scE0vMltqdXM9kzwDPKc2ZfobCXtn2EFSHzav5H3y+OHV6JOlh0l9JOPdB8nU9QtAUNKxJxzbNdR122OhFNd4ZpjrzVfhugz0uZSIguk7coMxVHXLAv8pHaWWHMpjCR9Qy2O/K3/YZOGhjjkVQ7SwvJNl29dYUSGCoMoYbUVWpr+sZxM5WQKnBY7rw3dKizHOxCs9WGrhGaH8cOA/tkqaAcuQrW4U5pcUGfBaB2mgDUPf2xKJ1xPLhoTmvtWtOoiynvtRsPoV1A4fDsX0c0MkqcDf4ZMZemrCxAC/A+xpVXLKHcbJ1L6srS+uXQkYI7cTojF0m+RUPtWn0xazmRNCiD3yCfPdOoYoWoiL4L4Onc0mg+sm8MRLUmSX8s/yh54FcBg7awGCrPOTB7wlP7rBcOP+i2aCqeTrdNGHiwN2I0+l0lnoZ1prCQLmjjEHiP3f7kFN1It5gRV5DQChvVNiN5tkJxyXyaKS+J0r68XQ4w0w4Uxwpu90SNZ/DKeumdYDLQfLrwxT3MM54imaKOw65FJz2BHt/PsmtruDONrtrm/e1hIpfmIlyKXD6JqaWK3J91tm7Nz+CViDrEgVGB9917E8BPKuXlDeUm5iM2QNRBhmHhBpKaUxxK53dWiPPlEYpxmp98HvRbI1yWyWygVseD64EpuqLc4g5PRdB26UYYh6osnaIGWXESkhY0cHruXQo5ap5FmLRb8XTd4beXCin8Ba1B5Qs5mJosDx6InIuUOP0diNHGu4t/v5TPvJsd2ZN/kXV+bBqhlUwCuaw82gjhgv2ZZJM X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2aad688f-b250-4564-092b-08dcb2f023a3 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 12:39:24.2765 (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: CY8PR20MB5499 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..8b8fdf6243d4 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 = <85000>; + 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 Fri Aug 2 12:38:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13751533 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10olkn2020.outbound.protection.outlook.com [40.92.40.20]) (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 967331E3CCC; Fri, 2 Aug 2024 12:39:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.40.20 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722602376; cv=fail; b=VY8la2Q8GCUZQvXYJrVM88iPbEdTD3Xfz0zw4P8njZfTItgqa6ZdJps0cVdgqDkGDk5L9rWqWQn5bbj6BJ3dChWgWnnFw8uRXqou73i9PWrExfCkXlOguw4IVrbzzdHjRJvVi9lZUZogE+jiQimDwzbBLqj4fWoAntg8J1IJues= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722602376; c=relaxed/simple; bh=ky4hdMO5Qo20h4lLnPTmtodE2ab1YlFe5yheyv5xp6A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=tAG6v+mwjO3S8sUC5mrAMYZCAgGIoGkgvXYH+0Z+WcFVlq/zbqkPBg2g7uSCbknhFtSva5k/uBLP+uxla0bYyVepoXMAwPF+weIDA1dk5IPow6O3jv4qvA91RZDVHBp9b9eckSeDu5tomyjBbcEAluI5trdaWlH1YxssPH/vOio= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=PQTfS8dj; arc=fail smtp.client-ip=40.92.40.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="PQTfS8dj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b+PF7dbwuZC/IWrHnR+SBSFZwr6BBO5MEes0XRasWG/3cIC0SttPNNBzCUhJY7mCltJrg0v/37Gy3KDivSXIMh+HJETLZEzS+snAYi4kkC56XjgeRXnD5xt80PqRdsh5nq3In6BK2CegNlwPLT0mymD5SDZ/yvbBSfd7mzI673hrXSAscJMFd7Gj5GSsir/hYY2NckYy0aDpZ28bJ7pNFkm2yt1jNxzoyxB5eaT4OlFDyYNbWRBIP0/2WshtpGHOoe3IRgAIAsotSTM9zboXNTN6XUX4knkxY87Le5VKSXu/3GxKEbLOVqY0a79/Zt+7bxEc70vrm4v+yc5eBlB/RA== 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=oKfJxZpv2S9cJDJFBoxogiufiOfYodWSGVaJ2yBznh4=; b=S/7VIL5ziKxUKgiQTxfp2jsZh8VF2+JDO0YXYbrugeBJ+u/VZBZKWFRFxBanjkgo5LtF/CnVQssJyCFzr3JIo53IX4e8FeYS6Rkpce05eFEhxtUo+UESDrx7FtOkE3vBlHR1AoYZ3/BM6+rl+ufHgTlBH3ShOFfv0fyKyxjXY5AnMWgCN7q+V8kp3fGQ6fAwZM2tMsTzoMIG6czz0avnHpBaDY9QnAHTaZ0FDLSH7n11lD46DhLenE1hdlc32iBVqAgDV2pDPPmiGLtrpu7O8i5xNyQUuweAc8Z3wSrDoGfaMEoIbrVxIs7C8bmesw3CJ6U5ghuDvP1dnFBSF9kCig== 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=oKfJxZpv2S9cJDJFBoxogiufiOfYodWSGVaJ2yBznh4=; b=PQTfS8djiRjT0PSCkkZWw79iG5SgPlbAHLPzbMyZ2UjwY9+cx5oMHJnf9oyjPDeLN8rlSQ0OWuIpQDAWjBm/QmSNEmQm041WalttbEe/eyd3MKLT9grtnNtMt6jYw9D0maB7oPjUX7j1xJj3puc3rsc9oDkCDVb3M6LsY1xX5wPuCNYWt9+qRqpMfKFNGhr9TOUoMOJiTruLHvxOkEYiWbPv/FjumrCBUZQG6yNVgBpA2M59y2MKuvlQ+DZ4wK8L6T/sILa4oOfOauz7B8V4SQPOuKY0THKVXBleGAOOrxUL0WlS0P0rm1iFgpoKRGHwG9HaxsN2tNSk026vZs822A== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by CY8PR20MB5499.namprd20.prod.outlook.com (2603:10b6:930:55::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Fri, 2 Aug 2024 12:39:29 +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.7828.023; Fri, 2 Aug 2024 12:39:29 +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 , Jinyu Tang , Hal Feng , Yangyu Chen , Lad Prabhakar 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 v9 4/4] riscv: defconfig: Enable MCU support for SG2042 Date: Fri, 2 Aug 2024 20:38:41 +0800 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: X-TMN: [ZyDaK4cupEPhm8YJys4baKMhB1R4Wvbih1W+t03Lk+0=] X-ClientProxiedBy: TYCP286CA0061.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31a::13) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240802123842.1492286-4-inochiama@outlook.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|CY8PR20MB5499:EE_ X-MS-Office365-Filtering-Correlation-Id: 35132327-4aba-4d3b-8029-08dcb2f02688 X-Microsoft-Antispam: BCL:0;ARA:14566002|461199028|8060799006|5072599009|19110799003|3412199025|440099028|1710799026; X-Microsoft-Antispam-Message-Info: 7e4/caVhvzWU5O88+fmuwBXrW9H3KCguEDOrK6tzibEwM7Q/zVCBH3hxtLXez3ayWLgAtoObusN9nU0tMMm0tP2JAakT0jRHG/ks3vUWqtI4yjhQdmn57BjFUcfE6jeTqUsIRxHhN5vUKl2l4NH17SW8wq+WdTymHDjYLsv+N9tkW+I5jAtxDV/kFVH+JwdIZSiZeOU90tHbmGzFI6l8/yg4+e6vcbWPdVD/0YZoVCWNwyJbjrWdfh7HhD2lj0/v1rDKvvNTo13QEA3V1uE3at7+UeoeFp0LuXXyATaK3SRhFSi8kRm6XjuF5fsrey10WAUlcEXm/h3HjPbKJMUckAotqp8DJ+8JroGikrhDitAkM8w+eg/bBDN4WFu9jubdAAZ+nu9hIDBA7gP1j1VAP3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+qPQ7dTS1fSqZNDHJgMsPu9X2O7tpTOMuf481/knrqYWZx+HY3i3+7k5yO8KnSVUI0hj+6GnZmNBv4vnyO6oflAwW/a+pgY0irFiCzHz1CUPVSpkSz8p4XW6cIo8/puziaov1u9BPp3g2AZDGzAximxK35EydsZDMd8ff36an51q0GvleuThqEnW/t+Ono0ncJwSXIeM2LYioPDBlpbo9aQEwkR6OZF5f4PF1GrJ8w06dRHUFJETDS6ke0W52VzSPL8W3oo0oCxb0V+G7LaCXIyK0c4ofBFDSeVn4OGmDnFNi/p4coTYgvFXnJM0lXrzMqQJI3OxPfIn/7BhJlCcPjBuznVKnzUpEt6xLaeyrVW6qwX8ZWGeeYMs5dj6Vb4Gu+I/0Bhu5fXBlu6P1xMvPQ9pXrMm3jXAtjXpTchXLF85zXTZjFW+0Gr79LEBOKgx7wJH7FsMBc9QwYFAvG0IsUMY6iZU7io42JrmunrbLtif9ML6+Mi0Z0NizLx6xSSHSW0+CXwMC5AD5HWf014vXqTt9v+Csp6sH00Omq0HAWcwv1a7mILR2vbk X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35132327-4aba-4d3b-8029-08dcb2f02688 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 12:39:29.0125 (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: CY8PR20MB5499 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/boot/dts/sophgo/sg2042-milkv-pioneer.dts | 2 +- arch/riscv/configs/defconfig | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts index 8b8fdf6243d4..76375e25a495 100644 --- a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts +++ b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts @@ -67,7 +67,7 @@ soc_active3: soc-active3 { }; soc_hot: soc-hot { - temperature = <85000>; + temperature = <80000>; hysteresis = <5000>; type = "hot"; }; 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