From patchwork Fri Sep 15 05:40:51 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: 814066 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 3xtkns4vpvz9sPr for ; Fri, 15 Sep 2017 15:42:57 +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="mN0lF66L"; 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 3xtkns3bhszDrYk for ; Fri, 15 Sep 2017 15:42:57 +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="mN0lF66L"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c05::243; helo=mail-pg0-x243.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mN0lF66L"; dkim-atps=neutral Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (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 3xtkm924tpzDrYD for ; Fri, 15 Sep 2017 15:41:29 +1000 (AEST) Received: by mail-pg0-x243.google.com with SMTP id v5so820215pgn.4 for ; Thu, 14 Sep 2017 22:41: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=BoCveWOZ8vAERO9SJh7iknwoVgmYvZOCZ1HmaHZvFrY=; b=mN0lF66L+UPOTnaUcHffTl2inQXqlvTRpk1FmmJ/O4/mkJGV4FBydet6LpEDUfH4xF wvrSljAo1NdGiI9m1kRBAFGEJcoMcME6l/8ulSzHErQovUfcoUyDQiX4UoKuUC6zPoLX cy2O/SS1DA9SD0Uwyw8rmZMruuw6rZzO79bCDINx/FGoIqht7o+zjLE5SnP9OXQrhnmf JOPWNteJyYf2PRGhtPVWY2UilT4XuJ94SAlE6zQ7MKWWF3ty/If/PYLpr7ZkWISJysKS AtI2RXRuqTsPNMwkvF1IVTlFoo2jTi2Fl62KsxWKL/6W2iJmJGcuuBcacrhz/wmkaBsR agag== 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=BoCveWOZ8vAERO9SJh7iknwoVgmYvZOCZ1HmaHZvFrY=; b=BycBzQgp1VRTExSyxYPNcEnAR37Ow80Z3HbBg6+RLdtWqFyNRQBgj0UcBl4KFESGB9 SLjrz/EcdEtGYYIKNirBOtxlJKqDZFW5MCEJfW4ciNpH2bBWADMLk9XY5Ja8Fi6kz/DZ vVnMR8Pd9oG4jKYVYSYbCk0sy1hWwKcaWbaudMazDQzkD7su8tRURO6kCi4G4VKuL2lP vd6//2jxZd6D59hGbAlXFG26kRJgfBMiy1EexwHsk/okq8/lZaDCtEf3KvBOFjfCa/Nz 3udjbA8khyGEYvgLlAa1NBOZC3kNeNeYp4qi1nqh5rBke+esYsWnDic9JUlSdh//tiuq pTrQ== X-Gm-Message-State: AHPjjUgQXH8M0YXj3yWK9dikxRbj3d5q3GA7pjwVSvFgbKXcPFLoW+UV qeLmt/KDE34Xv1oU X-Google-Smtp-Source: AOwi7QA2roTMWjy7xEE8r7U7KlGZuEtaJLqvi6K+hIF5/zBTN0BmyL85wPYAuq4rNkIEKkECeNyLcw== X-Received: by 10.159.244.132 with SMTP id y4mr9306355plr.354.1505454086733; Thu, 14 Sep 2017 22:41:26 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id z8sm280581pgc.93.2017.09.14.22.41.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Sep 2017 22:41:26 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Fri, 15 Sep 2017 15:40:51 +1000 Message-Id: <20170915054059.32109-6-oohall@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20170915054059.32109-1-oohall@gmail.com> References: <20170915054059.32109-1-oohall@gmail.com> Subject: [Skiboot] [PATCH 06/14] witherspoon: Deprecate manual npu creation 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" In the future we will always create the npu nodes based on what's in the HDAT. For now we seperate witherspoon into an old and new platform where the old platform will assume a sequoia planar and create the relevant NPU nodes for that planar. If you have a redbud system this will be broken, but this should be fine for most cases. Signed-off-by: Oliver O'Halloran --- platforms/astbmc/witherspoon.c | 58 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/platforms/astbmc/witherspoon.c b/platforms/astbmc/witherspoon.c index e9cc98b55983..2ee2ef7b81f9 100644 --- a/platforms/astbmc/witherspoon.c +++ b/platforms/astbmc/witherspoon.c @@ -337,6 +337,32 @@ static bool witherspoon_probe(void) { if (!dt_node_is_compatible(dt_root, "ibm,witherspoon")) return false; + if (!dt_find_by_name(dt_root, "ibm,pcie-slots")) + return false; + if (!dt_find_compatible_node(dt_root, NULL, "ibm,power9-npu")) + return false; + + /* Lot of common early inits here */ + astbmc_early_init(); + + /* Setup UART for use by OPAL (Linux hvc) */ + uart_set_console_policy(UART_CONSOLE_OPAL); + + return true; +} + +static bool old_witherspoon_probe(void) +{ + struct dt_node *slots, *npu; + + if (!dt_node_is_compatible(dt_root, "ibm,witherspoon")) + return false; + + slots = dt_find_by_name(dt_root, "ibm,pcie-slots"); + npu = dt_find_compatible_node(dt_root, NULL, "ibm,power9-npu"); + + if (slots && npu) + return false; /* Lot of common early inits here */ astbmc_early_init(); @@ -344,11 +370,15 @@ 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(); + if (!npu) + dt_create_npu2(); slot_table_init(witherspoon_phb_table); + prerror("!!! Old witherspoon firmware detected. Update hostboot and fix the Planar VPD !!!\n"); + return true; } @@ -437,7 +467,9 @@ static void witherspoon_pre_pci_fixup(void) phb4_pre_pci_fixup_witherspoon(); } -DECLARE_PLATFORM(witherspoon_platform) = { +/* The only difference between these is the PCI slot handling */ + +DECLARE_PLATFORM(witherspoon) = { .name = "Witherspoon", .probe = witherspoon_probe, .init = astbmc_init, @@ -445,11 +477,29 @@ DECLARE_PLATFORM(witherspoon_platform) = { .start_preload_resource = flash_start_preload_resource, .resource_loaded = flash_resource_loaded, .bmc = &astbmc_openbmc, - .pci_get_slot_info = slot_table_get_slot_info, - .pci_probe_complete = check_all_slot_table, .cec_power_down = astbmc_ipmi_power_down, .cec_reboot = astbmc_ipmi_reboot, .elog_commit = ipmi_elog_commit, .exit = ipmi_wdt_final_reset, .terminate = ipmi_terminate, + + .pci_get_slot_info = map_pci_dev_to_slot, +}; + +DECLARE_PLATFORM(old_witherspoon) = { + .name = "Witherspoon (old)", + .probe = old_witherspoon_probe, + .init = astbmc_init, + .pre_pci_fixup = witherspoon_pre_pci_fixup, + .start_preload_resource = flash_start_preload_resource, + .resource_loaded = flash_resource_loaded, + .bmc = &astbmc_openbmc, + .cec_power_down = astbmc_ipmi_power_down, + .cec_reboot = astbmc_ipmi_reboot, + .elog_commit = ipmi_elog_commit, + .exit = ipmi_wdt_final_reset, + .terminate = ipmi_terminate, + + .pci_get_slot_info = slot_table_get_slot_info, + .pci_probe_complete = check_all_slot_table, };