From patchwork Wed Dec 12 08:25:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 1011825 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43FDCS57dSz9s1c for ; Wed, 12 Dec 2018 21:52:04 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 43FDCS1hj6zDqSs for ; Wed, 12 Dec 2018 21:52:04 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=kaod.org (client-ip=178.33.248.196; helo=1.mo4.mail-out.ovh.net; envelope-from=clg@kaod.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org X-Greylist: delayed 8781 seconds by postgrey-1.36 at bilbo; Wed, 12 Dec 2018 21:52:00 AEDT Received: from 1.mo4.mail-out.ovh.net (1.mo4.mail-out.ovh.net [178.33.248.196]) (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 43FDCN1dl6zDqQZ for ; Wed, 12 Dec 2018 21:51:58 +1100 (AEDT) Received: from player746.ha.ovh.net (unknown [10.109.159.136]) by mo4.mail-out.ovh.net (Postfix) with ESMTP id E607B1C5D79 for ; Wed, 12 Dec 2018 09:25:33 +0100 (CET) Received: from kaod.org (lfbn-1-10605-110.w90-89.abo.wanadoo.fr [90.89.196.110]) (Authenticated sender: clg@kaod.org) by player746.ha.ovh.net (Postfix) with ESMTPSA id A5B71D8325E; Wed, 12 Dec 2018 08:25:28 +0000 (UTC) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: skiboot@lists.ozlabs.org Date: Wed, 12 Dec 2018 09:25:26 +0100 Message-Id: <20181212082526.1676-1-clg@kaod.org> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 X-Ovh-Tracer-Id: 14266559196673969113 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudegkedguddvudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Subject: [Skiboot] [PATCH] plat/qemu: fix platform initialization when the BT device is not present X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stewart Smith Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" A QEMU PowerNV machine does not necessarily have a BT device. It needs to be defined on the command line with : -device ipmi-bmc-sim,id=bmc0 -device isa-ipmi-bt,bmc=bmc0,irq=10 When the QEMU platform is initialized by skiboot, we need to check that such a device is present and if not, skip the AST initialization. Fixes: 8340a9642bba ("plat/qemu: use the common OpenPOWER routines to initialize") Signed-off-by: Cédric Le Goater --- platforms/qemu/qemu.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/platforms/qemu/qemu.c b/platforms/qemu/qemu.c index 316231314b14..7ba7f26e155c 100644 --- a/platforms/qemu/qemu.c +++ b/platforms/qemu/qemu.c @@ -15,26 +15,45 @@ */ #include +#include #include #include #include +static bool bt_device_present; static bool qemu_probe(void) { + struct dt_node *n; + if (!dt_node_is_compatible(dt_root, "qemu,powernv")) return false; astbmc_early_init(); + /* check if the BT device was defined by QEMU */ + dt_for_each_child(dt_root, n) { + if (dt_node_is_compatible(n, "bt")) + bt_device_present = true; + } + return true; } +static void qemu_init(void) +{ + if (!bt_device_present) { + set_opal_console(&uart_opal_con); + } else { + astbmc_init(); + } +} + DECLARE_PLATFORM(qemu) = { .name = "Qemu", .probe = qemu_probe, - .init = astbmc_init, + .init = qemu_init, .external_irq = astbmc_ext_irq_serirq_cpld, .cec_power_down = astbmc_ipmi_power_down, .cec_reboot = astbmc_ipmi_reboot,