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. */ From patchwork Wed Sep 13 05:24:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 813162 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 3xsVV73wGGz9sMN for ; Wed, 13 Sep 2017 15:25:03 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xsVV72MTrzDrKj for ; Wed, 13 Sep 2017 15:25:03 +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 3xsVTm3HSzzDrHr for ; Wed, 13 Sep 2017 15:24:44 +1000 (AEST) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8D5Nrcj012252 for ; Wed, 13 Sep 2017 01:24:42 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0a-001b2d01.pphosted.com with ESMTP id 2cxx1311kg-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 13 Sep 2017 01:24:41 -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:38 +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:36 +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 v8D5OZw940763568 for ; Wed, 13 Sep 2017 15:24:35 +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 v8D5OZkC003728 for ; Wed, 13 Sep 2017 15:24:35 +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 v8D5OUGJ003602; Wed, 13 Sep 2017 15:24:33 +1000 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Wed, 13 Sep 2017 10:54:24 +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-00000355E8C8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17091305-0041-0000-0000-00000CD62DE5 Message-Id: <20170913052425.23122-2-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 2/3] hdata: Add wafer-id 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" Wafer id is derived from ECID data. bits 4:63 are the wafer id ( ten 6 bit fields each containing a code) Sample output: ------------- [root@wsp xscom@623fc00000000]# lsprop ecid ecid 019a00d4 03100718 852c0000 00fd7911 [root@wsp xscom@623fc00000000]# lsprop wafer-id wafer-id "6Q0DG340SO" Signed-off-by: Vasant Hegde --- hdata/spira.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/hdata/spira.c b/hdata/spira.c index 147e650..2e44209 100644 --- a/hdata/spira.c +++ b/hdata/spira.c @@ -375,6 +375,9 @@ static void add_vas_node(struct dt_node *np, int idx) static void add_ecid_data(const struct HDIF_common_hdr *hdr, struct dt_node *xscom) { + char wafer_id[11]; + uint8_t tmp; + int i; uint32_t size = 0; struct sppcrd_ecid *ecid; const struct HDIF_array_hdr *ec_hdr; @@ -386,6 +389,28 @@ static void add_ecid_data(const struct HDIF_common_hdr *hdr, 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)); + + /* + * bits 4:63 of ECID data contains wafter ID data (ten 6 bit fields + * each containing a code). + */ + for (i = 0; i < 10; i++) { + tmp = (u8)((ecid->low >> (i * 6)) & 0x3f); + if (tmp <= 9) + wafer_id[9 - i] = tmp + '0'; + else if (tmp >= 0xA && tmp <= 0x23) + wafer_id[9 - i] = tmp + '0' + 7; + else if (tmp == 0x3D) + wafer_id[9 - i] = '-'; + else if (tmp == 0x3E) + wafer_id[9 - i] = '.'; + else if (tmp == 0x3F) + wafer_id[9 - i] = ' '; + else /* Unknown code */ + wafer_id[9 - i] = tmp + '0'; + } + wafer_id[10] = '\0'; + dt_add_property_nstr(xscom, "wafer-id", wafer_id, 10); } static void add_xscom_add_pcia_assoc(struct dt_node *np, uint32_t pcid) 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)