From patchwork Tue Aug 1 12:59:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 796213 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 3xMGf60ChWz9sR8 for ; Tue, 1 Aug 2017 23:01:02 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="an87GPV/"; 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 3xMGf53CVczDrGy for ; Tue, 1 Aug 2017 23:01:01 +1000 (AEST) 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="an87GPV/"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (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 3xMGdT5GMBzDrGy for ; Tue, 1 Aug 2017 23:00:29 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="an87GPV/"; dkim-atps=neutral Received: by mail-pf0-x244.google.com with SMTP id j68so1611689pfc.2 for ; Tue, 01 Aug 2017 06:00:29 -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=wtxEA2VIDrQoKZkWe4L8EoeiGLeC9APZDkTPm4mI0co=; b=an87GPV/kVGnm8RnT4t5ST0zto6PWisVdsU1F9CH2AIxyh1eXUP6KvHNH7SHXEEz7g Hh7E9Kja4RjkzLYJNFFWz/UvHtO7Tjjbz0X7D5O0aH3vfnMNdfscPIeaBB53gInIr3nw HY7iUzvyI8ij93+5Gjo/0Oaiw7wM1C/6nkwXjQVTmtPkM7PmuLT7e8E2xkeG+qbviGTQ I0Ein7vfUZfAs8uiRUFNZkdUnGI7xfxXBZhitXWDMd3KccO6ve38NJ/Ta6E3fjYAHWzo Ie71mWj2Ydx/ipPCmbguLFTNjspbVWNgzC49jFlg2uvJYgms3zckZ4vh0hqL0SBM3WUB 2QoA== 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=wtxEA2VIDrQoKZkWe4L8EoeiGLeC9APZDkTPm4mI0co=; b=UnXGe8uEzWn25mK7WNUnX9pr+tMv33tzn9jwTj84tBfX9S0gu5IPCz6NbI5b0zqCqH SykUhjXRovK1yZAp6CKfpEa0P+8PL2SdYc/iwSrk/Tf/XZjHKP/9KaG3FNUChg1Xx0Od jPPzWSljYwzHdz5GzkDpJFVTL6XG6krqXidONY6G+lzlApRh9oVfnkdKZrV/EArwwJ+F L8Gg9RXcs4+0C5NZ7AHBwitRJ5NpkFuis1FgyElNqL8KIAUFkJXlMrOo1JWbC/OCWeac VANp+lzKptM/Sv6E7z4E7V+A9Qx3ehEEMOULW4cBzYWyH5y4MBMA5ASr/MFb7qCFY6+Z TOlg== X-Gm-Message-State: AIVw112hNYcDTWbljB9IqujVpP5ZBQneKM3zKrAeMUZSRhPgvBl6j32f BLNj7HIGcO6482pv X-Received: by 10.99.113.11 with SMTP id m11mr18710303pgc.96.1501592427847; Tue, 01 Aug 2017 06:00:27 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id g22sm3235806pgn.65.2017.08.01.06.00.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Aug 2017 06:00:27 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Tue, 1 Aug 2017 22:59:56 +1000 Message-Id: <20170801130007.8990-2-oohall@gmail.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170801130007.8990-1-oohall@gmail.com> References: <20170801130007.8990-1-oohall@gmail.com> Subject: [Skiboot] [RFC 01/12] witherspoon: Check for existing npu node 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" Only create the npu@xyz nodes if we haven't created them already. In the future we will populated the npu@xyz nodes and their child link@x nodes based on the HDAT. Signed-off-by: Oliver O'Halloran --- platforms/astbmc/witherspoon.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/platforms/astbmc/witherspoon.c b/platforms/astbmc/witherspoon.c index c5227398e401..8f7b15ce6a64 100644 --- a/platforms/astbmc/witherspoon.c +++ b/platforms/astbmc/witherspoon.c @@ -301,6 +301,9 @@ static void dt_create_npu2(void) static bool witherspoon_probe(void) { + struct dt_node *n; + bool found = false; + if (!dt_node_is_compatible(dt_root, "ibm,witherspoon")) return false; @@ -310,8 +313,12 @@ static bool witherspoon_probe(void) /* Setup UART for use by OPAL (Linux hvc) */ uart_set_console_policy(UART_CONSOLE_OPAL); - /* Add NPU2 bindings */ - dt_create_npu2(); + /* Add NPU2 bindings if we didn't create them inside the HDAT already */ + dt_for_each_compatible(dt_root, n, "ibm,power9-npu") + found = true; + + if (!found) + dt_create_npu2(); slot_table_init(witherspoon_phb_table);