From patchwork Wed Sep 13 05:24:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 813165 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xsVWJ69RGz9sPm for ; Wed, 13 Sep 2017 15:26:04 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xsVWJ5FS9zDrL8 for ; Wed, 13 Sep 2017 15:26:04 +1000 (AEST) 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.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=hegdevasant@linux.vnet.ibm.com; receiver=) 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 3xsVWC1Y2CzDrJ3 for ; Wed, 13 Sep 2017 15:25:58 +1000 (AEST) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8D5OQLB117153 for ; Wed, 13 Sep 2017 01:25:56 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0a-001b2d01.pphosted.com with ESMTP id 2cxq14frma-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 13 Sep 2017 01:25:56 -0400 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Sep 2017 15:25:54 +1000 Received: from d23relay07.au.ibm.com (202.81.31.226) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 13 Sep 2017 15:25:53 +1000 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 v8D5ObaM36765808 for ; Wed, 13 Sep 2017 15:24:37 +1000 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 v8D5Obeb003783 for ; Wed, 13 Sep 2017 15:24:37 +1000 Received: from hegdevasant.in.ibm.com ([9.109.222.138]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v8D5OUGK003602; Wed, 13 Sep 2017 15:24:35 +1000 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Wed, 13 Sep 2017 10:54:25 +0530 X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170913052425.23122-1-hegdevasant@linux.vnet.ibm.com> References: <20170913052425.23122-1-hegdevasant@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17091305-0040-0000-0000-00000355E8CB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17091305-0041-0000-0000-00000CD62DE9 Message-Id: <20170913052425.23122-3-hegdevasant@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-13_03:, , 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-1707230000 definitions=main-1709130083 Subject: [Skiboot] [PATCH 3/3] hdata: Add wafer-location property 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" Extract wafer-location from ECID and add property under xscom node. bits 64:71 are the chip x location (7:0) bits 72:79 are the chip y location (7:0) Sample output: ------------- [root@wsp xscom@623fc00000000]# lsprop ecid ecid 019a00d4 03100718 852c0000 00fd7911 [root@wsp xscom@623fc00000000]# lsprop wafer-location wafer-location 00000085 0000002c Signed-off-by: Vasant Hegde --- hdata/spira.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hdata/spira.c b/hdata/spira.c index 2e44209..bed7a21 100644 --- a/hdata/spira.c +++ b/hdata/spira.c @@ -411,6 +411,10 @@ static void add_ecid_data(const struct HDIF_common_hdr *hdr, } wafer_id[10] = '\0'; dt_add_property_nstr(xscom, "wafer-id", wafer_id, 10); + + dt_add_property_cells(xscom, "wafer-location", + (u32)((be64_to_cpu(ecid->high) >> 56) & 0xff), + (u32)((be64_to_cpu(ecid->high) >> 48) & 0xff)); } static void add_xscom_add_pcia_assoc(struct dt_node *np, uint32_t pcid)