From 726e72342fdd2e1fc5ad34a1aafa76b135524a0a Mon Sep 17 00:00:00 2001 From: Samuel Mendoza-Jonas Date: Wed, 13 Jul 2016 13:49:11 +1000 Subject: discover/platform-powerpc: Use IPMI on BMC-based machines only With a kernel that has IPMI support Petitboot will try to use direct IPMI, however on FSP machines this is not fully functional. Use direct IPMI only on BMC-based machines, and use sysparams otherwise. Signed-off-by: Samuel Mendoza-Jonas --- discover/platform-powerpc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c index eb54c6d..8fca5bd 100644 --- a/discover/platform-powerpc.c +++ b/discover/platform-powerpc.c @@ -1348,6 +1348,7 @@ static bool probe(struct platform *p, void *ctx) { struct platform_powerpc *platform; struct stat statbuf; + bool bmc_present; int rc; /* we need a device tree */ @@ -1363,7 +1364,9 @@ static bool probe(struct platform *p, void *ctx) p->platform_data = platform; - if (ipmi_present()) { + bmc_present = stat("/proc/device-tree/bmc", &statbuf) == 0; + + if (ipmi_present() && bmc_present) { pb_debug("platform: using direct IPMI for IPMI paramters\n"); platform->ipmi = ipmi_open(platform); platform->get_ipmi_bootdev = get_ipmi_bootdev_ipmi; @@ -1378,8 +1381,7 @@ static bool probe(struct platform *p, void *ctx) pb_log("platform: no IPMI parameter support\n"); } - rc = stat("/proc/device-tree/bmc", &statbuf); - if (!rc) + if (bmc_present) platform->get_platform_versions = hostboot_load_versions; return true; -- cgit v1.1