From patchwork Mon Nov 14 04:53:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: ppaidipe X-Patchwork-Id: 694370 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 AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tHJ8F1Y5rz9t0G for ; Mon, 14 Nov 2016 15:54:05 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tHJ8F0gVwzDvbg for ; Mon, 14 Nov 2016 15:54:05 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org 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 3tHJ841MyvzDvNH for ; Mon, 14 Nov 2016 15:53:56 +1100 (AEDT) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uAE4rbdn142086 for ; Sun, 13 Nov 2016 23:53:54 -0500 Received: from e23smtp04.au.ibm.com (e23smtp04.au.ibm.com [202.81.31.146]) by mx0a-001b2d01.pphosted.com with ESMTP id 26q05nnm59-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 13 Nov 2016 23:53:54 -0500 Received: from localhost by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 14 Nov 2016 14:53:51 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp04.au.ibm.com (202.81.31.210) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 14 Nov 2016 14:53:49 +1000 Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 4B4F83578056 for ; Mon, 14 Nov 2016 15:53:49 +1100 (EST) Received: from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uAE4rnXB25821240 for ; Mon, 14 Nov 2016 15:53:49 +1100 Received: from d23av05.au.ibm.com (localhost [127.0.0.1]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uAE4rmkc028608 for ; Mon, 14 Nov 2016 15:53:49 +1100 Received: from localhost.in.ibm.com ([9.124.158.132]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uAE4rlhh028584; Mon, 14 Nov 2016 15:53:48 +1100 From: ppaidipe@linux.vnet.ibm.com To: skiboot@lists.ozlabs.org Date: Mon, 14 Nov 2016 10:23:40 +0530 X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16111404-0012-0000-0000-000001E8137E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16111404-0013-0000-0000-0000066C8ABD Message-Id: <1479099220-1787-1-git-send-email-ppaidipe@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-11-14_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611140097 Subject: [Skiboot] [PATCH 3/3] hw/occ: Add occ functional state DT property and set chip->occ_functional properly. 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: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: Pridhiviraj Paidipeddi ibm,occ-functional-state property exist only on ibm,fsp systems. Add this property for non-fsp systems also and set chip->occ_functional data field accordingly. OCC Spec says: When OCC is told to go active it will populate OCC-OPAL shared memory interface with ‘valid’ and all Pstate data. So incase of OpenPower systems OPAL can add DT property ibm,occ-functional-state and set the chip->occ_functional data field to true when OPAL find's the valid homer region and corresponding occ_valid byte is set to 0x1. Signed-off-by: Pridhiviraj Paidipeddi --- hw/occ.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/hw/occ.c b/hw/occ.c index d5c590b..194be98 100644 --- a/hw/occ.c +++ b/hw/occ.c @@ -88,6 +88,7 @@ DEFINE_LOG_ENTRY(OPAL_RC_OCC_TIMEOUT, OPAL_PLATFORM_ERR_EVT, OPAL_OCC, static bool wait_for_all_occ_init(void) { struct proc_chip *chip; + struct dt_node *xn; uint64_t occ_data_area; struct occ_pstate_table *occ_data; int tries; @@ -115,12 +116,6 @@ static bool wait_for_all_occ_init(void) return false; } - if (!chip->occ_functional) { - prlog(PR_WARNING, "OCC: Chip: %x occ not functional\n", - chip->id); - continue; - } - /* Get PState table address */ occ_data_area = chip->homer_base + P8_HOMER_SAPPHIRE_DATA_OFFSET; occ_data = (struct occ_pstate_table *)occ_data_area; @@ -149,6 +144,11 @@ static bool wait_for_all_occ_init(void) chip->id); return false; } + + if (!chip->occ_functional) { + chip->occ_functional = true; + } + prlog(PR_DEBUG, "OCC: Chip %02x Data (%016llx) = %016llx\n", chip->id, occ_data_area, *(uint64_t *)occ_data_area); @@ -156,6 +156,14 @@ static bool wait_for_all_occ_init(void) end_time = mftb(); prlog(PR_NOTICE, "OCC: All Chip Rdy after %lu ms\n", tb_to_msecs(end_time - start_time)); + + dt_for_each_compatible(dt_root, xn, "ibm,xscom") { + const struct dt_property *p; + p = dt_find_property(xn, "ibm,occ-functional-state"); + if (!p) + dt_add_property_cells(xn, "ibm,occ-functional-state", + 0x1); + } return true; }