summaryrefslogtreecommitdiffstats
path: root/discover/platform-powerpc.c
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-07-13 13:49:11 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-07-14 11:25:43 +1000
commit726e72342fdd2e1fc5ad34a1aafa76b135524a0a (patch)
tree7163c74209d3cc1b48bb30389c669496145f309b /discover/platform-powerpc.c
parent4a9727c96f4e7b6e7cc237e737441bfae83a7a80 (diff)
downloadpetitboot-726e72342fdd2e1fc5ad34a1aafa76b135524a0a.zip
petitboot-726e72342fdd2e1fc5ad34a1aafa76b135524a0a.tar.gz
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 <sam@mendozajonas.com>
Diffstat (limited to 'discover/platform-powerpc.c')
-rw-r--r--discover/platform-powerpc.c8
1 files 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;
OpenPOWER on IntegriCloud