From patchwork Mon Apr 10 01:57:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Currey X-Patchwork-Id: 748809 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w1YSt2bHQz9s65 for ; Mon, 10 Apr 2017 12:06:22 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="CFc3VApe"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3w1YSt1NQbzDq88 for ; Mon, 10 Apr 2017 12:06:22 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="CFc3VApe"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3w1YSn0r5zzDq8B for ; Mon, 10 Apr 2017 12:06:17 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="CFc3VApe"; dkim-atps=neutral Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id CFA3CC73; Sun, 9 Apr 2017 21:58:08 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Sun, 09 Apr 2017 21:58:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=YO4ssRR3AwH3i9pmb6JoRvxji947ueNiJ7+wHgsSM HM=; b=CFc3VApe2vVp7+MIsYFppyFbzi7TPk5MmbD81NQ6WUpPGl7Cma0JzNABQ iun5AkJyosMx4UOn22w+9lp72YUx1mnhD9ynXXeGw7W3JFgjyg38Snz4DF8tAAHt ZjDlx48x0th1zcFYdmiakQGGudOXS9+657jyzoMZAbxtQSY0DJ9tEsAfHk83Qyhw rXMBoZCM4ciCGoLXJ/t5jF9KwJmyhMCpW+yQw461YRWYTgufYJq7yv91qERGIDBW 5fvmwLifOI+DW9v/sxh5TCID7ZnnSpH9Pct4RvTA+UXMMx7Dpj+NAp+cSDE/mKeG gMvHym++aFQd/eGR11akQV/Qn2hVg== X-ME-Sender: X-Sasl-enc: vIj1nkwBiVNQQXPxiTtLZnOJVsuBFDKf4EBJX05Yb0RB 1491789487 Received: from snap.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 4B3FF2466B; Sun, 9 Apr 2017 21:58:07 -0400 (EDT) From: Russell Currey To: skiboot@lists.ozlabs.org Date: Mon, 10 Apr 2017 11:57:35 +1000 Message-Id: <20170410015737.9487-3-ruscur@russell.cc> X-Mailer: git-send-email 2.12.1 In-Reply-To: <20170410015737.9487-1-ruscur@russell.cc> References: <20170410015737.9487-1-ruscur@russell.cc> Subject: [Skiboot] [PATCH 2/4] phb4: Implement fence check X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Fence detection is missing in PHB4, so implement it. The mechanism is the exact same as in PHB3. Signed-off-by: Russell Currey --- hw/phb4.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/phb4.c b/hw/phb4.c index 6c7bb9fe..2b2d2ab7 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -157,7 +157,14 @@ static inline void phb4_ioda_sel(struct phb4 *p, uint32_t table, /* Check if AIB is fenced via PBCQ NFIR */ static bool phb4_fenced(struct phb4 *p) { - // FIXME + uint64_t nfir; + + xscom_read(p->chip_id, p->pe_stk_xscom + 0x0, &nfir); + if (nfir & PPC_BIT(16)) { + p->flags |= PHB4_AIB_FENCED; + p->state = PHB4_STATE_FENCED; + return true; + } return false; }