Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1197611imm; Wed, 11 Jul 2018 19:54:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdjQ/cQieBKhctTLA/Wbm8ZFVcq1fMCUGV5KuqqXcA34oj/wj+hA/9pklQy2WkoQvM8frtU X-Received: by 2002:a62:1c16:: with SMTP id c22-v6mr476086pfc.148.1531364083726; Wed, 11 Jul 2018 19:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531364083; cv=none; d=google.com; s=arc-20160816; b=ilW+kjIVXTIa9rcJgYqYFxxocAryRY+ehwZQs7oT/e6vS/yP6Xe88Ct0vO2iiANRK3 /nd7lkYSn1yDx4jVaOiasY0U0S68ypp792fzCHP4IaAUKte/yT1B75kq2ci9FK+4mI2e BSJLUeIPGlX8V2ZL3YaxIL+eWTi0KW4hIXprtFsUaTJmmVXNOpCaOhPWc4VCyKl1Z1lK N20sPj142Z4E2xHrRP0uRIhHmvfxezBmuVEUDgm5Biq2RPmJr5tjzy+P29E3KOSrulgn YFglHyqL8EFYSAkJz1FwtNivKQFCmWXbT2oQM64AkLmTCm2fP2ug6XBqNrNDr2owqSAj 5w0Q== 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=mu1yf0mlJ8LrCaZco1bU7cFdLWXS5/RuTGAKjajKWEA=; b=EwidWLkA0AGWXBpSejdpWDfRmNekNc/AUl1UxCWjiA9VALK1+Yb2MqAOb0PKEMv9zI nAt9XGon4JfLnBCT/7tKrg+zhfeorqqSNXTM2IG4xRxXtPaha6IzJBqn2bzL7a8IH3it eYk6iHHd13K3jg0woK8ojDRbHmGUtomzDUWfH99xxc7+T4ByOIpxUS4GDhowG8Ab89lI xzTk9RzCR/4D/Mcef/vauGfCltzwPN3bLnv1MmNrjimMSZcGGyBzqPSiluy6aVVi4e3l UKXFeSr3YdZ1W/qO1JFWpm2nSvliUOYp5dkkYTN+ltxdQK4NMK6aR7tR0alud7dvE4Pn Bc2w== 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 f62-v6si10397577pfb.218.2018.07.11.19.54.28; Wed, 11 Jul 2018 19:54:43 -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 S2389577AbeGKVH6 (ORCPT + 99 others); Wed, 11 Jul 2018 17:07:58 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42906 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733168AbeGKVH5 (ORCPT ); Wed, 11 Jul 2018 17:07:57 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6BL086D001528 for ; Wed, 11 Jul 2018 17:01:46 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 2k5s8w0dn6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 11 Jul 2018 17:01:46 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 11 Jul 2018 15:01:45 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 11 Jul 2018 15:01:41 -0600 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6BL1eoY37552224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 11 Jul 2018 14:01:40 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C2A9C6E053; Wed, 11 Jul 2018 15:01:40 -0600 (MDT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CEB206E04C; Wed, 11 Jul 2018 15:01:39 -0600 (MDT) Received: from talon7.ibm.com (unknown [9.41.102.69]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 11 Jul 2018 15:01:39 -0600 (MDT) From: Eddie James To: linux-kernel@vger.kernel.org Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, gregkh@linuxfoundation.org, benh@kernel.crashing.org, linux@roeck-us.net, jdelvare@suse.com, mark.rutland@arm.com, openbmc@lists.ozlabs.org, robh+dt@kernel.org, joel@jms.id.au, Eddie James Subject: [PATCH v4 0/9] hwmon and fsi: Add On-Chip Controller (OCC) driver Date: Wed, 11 Jul 2018 16:01:29 -0500 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 18071121-0020-0000-0000-00000E3CAB18 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009352; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01059946; UDB=6.00544035; IPR=6.00837866; MB=3.00022107; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-11 21:01:45 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18071121-0021-0000-0000-0000623F8D81 Message-Id: <1531342898-15790-1-git-send-email-eajames@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-11_06:,, 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=777 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807110221 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 in linux-next as an FSI client driver. For POWER8 OCCs, communication between the service processor and the OCC is achieved over I2C bus. 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 (9): 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/i2c/ibm,p8-occ-hwmon.txt | 25 + Documentation/hwmon/occ | 73 ++ drivers/fsi/Kconfig | 10 + drivers/fsi/Makefile | 1 + drivers/fsi/fsi-occ.c | 609 ++++++++++ drivers/hwmon/Kconfig | 2 + drivers/hwmon/Makefile | 1 + drivers/hwmon/occ/Kconfig | 28 + drivers/hwmon/occ/Makefile | 11 + drivers/hwmon/occ/common.c | 1250 ++++++++++++++++++++ drivers/hwmon/occ/common.h | 136 +++ drivers/hwmon/occ/p8_i2c.c | 264 +++++ drivers/hwmon/occ/p9_sbe.c | 115 ++ drivers/hwmon/occ/sysfs.c | 188 +++ include/linux/fsi-occ.h | 34 + 15 files changed, 2747 insertions(+) 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