From patchwork Fri Dec 24 04:13:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quan Nguyen X-Patchwork-Id: 528418 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79D2FC4332F for ; Fri, 24 Dec 2021 04:15:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351289AbhLXEPP (ORCPT ); Thu, 23 Dec 2021 23:15:15 -0500 Received: from mail-co1nam11on2129.outbound.protection.outlook.com ([40.107.220.129]:62497 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1351310AbhLXEPN (ORCPT ); Thu, 23 Dec 2021 23:15:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RB8AD2DMLBO8oPxXWfC5GXNUnPeZJvRuq0BCjFHOVBhlk6e3L/k4eh2rq/6rtFfbaVAG3l8KEwf1111Q1KrKxeJV2oPU+CmiVXbSyZxYqGcO7VkuhGOfFrJI4lkid39nSxH37/4QIVPddoFu7YCgAbg2aawvAWhf2bTVoRMEmZyeaiUi+UrWejAPmMu+++tQ+LrfWpkbUuga3teAPhUnV7dMe5+pamXEElsCxuNLAkoFvGB/D4M3ybcHNaX5vZOxGo134L4Tv8MOVlIQVi7USOF2tYphS5rc3wyDX7b0Xh8TCg2t78LUeghYP2FbInFx9AxBFWfm/wOYU6Notnd/iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=PA0QHP9i/CMeY2RF1/2Xxuy8kD0O7t9IEvOb0icWvS8=; b=Q20dLyA4Umx6pB8H3tvQEaa5s5rj0iVYU4ejEUrrTB7doufyzdjIad1n/TWclfWznues7MpeHhsQEsTDl9BiqwIg8QE9qjSUdeyctTULoiRYq2JUWHgMyx4fxYafooZ03eNcoBJMJXDx7LMqG6LembE0dtP6bFZ83gNCG+D5lnoGlI7nhaU89xMRqaYbihAnC4O6zs8Y2q4s5K+K4exJiR6N26TYLnmXks/Cc9QEjfF85+mOnPl2pP3WD70R2Tv5p3UMitSFv1TuVm9XJ7+rn7a7zYr5ncD3sNCn+37o7D45suBdHSXz4c/tadqaz4gBDBeERWIsyN+G8Rh08Viefg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PA0QHP9i/CMeY2RF1/2Xxuy8kD0O7t9IEvOb0icWvS8=; b=iZYBqDjYgSKbwhvmTjMaae7A3QbpE3LMdV7UekTRs1LdRM5fOzTfcE5cZt4j8vIP7EGwxiKaVOa8mMvKGiTwbN9uRu/ApwIoAahYeRV2YieUa3O4mqn11VKOixJrM9Au65Myoswh/DZV3nvVoRiq4twjQbC3kfHfHV5xKjLmK8U= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ0PR01MB7282.prod.exchangelabs.com (2603:10b6:a03:3f2::24) by BYAPR01MB5189.prod.exchangelabs.com (2603:10b6:a03:78::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.21; Fri, 24 Dec 2021 04:15:12 +0000 Received: from SJ0PR01MB7282.prod.exchangelabs.com ([fe80::f957:680d:69b0:9999]) by SJ0PR01MB7282.prod.exchangelabs.com ([fe80::f957:680d:69b0:9999%4]) with mapi id 15.20.4801.019; Fri, 24 Dec 2021 04:15:11 +0000 From: Quan Nguyen To: Joel Stanley , Andrew Jeffery , Jean Delvare , Guenter Roeck , Rob Herring , Lee Jones , Jonathan Corbet , linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, Mark Brown , Greg Kroah-Hartman , "Rafael J . Wysocki" , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Gustavo Pimentel Cc: Open Source Submission , Phong Vo , "Thang Q . Nguyen" , Quan Nguyen , Thu Nguyen Subject: [PATCH v6 4/9] docs: hwmon: (smpro-hwmon) Add documentation Date: Fri, 24 Dec 2021 11:13:47 +0700 Message-Id: <20211224041352.29405-5-quan@os.amperecomputing.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20211224041352.29405-1-quan@os.amperecomputing.com> References: <20211224041352.29405-1-quan@os.amperecomputing.com> X-ClientProxiedBy: SG2PR06CA0134.apcprd06.prod.outlook.com (2603:1096:1:1f::12) To SJ0PR01MB7282.prod.exchangelabs.com (2603:10b6:a03:3f2::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f39db4d-fd3b-4cc7-a66c-08d9c693fa57 X-MS-TrafficTypeDiagnostic: BYAPR01MB5189:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YfBfS+6vMEffASpCHdYb8ULeey4dz90sAduJQ5aOQ4w0QItxqcTFg4yqkE0SFZJXtlj0bawhuL9+k9/THanGgwUXj+mIB4N+Gr7Dum1Rmfg2EpnTqWPFiH8dF4WsrFAqYx1X1OPx2X5ipdHZXws4EqGSKtyz874g+oQWzqdADc2QklXTEqT6KZp8D8l8d42BA5AdVWI9xTRy1fOpZXYbO8+Xxtb8K5GQqc/11ZSVa56/Dv4iAzBnaBZnCcSYaDu7XoRIv5wjY0E+fUmQe1j9zxPBx8D07OD++7COwlY7qQZle6LGJ9rtVaC7U57MgCFpPAeNTzi0+bo74/mZ3cGen1ZMaIC/y4iBpXy8ku/djZGeAdAt26k8/CZU3LivAc/xfbzvGvZU/ywXrjCglydQ0MCG6TCa0XGFKXljn7Bvw1TTmbRZLjM2Yrrj7IyhrbooDiJlIMZMkpLNZCIIlapKw6/tMOH3GjhEI4ozXdrgQbdhH0bxkna8jv/FP/DrAML/YFtFY4HtJsdffd2A6zSvV4D04b9nsG4DEJYP5DBpN/B1Q72EySHiJTj5Sglk4pwYDwAij+2Kab98h4sKnYLzQmh4TWpb5WPE9zJMIDJUkr1NtygGHR4mEeqn5dDSUs3jugYZLrssEC/o5gm3S6dSNg+voz4UsabdEjecT20B5QOyQMKiy6G3iuzfU5DZmiuVOYsJxFQ3KnwqW/NQtn1Ipg7ERkZKTv39npHjkUUZoGk= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR01MB7282.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(110136005)(54906003)(86362001)(38100700002)(38350700002)(83380400001)(66476007)(52116002)(5660300002)(107886003)(2616005)(8676002)(66946007)(6666004)(66556008)(2906002)(508600001)(1076003)(4326008)(316002)(6506007)(8936002)(6486002)(26005)(186003)(6512007)(7416002)(921005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UjSzoc6XbuJd+WnlZJLDTPlXHfsN5fUm6HULIaYTbiPApEiyS5bwfhbQZBpBTt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eg1qzXB7qrje2KEGl1Cte2BmiZpRe584kzxf+ShNOx0QcO2/mf4eWu9CuEUJqHF0ls+PZo+PScLLqV+ko4rQ1Re4Xuacol0haGJw0U04LyXko4Pfe24WHvvtR2dZjL0ruUxqTa56djdahY9Qq/5637v0osctQxyXfS1LbSKT2h/SNmu1LAaXuI2wIOn3saqcdcGMmcuVT0bfgYTjC7Nfq7gKCB4CWCyayAm0NDMYguKXoIz4qH7il77r+lh+HlBqhyKlGTaA5BWADTTqpLjvpg3gmX35qeA9w8HW3FrKcLEnei4FSuQi3TezXtDB3Te/ezFEyv241jkMO3PqHHS5tFGpvBx14US0DiR2CrJiWT8L1SIdo+P+K0MYZp1Cf6hLXKkt0G8A1B84YaEVEKTmGsFSHY2H101Sh2WEq9qUqYK+fN8cHu7xMLMK4vgQEPk72dZAtaadyxamlY6F/MzR6UagJS5G9/BaMMD/ULTBVPgUOEtrK3L7aX87DjfEyOFNCFnRKk3RSI0NwYOlcqxjXYr79/D1kXRfzAKQ1VcDHM4EHIzKpM8arA2k8bDNB9ADjJgI= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f39db4d-fd3b-4cc7-a66c-08d9c693fa57 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR01MB7282.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Dec 2021 04:15:11.8125 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oMSwh/6JoVOi4QYZXClBBIu5TL2sewtSacO5whEPugqxe8mUTprpsOZ++KfrEsAxm418eQ7XuvlXAYRXvz6TnEzWHD3zM7+Am2nuNbGZ7S4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR01MB5189 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add documentation for the Ampere(R)'s Altra(R) SMpro hwmon driver. Signed-off-by: Thu Nguyen Signed-off-by: Quan Nguyen Reviewed-by: Guenter Roeck --- Changes in v6: + None Changes in v5: + None Changes in v4: + None Changes in v3: + None Changes in v2: + Removed "virtual" sensors [Guenter] + Fixed typo "mili" to "milli", "nanoWatt" to "microWatt" [Guenter] + Reported SOC_TDP as "Socket TDP" using max attributes [Guenter] + Clarified "highest" meaning in documentation [Guenter] + Reported MEM HOT Threshold for all DIMMs as temp*_crit [Guenter] + Removed Socket TDP sensor [Quan] + Included sensor type and channel in labels [Quan] Documentation/hwmon/index.rst | 1 + Documentation/hwmon/smpro-hwmon.rst | 101 ++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 Documentation/hwmon/smpro-hwmon.rst diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst index df20022c741f..79d1b8023186 100644 --- a/Documentation/hwmon/index.rst +++ b/Documentation/hwmon/index.rst @@ -180,6 +180,7 @@ Hardware Monitoring Kernel Drivers sis5595 sl28cpld smm665 + smpro-hwmon smsc47b397 smsc47m192 smsc47m1 diff --git a/Documentation/hwmon/smpro-hwmon.rst b/Documentation/hwmon/smpro-hwmon.rst new file mode 100644 index 000000000000..f978b1370e16 --- /dev/null +++ b/Documentation/hwmon/smpro-hwmon.rst @@ -0,0 +1,101 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +Kernel driver Ampere(R)'s Altra(R) SMpro hwmon +============================================== + +Supported chips: + + * Ampere(R) Altra(R) + + Prefix: 'smpro' + + Reference: Altra SoC BMC Interface Specification + +Author: Thu Nguyen + +Description +----------- +This driver supports hardware monitoring for Ampere(R) Altra(R) SoC's based on the +SMpro co-processor (SMpro). +The following sensor types are supported by the driver: + + * temperature + * voltage + * current + * power + +The SMpro interface provides the registers to query the various sensors and +their values which are then exported to userspace by this driver. + +Usage Notes +----------- + +SMpro hwmon driver creates at least two sysfs files for each sensor. + +* File ``_label`` reports the sensor label. +* File ``_input`` returns the sensor value. + +The sysfs files are allocated in the SMpro root fs folder. +There is one root folder for each SMpro instance. + +When the SoC is turned off, the driver will fail to read registers +and return -ENXIO. + +Sysfs entries +------------- + +The following sysfs files are supported: + +* Ampere(R) Altra(R): + +============ ============= ====== =============================================== +Name Unit Perm Description +temp1_input milli Celsius RO SoC temperature +temp2_input milli Celsius RO Max temperature reported among SoC VRDs +temp2_crit milli Celsius RO SoC VRD HOT Threshold temperature +temp3_input milli Celsius RO Max temperature reported among DIMM VRDs +temp4_input milli Celsius RO Max temperature reported among Core VRDs +temp5_input milli Celsius RO Temperature of DIMM0 on CH0 +temp5_crit milli Celsius RO MEM HOT Threshold for all DIMMs +temp6_input milli Celsius RO Temperature of DIMM0 on CH1 +temp6_crit milli Celsius RO MEM HOT Threshold for all DIMMs +temp7_input milli Celsius RO Temperature of DIMM0 on CH2 +temp7_crit milli Celsius RO MEM HOT Threshold for all DIMMs +temp8_input milli Celsius RO Temperature of DIMM0 on CH3 +temp8_crit milli Celsius RO MEM HOT Threshold for all DIMMs +temp9_input milli Celsius RO Temperature of DIMM0 on CH4 +temp9_crit milli Celsius RO MEM HOT Threshold for all DIMMs +temp10_input milli Celsius RO Temperature of DIMM0 on CH5 +temp10_crit milli Celsius RO MEM HOT Threshold for all DIMMs +temp11_input milli Celsius RO Temperature of DIMM0 on CH6 +temp11_crit milli Celsius RO MEM HOT Threshold for all DIMMs +temp12_input milli Celsius RO Temperature of DIMM0 on CH7 +temp12_crit milli Celsius RO MEM HOT Threshold for all DIMMs +temp13_input milli Celsius RO Max temperature reported among RCA VRDs +in0_input milli Volts RO Core voltage +in1_input milli Volts RO SoC voltage +in2_input milli Volts RO DIMM VRD1 voltage +in3_input milli Volts RO DIMM VRD2 voltage +in4_input milli Volts RO RCA VRD voltage +cur1_input milli Amperes RO Core VRD current +cur2_input milli Amperes RO SoC VRD current +cur3_input milli Amperes RO DIMM VRD1 current +cur4_input milli Amperes RO DIMM VRD2 current +cur5_input milli Amperes RO RCA VRD current +power1_input micro Watts RO Core VRD power +power2_input micro Watts RO SoC VRD power +power3_input micro Watts RO DIMM VRD1 power +power4_input micro Watts RO DIMM VRD2 power +power5_input micro Watts RO RCA VRD power +============ ============= ====== =============================================== + +Example:: + + # cat in0_input + 830 + # cat temp1_input + 37000 + # cat curr1_input + 9000 + # cat power5_input + 19500000