From patchwork Wed Oct 18 11:49:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shilpasri G Bhat X-Patchwork-Id: 827552 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 3yH9Q25H91z9sBW for ; Wed, 18 Oct 2017 22:51:38 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3yH9Q245fhzDrS5 for ; Wed, 18 Oct 2017 22:51:38 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=shilpa.bhat@linux.vnet.ibm.com; receiver=) 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 3yH9P146FJzDrGy for ; Wed, 18 Oct 2017 22:50:44 +1100 (AEDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9IBnXln015922 for ; Wed, 18 Oct 2017 07:50:42 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2dp358ctwd-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 18 Oct 2017 07:50:42 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 18 Oct 2017 12:50:40 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 18 Oct 2017 12:50:38 +0100 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9IBoZcg23331068 for ; Wed, 18 Oct 2017 11:50:37 GMT Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v9IBoePE010894 for ; Wed, 18 Oct 2017 22:50:40 +1100 Received: from oc4502181600.ibm.com ([9.102.1.24]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v9IBobDu010815; Wed, 18 Oct 2017 22:50:38 +1100 From: Shilpasri G Bhat To: skiboot@lists.ozlabs.org Date: Wed, 18 Oct 2017 17:19:32 +0530 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-MML: disable x-cbid: 17101811-0040-0000-0000-000003E3FE2A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17101811-0041-0000-0000-000025E64D41 Message-Id: <1508327372-10535-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-10-18_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710180167 Subject: [Skiboot] [PATCH] occ-sensors : Add OCC inband sensor region to exports X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 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" Signed-off-by: Shilpasri G Bhat --- hw/occ-sensor.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/occ-sensor.c b/hw/occ-sensor.c index 89f529f..1042c11 100644 --- a/hw/occ-sensor.c +++ b/hw/occ-sensor.c @@ -546,7 +546,7 @@ static const char *get_sensor_loc_string(enum occ_sensor_location loc) void occ_sensors_init(void) { struct proc_chip *chip; - struct dt_node *sg; + struct dt_node *sg, *exports; int occ_num = 0, i; /* OCC inband sensors is only supported in P9 */ @@ -633,4 +633,16 @@ void occ_sensors_init(void) occ_add_sensor_groups(sg, phandles, phcount, chip->id); free(phandles); } + + if (!occ_num) + return; + + exports = dt_find_by_path(dt_root, "/ibm,opal/firmware/exports"); + if (!exports) { + prerror("OCC: dt node /ibm,opal/firmware/exports not found\n"); + return; + } + + dt_add_property_u64s(exports, "occ_inband_sensors", occ_sensor_base, + OCC_SENSOR_DATA_BLOCK_SIZE * occ_num); }