Message ID | 1511207217-14075-1-git-send-email-eajames@linux.vnet.ibm.com |
---|---|
Headers | show
Return-Path: <devicetree-owner@vger.kernel.org> X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3ygfPR2Qnfz9s82 for <incoming-dt@patchwork.ozlabs.org>; Tue, 21 Nov 2017 06:47:07 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752370AbdKTTrF (ORCPT <rfc822;incoming-dt@patchwork.ozlabs.org>); Mon, 20 Nov 2017 14:47:05 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58168 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752196AbdKTTrE (ORCPT <rfc822; devicetree@vger.kernel.org>); Mon, 20 Nov 2017 14:47:04 -0500 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAKJi4kv062608 for <devicetree@vger.kernel.org>; Mon, 20 Nov 2017 14:47:04 -0500 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ec2h51wmv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for <devicetree@vger.kernel.org>; Mon, 20 Nov 2017 14:47:03 -0500 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for <devicetree@vger.kernel.org> from <eajames@linux.vnet.ibm.com>; Mon, 20 Nov 2017 12:47:03 -0700 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 20 Nov 2017 12:47:00 -0700 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vAKJkxPK10027274; Mon, 20 Nov 2017 12:46:59 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B20BCC6047; Mon, 20 Nov 2017 12:46:59 -0700 (MST) Received: from oc3016140333.ibm.com (unknown [9.41.174.252]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id 33DFBC603C; Mon, 20 Nov 2017 12:46:59 -0700 (MST) From: Eddie James <eajames@linux.vnet.ibm.com> To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, devicetree@vger.kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, bradleyb@fuzziesquirrel.com, cbostic@linux.vnet.ibm.com, joel@jms.id.au, eajames@linux.vnet.ibm.com, "Edward A. James" <eajames@us.ibm.com> Subject: [PATCH v5 0/8] drivers/fsi: Add SBEFIFO and OCC client drivers Date: Mon, 20 Nov 2017 13:46:49 -0600 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 17112019-8235-0000-0000-00000C99AE42 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008100; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000240; SDB=6.00948744; UDB=6.00479090; IPR=6.00729025; BA=6.00005702; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00018111; XFM=3.00000015; UTC=2017-11-20 19:47:02 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17112019-8236-0000-0000-00003E86C83C Message-Id: <1511207217-14075-1-git-send-email-eajames@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-20_11:, , 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711200264 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: <devicetree.vger.kernel.org> X-Mailing-List: devicetree@vger.kernel.org |
Series |
drivers/fsi: Add SBEFIFO and OCC client drivers
|
expand
|
From: "Edward A. James" <eajames@us.ibm.com> This series adds two FSI-based device drivers; one for the SBEFIFO and one for the On-Chip Controller (OCC). IBM POWER9 processors contain some embedded hardware and software bits collectively referred to as the self boot engine (SBE). One role of the SBE is to act as a proxy that provides access to the registers of the POWER chip from other (embedded) systems. The POWER9 chip contains a hardware frontend for communicating with the SBE from remote systems called the SBEFIFO. The SBEFIFO logic is contained within an FSI CFAM and as such the driver implements an FSI bus device. The SBE expects to communicate using a defined wire protocol; however, the driver knows nothing of the protocol and only provides raw access to the fifo device to userspace applications wishing to communicate with the SBE using the wire protocol. The SBEFIFO consists of two hardware fifos. The upstream fifo is used by the driver to transfer data to the SBE on the POWER chip, from the system hosting the driver. The downstream fifo is used by the driver to transfer data from the SBE on the power chip to the system hosting the driver. The OCC is a device embedded on a POWER processor that collects and aggregates sensor data from the processor and system. The OCC can provide the raw sensor data as well as perform thermal and power management on the system. This driver provides an atomic communications channel between a service processor (e.g. a BMC) and the OCC. The driver is dependent on the FSI SBEFIFO driver to get hardware access through the SBE to the OCC SRAM. Commands are issued to the SBE to send or fetch data to the SRAM. The format of communications to the OCC is writing a command to SRAM, followed by a sending a "doorbell" or attention to the OCC, followed by reading the response from OCC. All of this takes place atomically so that multiple users don't collide in the SRAM. Changes since v4: * Use irqsave/irqrestore for spinlocks. * Put the OCC driver in the same patchset as it doesn't build without SBEFIFO. * Switch to reference counting for OCC clients. Changes since v3: * Add reset procedure and use it if there is data in the FIFO at probe time. * Add timeout for waiting for data to appear in the FIFO; if the SBE isn't running, then previously we would wait forever. * Fix remove() order of operations for both drivers. * Fix xfr memory leak for SBEFIFO. * Formatting fixes. Changes since v2: * Rename occ.c and occ.h to fsi-occ.c and fsi-occ.h * Improved remove() ordering in both drivers. * Added cancel functionality to OCC driver to make sure no xfrs started during remove(). * Fix spin_unlock with spin_unlock_irq in OCC driver. * Fix list_first_entry with list_first_entry_or_null in OCC worker function. * Add OCC response definitions to OCC include file. * Handle probe() failures better. Changes since v1: * Split bindings into separate patch and added SBEFIFO device binding * Fixed #includes * Fix SBEFIFO race condition between write() and poll_timer(). * Followed Rob's suggestion to just create one platform device for hwmon driver, instead of using the device tree. * Also check for "command in progress" response from OCC and try a while Edward A. James (8): dt-bindings: fsi: Add SBEFIFO documentation drivers/fsi: Add SBEFIFO FSI client device driver drivers/fsi: sbefifo: Add miscdevice drivers/fsi: sbefifo: Add in-kernel API dt-bindings: fsi: Add OCC documentation drivers/fsi: Add On-Chip Controller (OCC) driver drivers/fsi: occ: Add miscdevice drivers/fsi: occ: Add in-kernel API .../devicetree/bindings/fsi/ibm,p9-occ.txt | 18 + .../devicetree/bindings/fsi/ibm,p9-sbefifo.txt | 35 + drivers/fsi/Kconfig | 17 + drivers/fsi/Makefile | 2 + drivers/fsi/fsi-occ.c | 876 +++++++++++++++++ drivers/fsi/fsi-sbefifo.c | 1027 ++++++++++++++++++++ include/linux/fsi-occ.h | 41 + include/linux/fsi-sbefifo.h | 30 + 8 files changed, 2046 insertions(+) create mode 100644 Documentation/devicetree/bindings/fsi/ibm,p9-occ.txt create mode 100644 Documentation/devicetree/bindings/fsi/ibm,p9-sbefifo.txt create mode 100644 drivers/fsi/fsi-occ.c create mode 100644 drivers/fsi/fsi-sbefifo.c create mode 100644 include/linux/fsi-occ.h create mode 100644 include/linux/fsi-sbefifo.h