Received: by 10.223.176.46 with SMTP id f43csp4056211wra; Tue, 23 Jan 2018 03:36:46 -0800 (PST) X-Google-Smtp-Source: AH8x224pk6ou7/B3vbvWcc/A/40T2UK3YXIUTYh8gA+XDo/Dj9FdMM7iOHES0E+Fa6bS690qDK+p X-Received: by 10.101.92.129 with SMTP id a1mr8863188pgt.198.1516707406173; Tue, 23 Jan 2018 03:36:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516707406; cv=none; d=google.com; s=arc-20160816; b=VEanVkfJ5RftCHusH5jZK5zWpci0OHs2Mpu/PvomwxQIm2/ZolLVyDFOhLkJP8iNsw gTyy1RhkTysRytwSrQRu1JMY1UEiP7+1adqUUChoPsUS0L9UoHidWYMFOIbav/dZ8n2x FElIaA70oSM1pPDUKIhE7unO90cYZIclNyneDs9dCb7OlPPTd8Nq9URg1CO2DG5Ap77c qgaMrRQg5ugpSyKu0LvdrJh8g3NKIvHKoGZE9gKeaR9lnLPldpLgIWwdG0eVgn1O2H2J 74ksoKW+KmtR2vU1BI6ow1DoeODTpINJaBIdD9XyD54vf5ap6UHktimUbYxuCbbnRREG +5Mw== 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=oadjuhheH+IVIBHZRMXuRHmd8QJR4Z+aXzYiWqh0RzY=; b=zbn687v38dUVZW4MCVEooScrbSKK/2dbCQjRrx6cdrxaZWA14QW+xzUNTFyvHexd/M XJwE3AntxtjRxbIOshye9dR4nDmGR0Rf2E6K7j8l7x5X5hDHxWApQ6UtPtTUeI9f5Dvw iakuGhStajShW2lolAbws/OPtJ4bqxPgqDkxejGVZ9qY2CgKp3HBght0VjDzdDarvNC0 bpifmBm6TdRmrwXThHuXJN3nDICOKJqMTC8M+TwTF9HxUyHZf1s+WDzQxYLY3+B/36Fk PX5W9s4xoNFze6Bmrm1T7kWOdVSVbQm+HFIhoNuBgURRXZzLaxTZfENJ/kWD5RSb+kT6 QD5w== 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 e7si4842346pgq.581.2018.01.23.03.36.31; Tue, 23 Jan 2018 03:36:46 -0800 (PST) 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 S1751443AbeAWLb5 (ORCPT + 99 others); Tue, 23 Jan 2018 06:31:57 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33042 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751359AbeAWLbz (ORCPT ); Tue, 23 Jan 2018 06:31:55 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0NBTbrE123131 for ; Tue, 23 Jan 2018 06:31:55 -0500 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fp3n01kc8-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 23 Jan 2018 06:31:55 -0500 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Jan 2018 11:31:52 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 23 Jan 2018 11:31:49 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0NBVmFG47841498; Tue, 23 Jan 2018 11:31:48 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CCE58A4053; Tue, 23 Jan 2018 11:25:28 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8451AA405B; Tue, 23 Jan 2018 11:25:28 +0000 (GMT) Received: from borneo.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.34]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 23 Jan 2018 11:25:28 +0000 (GMT) From: Frederic Barrat To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, gregkh@linuxfoundation.org, mpe@ellerman.id.au, andrew.donnellan@au1.ibm.com, alastair@au1.ibm.com Subject: [PATCH v2 00/13] New driver to support OpenCAPI devices on POWER9 Date: Tue, 23 Jan 2018 12:31:35 +0100 X-Mailer: git-send-email 2.14.1 X-TM-AS-GCONF: 00 x-cbid: 18012311-0016-0000-0000-0000051AD93F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012311-0017-0000-0000-000028575EDE Message-Id: <20180123113148.6024-1-fbarrat@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-23_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801230158 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds support for Open Coherent Accelerator (ocxl) devices on POWER9 processor. OpenCAPI is a consortium developing the specifications for an interface between processors and accelerators, allowing sharing the host memory with the accelerators, using virtual addresses. The OpenCAPI device can also have its own local memory and provide access to the host, though it is not supported by that series. The OpenCAPI specification is processor agnostic, but this series adds support specifically for powerpc. Even though the underlying transport is not PCI, the firmware abstracts the hardware like a PCI host bridge and Linux sees the OpenCAPI devices as PCI devices. So a lot of existing infrastructure and commands can be reused. Patches 1-5: add the platform-specific services needed by the driver Patches 6-10: driver code Patch 11: small correction to existing cxl driver Patch 12: documentation Current limitations, that will be addressed in later patches: - no capability to trigger a reset of the opencapi adapter - no support for the 'wake_host_thread' command - no support for adapters with a dual-link connection (none exists yet) - no access to the adapter-local memory Many people contributed directly or indirectly, from the software, hardware and bringup teams. In particular Andrew Donnellan and Alastair D'Silva, who are developing the related firmware and library. Feedback welcome! Changelog: v2: All/many patches: use new SPDX tag for licensing info fix sparse warnings patch 2: set "From" field correctly don't activate the PCI fixup on platforms other than powernv patch 4: fix typos patch 7: map AFU interrupt trigger page write-only patch 10: rephrase CONFIG help message patch 12: add documentation for new sysfs files patch 13: follow alphabetical order for new entry in MAINTAINERS Andrew Donnellan (1): powerpc/powernv: Set correct configuration space size for opencapi devices Frederic Barrat (12): powerpc/powernv: Introduce new PHB type for opencapi links powerpc/powernv: Add opal calls for opencapi powerpc/powernv: Add platform-specific services for opencapi powerpc/powernv: Capture actag information for the device ocxl: Driver code for 'generic' opencapi devices ocxl: Add AFU interrupt support ocxl: Add a kernel API for other opencapi drivers ocxl: Add trace points ocxl: Add Makefile and Kconfig cxl: Remove support for "Processing accelerators" class ocxl: Documentation ocxl: add MAINTAINERS entry Documentation/ABI/testing/sysfs-class-ocxl | 35 ++ Documentation/accelerators/ocxl.rst | 160 ++++++ Documentation/ioctl/ioctl-number.txt | 1 + MAINTAINERS | 12 + arch/powerpc/include/asm/opal-api.h | 5 +- arch/powerpc/include/asm/opal.h | 6 + arch/powerpc/include/asm/pnv-ocxl.h | 36 ++ arch/powerpc/platforms/powernv/Makefile | 1 + arch/powerpc/platforms/powernv/npu-dma.c | 2 +- arch/powerpc/platforms/powernv/ocxl.c | 515 ++++++++++++++++++ arch/powerpc/platforms/powernv/opal-wrappers.S | 3 + arch/powerpc/platforms/powernv/pci-ioda.c | 54 +- arch/powerpc/platforms/powernv/pci.c | 4 + arch/powerpc/platforms/powernv/pci.h | 8 +- drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/cxl/pci.c | 2 - drivers/misc/ocxl/Kconfig | 31 ++ drivers/misc/ocxl/Makefile | 11 + drivers/misc/ocxl/afu_irq.c | 202 +++++++ drivers/misc/ocxl/config.c | 723 +++++++++++++++++++++++++ drivers/misc/ocxl/context.c | 279 ++++++++++ drivers/misc/ocxl/file.c | 432 +++++++++++++++ drivers/misc/ocxl/link.c | 647 ++++++++++++++++++++++ drivers/misc/ocxl/main.c | 33 ++ drivers/misc/ocxl/ocxl_internal.h | 131 +++++ drivers/misc/ocxl/pasid.c | 107 ++++ drivers/misc/ocxl/pci.c | 585 ++++++++++++++++++++ drivers/misc/ocxl/sysfs.c | 142 +++++ drivers/misc/ocxl/trace.c | 6 + drivers/misc/ocxl/trace.h | 182 +++++++ include/misc/ocxl-config.h | 45 ++ include/misc/ocxl.h | 214 ++++++++ include/uapi/misc/ocxl.h | 49 ++ 34 files changed, 4650 insertions(+), 15 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-class-ocxl create mode 100644 Documentation/accelerators/ocxl.rst create mode 100644 arch/powerpc/include/asm/pnv-ocxl.h create mode 100644 arch/powerpc/platforms/powernv/ocxl.c create mode 100644 drivers/misc/ocxl/Kconfig create mode 100644 drivers/misc/ocxl/Makefile create mode 100644 drivers/misc/ocxl/afu_irq.c create mode 100644 drivers/misc/ocxl/config.c create mode 100644 drivers/misc/ocxl/context.c create mode 100644 drivers/misc/ocxl/file.c create mode 100644 drivers/misc/ocxl/link.c create mode 100644 drivers/misc/ocxl/main.c create mode 100644 drivers/misc/ocxl/ocxl_internal.h create mode 100644 drivers/misc/ocxl/pasid.c create mode 100644 drivers/misc/ocxl/pci.c create mode 100644 drivers/misc/ocxl/sysfs.c create mode 100644 drivers/misc/ocxl/trace.c create mode 100644 drivers/misc/ocxl/trace.h create mode 100644 include/misc/ocxl-config.h create mode 100644 include/misc/ocxl.h create mode 100644 include/uapi/misc/ocxl.h -- 2.14.1