From patchwork Fri Apr 9 03:13:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quan Nguyen X-Patchwork-Id: 12192897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 226B7C43461 for ; Fri, 9 Apr 2021 03:14:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F188B61159 for ; Fri, 9 Apr 2021 03:14:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233233AbhDIDO1 (ORCPT ); Thu, 8 Apr 2021 23:14:27 -0400 Received: from mail-bn7nam10on2137.outbound.protection.outlook.com ([40.107.92.137]:46785 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232918AbhDIDOY (ORCPT ); Thu, 8 Apr 2021 23:14:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oYT+Sgu9PR1//jIHRy16nK6d+8RMvGoo+biyV2zhRxsuboT0IRMYNd8z/+S7DSxovSDjU9M2rsi6su0yX74LCY6WOyLbLCVcmnT0m+zPOF3EesF1vA67v03GmgFdvHBqz7hlvVW5Qnd1nNxuJzCin1gdva87/UDBIz4ac0DFv1jaM8LSan8H4pjcjtwFGj+ERR3fiMeaGKneREXJ9+uIOVeyR9PIAeE5LTUB/zWBfLcBmGOEX6T5PrbV2N1EkSSKX0VwQTmPDhjSGInj8aH1mQXlaO4mbCblIVA9uK3PfZlmq8AOz/fLAz+4XTVuehSz7fMain2zelnGJpaOAVZpxw== 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-SenderADCheck; bh=RBVSOQre6GNvan9CYMBo1V1qm6TAfhvhVmTPmLZFnPY=; b=nrRSRz8qLoAW4WwmUcMDTksZGMmmcQSk4Cxuq9aAXzxIdKiJOZt6JVKKFF52non6YpGaoxRJ9tTDRN3jgS3NE9ahHOikJgOHHmU6vGqNECNee5jx22R8eWERrSAy4wPPSIrKJFeyVbpN7qwKJ7XqcQIKiqEjbwck2Fsz7ZHS8THuNxluOLDAgWT2OMg2YJoeTDw4ZB61RmpPBVYkori6MR3NcF2MRnotOfSWKGWIaW+7WOeLDWTvADkT/bb2FRKt1+2dKpSXhQJn15eHNwXLuZY2D6IEKrnx780QjIr2gGFhEgsqfdJWcur312DsOnJZPg/YAvgm8u1WcgK1b20JfA== 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=RBVSOQre6GNvan9CYMBo1V1qm6TAfhvhVmTPmLZFnPY=; b=orHn4pGGCE1IXdxpq/vLsHK3bvG1X+VkZtbKb3m002qwYh60k/8moCSYHdFSJzhrH6TSpVqKv1+kga65G6sOn1zm78mUstP4dP8qAUxPbXOb3Goh2nlLIKOESInbKXHJLmphOdirjpE/VHV+xegycQCA8OeBWw+Cmr0v94Bdg5I= Authentication-Results: jms.id.au; dkim=none (message not signed) header.d=none;jms.id.au; dmarc=none action=none header.from=os.amperecomputing.com; Received: from MW2PR0102MB3482.prod.exchangelabs.com (2603:10b6:302:c::32) by MWHPR0101MB2991.prod.exchangelabs.com (2603:10b6:301:36::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.26; Fri, 9 Apr 2021 03:14:08 +0000 Received: from MW2PR0102MB3482.prod.exchangelabs.com ([fe80::d840:7aa7:58d4:b503]) by MW2PR0102MB3482.prod.exchangelabs.com ([fe80::d840:7aa7:58d4:b503%5]) with mapi id 15.20.4020.016; Fri, 9 Apr 2021 03:14:08 +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 Cc: Open Source Submission , Phong Vo , "Thang Q . Nguyen" Subject: [PATCH v3 1/4] dt-bindings: mfd: Add bindings for Ampere Altra SMPro drivers Date: Fri, 9 Apr 2021 10:13:29 +0700 Message-Id: <20210409031332.21919-2-quan@os.amperecomputing.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210409031332.21919-1-quan@os.amperecomputing.com> References: <20210409031332.21919-1-quan@os.amperecomputing.com> X-Originating-IP: [118.69.219.201] X-ClientProxiedBy: HK0PR01CA0054.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::18) To MW2PR0102MB3482.prod.exchangelabs.com (2603:10b6:302:c::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from hcm-sw-17.amperecomputing.com (118.69.219.201) by HK0PR01CA0054.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Fri, 9 Apr 2021 03:14:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dbceae35-00af-4891-f6a4-08d8fb05880c X-MS-TrafficTypeDiagnostic: MWHPR0101MB2991: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eNIFAWzcL2JCR1rWB2UGpfTu/4g+eq5MwIp1o3GJgVBmzPDoEFiZ/tjorGTDLr0neorlpLmdlGL+CCxirDxS3pOV9HfRGEMe6q/G/jUZ24ANwRHZcLJgmOUAy1i91nDlqET7b9WrLRjQTTXOmBzgM/RI5c2dJp+ycmfqXrD8KzTfqEuFz4mIpCmTYy2FuvG/P3DX7bbyM3cquvfIe4ETIj+kNDYK+2o7QP5gzA0MVClI02GUS15CsOcb6xPgGetmFXPFu/smonaXu4z8agqnwuDEqTBqlW6e3gzOfS9spJbFaKGer28SJctLLpu3Gh/9xyBpkQ8ujUALX7Hz3Z5juLr1PBysGIdreW/EXYFnTH8edV9WRC6TdCdxaoBF2ql6hBq01AM/hdQF0HrYCE0u5/K4Ip69fuxWaXV93Ph3AimKZWerXQ12DMgbrs6bUYcmVuiFgcU0jpKsRiWFXj13j4KyBHjkz1kMQ+xNEDSZZ2L2wWxzrzHnKWipSwpT8KXAQHiKOMQlA/OxKKH5scXaapFYraybHoOf6gIyfsJ/o2Ro/3crPFU1V5bKKt4zz+W/rG9mr1isLqlfa2SmIQbwb9M5PN5o9tnHFgwc6omGVLr2R9QjeJuX2Z++o5gpYksnYM9BNJnOobCy4nmG9BbFHhCJ1Ys7cI+KxZyqPtXdjifpOxHb8JEXhc4uib9TepqBgUJ2qttJGCpGduInqDSwfnU6xi4gmR8z4sQDThmS1SqR6L4h7wRU0JF+C3RvmeabJzUY3/uEK6kOJTELVD7R+g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW2PR0102MB3482.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(39850400004)(396003)(136003)(346002)(376002)(6512007)(478600001)(38350700001)(921005)(6666004)(26005)(316002)(6486002)(1076003)(83380400001)(2906002)(86362001)(7416002)(186003)(16526019)(6506007)(966005)(5660300002)(107886003)(38100700001)(4326008)(66946007)(956004)(8936002)(8676002)(2616005)(52116002)(66556008)(54906003)(110136005)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: yhWugmoidZFKZzdQbJCUuWRdWlvLWrMiCDl+5aCgsnNDTXNj7xDVRfhbtXAL2u6+6AJhNWedlCgArFLD8TFj8ZuYJdtfXhN5dxgTHKQJRel7l4FB7lCcUKIknd7PN/HQ0aivQm0gnZ+1WCZdImJbyDlGXSubqk4HkqQpTZ8tQ9j51KCoZckKb4OSIvN5xyAcwypEOXkJrZ8zYBqDDMmpvhdPmcJbTTXk0xyaGuPVqxhy2Fsskf4zneiAe6GYVlsxKypYtErLMs9pq64mywA4hkeCZLrn339QE8tSrdfe6I9Aqh7nrmS8lcTz6mwbfadYNz1tizpfcr6NriJfEI+QQWr6JNXQmybF56chfk2XiXEgaxPNg0vIdMvoPvOjEPhs8gjRbg2KqMVrvDporWcBOOY76oTtBRXik4TUKwLRwK6MKuFH95KXP/gIEWC+xcVP+hVjYdxEk42weIlx4v9BHci2jHufjHKiMh7p8+PO0cbzBnCXU80TgO8zQ//KPvN6yZP8H5M/v5dx4Q+H3NboAh/a3YS/zDP+xien6bLTpcruqziGT2SvMLHggzd7yRm8m4sxfqZlIi1zd9M4MM5Enb/i+NsIePKrLxccxPnO+5RQXAOPTyksuZVytI7uYYE6AmBIPako4mcXZW826mD8kDBt93+ydXjLnZ0p3Z2OarOXghOT1F9wcyvzHkg71+FXOuTuPvyYoxAbLpcNYTlPtzNjoAQaKtoCYDpVi029OedyZ/UlOgWc8VKFsBJbddy9rzg4nXDlUS1TehSPy6azq4e3hgzeO7c1MZpYZPsRugELItIeASti6RQM2+XHGB8yTFBjoLc9Sbemh5ip2K7cVgSPnhQ9na3l/P0mMCHmkViLjBG01Z9b3IjPwxvwnExtDxSckSFxmyLz0iTi8d8nPg6s/gUyhNt5xNGjmqtHcoKM887UvNSK1lvi6CKgKL2wE9iIjrUBJKxtR8M9QzQOsJrba77T0jEh0oABAATpL4qOkO0AOMt8GqyMGVvxjqg7JRPSX+CvuraFnez13og/KAzq1uCenHHBJ4WiRuxbOkyk68Rc5J5sIxXwdKX5SS+LN7YYxIWmB5PjqX8GSCIxIEN/xFKjNFW9/ynrZdDXTL1qhC/j62UGJb35dimnTEznt95Zl7Ro+snc56WR2y9ylOoOpFlCdQqfVn2lQVic/qSTVkGIkoQk45h7FF9IPgL9SVBs77Jgn89bjRulODJNIbLFiZdQ/M6oqzxVi5CUNvt63rWbGPJ49jzZkUmPjA2STMTvuGDQpoQgRPV598SypcGOHMTpaOY/N08OMddnY85+HURFsqkujgQdmT9Eyuri X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbceae35-00af-4891-f6a4-08d8fb05880c X-MS-Exchange-CrossTenant-AuthSource: MW2PR0102MB3482.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2021 03:14:05.2642 (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: ue3J/n44QGTrFPf/BuG9/M1RO2P+xZMNGDx7mLgcwuHtNvQyIDcQ5b+dB7xatEVwEKt8RnPhEFrrJDk+w4gQa9TQObecdQX9qH3JClBVYl4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0101MB2991 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Adds device tree bindings for SMPro drivers found on the Mt.Jade hardware reference platform with Ampere's Altra Processor family. Signed-off-by: Quan Nguyen --- .../bindings/hwmon/ampere,ac01-hwmon.yaml | 28 +++++ .../devicetree/bindings/mfd/ampere,smpro.yaml | 105 ++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/ampere,ac01-hwmon.yaml create mode 100644 Documentation/devicetree/bindings/mfd/ampere,smpro.yaml diff --git a/Documentation/devicetree/bindings/hwmon/ampere,ac01-hwmon.yaml b/Documentation/devicetree/bindings/hwmon/ampere,ac01-hwmon.yaml new file mode 100644 index 000000000000..fbf7ec754160 --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/ampere,ac01-hwmon.yaml @@ -0,0 +1,28 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hwmon/ampere,ac01-hwmon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hardware monitoring driver for the Ampere Altra SMPro + +maintainers: + - Quan Nguyen + +description: | + This module is part of the Ampere Altra SMPro multi-function device. For more + details see ../mfd/ampere,smpro.yaml. + +properties: + compatible: + enum: + - ampere,ac01-hwmon + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/mfd/ampere,smpro.yaml b/Documentation/devicetree/bindings/mfd/ampere,smpro.yaml new file mode 100644 index 000000000000..5613c420869e --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/ampere,smpro.yaml @@ -0,0 +1,105 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/ampere,smpro.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ampere Altra SMPro firmware driver + +maintainers: + - Quan Nguyen + +description: | + Ampere Altra SMPro firmware may contain different blocks like hardware + monitoring, error monitoring and other miscellaneous features. + +properties: + compatible: + enum: + - ampere,smpro + + reg: + description: + I2C device address. + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +patternProperties: + "^hwmon(@[0-9a-f]+)?$": + $ref: ../hwmon/ampere,ac01-hwmon.yaml + + "^misc(@[0-9a-f]+)?$": + type: object + description: | + This module is part of the Ampere Altra SMPro multi-function device + to support miscellaneous features + properties: + compatible: + enum: + - ampere,ac01-misc + reg: + maxItems: 1 + + required: + - compatible + - reg + + "^errmon(@[0-9a-f]+)?$": + type: object + description: | + This module is part of the Ampere Altra SMPro multi-function device + that supports error monitoring feature. + + properties: + compatible: + enum: + - ampere,ac01-errmon + reg: + maxItems: 1 + + required: + - compatible + - reg + +required: + - "#address-cells" + - "#size-cells" + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + smpro@4f { + compatible = "ampere,smpro"; + reg = <0x4f>; + #address-cells = <1>; + #size-cells = <0>; + + hwmon@10 { + compatible = "ampere,ac01-hwmon"; + reg = <0x10>; + }; + + misc@b0 { + compatible = "ampere,ac01-misc"; + reg = <0xb0>; + }; + + errmon@80 { + compatible = "ampere,ac01-errmon"; + reg = <0x80>; + }; + + }; + }; From patchwork Fri Apr 9 03:13:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quan Nguyen X-Patchwork-Id: 12192899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 923FCC43600 for ; Fri, 9 Apr 2021 03:14:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 656D2610F9 for ; Fri, 9 Apr 2021 03:14:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233196AbhDIDOb (ORCPT ); Thu, 8 Apr 2021 23:14:31 -0400 Received: from mail-bn7nam10on2137.outbound.protection.outlook.com ([40.107.92.137]:46785 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233190AbhDIDO0 (ORCPT ); Thu, 8 Apr 2021 23:14:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O8/xOYPjIodSFXZhczTSfuk9dxNYwWWJAG/NVj97ylMQUh3xzXOVgH70VozGLTnc/U3r+ncLQ2yzpJ/G01bB3ZjXlMzM1z2j0ZGPWGKqtLe7wQO8IgbKp69CAMMi1ivdtR16S4WF1D/OZ8KPUO7SXvxq7TOJxyt2ubQffEv3/ioFQEqw1+y3rVkB6QKcHocNSstc5M4uIJjF4rraRfSX0j3egEyuyHrnu+gneIdrNlNAQ8odV+NhcaH3OIvZwGnNY7JNOBkZ+upJjogGCaUN4ytypI/PgIm8jin4S7UzUqTPOMJO4xFGUaExnGt+xqKvWggeAKt2IFKL1VepUgUBfw== 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-SenderADCheck; bh=29W8ho0+Xw7Kqr3NjweadDw7HfMJk04fN+WYpLmVGU8=; b=JXEhmyHw/54UqPSe8OhzW22pHzZ6L9GXsv3XIZIKuhHyW5RLlvUuN2omIDpI/aDf35FA7zegk45W8YWzesScBguo0HtCMwch7Dqw7QdwCw0Yr4/tIW18Ne/C4EUhUOe/Mt2VrCCdfbIhrTXkTEHNJNqrY6pFk12dt5Tw9Zej5V0N8triApbKlibXxBmxU5mpQ6k5KkviI23XEpN5q8AOR44PJtJDJkLYA4Dj9Km3zXdGScOkdkNCUTR+mUej5p4RRtsY8RLuA0/9+O8TTGKnSmFBf1P/zrWHFAfb1K9PV3LZrRj38dtMt1n+AhmFuu6CwDRylvBfFa6PqBnpGDxPvw== 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=29W8ho0+Xw7Kqr3NjweadDw7HfMJk04fN+WYpLmVGU8=; b=hQ8yLdjERUtF+ofSqV39DdzZ2dyK81F7SrUI3p5QBqwoJGjJm1plXL9Ivvr85wc06/9E9ZMR/GofqH9yEB/iCml3laDu2OkpgdtNGy2f+eMlmhC/xSNRtxDptg/MVzbLHML0wRZgAztTSbP6Wwx4pRAA3iLuwXLYlHCWu3MCPRE= Authentication-Results: jms.id.au; dkim=none (message not signed) header.d=none;jms.id.au; dmarc=none action=none header.from=os.amperecomputing.com; Received: from MW2PR0102MB3482.prod.exchangelabs.com (2603:10b6:302:c::32) by MWHPR0101MB2991.prod.exchangelabs.com (2603:10b6:301:36::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.26; Fri, 9 Apr 2021 03:14:09 +0000 Received: from MW2PR0102MB3482.prod.exchangelabs.com ([fe80::d840:7aa7:58d4:b503]) by MW2PR0102MB3482.prod.exchangelabs.com ([fe80::d840:7aa7:58d4:b503%5]) with mapi id 15.20.4020.016; Fri, 9 Apr 2021 03:14:09 +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 Cc: Open Source Submission , Phong Vo , "Thang Q . Nguyen" Subject: [PATCH v3 2/4] mfd: simple-mfd-i2c: Adds Ampere's Altra SMpro support Date: Fri, 9 Apr 2021 10:13:30 +0700 Message-Id: <20210409031332.21919-3-quan@os.amperecomputing.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210409031332.21919-1-quan@os.amperecomputing.com> References: <20210409031332.21919-1-quan@os.amperecomputing.com> X-Originating-IP: [118.69.219.201] X-ClientProxiedBy: HK0PR01CA0054.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::18) To MW2PR0102MB3482.prod.exchangelabs.com (2603:10b6:302:c::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from hcm-sw-17.amperecomputing.com (118.69.219.201) by HK0PR01CA0054.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Fri, 9 Apr 2021 03:14:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4aef3221-474e-4ae5-e283-08d8fb058a88 X-MS-TrafficTypeDiagnostic: MWHPR0101MB2991: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bVSyDVNUJynUKEcOqk0QRtKXC+uEnwJ1hSyVtgWSXQt710UACqmBZal0BDjQpzPQ0dCnnZr5xp2aGJUGqRgfMC18hN6C2ADoM+LcCVv4BzcBee77eShVeX9GeemmDVq3Z4JFv1m8prtGNIKpNy/5VFkcIUS65LzFlagg7xL+Q2HE2MALnzXp6GEHoiPdT/5tqxZGFlKXP6NprjZX0ZH34ZbEgefnTj84LzS02BIga5vu8il+e44DrMRzVYwIWxe8IKKF8EB0LayZ7l9Ig0D2v6msMjgB3YNW1VzzMpZZ3StsjFi1B8gnVVorioOFa2xCvXs7ro8O0ftUqbPPLF1JUQdvXr76OdccA2RiRZbK2ys6JX0Eum6nm0CXokTcmCWEVSLKtvMMawQrg+8ie8WrGUBkDqAj0IRW3L78Xm6gU67tzitN0yP3RKRvsQWzxIaVLMmDkQJYVxeNX23M+XYEBUiHEmVwYMuJ7ei9yWGNUFgGtIJrtUVadIn/lX9itVxt4OlOTiQR4bYmiFrJ07EGsYvkZKGVu3S/zS3q4aVI0RuF3kn4SkcVcEDLs+oHPc3mF/B+KrxzxQQd8DexlZdAl64zhKtCRlaSr6AbTfRegQJxLxjKiWpVa/pdYiF8/smYNUax6iEKw2ikyXFSZyXNuwqOXCc3bIFHIxzEjpbs6cPwwrFHCMflRIet0W40xo4VARXjJIi9Kao33MfUAh7TWw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW2PR0102MB3482.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(39850400004)(396003)(136003)(346002)(376002)(6512007)(478600001)(38350700001)(921005)(6666004)(26005)(316002)(6486002)(1076003)(83380400001)(2906002)(86362001)(7416002)(186003)(16526019)(6506007)(5660300002)(107886003)(38100700001)(4326008)(66946007)(956004)(8936002)(8676002)(2616005)(52116002)(66556008)(54906003)(110136005)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: iivEg3YexNOACZDUXzZ7DmgZ5Fbbk7eJSpa9HY6KPE32QB9hOEGoaEBSSMSQeeUCjoOeXxkLGGYCHdtnEDyS+uSNBx8HlvMvh/Zy+QKlw932uv6T2+1djvKIC71SU5a2RPZsWOg2gBcDoMjgZyLDiK3vMMyqRXqTuZqMS8b5a6GlXApbKA+sFyDh0hgNFO0DIzsBSulZkLx+dM5olpjUzHWjphjK9x4ma37oIeW39iDuNLsl4PR33hG+NEoHiDdSUb/jMrXZBWj2O/mT/k0//7M44FLOUvtwookx09ti+sKgzzFZ1pDuP6qQlOWI6Qx///WbPawzR7dUi+y0WeuRi5EZQc64I5H4LpL0ltr4/Cu4d6amILzdbU2WKoT1kzo/oaAciz+8DdfBX63+gPJzTXhQoNxfptN4lBlp5hOVbtDcs3Iyq42LIGtp/x2XrR2P+pXe79766ShZS87gyqqMp9jsk7eJBZ8s1sU+EDtKgNqxfEfLBpHNqbKOxCTw6Ba0BUbsDUr4iMSCyImWqnOk7//p1SvqFnhnzNfG2ZS+hjyKzvNP2zxKMZUNPgiNNjsP6CSSPUzOIfzul6K83lzwd9mg2rsVct9rSlH8ZAlZetH5Av5ZJldiS+6ttCJneRVFpBfPeoSwFZ8BVQ1e1d0sRagYdKpWUtPUeQ55xyvqhsC9Y/h6YlSTNU2Kd57tlqz5rrc3Gg/jMJ/M7UYOvnN+JhMUWN+SHSYj7ZWROl7/bv3C5b6m7/MqHB7S6tnANF7HLOte6MTdsTMgfi/KPam+2PleNcduOQTE0mOFzsfzwQ45w/9U7BveIRQDy6AxLhWQLOOxWEX7uFH/sjUocnVHQgYT2s7hUMWESMK1DmVHBLqemjy8zMMr2tV8OWVmZnzE7aLVA3IotSvQ0M3DFQ3brgaCJqOTs3MFphO7xPhql8fNkaTQC11dzSKkL6WrdkhT7dHBrEEhOQwd6LovnJO1PtB2J/Q7aHn+031Ggw0n+vEsp02FeFEBgtuPqpyeq8RIGYbtod/H+oXhi2Zazyka9+sNDBzEcbT9gv2wsVZHXbVrNHzT3alQIQC+0FGzbYADVPkL8u2Qvn20g0FiT2xhsxep+vrxCFwDXV0AxM63d7mv2CnlfR+1S5qYRhKCHq4tw43dX+Gmfvzw2EXd8K8K6OjgM1nrs+OX8eXinGOPM2Jb3eaEJV+IEfi08V8c4g1GbEKdSJgxWE3n0THx9RBx+34Yr1A427xMYNxcF08sQJwSHMnxQNvyT1FXgGUgpdLdeTDCYFOPc7w+vnj2ksepLiJLjua0W0mFP3ZJHWdNqyLJmT1lfKn8DZGTqmLJctC6 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4aef3221-474e-4ae5-e283-08d8fb058a88 X-MS-Exchange-CrossTenant-AuthSource: MW2PR0102MB3482.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2021 03:14:09.5067 (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: Ad91onPXNHj0pUG493XmtRka4Y+7ipbPztfWBXMFAQr3Cv9SQyBKsiZt2DEh2NKsrL7xnBKNyDBq3/WGw1zO2w/BBvNHP0Wk4+FJ11l0a4s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0101MB2991 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Adds an MFD driver for SMpro found on the Mt.Jade hardware reference platform with Ampere's Altra processor family. Signed-off-by: Quan Nguyen Reported-by: kernel test robot --- drivers/mfd/Kconfig | 10 ++++++++++ drivers/mfd/simple-mfd-i2c.c | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index d07e8cf93286..f7a6460f7aa0 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -77,6 +77,16 @@ config MFD_AS3711 help Support for the AS3711 PMIC from AMS +config MFD_SMPRO + tristate "Ampere Computing MFD SMpro core driver" + select MFD_SIMPLE_MFD_I2C + help + Say yes here to enable SMpro driver support for Ampere's Altra + processor family. + + Ampere's Altra SMpro exposes an I2C regmap interface that can + be accessed by child devices. + config MFD_AS3722 tristate "ams AS3722 Power Management IC" select MFD_CORE diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c index 87f684cff9a1..9a44655f5592 100644 --- a/drivers/mfd/simple-mfd-i2c.c +++ b/drivers/mfd/simple-mfd-i2c.c @@ -21,6 +21,11 @@ static const struct regmap_config simple_regmap_config = { .val_bits = 8, }; +static const struct regmap_config simple_word_regmap_config = { + .reg_bits = 8, + .val_bits = 16, +}; + static int simple_mfd_i2c_probe(struct i2c_client *i2c) { const struct regmap_config *config; @@ -39,6 +44,7 @@ static int simple_mfd_i2c_probe(struct i2c_client *i2c) static const struct of_device_id simple_mfd_i2c_of_match[] = { { .compatible = "kontron,sl28cpld" }, + { .compatible = "ampere,smpro", .data = &simple_word_regmap_config }, {} }; MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match); From patchwork Fri Apr 9 03:13:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quan Nguyen X-Patchwork-Id: 12192901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C84EDC433ED for ; Fri, 9 Apr 2021 03:14:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A35C5610F9 for ; Fri, 9 Apr 2021 03:14:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233250AbhDIDOc (ORCPT ); Thu, 8 Apr 2021 23:14:32 -0400 Received: from mail-bn7nam10on2137.outbound.protection.outlook.com ([40.107.92.137]:46785 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233210AbhDIDOa (ORCPT ); Thu, 8 Apr 2021 23:14:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E1m+mp8f3oO/+5CjrZrrZTWfi0uutLQML1zEW5b/thanoKM30UGIBaAB5QMby+iosMt2oP07CDbBnw5vBQgim39pbfFk7rDPgebggLNRcd4+GmtAYryJjFvqgueXlc3fzYMDfZx6tnSs0+TkZMIL5uf/58xBvgSx4QFngBCUta0T8RMS05m/ZbnhP4I1H+CHePYH0hB8x1C4GXtSBGXhtrhQMgZy74FOVp4/dItSrTha6hZ9os9ZuvmaFPbeVxE9rDyf69bh9+flxRiLRXRhCJI9VMatMW0BtnmVXlfqysnYMYzUEAvovYw7VI4PyRxppx9K0o99mK9vDFgnGqSwxg== 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-SenderADCheck; bh=MJjWqff7UmjKtBAuThyOP0BAJvXIU6v8o7tkm8uqwlE=; b=MLp8OFYTSnxmVIUlT6J7POCCd0nE0eDdCEXyXM+w0FcDzVEXvQ0o7a/FRoW3m3bJqYPMBDCPEDOzSbTgS9CqxaSXgT9/GaMIYcz5QPfrmPpGgW2mV5v+610PYk2TY2Jt1pKtrYAezWArOdiA3uqx1URDUDFvjG3sDlL+yYUFqN7aNZIffAAVfEO7c6VXMHAQMcPik+7atBF7NSqA0P8MmNSMEY4RmmUqz8MBuYwajRpARlf0Q++XvGQJ2+GxxpnEKyfoYdKiMvrLm4bQVynkKxL+awsRqEp5yX/OUwcVm/8CtJbmhckHuq2JA8pRA2nV4rGE7DIn7t4HrlnjQjXOSA== 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=MJjWqff7UmjKtBAuThyOP0BAJvXIU6v8o7tkm8uqwlE=; b=kPJ22Z9r7yMdthWUX5IX4GqNDJGbFyr8sQCBuEdrtRRVIgry1HYsPkSGhlNWWt/6ftZa5ZELeYocnvZh+Ppe/O0kJbwlc1CcU6ICzaTheW2PblUdyoT+4FwcxVoiG2CSq0DthgQl+4Oye5SXcwbHoGhNts+1IYdyWVyZBuhuq40= Authentication-Results: jms.id.au; dkim=none (message not signed) header.d=none;jms.id.au; dmarc=none action=none header.from=os.amperecomputing.com; Received: from MW2PR0102MB3482.prod.exchangelabs.com (2603:10b6:302:c::32) by MWHPR0101MB2991.prod.exchangelabs.com (2603:10b6:301:36::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.26; Fri, 9 Apr 2021 03:14:13 +0000 Received: from MW2PR0102MB3482.prod.exchangelabs.com ([fe80::d840:7aa7:58d4:b503]) by MW2PR0102MB3482.prod.exchangelabs.com ([fe80::d840:7aa7:58d4:b503%5]) with mapi id 15.20.4020.016; Fri, 9 Apr 2021 03:14:13 +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 Cc: Open Source Submission , Phong Vo , "Thang Q . Nguyen" Subject: [PATCH v3 3/4] hwmon: smpro: Add Ampere's Altra smpro-hwmon driver Date: Fri, 9 Apr 2021 10:13:31 +0700 Message-Id: <20210409031332.21919-4-quan@os.amperecomputing.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210409031332.21919-1-quan@os.amperecomputing.com> References: <20210409031332.21919-1-quan@os.amperecomputing.com> X-Originating-IP: [118.69.219.201] X-ClientProxiedBy: HK0PR01CA0054.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::18) To MW2PR0102MB3482.prod.exchangelabs.com (2603:10b6:302:c::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from hcm-sw-17.amperecomputing.com (118.69.219.201) by HK0PR01CA0054.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Fri, 9 Apr 2021 03:14:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a4fe143b-ca47-40b2-0190-08d8fb058d11 X-MS-TrafficTypeDiagnostic: MWHPR0101MB2991: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1247; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tFfFfUQ1eR7OFBUBn0k8pUVCnypX+3+eLVutpAkkodlrFg97hB2eg8SxOt9BS/8CN78ybZkyyfDEWF1nnUwExcyx0B0hJpaecWgViNv3FBhfaBFhoqAghTZ6wnCg6Bwxhh58hX9xB/6kmwI0esgUrhOibcjIQgtVZTjZqyti9ViISCGNng9Pv5qg30OWxz9JW6e+pVMNCZ45+T9kOJGkQj9TqNssPC7H+vufG8FD6mmBjuxsZ1FQW7ppCYqQcUQbI8NJz7hnOl7E5+9yggz/oy3jb3477w2aYndiGPRRR0YYWWw8yM/Edo41XCe6AgmuoVBdTbMQmqfIbJVx6jG7DocR0mX4C3zxMMzmIsRelp7oNXgEUk95+Z4CtPAEj4knwP0jeTLRpFUJXsAys6RRRmzOyoxu9wJsN3ZMjV49hsDs7oV2nl2kbnDHuCsL1I6qaFyJNAyEKgTGABsuLnGjHf286JJ7N0bvlMMAAAOR4xJAxrcAJJkwerZ1z1l8Nxi9ktj6UsAlxuB5pPDPEC3BtYGyKnbAoOdG18vxY6cef+C3r9c7syotgHOMHBM01uFycpYjEqQkwVyPkDhtV+3tSIbX834LGOizg4Qpg7kI80tLMJOSp6AiGzaMNuf668eZeNH/BKAPzgEH6FVdof6ukwa92HdytYZsO0H46Z1TET7d/jVpg+y1SCZ55xAvUk5AFnEztqdXNuYBYoWF6nmeNw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW2PR0102MB3482.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(39850400004)(396003)(136003)(346002)(376002)(6512007)(30864003)(478600001)(38350700001)(921005)(6666004)(26005)(316002)(6486002)(1076003)(83380400001)(2906002)(86362001)(7416002)(186003)(16526019)(6506007)(5660300002)(107886003)(38100700001)(4326008)(66946007)(956004)(8936002)(8676002)(2616005)(52116002)(66556008)(54906003)(110136005)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: OZ+N1n2WXz2Vx52OZwGXuq8nk63NXmw0/UGHx1oSD+gQdMLh80kSogV4n24T5UZmZ7lVnifRisBdv9ryI/AcI2LFz6zVWtMsPEBv6mLh0ClTJS5fhGJXM5IXWqOvdx299MAS0eOOy7dfwo4uZXaz0MSCRltXpDkEv+Fp3HmG5YaNkgbOTQi+znGHlcjN7wMtSHwVEZuEDv/YgbDkd5M6oa2RASodKyQRL3VHHE4AFbTY9FPxqbt7pMaDOAVPmpMojGwmjetK5n49NyMSkWIoWjYzifoSlyXZozGIC4SViVIeIXieauz4da/5faHS22NgOcEHbOYCT6AWlSTtChfyOLvRYScRJLgB2GWXrIsgZf8SwsZZe5pKcyTdAyBnhDyoE4vKSygVp9BBd7L7/sd+IPZMwbBeoaztmiWJAgbQ/GPgztDCrLSewugxatlAcPCJnXPgtvfcwlFQG8SGSl+DZETft8NRLMqZ9KyK5CIkEaG/ZYZXn700u+8vsCNjAVDxDamGp4fJQiMbYuoPt+Ho7eEq8qYJipgOczmYgFzDFlNKsOQkpUJyaBzB+EbxioLbXVOVZ2MBdcKAWOae/HjOn8o9zz4tjcnGr7suZYCXdWlbCloocLJSdRTMV1Izii21N5X/z37IYQIL+I2D77kfL3HgRPMCyT8MeCIHQ/Fkt1SrwAeYZejMRqq7LoRGZmk7GYVyyE8fnd48JrDirKoKqu6A9K2pSIryvh3zPbJmf/UWzfQ8PlEN9Bpwp6U2vKMdw0OIjslRXdUQpnTS981lhagneAp9pbxwRPh4Y2s+MzsgEA4MOYDYIhAc9ewxGeUOfgTbYgxsDbdg5p3yPk5WG6nlO3hxswiEsrMkgeFUfsU7BzHsiADQwp8Uge7L3uIO7GXIPwEGuA7r08EWcUo/pR+x4ue1n5alm5+5500X/R881S+L6ZnwrUmdUOVl8wOmTmi+TLYsv69N9HL595V0vntpX1BRLoo2vi/xF9j79+sV8hCgG//w7Hgvs6eTj4QL6xcA4oFihh8E5K6kLNZMqF09LlCUV9/iAwcXQU6P/bswV4S7k0xnRO+fKiv8UPw9x8HK0N+rQvWNpo77JV3ZBPZz8QRSmZRYkKTxM9zGkCc+M9Swk0QVL4V0ekRTMND6Ztwl8jGkpIvCabjYp7o0fNUX7D5mBjjYZy9NmfwDvGYzUT8LL5TCTPZbW38DHjowFusqPAaSNp7ep6iQ1eMfik9c5on7iZOBGwuNrvJVkza0/OYXNhDiik30Cn9J+m9ANVXv9lIP9LMXf0+gzz0WYqhZf97yAvdFWBFoDE4F+rNLge/JAzmkTDvCGobW/RAe X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4fe143b-ca47-40b2-0190-08d8fb058d11 X-MS-Exchange-CrossTenant-AuthSource: MW2PR0102MB3482.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2021 03:14:13.6673 (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: StolC0xgogMLbSgmqlcSWkVKER7ODzuKmTCbdhKDXvEQCOSsVitqS3yT9+uZnKR1Ng9OYoU6pJt4el08B2L5a0iQVdXDOgQKuSSaXf68RhE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0101MB2991 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org This commit adds support for Ampere SMpro hwmon driver. This driver supports accessing various CPU sensors provided by the SMpro co-processor including temperature, power, voltages, and current. Signed-off-by: Quan Nguyen --- drivers/hwmon/Kconfig | 8 + drivers/hwmon/Makefile | 1 + drivers/hwmon/smpro-hwmon.c | 491 ++++++++++++++++++++++++++++++++++++ 3 files changed, 500 insertions(+) create mode 100644 drivers/hwmon/smpro-hwmon.c diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 0ddc974b102e..ba4b5a911baf 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -67,6 +67,14 @@ config SENSORS_ABITUGURU3 This driver can also be built as a module. If so, the module will be called abituguru3. +config SENSORS_SMPRO + tristate "Ampere's Altra SMpro hardware monitoring driver" + depends on MFD_SMPRO + help + If you say yes here you get support for the thermal, voltage, + current and power sensors of Ampere's Altra processor family SoC + with SMpro co-processor. + config SENSORS_AD7314 tristate "Analog Devices AD7314 and compatibles" depends on SPI diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile index 59e78bc212cf..b25391f9c651 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile @@ -174,6 +174,7 @@ obj-$(CONFIG_SENSORS_SHT3x) += sht3x.o obj-$(CONFIG_SENSORS_SHTC1) += shtc1.o obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o obj-$(CONFIG_SENSORS_SMM665) += smm665.o +obj-$(CONFIG_SENSORS_SMPRO) += smpro-hwmon.o obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o diff --git a/drivers/hwmon/smpro-hwmon.c b/drivers/hwmon/smpro-hwmon.c new file mode 100644 index 000000000000..a3389fcbad82 --- /dev/null +++ b/drivers/hwmon/smpro-hwmon.c @@ -0,0 +1,491 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Ampere Computing SoC's SMPro Hardware Monitoring Driver + * + * Copyright (c) 2021, Ampere Computing LLC + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Identification Registers */ +#define MANUFACTURER_ID_REG 0x02 +#define AMPERE_MANUFACTURER_ID 0xCD3A + +/* Logical Power Sensor Registers */ +#define SOC_TEMP 0x00 +#define SOC_VRD_TEMP 0x01 +#define DIMM_VRD_TEMP 0x02 +#define CORE_VRD_TEMP 0x03 +#define CH0_DIMM_TEMP 0x04 +#define CH1_DIMM_TEMP 0x05 +#define CH2_DIMM_TEMP 0x06 +#define CH3_DIMM_TEMP 0x07 +#define CH4_DIMM_TEMP 0x08 +#define CH5_DIMM_TEMP 0x09 +#define CH6_DIMM_TEMP 0x0A +#define CH7_DIMM_TEMP 0x0B +#define RCA_VRD_TEMP 0x0C + +#define CORE_VRD_PWR 0x10 +#define SOC_PWR 0x11 +#define DIMM_VRD1_PWR 0x12 +#define DIMM_VRD2_PWR 0x13 +#define CORE_VRD_PWR_MW 0x16 +#define SOC_PWR_MW 0x17 +#define DIMM_VRD1_PWR_MW 0x18 +#define DIMM_VRD2_PWR_MW 0x19 +#define RCA_VRD_PWR 0x1A +#define RCA_VRD_PWR_MW 0x1B + +#define MEM_HOT_THRESHOLD 0x22 +#define SOC_VR_HOT_THRESHOLD 0x23 +#define CORE_VRD_VOLT 0x24 +#define SOC_VRD_VOLT 0x25 +#define DIMM_VRD1_VOLT 0x26 +#define DIMM_VRD2_VOLT 0x27 +#define RCA_VRD_VOLT 0x28 + +#define CORE_VRD_CURR 0x29 +#define SOC_VRD_CURR 0x2A +#define DIMM_VRD1_CURR 0x2B +#define DIMM_VRD2_CURR 0x2C +#define RCA_VRD_CURR 0x2D + +struct smpro_hwmon { + struct regmap *regmap; + u32 offset; +}; + +struct smpro_sensor { + const u8 reg; + const u8 reg_ext; + const char *label; +}; + +static const struct smpro_sensor temperature[] = { + { + .reg = SOC_TEMP, + .label = "temp1 SoC" + }, + { + .reg = SOC_VRD_TEMP, + .reg_ext = SOC_VR_HOT_THRESHOLD, + .label = "temp2 SoC VRD" + }, + { + .reg = DIMM_VRD_TEMP, + .label = "temp3 DIMM VRD" + }, + { + .reg = CORE_VRD_TEMP, + .label = "temp4 CORE VRD" + }, + { + .reg = CH0_DIMM_TEMP, + .reg_ext = MEM_HOT_THRESHOLD, + .label = "temp5 CH0 DIMM" + }, + { + .reg = CH1_DIMM_TEMP, + .reg_ext = MEM_HOT_THRESHOLD, + .label = "temp6 CH1 DIMM" + }, + { + .reg = CH2_DIMM_TEMP, + .reg_ext = MEM_HOT_THRESHOLD, + .label = "temp7 CH2 DIMM" + }, + { + .reg = CH3_DIMM_TEMP, + .reg_ext = MEM_HOT_THRESHOLD, + .label = "temp8 CH3 DIMM" + }, + { + .reg = CH4_DIMM_TEMP, + .reg_ext = MEM_HOT_THRESHOLD, + .label = "temp9 CH4 DIMM" + }, + { + .reg = CH5_DIMM_TEMP, + .reg_ext = MEM_HOT_THRESHOLD, + .label = "temp10 CH5 DIMM" + }, + { + .reg = CH6_DIMM_TEMP, + .reg_ext = MEM_HOT_THRESHOLD, + .label = "temp11 CH6 DIMM" + }, + { + .reg = CH7_DIMM_TEMP, + .reg_ext = MEM_HOT_THRESHOLD, + .label = "temp12 CH7 DIMM" + }, + { + .reg = RCA_VRD_TEMP, + .label = "temp13 RCA VRD" + }, +}; + +static const struct smpro_sensor voltage[] = { + { + .reg = CORE_VRD_VOLT, + .label = "vout0 CORE VRD" + }, + { + .reg = SOC_VRD_VOLT, + .label = "vout1 SoC VRD" + }, + { + .reg = DIMM_VRD1_VOLT, + .label = "vout2 DIMM VRD1" + }, + { + .reg = DIMM_VRD2_VOLT, + .label = "vout3 DIMM VRD2" + }, + { + .reg = RCA_VRD_VOLT, + .label = "vout4 RCA VRD" + }, +}; + +static const struct smpro_sensor curr_sensor[] = { + { + .reg = CORE_VRD_CURR, + .label = "iout1 CORE VRD" + }, + { + .reg = SOC_VRD_CURR, + .label = "iout2 SoC VRD" + }, + { + .reg = DIMM_VRD1_CURR, + .label = "iout3 DIMM VRD1" + }, + { + .reg = DIMM_VRD2_CURR, + .label = "iout4 DIMM VRD2" + }, + { + .reg = RCA_VRD_CURR, + .label = "iout5 RCA VRD" + }, +}; + +static const struct smpro_sensor power[] = { + { + .reg = CORE_VRD_PWR, + .reg_ext = CORE_VRD_PWR_MW, + .label = "power1 CORE VRD" + }, + { + .reg = SOC_PWR, + .reg_ext = SOC_PWR_MW, + .label = "power2 SoC" + }, + { + .reg = DIMM_VRD1_PWR, + .reg_ext = DIMM_VRD1_PWR_MW, + .label = "power3 DIMM VRD1" + }, + { + .reg = DIMM_VRD2_PWR, + .reg_ext = DIMM_VRD2_PWR_MW, + .label = "power4 DIMM VRD2" + }, + { + .reg = RCA_VRD_PWR, + .reg_ext = RCA_VRD_PWR_MW, + .label = "power5 RCA VRD" + }, +}; + +static int smpro_read_temp(struct device *dev, u32 attr, int channel, long *val) +{ + struct smpro_hwmon *hwmon = dev_get_drvdata(dev); + unsigned int value; + int ret; + + switch (attr) { + case hwmon_temp_input: + ret = regmap_read(hwmon->regmap, hwmon->offset + temperature[channel].reg, &value); + if (ret) + return ret; + break; + case hwmon_temp_crit: + ret = regmap_read(hwmon->regmap, + hwmon->offset + temperature[channel].reg_ext, &value); + if (ret) + return ret; + break; + default: + return -EOPNOTSUPP; + } + + *val = sign_extend32(value, 8) * 1000; + return 0; +} + +static int smpro_read_in(struct device *dev, u32 attr, int channel, long *val) +{ + struct smpro_hwmon *hwmon = dev_get_drvdata(dev); + unsigned int value; + int ret; + + switch (attr) { + case hwmon_in_input: + ret = regmap_read(hwmon->regmap, hwmon->offset + voltage[channel].reg, &value); + if (ret < 0) + return ret; + /* 15-bit value in 1mV */ + *val = value & 0x7fff; + return 0; + default: + return -EOPNOTSUPP; + } +} + +static int smpro_read_curr(struct device *dev, u32 attr, int channel, long *val) +{ + struct smpro_hwmon *hwmon = dev_get_drvdata(dev); + unsigned int value; + int ret; + + switch (attr) { + case hwmon_curr_input: + ret = regmap_read(hwmon->regmap, hwmon->offset + curr_sensor[channel].reg, &value); + if (ret < 0) + return ret; + /* Scale reported by the hardware is 1mA */ + *val = value & 0x7fff; + return 0; + default: + return -EOPNOTSUPP; + } +} + +static int smpro_read_power(struct device *dev, u32 attr, int channel, long *val_pwr) +{ + struct smpro_hwmon *hwmon = dev_get_drvdata(dev); + unsigned int val = 0, val_mw = 0; + int ret; + + switch (attr) { + case hwmon_power_input: + ret = regmap_read(hwmon->regmap, hwmon->offset + power[channel].reg, &val); + if (ret) + return ret; + + ret = regmap_read(hwmon->regmap, hwmon->offset + power[channel].reg_ext, &val_mw); + if (ret) + return ret; + + *val_pwr = val * 1000000 + val_mw * 1000; + return 0; + + default: + return -EOPNOTSUPP; + } +} + +static int smpro_read(struct device *dev, enum hwmon_sensor_types type, + u32 attr, int channel, long *val) +{ + switch (type) { + case hwmon_temp: + return smpro_read_temp(dev, attr, channel, val); + case hwmon_in: + return smpro_read_in(dev, attr, channel, val); + case hwmon_power: + return smpro_read_power(dev, attr, channel, val); + case hwmon_curr: + return smpro_read_curr(dev, attr, channel, val); + default: + return -EOPNOTSUPP; + } +} + +static int smpro_read_string(struct device *dev, enum hwmon_sensor_types type, + u32 attr, int channel, const char **str) +{ + switch (type) { + case hwmon_temp: + switch (attr) { + case hwmon_temp_label: + *str = temperature[channel].label; + return 0; + default: + break; + } + break; + + case hwmon_in: + switch (attr) { + case hwmon_in_label: + *str = voltage[channel].label; + return 0; + default: + break; + } + break; + + case hwmon_curr: + switch (attr) { + case hwmon_curr_label: + *str = curr_sensor[channel].label; + return 0; + default: + break; + } + break; + + case hwmon_power: + switch (attr) { + case hwmon_power_label: + *str = power[channel].label; + return 0; + default: + break; + } + break; + default: + break; + } + + return -EOPNOTSUPP; +} + +static umode_t smpro_is_visible(const void *data, enum hwmon_sensor_types type, + u32 attr, int channel) +{ + const struct smpro_hwmon *hwmon = data; + unsigned int value; + int ret; + + switch (type) { + case hwmon_temp: + switch (attr) { + case hwmon_temp_input: + case hwmon_temp_label: + case hwmon_temp_crit: + ret = regmap_read(hwmon->regmap, + hwmon->offset + temperature[channel].reg, &value); + if (ret || value == 0xFFFF) + return 0; + break; + } + default: + break; + } + + return 0444; +} + +static const struct hwmon_channel_info *smpro_info[] = { + HWMON_CHANNEL_INFO(temp, + HWMON_T_INPUT | HWMON_T_LABEL, + HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, + HWMON_T_INPUT | HWMON_T_LABEL, + HWMON_T_INPUT | HWMON_T_LABEL, + HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, + HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, + HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, + HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, + HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, + HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, + HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, + HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, + HWMON_T_INPUT | HWMON_T_LABEL), + HWMON_CHANNEL_INFO(in, + HWMON_I_INPUT | HWMON_I_LABEL, + HWMON_I_INPUT | HWMON_I_LABEL, + HWMON_I_INPUT | HWMON_I_LABEL, + HWMON_I_INPUT | HWMON_I_LABEL, + HWMON_I_INPUT | HWMON_I_LABEL), + HWMON_CHANNEL_INFO(power, + HWMON_P_INPUT | HWMON_P_LABEL, + HWMON_P_INPUT | HWMON_P_LABEL, + HWMON_P_INPUT | HWMON_P_LABEL, + HWMON_P_INPUT | HWMON_P_LABEL, + HWMON_P_INPUT | HWMON_P_LABEL), + HWMON_CHANNEL_INFO(curr, + HWMON_C_INPUT | HWMON_C_LABEL, + HWMON_C_INPUT | HWMON_C_LABEL, + HWMON_C_INPUT | HWMON_C_LABEL, + HWMON_C_INPUT | HWMON_C_LABEL, + HWMON_C_INPUT | HWMON_C_LABEL), + NULL +}; + +static const struct hwmon_ops smpro_hwmon_ops = { + .is_visible = smpro_is_visible, + .read = smpro_read, + .read_string = smpro_read_string, +}; + +static const struct hwmon_chip_info smpro_chip_info = { + .ops = &smpro_hwmon_ops, + .info = smpro_info, +}; + +static int smpro_hwmon_probe(struct platform_device *pdev) +{ + struct smpro_hwmon *hwmon; + struct device *hwmon_dev; + unsigned int val; + int ret; + + hwmon = devm_kzalloc(&pdev->dev, sizeof(struct smpro_hwmon), GFP_KERNEL); + if (!hwmon) + return -ENOMEM; + + hwmon->regmap = dev_get_regmap(pdev->dev.parent, NULL); + if (!hwmon->regmap) + return -ENODEV; + + ret = device_property_read_u32(&pdev->dev, "reg", &hwmon->offset); + if (ret) + return -EINVAL; + + /* Check for valid ID */ + ret = regmap_read(hwmon->regmap, MANUFACTURER_ID_REG, &val); + if (ret) + return -EPROBE_DEFER; + + if (val != AMPERE_MANUFACTURER_ID) + return -ENODEV; + + hwmon_dev = devm_hwmon_device_register_with_info(&pdev->dev, "smpro_hwmon", + hwmon, &smpro_chip_info, NULL); + + return PTR_ERR_OR_ZERO(hwmon_dev); +} + +static const struct of_device_id smpro_hwmon_of_match[] = { + { .compatible = "ampere,ac01-hwmon" }, + {} +}; +MODULE_DEVICE_TABLE(of, smpro_hwmon_of_match); + +static struct platform_driver smpro_hwmon_driver = { + .probe = smpro_hwmon_probe, + .driver = { + .name = "smpro-hwmon", + .of_match_table = smpro_hwmon_of_match, + }, +}; + +module_platform_driver(smpro_hwmon_driver); + +MODULE_AUTHOR("Thu Nguyen "); +MODULE_AUTHOR("Quan Nguyen "); +MODULE_DESCRIPTION("Ampere Altra SMPro hwmon driver"); +MODULE_LICENSE("GPL v2"); From patchwork Fri Apr 9 03:13:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quan Nguyen X-Patchwork-Id: 12192903 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05DDEC43460 for ; Fri, 9 Apr 2021 03:14:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DCB73610F7 for ; Fri, 9 Apr 2021 03:14:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233264AbhDIDOd (ORCPT ); Thu, 8 Apr 2021 23:14:33 -0400 Received: from mail-bn7nam10on2137.outbound.protection.outlook.com ([40.107.92.137]:46785 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233248AbhDIDOc (ORCPT ); Thu, 8 Apr 2021 23:14:32 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xvs/uD0wzf/J9iFhx86NYJY0I5BUY29Yo2PeCwmeRsRHQlhVp7TY41zJ5rJQttSv8+vOEiD1p01Pawcse5Ro+LSMyaJH2qlDAy70joFJKOHWRJuWZtZVLe8tQ2T+au0JvVKL6TBRQpBXi3kESE+D3/YIu8a8c/xyVoe4lPrOKzrM/PpD4oejhjl+TlhW/fyICT1kpw4PYSy6kZ3iQQcsvwqGHL3PeFsByM3s36WQSDit25kChtYFHoW3ViPRkfIpYUE2w97M/i2b+GJ0rqNPtWMpgfGU4hqh8jY13telBSz49ojSrFRVneAJxloP7hNLiW5z/jrESOfavd6wDBumHw== 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-SenderADCheck; bh=YsnJgrS+GjqZP32bh7ZFKSuGXYYU0wjYM7emkHcqBJU=; b=WvqTFnIg8nv6AQq6NAaSGUkjA7XSq6dHzzCVuuWF0afrfvlCi/3erhvkhB7XN6C8hMle3I6gHF0va191Vs2Ojlu7QpcjjU2EZmkvnWhfngzHafQ4cxelI9/jX298vJ9F8TGNQl6tPLmHIgCc37fuWqmqdo/J/SsFCiVrQcMnsI4GuWUBSl4yRIKipcLSOEqaWY2H3Ur795K5dv5SjaZvDJgQjuxyy1j4deGxrJ7jODLKQRHe3W2DG3TScCr+BK8Sv9FCx1i4WC5rBFSzkBqTmdEVDsRCJnFBxtdi5EdK8QDbbWuzLI7v4TrriyOOLXj+Alzr/ohU2weW3gIWtx7M4g== 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=YsnJgrS+GjqZP32bh7ZFKSuGXYYU0wjYM7emkHcqBJU=; b=DUbcAoJ0f7vY5koER9qmqG2if2Lq9a9sV/UM3Thl+JJnk7iJgGu1V3Dc/MnQrCJZwEMMSrFB6o+ANdwkDRaT+TQrGwO0yApAJKSY52nnb5W1k/KNcMf7Yj8fOXoXE2HjfKzknxDq1WT3a/jjPrTrBn28BDFaCqVYfn956yY5luQ= Authentication-Results: jms.id.au; dkim=none (message not signed) header.d=none;jms.id.au; dmarc=none action=none header.from=os.amperecomputing.com; Received: from MW2PR0102MB3482.prod.exchangelabs.com (2603:10b6:302:c::32) by MWHPR0101MB2991.prod.exchangelabs.com (2603:10b6:301:36::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.26; Fri, 9 Apr 2021 03:14:17 +0000 Received: from MW2PR0102MB3482.prod.exchangelabs.com ([fe80::d840:7aa7:58d4:b503]) by MW2PR0102MB3482.prod.exchangelabs.com ([fe80::d840:7aa7:58d4:b503%5]) with mapi id 15.20.4020.016; Fri, 9 Apr 2021 03:14:17 +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 Cc: Open Source Submission , Phong Vo , "Thang Q . Nguyen" Subject: [PATCH v3 4/4] docs: hwmon: (smpro-hwmon) Add documentation Date: Fri, 9 Apr 2021 10:13:32 +0700 Message-Id: <20210409031332.21919-5-quan@os.amperecomputing.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210409031332.21919-1-quan@os.amperecomputing.com> References: <20210409031332.21919-1-quan@os.amperecomputing.com> X-Originating-IP: [118.69.219.201] X-ClientProxiedBy: HK0PR01CA0054.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::18) To MW2PR0102MB3482.prod.exchangelabs.com (2603:10b6:302:c::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from hcm-sw-17.amperecomputing.com (118.69.219.201) by HK0PR01CA0054.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Fri, 9 Apr 2021 03:14:13 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 71606360-701b-4caf-5a3e-08d8fb058f88 X-MS-TrafficTypeDiagnostic: MWHPR0101MB2991: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IXStxnZ2YuhheHFNTSEDRMZLqAgU2wj3w9pWtwrrn7r+iJiUNBxHCxCAn/dqmSpGeCGbzEJb3og52ubXbF6odkJzw/Bd5PQiV8UbjkDP/qJ+iomEGr7pWfsVdJwwa8gmpysIiv7Kq0Gy8VqVMQlhSDOxR0ZVpngcxKm7wnYO1FUuGhqfYdIdlH+5DyRMSNMQjQJxIkCtx6tBhua1OctRjNaooKf/h7Ru7M9Vyp9bgw9jeSjSA9OcUWwCLSA9COYJl9qxdQBOkT9E+SRHW5naixZOoE1V+acNwfc64YGyChevXD1xMStCuL10Av/bUvzMBA7CefWg4pw9bP4TJPfGUsAn00sEDni0r4M2xvAh2ud1E8qLeFvUsUH8N5rBqoOi3mFfi/+9j0FqVjMqnjUEhxkK/ayLJ16Nly/mrKa4+JGiIVU037mF0Md/YkCvM5CYN/I1pMvAtCvInJnXjHJGk4d4XyE1UIp9FqWxzX6IF6i0sPZmJPdqIP9DFlltwBsOmO1fk1rRWYxd8t8VgYVtHZ36LfpgjtIxe6e/wV7sc6RtZV/KKGOylGB2UCvqfFVUHs4EmZD4HryBum0vlSVxlXEvtbqK4NnT4TRLkLeuRtro3gZnUfBjujlNAuE/YBPF1RXwmA6E/OayA48BF20GKlkCl6XQzSHvXF4IKaDIZiwLv66k7p5rJHWI5ZqDUxbJFbm9aKgs1i8Wbpl4swiOEQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW2PR0102MB3482.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(39850400004)(396003)(136003)(346002)(376002)(6512007)(478600001)(38350700001)(921005)(6666004)(26005)(316002)(6486002)(1076003)(2906002)(86362001)(7416002)(186003)(16526019)(6506007)(5660300002)(107886003)(38100700001)(4326008)(66946007)(956004)(8936002)(8676002)(2616005)(52116002)(66556008)(54906003)(110136005)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: Dl9HssQy4PzFCvxo/wa8YQgrTa4kMmOcqHOmGGwGIGpnOU74y8o8ENvBWrTs2Dcu34B8qsuVkhsI4Rj/2mRWkIt+P7rSwa8sziQDyOXYY/NAH9jHKela6+Rlicc5+uDGBTddSy+1sfjwXQI04yXNLZ5WjXC+3+7l5Dix3zJFLcfnE+KW5e2dS/69LjptyGPyLl2mlLwm6fg5u0i6fcw2Vsp9WP3FHgC0g2Wq07aSJmXC4lk0nyrMxONx6n5JENUOZyjZZ3vsyG5aeMvylvaax7S7oHNmJyQFqEdPyWeIXGC55v7lIX6LOJZD1XZaCALHNazFklmq3hPD2nQiudK9e6FNECH8dpmPaPBTL4jwcPS7O8k3Oa+nYCnkF9kdCfd/NKPV9frApTgrksyRP7A4Mg9Dm8n4H6Os68EDlu6YAC3l69GwKHGB64cBWK17HQFCq7AnuF5cL1APAXfAwcL0oajbvgm4Vt2TeDvd7ixuRgo1GCm0u9eWLZXEGNjpQmlWuCFnZZdH+G13bHlwhxU+TwcVmCs8t28UJ66n43Y09lwhvBomEUwXxFa1VlKus+olwfY5AcR1tD+kbPKxXTjPjV+bg0Z2ivUNo7DEFKGrIOohQQzfRfzN3Uf02wf08p289g8CrJ4iatuExTpXqcKUzgOf31U7Mo0HjU4JGo/Kpt4oiejrS/rG3KkSdCy1ltVUlnpe/3cMlH/80AiH2I51FHP9ILtMUL7kvQvxKLHVQAPuUIg8r1ix/EAGMzG9x1OyYgLXvDFvme5SKzWfGdQg7rx/rV+rKSYDFV6PRGlRUnflWAmFvvyI13jXS/zK/RYyBblGvcDUhJ1QP0uzmZPkQhzgMhFCfemzVatYc3mMNl9KNbZx2g6z+erWht55zSwdgatgSRtFg7PBjryrqWFg901Msi2WNWPai1oAFFn3NQ0ItBrsw2yCWrEKgw6UUBX/QqDuJsmm7vS3uuexxvAcANBFXdGy6jY7kRpOa/I3ETgfmlEJK2jdkdAQp1rAxiY5mcp8KWFlE3qwv92IxTE2GurKiqvZocFBMoLfOvWRlc7y/RGXc+yUqe73yuEqvydT9shz+WdXUYYnkiAxLuxXDU3vrFPiSFv8Q4h8+NNxpOtNxdQNgCXd0ay1/UbgYE8fz/uit4D6NWmfz3yXJ5BD/Qq3nEI29Xes8RIuCEQm/c80p843+DZh34sGbufBq1RUMbkcLW6iwi3ZgJ3HUf5miGru+SpFGIxtVsHZkc+qYEU1YDgSmvCtFbPuephILLsi5iOPbNxCgh56mX/pR5mabCPdMO8PI7IArexqqm4kH42a8/3iLLWrep/NH6qAVoEA X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 71606360-701b-4caf-5a3e-08d8fb058f88 X-MS-Exchange-CrossTenant-AuthSource: MW2PR0102MB3482.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2021 03:14:17.7919 (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: dIlhlrX/amz3YTJnZfH+EJNN36TtN2EELGsVv6qIAMGCVzlQqEi6ERY7vxLxR4FLbmGS16Oe8DAhsClXTCmKju9ETUcc1ETbTit+V+gR0gU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0101MB2991 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@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 --- 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 48bfa7887dd4..3e3631b253b6 100644 --- a/Documentation/hwmon/index.rst +++ b/Documentation/hwmon/index.rst @@ -166,6 +166,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