From patchwork Thu Aug 31 07:12:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudio Carvalho X-Patchwork-Id: 808074 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 3xjYYC2cBjz9sMN for ; Thu, 31 Aug 2017 17:15:11 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xjYYC1nD1zDqmX for ; Thu, 31 Aug 2017 17:15:11 +1000 (AEST) 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 3xjYVW6MmdzDqlM for ; Thu, 31 Aug 2017 17:12:51 +1000 (AEST) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v7V7BliH030923 for ; Thu, 31 Aug 2017 03:12:50 -0400 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0a-001b2d01.pphosted.com with ESMTP id 2cpdby1p3d-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 31 Aug 2017 03:12:49 -0400 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 Aug 2017 03:12:48 -0400 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 31 Aug 2017 03:12:46 -0400 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v7V7CkSC60424300; Thu, 31 Aug 2017 07:12:46 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AF8E0AE03B; Thu, 31 Aug 2017 03:13:10 -0400 (EDT) Received: from legolas.ibm.com (unknown [9.85.193.48]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id 06887AE034; Thu, 31 Aug 2017 03:13:09 -0400 (EDT) From: Claudio Carvalho To: skiboot@lists.ozlabs.org Date: Thu, 31 Aug 2017 04:12:33 -0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504163557-14432-1-git-send-email-cclaudio@linux.vnet.ibm.com> References: <1504163557-14432-1-git-send-email-cclaudio@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17083107-2213-0000-0000-000002123923 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007640; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000226; SDB=6.00910093; UDB=6.00456508; IPR=6.00690374; BA=6.00005562; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016938; XFM=3.00000015; UTC=2017-08-31 07:12:47 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17083107-2214-0000-0000-000057644725 Message-Id: <1504163557-14432-2-git-send-email-cclaudio@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-31_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-1707230000 definitions=main-1708310109 Subject: [Skiboot] [PATCH v2 1/5] hdata/i2c: add __packed to the host_i2c_hdr structure 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: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This adds __packed to the host_i2c_hdr structure since it defines an offset that refers to the beginning of the structure. Fixes: 41dc3eb4495c451a405974570f604622a3f829ef Signed-off-by: Claudio Carvalho --- hdata/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hdata/i2c.c b/hdata/i2c.c index 9de6aa4..cc127d5 100644 --- a/hdata/i2c.c +++ b/hdata/i2c.c @@ -152,7 +152,7 @@ static bool is_zeros(const void *p, size_t size) struct host_i2c_hdr { const struct HDIF_array_hdr hdr; __be32 version; -}; +} __packed; int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index, struct dt_node *xscom) From patchwork Thu Aug 31 07:12:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudio Carvalho X-Patchwork-Id: 808076 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 3xjYYP2PxGz9s7c for ; Thu, 31 Aug 2017 17:15:21 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xjYYP1Yb3zDrKh for ; Thu, 31 Aug 2017 17:15:21 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org 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 3xjYVb1X2mzDqbZ for ; Thu, 31 Aug 2017 17:12:54 +1000 (AEST) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v7V79ddC053373 for ; Thu, 31 Aug 2017 03:12:52 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0b-001b2d01.pphosted.com with ESMTP id 2cp6sd8mn5-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 31 Aug 2017 03:12:52 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 Aug 2017 03:12:51 -0400 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 31 Aug 2017 03:12:48 -0400 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v7V7Cmjh21954580; Thu, 31 Aug 2017 07:12:48 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A6C50AE03B; Thu, 31 Aug 2017 03:13:12 -0400 (EDT) Received: from legolas.ibm.com (unknown [9.85.193.48]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id F1743AE03C; Thu, 31 Aug 2017 03:13:11 -0400 (EDT) From: Claudio Carvalho To: skiboot@lists.ozlabs.org Date: Thu, 31 Aug 2017 04:12:34 -0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504163557-14432-1-git-send-email-cclaudio@linux.vnet.ibm.com> References: <1504163557-14432-1-git-send-email-cclaudio@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17083107-0024-0000-0000-000002C83684 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007640; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000226; SDB=6.00910093; UDB=6.00456508; IPR=6.00690374; BA=6.00005562; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016938; XFM=3.00000015; UTC=2017-08-31 07:12:50 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17083107-0025-0000-0000-00004544B539 Message-Id: <1504163557-14432-3-git-send-email-cclaudio@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-31_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-1707230000 definitions=main-1708310109 Subject: [Skiboot] [PATCH v2 2/5] hdata/i2c: ignore i2c devs marked as unknown in the hdat 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: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Some I2C devices are marked as unknown in the hdat. We don't need to add them to the device tree, so this just log them. Signed-off-by: Claudio Carvalho Reviewed-by: Oliver O'Halloran --- hdata/i2c.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hdata/i2c.c b/hdata/i2c.c index cc127d5..bfb5b48 100644 --- a/hdata/i2c.c +++ b/hdata/i2c.c @@ -226,6 +226,17 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index, */ i2c_addr = dev->i2c_addr >> 1; + /* + * Some i2c devs are marked as unknown in the hdat. + * Ignoring them. + */ + if (dev->type == 0xFF) { + prlog(PR_INFO, "HDAT I2C: ignoring e%dp%d - unknown@%x " + "(port 0x%x)\n", dev->i2cm_engine, + dev->i2cm_port, i2c_addr, dev->i2c_port); + continue; + } + prlog(PR_TRACE, "HDAT I2C: found e%dp%d - %x\n", dev->i2cm_engine, dev->i2cm_port, i2c_addr); From patchwork Thu Aug 31 07:12:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudio Carvalho X-Patchwork-Id: 808078 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 3xjYYv0XVSz9sMN for ; Thu, 31 Aug 2017 17:15:47 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xjYYt5fLqzDqV5 for ; Thu, 31 Aug 2017 17:15:46 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org 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 3xjYVb4mcVzDqjm for ; Thu, 31 Aug 2017 17:12:55 +1000 (AEST) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v7V79mPl017253 for ; Thu, 31 Aug 2017 03:12:52 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0b-001b2d01.pphosted.com with ESMTP id 2cpa77x8jd-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 31 Aug 2017 03:12:52 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 Aug 2017 03:12:52 -0400 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 31 Aug 2017 03:12:50 -0400 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v7V7CoQv29294786; Thu, 31 Aug 2017 07:12:50 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 94140AE043; Thu, 31 Aug 2017 03:13:14 -0400 (EDT) Received: from legolas.ibm.com (unknown [9.85.193.48]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id E8474AE034; Thu, 31 Aug 2017 03:13:13 -0400 (EDT) From: Claudio Carvalho To: skiboot@lists.ozlabs.org Date: Thu, 31 Aug 2017 04:12:35 -0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504163557-14432-1-git-send-email-cclaudio@linux.vnet.ibm.com> References: <1504163557-14432-1-git-send-email-cclaudio@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17083107-0024-0000-0000-000002C83686 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007640; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000226; SDB=6.00910094; UDB=6.00456508; IPR=6.00690374; BA=6.00005562; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016938; XFM=3.00000015; UTC=2017-08-31 07:12:52 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17083107-0025-0000-0000-00004544B53F Message-Id: <1504163557-14432-4-git-send-email-cclaudio@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-31_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-1707230000 definitions=main-1708310109 Subject: [Skiboot] [PATCH v2 3/5] hdata/i2c: update the list of known i2c devs as of version 2 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: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Some i2c devices are not properly identified during the HDAT parsing. This fixes that by updating the list of known i2c devices as of the i2c array version 2. Signed-off-by: Claudio Carvalho Reviewed-by: Oliver O'Halloran --- hdata/i2c.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hdata/i2c.c b/hdata/i2c.c index bfb5b48..14650b6 100644 --- a/hdata/i2c.c +++ b/hdata/i2c.c @@ -91,8 +91,14 @@ struct hdat_i2c_type { }; struct hdat_i2c_type hdat_i2c_devs[] = { + { 0x1, "gpio", "nxp,pca9551" }, /* XXX: Please verify that all VPD EEPROMs are of this type */ - { 0x2, "eeprom", "atmel,24c128" } + { 0x2, "eeprom", "atmel,24c128" }, + { 0x3, "tpm", "nuvoton,npct650" }, + { 0x6, "gpio", "nxp,pca9552" }, + { 0x7, "gpio", "nxp,pca9553" }, + { 0x8, "gpio", "nxp,pca9554" }, + { 0x9, "gpio", "nxp,pca9555" } }; struct hdat_i2c_label { @@ -103,11 +109,14 @@ struct hdat_i2c_label { struct hdat_i2c_label hdat_i2c_labels[] = { { 0x1, "9551-led-controller" }, { 0x2, "seeprom" }, + { 0x4, "tpm" }, { 0x5, "module-vpd" }, { 0x6, "dimm SPD" }, { 0x7, "proc-vpd" }, { 0x8, "sbe-eeprom" }, - { 0x9, "planar-vpd" } + { 0x9, "planar-vpd" }, + { 0xd, "secure-window-open-gpios" }, + { 0xe, "physical-presence-gpios" } }; /* From patchwork Thu Aug 31 07:12:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudio Carvalho X-Patchwork-Id: 808079 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 3xjYYz6X8Fz9s7c for ; Thu, 31 Aug 2017 17:15:51 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xjYYz5j15zDqkY for ; Thu, 31 Aug 2017 17:15:51 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org 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 3xjYVd3HKYzDqZv for ; Thu, 31 Aug 2017 17:12:57 +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 v7V79YuV046602 for ; Thu, 31 Aug 2017 03:12:54 -0400 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0b-001b2d01.pphosted.com with ESMTP id 2cpdd6993k-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 31 Aug 2017 03:12:54 -0400 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 Aug 2017 03:12:54 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 31 Aug 2017 03:12:52 -0400 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v7V7Cq3K33292432; Thu, 31 Aug 2017 07:12:52 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8280AAE034; Thu, 31 Aug 2017 03:13:16 -0400 (EDT) Received: from legolas.ibm.com (unknown [9.85.193.48]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id D5DE1AE03C; Thu, 31 Aug 2017 03:13:15 -0400 (EDT) From: Claudio Carvalho To: skiboot@lists.ozlabs.org Date: Thu, 31 Aug 2017 04:12:36 -0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504163557-14432-1-git-send-email-cclaudio@linux.vnet.ibm.com> References: <1504163557-14432-1-git-send-email-cclaudio@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17083107-0008-0000-0000-0000027738D2 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007640; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000226; SDB=6.00910094; UDB=6.00456508; IPR=6.00690374; BA=6.00005562; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016938; XFM=3.00000015; UTC=2017-08-31 07:12:54 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17083107-0009-0000-0000-0000368BD400 Message-Id: <1504163557-14432-5-git-send-email-cclaudio@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-31_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-1707230000 definitions=main-1708310109 Subject: [Skiboot] [PATCH v2 4/5] hdata/i2c: ignore the secure window and physical presence i2c devs 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: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This ignores the secure window and physical presence i2c devices since they are failing the HDAT parsing and they won't be used for now. In P9, the secure window and physical presence are gpio pins in an i2c gpio expander. In the HDAT the secure window and physical presence are duplicates of the associated i2c gpio expander device, however distinguished by the gpio port. That causes a failure when dt_new_addr() is called because skiboot is not able to distinguish nodes by port. Signed-off-by: Claudio Carvalho --- hdata/i2c.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hdata/i2c.c b/hdata/i2c.c index 14650b6..8a2e392 100644 --- a/hdata/i2c.c +++ b/hdata/i2c.c @@ -259,6 +259,20 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index, compat = NULL; } + /* + * TODO: Create devtree entries for the secure window and + * physical presence. In the hdat they are i2c gpio-expander + * devices distinguished only by the port property. + */ + if (be32_to_cpu(dev->purpose) == 0xd || + be32_to_cpu(dev->purpose) == 0xe) { + prlog(PR_INFO, "HDAT I2C: ignoring e%dp%d - %s@%x " + "(port 0x%x) - %s\n", dev->i2cm_engine, + dev->i2cm_port, name, i2c_addr, dev->i2c_port, + label); + continue; + } + node = dt_new_addr(bus, name, i2c_addr); if (!node) continue; From patchwork Thu Aug 31 07:12:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudio Carvalho X-Patchwork-Id: 808081 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 3xjYZ76j2Bz9s7c for ; Thu, 31 Aug 2017 17:15:59 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xjYZ75v2WzDqZ9 for ; Thu, 31 Aug 2017 17:15:59 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org 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 3xjYVg3PW0zDqXl for ; Thu, 31 Aug 2017 17:12:59 +1000 (AEST) 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 v7V79cVA104574 for ; Thu, 31 Aug 2017 03:12:56 -0400 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0b-001b2d01.pphosted.com with ESMTP id 2cpbh896kg-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 31 Aug 2017 03:12:55 -0400 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 Aug 2017 03:12:55 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 31 Aug 2017 03:12:54 -0400 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v7V7CsCN25231522; Thu, 31 Aug 2017 07:12:54 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6EE06AE043; Thu, 31 Aug 2017 03:13:18 -0400 (EDT) Received: from legolas.ibm.com (unknown [9.85.193.48]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id C3305AE034; Thu, 31 Aug 2017 03:13:17 -0400 (EDT) From: Claudio Carvalho To: skiboot@lists.ozlabs.org Date: Thu, 31 Aug 2017 04:12:37 -0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504163557-14432-1-git-send-email-cclaudio@linux.vnet.ibm.com> References: <1504163557-14432-1-git-send-email-cclaudio@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17083107-0056-0000-0000-000003BF3F35 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007640; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000226; SDB=6.00910093; UDB=6.00456508; IPR=6.00690374; BA=6.00005562; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016938; XFM=3.00000015; UTC=2017-08-31 07:12:55 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17083107-0057-0000-0000-000007F5706D Message-Id: <1504163557-14432-6-git-send-email-cclaudio@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-31_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-1707230000 definitions=main-1708310109 Subject: [Skiboot] [PATCH v2 5/5] hdata/i2c: add support to the i2c array version 2 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: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This adds the description field to the i2c array, as specified in the i2c array version 2. When the description field is populated, we should be able to get the description (name, compat and label) of new i2c devices from it, instead of having to input these information manually in the list of known i2c devices. Signed-off-by: Claudio Carvalho --- hdata/i2c.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hdata/i2c.c b/hdata/i2c.c index 8a2e392..c365a92 100644 --- a/hdata/i2c.c +++ b/hdata/i2c.c @@ -22,6 +22,7 @@ struct i2c_dev { __be32 purpose; __be32 i2c_link; __be16 slca_index; + char desc[64]; }; #define P9_I2CM_XSCOM_SIZE 0x1000 @@ -202,11 +203,8 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index, version = be32_to_cpu(ahdr->version); } - if (version == 2) { - prerror("I2C: v%d found, but not supported. Parsing as v1\n", - version); - } else if (version > 2) { - prerror("I2C: v%d found, but not supported! THIS IS A BUG\n", + if (version != 1 && version != 2) { + prerror("I2C: HDAT version %d not supported! THIS IS A BUG\n", version); return -1; }