From patchwork Tue Apr 24 03:24:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 903269 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40VTKK1yRsz9rx7 for ; Tue, 24 Apr 2018 13:27:17 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hr3StXLX"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40VTKK07FDzF2GL for ; Tue, 24 Apr 2018 13:27:17 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hr3StXLX"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=74.125.83.68; helo=mail-pg0-f68.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hr3StXLX"; dkim-atps=neutral Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40VTJ8185zzF283 for ; Tue, 24 Apr 2018 13:26:15 +1000 (AEST) Received: by mail-pg0-f68.google.com with SMTP id i194so9800786pgd.0 for ; Mon, 23 Apr 2018 20:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=98p0QisOsgpZwy2S73mn8oE3yIk0nYGJAM/2x2xmDOI=; b=hr3StXLX+aAMIC9qg+ZaMdNVFx5lXvPMssmtCAgEgficholnTInrIiF/iMbR9KQtmZ lGb0s0wEGvCS4iGtHTcnJu4eOW4rIuV9g1Kz3CQf3kTifcZ+m1EzzhuUiTB1CdsJ/Lgg ID3phYPGM32YnJGjYX6JtEJivU08+wOoLYgYwwvs/uw7uf7MrgAFiGg5bhWexJG4sNWp ToUaSPFLScSkjOX64uPfdLO7EkBTpIjJ2YBguvLO9B8Dr6UU/6uMKaSWiEZgyzbvHYgp CdiInefbjKvmyexoXZ3+dvaVE1Je9ss4+/h5wJLDdyu0DqGyjbbniYl0abzS1tjJ20dK 0wKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=98p0QisOsgpZwy2S73mn8oE3yIk0nYGJAM/2x2xmDOI=; b=Dnwi9fN064TERMran7fAERWpao/rcrXlBQ+fOX1ceo+9WH9+5RdiQdvAy0nsh7JSwC kxHm1l8Q36onadKxkrtCMH/V6aOjOZ6SnjjGt2C3VwiRfebYY5E/IBt+Jj0/cEP3p9Ev Aw1E3WHBCiCJPhne83s6arOJ64lIqcSuSvWLSLvn0KiMxWa5Qi0tWChuX2pK23MLzIm2 o/0AvdKqxGrC5pi9kbsDAnfFJc2FmDZeb8FtW5uiaocxa3dhSnhOKmRWEaI06DEE041w 2x452wcmyIaRagH2uEkiKepPaCeIC9tVK0qgtRChaA71c7zC3MaQL6CggvTSPe55whYS jPPA== X-Gm-Message-State: ALQs6tDxgGaE9645wDyP96xJLPe5LxVUbaMsBP+VnMqqRtnyE3Ne8DcL XiQuU7z+Iq2GyFBUjsOcXpIhRQ== X-Google-Smtp-Source: AIpwx4/zHvy6EiM774wOznWAsSsPEKm6j93OCgEw1iyeJJJx+ID/FyeVQkSUUZzCvyIjPTgVx+v3GA== X-Received: by 2002:a17:902:24c:: with SMTP id 70-v6mr23435656plc.384.1524540313569; Mon, 23 Apr 2018 20:25:13 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id r82sm42310879pfk.187.2018.04.23.20.25.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 20:25:12 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Tue, 24 Apr 2018 13:24:59 +1000 Message-Id: <20180424032502.17619-1-oohall@gmail.com> X-Mailer: git-send-email 2.9.5 Subject: [Skiboot] [PATCH 1/4] hdata/i2c: Ignore CFAM I2C master X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 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" Recent FSP firmware builds put in information about the CFAM I2C master in addition the to host I2C masters accessible via XSCOM. Odds are this information should not be there since there's no handshaking between the FSP/BMC and the host over who controls that I2C master, but it is so we need to deal with it. This patch adds filtering to the HDAT parser so it ignores the CFAM I2C master. Without this it will create a bogus i2cm@ which migh cause issues. Signed-off-by: Oliver O'Halloran Tested-by: Andrew Donnellan --- hdata/i2c.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hdata/i2c.c b/hdata/i2c.c index 9acb08419bb3..6ea34507345c 100644 --- a/hdata/i2c.c +++ b/hdata/i2c.c @@ -261,6 +261,16 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index, continue; } + /* + * On some systems the CFAM I2C master is represented in the + * host I2C table as engine 6. There are only 4 (0, 1, 2, 3) + * engines accessible to the host via XSCOM so filter out + * engines outside this range so we don't create bogus + * i2cm@ nodes. + */ + if (dev->i2cm_engine >= 4 && proc_gen == proc_gen_p9) + continue; + i2cm = get_i2cm_node(xscom, dev->i2cm_engine); bus = get_bus_node(i2cm, dev->i2cm_port, be16_to_cpu(dev->i2c_bus_freq)); From patchwork Tue Apr 24 03:25:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 903271 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40VTKb0FxWz9s02 for ; Tue, 24 Apr 2018 13:27:31 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mSnBr+H5"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40VTKZ5LylzF2Gy for ; Tue, 24 Apr 2018 13:27:30 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mSnBr+H5"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=209.85.192.195; helo=mail-pf0-f195.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mSnBr+H5"; dkim-atps=neutral Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40VTJ94FjDzF288 for ; Tue, 24 Apr 2018 13:26:17 +1000 (AEST) Received: by mail-pf0-f195.google.com with SMTP id g14so11039688pfh.3 for ; Mon, 23 Apr 2018 20:26:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AJZR7rhzyWpnMTnCQTOp9voMVbKZXb8QpOlZ0WEWgvs=; b=mSnBr+H5/TLtfnQ7FCQbQHxI5KEnQQ545+EWXgxi8mmobb2zcIJLWGYdn0/VI5Oc7r yNzSZDbB4yDiKRMPIruwZIOi2XAIiWiCOaESoe/tQmzqmEd1nWe/zezwcnBcBw4df/FE v9RpEvtIoHjIRBrKHOSfp0aTRyqYvE2beInCqTPfjBOnLhOwIMFAC5ERJTm1NQasLBat Hp0DOWBezbIT8tTRXB+PApKmveGpgDbYi/3xQCeDdj3+W5KgQc9cL1uPjwIYyWVAM44q S/obbce/hRcUoImY1Gy28AFiUPq4BfwAuI9DgD7nZGYpBSK9wwqdNAj0L6/FhlbwXpf+ r1gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AJZR7rhzyWpnMTnCQTOp9voMVbKZXb8QpOlZ0WEWgvs=; b=og+PbdqCIArGWrqlEwBFv+693UX8Z1BZDqaaBzee3NJdphZNulg6le2tbRfNHtBcwh bffDYwB4LM8GerAHqts8cycN/sgYuqhl4sG+IvwVsdfBKWZ/Vx6n1NtldwZpfWP9Mhgk +r7Ec2X1wVqYLjCbfAWEeIJRxcbVMGF4eVO1sXmHewRsOJ6Vq76dTjA7u/o49UFMzban Vt/0m/t1WsLIZD71a1z7JCj2xfAllQpLiWMmIqL2edFea0dDPk0C98UbiL9rljOBJDP1 9m0M9K9g3s+jfsl3WMnbSP3OBvyGyvxj/Z+P89F1MrJY9iczAzNrSm36UtyiMlguuGEp y5vA== X-Gm-Message-State: ALQs6tD02m7rKJjVIylcnemNYNYvZvaJHBfwrtfQWp+MViIAjFpvNcJx EI+BM7k5ssd405IpZskBuOg75g== X-Google-Smtp-Source: AIpwx4+LEJvtScYuKKrgWn7zdsJK441ONuQ+cqLj2mtIelBrhhGXwx7UcqyVZyHm+V3JTU3ShgafOQ== X-Received: by 2002:a17:902:481:: with SMTP id e1-v6mr23528480ple.377.1524540315539; Mon, 23 Apr 2018 20:25:15 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id r82sm42310879pfk.187.2018.04.23.20.25.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 20:25:15 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Tue, 24 Apr 2018 13:25:00 +1000 Message-Id: <20180424032502.17619-2-oohall@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180424032502.17619-1-oohall@gmail.com> References: <20180424032502.17619-1-oohall@gmail.com> Subject: [Skiboot] [PATCH 2/4] hdata/i2c: Replace i2c_ prefix with dev_ X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 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" The current naming scheme makes it easy to conflate "i2cm_port" and "i2c_port." The latter is used to describe multi-port I2C devices such as GPIO expanders and multi-channel PCIe hotplug controllers. Rename i2c_port to dev_port to make the two a bit more distinct. Also rename i2c_addr to dev_addr for consistency. Signed-off-by: Oliver O'Halloran Reviewed-by: Andrew Donnellan --- hdata/i2c.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hdata/i2c.c b/hdata/i2c.c index 6ea34507345c..c08b53d5c8fb 100644 --- a/hdata/i2c.c +++ b/hdata/i2c.c @@ -31,8 +31,8 @@ struct i2c_dev { /* i2c slave info */ uint8_t type; - uint8_t i2c_addr; - uint8_t i2c_port; + uint8_t dev_addr; + uint8_t dev_port; uint8_t __reserved; __be32 purpose; @@ -207,7 +207,7 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index, const struct i2c_dev *dev; const char *label, *name, *compat; const struct host_i2c_hdr *ahdr; - uint32_t i2c_addr; + uint32_t dev_addr; uint32_t version; uint32_t size; uint32_t purpose; @@ -280,7 +280,7 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index, * justified quantity (i.e it includes the R/W bit). So we need * to strip it off to get an address linux can use. */ - i2c_addr = dev->i2c_addr >> 1; + dev_addr = dev->dev_addr >> 1; purpose = be32_to_cpu(dev->purpose); type = map_type(dev->type); @@ -315,18 +315,18 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index, */ if (!type || dev->type == 0xFF) prlog(PR_WARNING, "HDAT I2C: found e%dp%d - %s@%x (%#x:%s)\n", - dev->i2cm_engine, dev->i2cm_port, name, i2c_addr, + dev->i2cm_engine, dev->i2cm_port, name, dev_addr, purpose, label); else prlog(PR_TRACE, "HDAT I2C: found e%dp%d - %s@%x (%#x:%s)\n", - dev->i2cm_engine, dev->i2cm_port, name, i2c_addr, + dev->i2cm_engine, dev->i2cm_port, name, dev_addr, purpose, label); - node = dt_new_addr(bus, name, i2c_addr); + node = dt_new_addr(bus, name, dev_addr); if (!node) continue; - dt_add_property_cells(node, "reg", i2c_addr); + dt_add_property_cells(node, "reg", dev_addr); dt_add_property_cells(node, "link-id", be32_to_cpu(dev->i2c_link)); if (compat) From patchwork Tue Apr 24 03:25:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 903272 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40VTLC69nLz9rx7 for ; Tue, 24 Apr 2018 13:28:03 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="u/ywT3R9"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40VTLC4TlxzF2BW for ; Tue, 24 Apr 2018 13:28:03 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="u/ywT3R9"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=74.125.83.66; helo=mail-pg0-f66.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="u/ywT3R9"; dkim-atps=neutral Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40VTJC3yJpzF24X for ; Tue, 24 Apr 2018 13:26:19 +1000 (AEST) Received: by mail-pg0-f66.google.com with SMTP id f132so9786964pgc.10 for ; Mon, 23 Apr 2018 20:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IbKU+403AGj1WaD8lInTYwDuC65TKw6Udq+wR6XZ1bc=; b=u/ywT3R94vZuQMEDl2k9EZfvRlAyQvhSoaJhQMY9I4amcovtlh8rWNtJblr0SeFXJB uKxsxvgod1KLxrPqZsEkRlCiDpYKMee1BPpwNcM1JQ3bpGdi7lWvuv3XSBs1qIAfDCah u9d29S8W3WJQFPqQ0SHYzBmxFJVfvzPwNKrcMWEwP8Y/6nUb3mMtzA9IGTuTinomTYL+ RcKXKjXMY5tNtDEN5N+QgUB6PwS/uOkdbeQlLaVpZ6lcawMcFrkkyNlGP2RtUs03BUxG tfZNvsLWdyn3CP+h4p9pUQni9/FVijB2vTe586NxCN+YQXUTS3MULdextD3GM1tM5neA 7oWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IbKU+403AGj1WaD8lInTYwDuC65TKw6Udq+wR6XZ1bc=; b=OBKUVQVQJ2IfmetR9muvylC7VptjCivIgD3bukX/6AkuYvqeQDop8+tOn9xA9DmT3l fMD/ALiAvEVWhcN2wWhTH602Q/dhwDejCp5xrHpWAsvmalv8/ArIHd6EX9qLPrgizNtV bjFGoTawyjBUhdKlUEwFDLHLxktqmwj6BoCF4QbT7i0A7wOfB5KDD3EExO/oj2ifqHNq 5p+6gI74F8Yh2IShmUIChTRRzw5Oh0BJLEWMs/5iA7+UqVwrv8Fff9JcPvY+gb0jwNJi +d45Bxo5nmKx4wAptVzWDlMXjdQLjjxt4oW8th/KaQLg/S6vHiBip/hyKbZllDSdPPyV +AIQ== X-Gm-Message-State: ALQs6tBfmXJhShjCnYCdF7XokVAWwo9sxlCtJzaEKPpF+CwHxmwSobZB ZJyGC5UltXvw4n9ltyMTPRhqeA== X-Google-Smtp-Source: AIpwx4/iJyMBW3geyP/4sxdrlpOoCyfU8wMPQ1HnOwrqFrahEJH2gRVto8Sj9VGdXA8SAo7ZS+DgDw== X-Received: by 2002:a17:902:8:: with SMTP id 8-v6mr22950818pla.287.1524540317477; Mon, 23 Apr 2018 20:25:17 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id r82sm42310879pfk.187.2018.04.23.20.25.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 20:25:17 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Tue, 24 Apr 2018 13:25:01 +1000 Message-Id: <20180424032502.17619-3-oohall@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180424032502.17619-1-oohall@gmail.com> References: <20180424032502.17619-1-oohall@gmail.com> Subject: [Skiboot] [PATCH 3/4] hdata/i2c: Ignore multi-port I2C devices X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 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" Recent FSP firmware builds add support for multi-port I2C devices such as the GPIO expanders used for the presence detect of OpenCAPI devices and the PCIe hotplug controllers used to power cycle PCIe slots on ZZ. The OpenCAPI driver inside of skiboot currently uses a platform-specific method to talk to the relevant I2C device rather than relying on HDAT since not all platforms correctly report the I2C devices (hello Zaius). Additionally the nature of multi-port devices require that we a device specific handler so that we generate the correct DT bindings. Currently we don't and there is no immediate need for this support so just ignore the multi-port devices for now. Signed-off-by: Oliver O'Halloran Acked-by: Andrew Donnellan Tested-by: Andrew Donnellan --- hdata/i2c.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/hdata/i2c.c b/hdata/i2c.c index c08b53d5c8fb..cbd3bf0155df 100644 --- a/hdata/i2c.c +++ b/hdata/i2c.c @@ -314,13 +314,22 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index, * hdat. Log both cases to see what/where/why. */ if (!type || dev->type == 0xFF) - prlog(PR_WARNING, "HDAT I2C: found e%dp%d - %s@%x (%#x:%s)\n", + prlog(PR_WARNING, "HDAT I2C: found e%dp%d - %s@%x dp:%02x (%#x:%s)\n", dev->i2cm_engine, dev->i2cm_port, name, dev_addr, - purpose, label); + dev->dev_port, purpose, label); else - prlog(PR_TRACE, "HDAT I2C: found e%dp%d - %s@%x (%#x:%s)\n", + prlog(PR_DEBUG, "HDAT I2C: found e%dp%d - %s@%x dp:%02x (%#x:%s)\n", dev->i2cm_engine, dev->i2cm_port, name, dev_addr, - purpose, label); + dev->dev_port, purpose, label); + + /* + * Multi-port device require special handling since we need to + * generate the device-specific DT bindings. For now we're just + * going to ignore them since these devices are owned by FW + * any way. + */ + if (dev->dev_port != 0xff) + continue; node = dt_new_addr(bus, name, dev_addr); if (!node) From patchwork Tue Apr 24 03:25:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 903273 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 40VTLM3kJZz9rx7 for ; Tue, 24 Apr 2018 13:28:11 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dcQMDBgH"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40VTLM26flzF29H for ; Tue, 24 Apr 2018 13:28:11 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dcQMDBgH"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=209.85.192.194; helo=mail-pf0-f194.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dcQMDBgH"; dkim-atps=neutral Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40VTJF4hmzzF21P for ; Tue, 24 Apr 2018 13:26:21 +1000 (AEST) Received: by mail-pf0-f194.google.com with SMTP id o16so11028829pfk.9 for ; Mon, 23 Apr 2018 20:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Elnfr2yZNEMUW7ZqbP6LPOHEsoi/cRd3tulIoYJUzd8=; b=dcQMDBgHc7pNO0PHRHttM7WJzMKllLPRIeQzqqmY31NCmpSOxbFgP4v5zaCPxCw9KS VaeKwepk3Z5Si9kxgWiscH/UZ78r2JgLTaMXitChxCOBJA6wip04f0YPpfzWXMd0m4VY gsuiqASALgxsaG1KGDqjL5NhBVFsGIIZ+aJSJtHwJUzAlx/oUljKn/sb/oQFcpmgztEc Uqc+owzVQOPF6yg3QWbgjwAm/lFGwfeWAIUdTEqOmAzJs55qM/lmT744DIGSyhN2QF/I rB83DhgS6w0T2AXemWDu9oybaD3JUi1B+MDPCfl6yX+9/Tn8xxBKyPDPCRbJsGRDRBEf 03tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Elnfr2yZNEMUW7ZqbP6LPOHEsoi/cRd3tulIoYJUzd8=; b=qnNahKhylwy7ZLxmmbdbWDXEmk5EGmh3KaD6PG3cE7KIDXGyjAs10C3Z2Z81WQjhmT s/c+YXa2zQUL3RbRP/Od0ChkvrgAcG2rSr+qUNxlQMMwzHcLaKyBaIc4SBC2LXNCbzfO NW+wWPbmcfdVT4yrUwXC/+owTjJicaQq4Vu9CUaduUuoqIBZSD2+gIlRjfeMA/aVI3J6 dwjl7rFtXPHx6bUA0xdoclBQZLhi/mYArBNb3wiQaOozF9r5e3kumihDaghyabt9akkG XsLiZeyEaOsaCqf3Gv7Pp/m2IsRxGAR0Bh7dKZI37IAeiw5xSGMCKFewEPgrhJYzugdy vy7g== X-Gm-Message-State: ALQs6tAbNuUyln/nZkEgebk8JnteGiqvuvwbtMr9zVPU6onPpyYYL2x5 A0kB+bjNni+Ozu1I0mrqd/YaNA== X-Google-Smtp-Source: AIpwx4/883j4lfEXz7qJRXEsjIXJ46+38NPdR8HZbDrCpKJsf602bT1Jq/pS82cXiywjE148AoTKXQ== X-Received: by 10.98.130.140 with SMTP id w134mr22406174pfd.127.1524540319574; Mon, 23 Apr 2018 20:25:19 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id r82sm42310879pfk.187.2018.04.23.20.25.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 20:25:18 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Tue, 24 Apr 2018 13:25:02 +1000 Message-Id: <20180424032502.17619-4-oohall@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180424032502.17619-1-oohall@gmail.com> References: <20180424032502.17619-1-oohall@gmail.com> Subject: [Skiboot] [PATCH 4/4] hdata/i2c: Fix up pci hotplug labels X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 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" These labels are used on the devices used to do PCIe slot power control for implementing PCIe hotplug. I'm not sure how they ended up as "eeprom-pgood" and "eeprom-controller" since that doesn't make any sense. Signed-off-by: Oliver O'Halloran --- hdata/i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hdata/i2c.c b/hdata/i2c.c index cbd3bf0155df..5dfdb10721b1 100644 --- a/hdata/i2c.c +++ b/hdata/i2c.c @@ -136,8 +136,8 @@ struct hdat_i2c_label { static struct hdat_i2c_label hdat_i2c_labels[] = { { 0x1, "led-controller" }, - { 0x2, "eeprom-pgood" }, - { 0x3, "eeprom-control" }, + { 0x2, "pci-hotplug-pgood" }, + { 0x3, "pci-hotplug-control" }, { 0x4, "tpm" }, { 0x5, "module-vpd" }, { 0x6, "dimm SPD" },