From patchwork Thu Oct 18 01:16:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Donnellan X-Patchwork-Id: 985656 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42bB2x16Nxz9s8r for ; Thu, 18 Oct 2018 12:16:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=au1.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42bB2w5zQwzF3R8 for ; Thu, 18 Oct 2018 12:16:40 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=au1.ibm.com X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=au1.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=andrew.donnellan@au1.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=au1.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42bB2s6572zF3GC for ; Thu, 18 Oct 2018 12:16:37 +1100 (AEDT) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9I19KPe094599 for ; Wed, 17 Oct 2018 21:16:36 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2n6ee7c600-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 17 Oct 2018 21:16:35 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 18 Oct 2018 02:16:33 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 18 Oct 2018 02:16:31 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w9I1GUBk3604814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 18 Oct 2018 01:16:30 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 62AC211C05E; Thu, 18 Oct 2018 01:16:30 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1417211C04C; Thu, 18 Oct 2018 01:16:30 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 18 Oct 2018 01:16:30 +0000 (GMT) Received: from intelligence.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id F22FBA0379; Thu, 18 Oct 2018 12:16:28 +1100 (AEDT) From: Andrew Donnellan To: skiboot@lists.ozlabs.org Date: Thu, 18 Oct 2018 12:16:17 +1100 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181018011617.14191-1-andrew.donnellan@au1.ibm.com> References: <20181018011617.14191-1-andrew.donnellan@au1.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18101801-4275-0000-0000-000002CF184A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18101801-4276-0000-0000-000037DA18DB Message-Id: <20181018011617.14191-4-andrew.donnellan@au1.ibm.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-10-17_15:, , 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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810180010 Subject: [Skiboot] [PATCH 4/4] hw/npu2-common: Allow mixed mode NPU setups X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair@popple.id.au, arbab@linux.ibm.com, fbarrat@linux.vnet.ibm.com Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Now that we have all the support in place for NPUs with both NVLink and OpenCAPI devices, get rid of the error that aborts NPU init when a mixed setup is detected. While we're there, rename setup_devices() to more accurately reflect what it does, and move the calls to the NVLink/OpenCAPI setup code out of there into the main probe function. Signed-off-by: Andrew Donnellan --- hw/npu2-common.c | 23 ++++------------------- hw/npu2-opencapi.c | 5 ----- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/hw/npu2-common.c b/hw/npu2-common.c index 1b07d157b744..16533286ca79 100644 --- a/hw/npu2-common.c +++ b/hw/npu2-common.c @@ -361,26 +361,19 @@ failed: return NULL; } -static void setup_devices(struct npu2 *npu) +static void add_link_type_properties(struct npu2 *npu) { - bool nvlink_detected = false, ocapi_detected = false; struct npu2_dev *dev; - /* - * TODO: In future, we'll do brick configuration here to support mixed - * setups. - */ for (int i = 0; i < npu->total_devices; i++) { dev = &npu->devices[i]; switch (dev->type) { case NPU2_DEV_TYPE_NVLINK: - nvlink_detected = true; dt_add_property_strings(dev->dt_node, "ibm,npu-link-type", "nvlink"); break; case NPU2_DEV_TYPE_OPENCAPI: - ocapi_detected = true; dt_add_property_strings(dev->dt_node, "ibm,npu-link-type", "opencapi"); @@ -393,16 +386,6 @@ static void setup_devices(struct npu2 *npu) "unknown"); } } - - if (nvlink_detected && ocapi_detected) { - prlog(PR_ERR, "NPU: NVLink and OpenCAPI devices on same chip not supported, aborting NPU init\n"); - return; - } - - if (nvlink_detected) - npu2_nvlink_init_npu(npu); - else if (ocapi_detected) - npu2_opencapi_init_npu(npu); } void probe_npu2(void) @@ -438,7 +421,9 @@ void probe_npu2(void) if (!npu) continue; platform.npu2_device_detect(npu); + add_link_type_properties(npu); set_brick_config(npu); - setup_devices(npu); + npu2_nvlink_init_npu(npu); + npu2_opencapi_init_npu(npu); } } diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c index fdad7c5c1bbe..93df898cd068 100644 --- a/hw/npu2-opencapi.c +++ b/hw/npu2-opencapi.c @@ -19,15 +19,10 @@ * * This file provides support for OpenCAPI as implemented on POWER9. * - * At present, we initialise the NPU separately from the NVLink code in npu2.c. - * As such, we don't currently support mixed NVLink and OpenCAPI configurations - * on the same NPU for machines such as Witherspoon. - * * Procedure references in this file are to the POWER9 OpenCAPI NPU Workbook * (IBM internal document). * * TODO: - * - Support for mixed NVLink and OpenCAPI on the same NPU * - Support for link ganging (one AFU using multiple links) * - Link reset and error handling * - Presence detection