Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp22562imm; Thu, 30 Aug 2018 14:34:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbKLIcg1hNGb7vHQjNXHPvdbAUexQDIB3eydjaSg2Y0rF77LGmPgDsevCeAZkgC7X3vmmJM X-Received: by 2002:a17:902:6501:: with SMTP id b1-v6mr12082440plk.31.1535664885953; Thu, 30 Aug 2018 14:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535664885; cv=none; d=google.com; s=arc-20160816; b=SfzZdn70boBNlsADZbudDgxKFrnBAaVtdK4KPE5tWJN1O6urpVRGHjrC2bRiFNURif Pnwq/LbXqNGlJG8C0xx+ouY4ObtlKuFlOB23YUlIEXcqGSeszAOiQtkQ9KYHmdal7cKc TqF0De7LTjC1hwpQVIW84kes7OELyBeZ9wHXFnoa+1VnUFCDJLSbgafKiNsPuELlS7JJ /idTgG+kYdPrL3TiCukMNQ3qZCrT1VOFUywQn4SMKttnCTQlNwiv71K/NriaHhmziOvH 4Z4jcVe+cHAmtreEZr6gPuKbGV5KVLlJnSwNXvsMQ3pXSesVlxM0sT9oB9JBHQRrIEox 1AIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=uffZnOvQg2ehUxFZsxbE+cUTqnwwm/MTy4XMyTEU654=; b=VnK/BoGnFRsjsJBGVO/A97X+X1pdsxi5XpXW+0FVaJXAtdqpdoGX/XMd7yRptDANq8 lTiXFcZnjWbN+pD+pzIlYuJERI5bHezt5HQQF36C5sQgBi/OAXFAqkiUNXJ1lXey9U5X H2nDoqnZ/WFH4Ab7jQhnXYPjcBq61jPfF3ejptJaKyqWxK9ZOD9tmU2CZdbK7Cx9uVaG oVZD5CTNzKS7p7a3lWjVSts0CQmPcgxX2VnQmSt7pMmqaBsthRvlWNwqzSjGMw4BkkKU 4uQRhfLFN6fLeRvN100wRI7L9zmWz4D9LL3y7ddLSURRWuBaSiCu/PfPeuxbuXMD2qMP H1+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s59-v6si7691316plb.341.2018.08.30.14.34.31; Thu, 30 Aug 2018 14:34:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727635AbeHaBhC (ORCPT + 99 others); Thu, 30 Aug 2018 21:37:02 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59038 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727539AbeHaBhC (ORCPT ); Thu, 30 Aug 2018 21:37:02 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7ULTVj1048013 for ; Thu, 30 Aug 2018 17:32:52 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0b-001b2d01.pphosted.com with ESMTP id 2m6q2guh77-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 30 Aug 2018 17:32:51 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 30 Aug 2018 17:32:51 -0400 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 30 Aug 2018 17:32:45 -0400 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7ULWiG627000894 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 30 Aug 2018 21:32:44 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AEC2E124052; Thu, 30 Aug 2018 18:33:21 -0400 (EDT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C907E124053; Thu, 30 Aug 2018 18:33:20 -0400 (EDT) Received: from oc6728276242.ibm.com (unknown [9.85.221.248]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 30 Aug 2018 18:33:20 -0400 (EDT) From: Eddie James To: linux-kernel@vger.kernel.org Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, jdelvare@suse.com, linux-doc@vger.kernel.org, openbmc@lists.ozlabs.org, robh+dt@kernel.org, gregkh@linuxfoundation.org, mark.rutland@arm.com, linux@roeck-us.net, joel@jms.id.au, benh@kernel.crashing.org, Eddie James Subject: [PATCH v5 00/10] hwmon and fsi: Add On-Chip Controller Driver Date: Thu, 30 Aug 2018 16:32:31 -0500 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 18083021-0040-0000-0000-000004680A79 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009641; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01081201; UDB=6.00557772; IPR=6.00861186; MB=3.00023023; MTD=3.00000008; XFM=3.00000015; UTC=2018-08-30 21:32:49 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18083021-0041-0000-0000-0000086F255E Message-Id: <1535664761-86018-1-git-send-email-eajames@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-30_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=908 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808300216 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds a hwmon driver to support the OCC on POWER8 and POWER9 processors. The OCC is an embedded processor that provides realtime power and thermal monitoring and management. The series also adds a "bus" driver to handle atomic communication between the service processor and the OCC on a POWER9 chip. This communication takes place over FSI bus to the SBE (Self-Boot engine) FIFO, which in turn communicates with the OCC. The driver for the SBEFIFO is already available as an FSI client driver. For POWER8 OCCs, communication between the service processor and the OCC is achieved over I2C bus. Changes since v4: * Make the hwmon attributes conform almost completely to standard names and values. The only exception is powerX_cap_user and powerX_cap_user_source. * Improve hwmon documentation. * Add ibm,p9-occ dt documentation. Changes since v3: * Add the FSI OCC driver. * Pull the sysfs attribute code into it's own file for cleanliness. * Various fixes for attribute creation and integer overflow. Changes since v2: * Add sysfs_notify for the error and throttling attributes when change is detected. * Removed occs_present counting of devices bound. * Improved remove() of P9 driver to avoid bad behavior with relation to OCC driver when unbound. * Added default cases (return EINVAL) for all sensor show functions. * Added temperature fault sensor. * Added back dt binding documentation for P9 to address checkpatch warning. * Added occs_present attribute from the poll response. Changes since v1: * Remove wait loop in P9 code, as that is now handled by FSI OCC driver. * Removed dt binding documentation for P9, FSI OCC driver will probe OCC hwmon driver automatically. * Moved OCC response code definitions to the OCC include file. * Fixed includes. * Changed some structure fields to __beXX as that is what they are. * Changed some errnos. * Removed some dev_err(). * Refactored P8 code a bit to use #defined addresses and magic values, and changed "goto retry" to a loop. * Refactored error handling a bit. Eddie James (10): dt-bindings: fsi: Add P9 OCC device documentation fsi: Add On-Chip Controller (OCC) driver Documentation: hwmon: Add OCC documentation dt-bindings: i2c: Add P8 OCC hwmon device documentation hwmon: Add On-Chip Controller (OCC) hwmon driver hwmon (occ): Add command transport method for P8 and P9 hwmon (occ): Parse OCC poll response hwmon (occ): Add sensor types and versions hwmon (occ): Add sensor attributes and register hwmon device hwmon (occ): Add sysfs attributes for additional OCC data .../devicetree/bindings/fsi/ibm,p9-occ.txt | 15 + .../devicetree/bindings/i2c/ibm,p8-occ-hwmon.txt | 25 + Documentation/hwmon/occ | 112 ++ drivers/fsi/Kconfig | 10 + drivers/fsi/Makefile | 1 + drivers/fsi/fsi-occ.c | 599 +++++++++++ drivers/hwmon/Kconfig | 2 + drivers/hwmon/Makefile | 1 + drivers/hwmon/occ/Kconfig | 28 + drivers/hwmon/occ/Makefile | 11 + drivers/hwmon/occ/common.c | 1098 ++++++++++++++++++++ drivers/hwmon/occ/common.h | 128 +++ drivers/hwmon/occ/p8_i2c.c | 255 +++++ drivers/hwmon/occ/p9_sbe.c | 106 ++ drivers/hwmon/occ/sysfs.c | 188 ++++ include/linux/fsi-occ.h | 25 + 16 files changed, 2604 insertions(+) create mode 100644 Documentation/devicetree/bindings/fsi/ibm,p9-occ.txt create mode 100644 Documentation/devicetree/bindings/i2c/ibm,p8-occ-hwmon.txt create mode 100644 Documentation/hwmon/occ create mode 100644 drivers/fsi/fsi-occ.c create mode 100644 drivers/hwmon/occ/Kconfig create mode 100644 drivers/hwmon/occ/Makefile create mode 100644 drivers/hwmon/occ/common.c create mode 100644 drivers/hwmon/occ/common.h create mode 100644 drivers/hwmon/occ/p8_i2c.c create mode 100644 drivers/hwmon/occ/p9_sbe.c create mode 100644 drivers/hwmon/occ/sysfs.c create mode 100644 include/linux/fsi-occ.h -- 1.8.3.1