aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2018-12-12 09:25:26 +0100
committerStewart Smith <stewart@linux.ibm.com>2018-12-13 10:23:17 +1100
commit2f0b6af6e01c5f7b3c762647d06c4f792e2cb3b7 (patch)
tree0f05e325b525b2919325b929badd63594e7a0b47
parent1bd34e4c60c69faeb825ba5f64658941a1422403 (diff)
downloadskiboot-2f0b6af6e01c5f7b3c762647d06c4f792e2cb3b7.zip
skiboot-2f0b6af6e01c5f7b3c762647d06c4f792e2cb3b7.tar.gz
skiboot-2f0b6af6e01c5f7b3c762647d06c4f792e2cb3b7.tar.bz2
plat/qemu: fix platform initialization when the BT device is not present
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 <clg@kaod.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r--platforms/qemu/qemu.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/platforms/qemu/qemu.c b/platforms/qemu/qemu.c
index 3162313..7ba7f26 100644
--- a/platforms/qemu/qemu.c
+++ b/platforms/qemu/qemu.c
@@ -15,26 +15,45 @@
*/
#include <skiboot.h>
+#include <console.h>
#include <device.h>
#include <ipmi.h>
#include <platforms/astbmc/astbmc.h>
+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,