From patchwork Tue Mar 31 09:47:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Barrat X-Patchwork-Id: 1264623 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48s4Kf73nyz9sSl for ; Tue, 31 Mar 2020 20:49:10 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48s4Kf1ZKczDr0L for ; Tue, 31 Mar 2020 20:49:10 +1100 (AEDT) X-Original-To: skiboot-stable@lists.ozlabs.org Delivered-To: skiboot-stable@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=fbarrat@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.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 48s4Jk1KqCzDqyg for ; Tue, 31 Mar 2020 20:48:21 +1100 (AEDT) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02V9WeZn043195 for ; Tue, 31 Mar 2020 05:48:18 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 303wrw148g-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 31 Mar 2020 05:48:18 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 Mar 2020 10:48:03 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 31 Mar 2020 10:48:02 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02V9mBIt43843634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 Mar 2020 09:48:12 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CF5D7AE056; Tue, 31 Mar 2020 09:48:11 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 99128AE055; Tue, 31 Mar 2020 09:48:11 +0000 (GMT) Received: from pic2.home (unknown [9.145.78.7]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 31 Mar 2020 09:48:11 +0000 (GMT) From: Frederic Barrat To: skiboot@lists.ozlabs.org Date: Tue, 31 Mar 2020 11:47:34 +0200 X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 20033109-0016-0000-0000-000002FB8DDD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20033109-0017-0000-0000-0000335F4C45 Message-Id: <20200331094735.82874-1-fbarrat@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-03-31_03:2020-03-30, 2020-03-31 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=933 clxscore=1011 bulkscore=0 malwarescore=0 suspectscore=1 phishscore=0 priorityscore=1501 spamscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003310086 Subject: [Skiboot-stable] [PATCH 1/2] npu2-hw-procedures: Add platform hook to tune PHY setup X-BeenThere: skiboot-stable@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Patches, review, and discussion for stable releases of skiboot" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: clombard@linux.ibm.com, skiboot-stable@lists.ozlabs.org, chhank@tw.ibm.com, andrew.donnellan@au1.ibm.com, joy_chu@wistron.com Errors-To: skiboot-stable-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot-stable" Add a hook to tune the PHY settings if needed. Only on the opencapi path for now, since it seems to be only useful there. It will be used on a later patch for Mihawk. Signed-off-by: Frederic Barrat Cc: skiboot-stable@lists.ozlabs.org # skiboot-op940.x Reviewed-by: Andrew Donnellan --- hw/npu2-hw-procedures.c | 3 +++ include/platform.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/hw/npu2-hw-procedures.c b/hw/npu2-hw-procedures.c index 6236380a..890b25a8 100644 --- a/hw/npu2-hw-procedures.c +++ b/hw/npu2-hw-procedures.c @@ -1020,6 +1020,9 @@ void npu2_opencapi_bump_ui_lane(struct npu2_dev *dev) void npu2_opencapi_phy_init(struct npu2_dev *dev) { + if (platform.ocapi->phy_setup) + platform.ocapi->phy_setup(dev); + run_procedure(dev, 5); /* procedure_phy_tx_zcal */ /* * This is only required for OpenCAPI - Hostboot tries to set this diff --git a/include/platform.h b/include/platform.h index 6aa263ae..c045883d 100644 --- a/include/platform.h +++ b/include/platform.h @@ -11,6 +11,7 @@ struct pci_slot; struct errorlog; struct npu2; struct npu3; +struct npu2_dev; enum resource_id { RESOURCE_ID_KERNEL, @@ -64,6 +65,7 @@ struct platform_ocapi { bool odl_phy_swap; /* Swap ODL1 to use brick 2 rather than * brick 1 lanes */ const char *(*ocapi_slot_label)(uint32_t chip_id, uint32_t brick_index); + void (*phy_setup)(struct npu2_dev *dev); }; struct dt_node;