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; }