From patchwork Wed Jul 8 21:08:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reza Arbab X-Patchwork-Id: 1325478 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B2BkS6R8Fz9sQt for ; Thu, 9 Jul 2020 07:09:04 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4B2BkS2jrtzDqg6 for ; Thu, 9 Jul 2020 07:09:04 +1000 (AEST) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=arbab@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 4B2Bk96L44zDqfP for ; Thu, 9 Jul 2020 07:08:47 +1000 (AEST) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 068L2J5W148359 for ; Wed, 8 Jul 2020 17:08:45 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 325mp21rmh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 08 Jul 2020 17:08:45 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 068L5Qsi021323 for ; Wed, 8 Jul 2020 21:08:44 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma03dal.us.ibm.com with ESMTP id 325k1mh9w0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 08 Jul 2020 21:08:44 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 068L8hVq49742124 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 8 Jul 2020 21:08:44 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C1B1712405A for ; Wed, 8 Jul 2020 21:08:43 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 895FA124052 for ; Wed, 8 Jul 2020 21:08:43 +0000 (GMT) Received: from arbab-laptop.localdomain (unknown [9.160.114.254]) by b01ledav002.gho.pok.ibm.com (Postfix) with SMTP for ; Wed, 8 Jul 2020 21:08:43 +0000 (GMT) Received: by arbab-laptop.localdomain (Postfix, from userid 152845) id 683DD4650C9; Wed, 8 Jul 2020 16:08:41 -0500 (CDT) From: Reza Arbab To: pdbg@lists.ozlabs.org Date: Wed, 8 Jul 2020 16:08:40 -0500 Message-Id: <1594242521-14281-1-git-send-email-arbab@linux.ibm.com> X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-08_17:2020-07-08, 2020-07-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 suspectscore=1 mlxscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 mlxlogscore=779 adultscore=0 bulkscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007080124 Subject: [Pdbg] [PATCH] libpdbg/cfam: Simplify FSI port enable X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Do this with one write to MSENP0 instead of RMW to MENP0. Signed-off-by: Reza Arbab --- libpdbg/cfam.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libpdbg/cfam.c b/libpdbg/cfam.c index 0b670d869496..1a7467185928 100644 --- a/libpdbg/cfam.c +++ b/libpdbg/cfam.c @@ -314,15 +314,13 @@ static int cfam_hmfsi_probe(struct pdbg_target *target) { struct fsi *fsi = target_to_fsi(target); struct pdbg_target *fsi_parent = target->parent; - uint32_t value, port; + uint32_t value; int rc; /* Enable the port in the upstream control register */ - assert(!(pdbg_target_u32_property(target, "port", &port))); - fsi_read(fsi_parent, 0x3404, &value); - value |= 1 << (31 - port); - if ((rc = fsi_write(fsi_parent, 0x3404, value))) { - PR_ERROR("Unable to enable HMFSI port %d\n", port); + assert(!(pdbg_target_u32_property(target, "port", &value))); + if ((rc = fsi_write(fsi_parent, 0x3406, 0x80000000 >> value))) { + PR_ERROR("Unable to enable HMFSI port %d\n", value); return rc; }