From patchwork Wed Sep 13 05:24:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 813161 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 3xsVTw1M72z9sPm for ; Wed, 13 Sep 2017 15:24:52 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xsVTv6JYGzDrJc for ; Wed, 13 Sep 2017 15:24:51 +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.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=hegdevasant@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 3xsVTj0SpszDrHr for ; Wed, 13 Sep 2017 15:24:40 +1000 (AEST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8D5NrT6027325 for ; Wed, 13 Sep 2017 01:24:37 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0b-001b2d01.pphosted.com with ESMTP id 2cxqkap7dc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 13 Sep 2017 01:24:37 -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:24:34 +1000 Received: from d23relay08.au.ibm.com (202.81.31.227) 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:24:34 +1000 Received: from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v8D5OXNc35979362 for ; Wed, 13 Sep 2017 15:24:33 +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 v8D5OXjH003669 for ; Wed, 13 Sep 2017 15:24:33 +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 v8D5OUGI003602; Wed, 13 Sep 2017 15:24:31 +1000 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Wed, 13 Sep 2017 10:54:23 +0530 X-Mailer: git-send-email 2.9.3 X-TM-AS-MML: disable x-cbid: 17091305-0040-0000-0000-00000355E8C7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17091305-0041-0000-0000-00000CD62DE4 Message-Id: <20170913052425.23122-1-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 1/3] hdata: Add ecid 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" Add ecid property under xscom node. Sample output: ------------- [root@wsp xscom@623fc00000000]# lsprop ecid ecid 019a00d4 03100718 852c0000 00fd7911 Signed-off-by: Vasant Hegde --- hdata/spira.c | 17 +++++++++++++++++ hdata/spira.h | 10 ++++++++++ 2 files changed, 27 insertions(+) diff --git a/hdata/spira.c b/hdata/spira.c index b58be7c..147e650 100644 --- a/hdata/spira.c +++ b/hdata/spira.c @@ -372,6 +372,22 @@ static void add_vas_node(struct dt_node *np, int idx) dt_add_property_cells(vas, "ibm,vas-id", idx); } +static void add_ecid_data(const struct HDIF_common_hdr *hdr, + struct dt_node *xscom) +{ + uint32_t size = 0; + struct sppcrd_ecid *ecid; + const struct HDIF_array_hdr *ec_hdr; + + ec_hdr = HDIF_get_idata(hdr, SPPCRD_IDATA_EC_LEVEL, &size); + if (!ec_hdr || !size) + return; + + ecid = (void *)ec_hdr + be32_to_cpu(ec_hdr->offset); + dt_add_property_u64s(xscom, "ecid", be64_to_cpu(ecid->low), + be64_to_cpu(ecid->high)); +} + static void add_xscom_add_pcia_assoc(struct dt_node *np, uint32_t pcid) { const struct HDIF_common_hdr *hdr; @@ -487,6 +503,7 @@ static bool add_xscom_sppcrd(uint64_t xscom_base) add_xive_node(np); parse_i2c_devs(hdif, SPPCRD_IDATA_HOST_I2C, np); add_vas_node(np, i); + add_ecid_data(hdif, np); } /* diff --git a/hdata/spira.h b/hdata/spira.h index 0276d4a..26648a9 100644 --- a/hdata/spira.h +++ b/hdata/spira.h @@ -1063,6 +1063,16 @@ struct sppcrd_chip_tod { /* Idata index 5 : Chip attached I2C devices */ #define SPPCRD_IDATA_HOST_I2C 5 +/* Idata index 8 : chip EC Level array */ +#define SPPCRD_IDATA_EC_LEVEL 8 + +struct sppcrd_ecid { + __be32 chip_id; + __be32 ec_level; + __be64 low; /* Processor ECID bit 0-63 */ + __be64 high; /* Processor ECID bit 64-127 */ +} __packed; + /* * Host Services Data. */