aboutsummaryrefslogtreecommitdiff
path: root/platforms
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2015-03-04 08:55:05 +0800
committerJeremy Kerr <jk@ozlabs.org>2015-03-04 16:02:20 +0800
commitb8a5d006c7d4319ce498bd8e6a1f34cf2f231fe8 (patch)
treed6a6f9d0a1f97bab01c5ee45fd0a231c3a9085bd /platforms
parentbd90edea34c562aa91346cc1116c1568e202f3d4 (diff)
downloadskiboot-b8a5d006c7d4319ce498bd8e6a1f34cf2f231fe8.zip
skiboot-b8a5d006c7d4319ce498bd8e6a1f34cf2f231fe8.tar.gz
skiboot-b8a5d006c7d4319ce498bd8e6a1f34cf2f231fe8.tar.bz2
astbmc: Use firmware FRU ID from the device tree
Rather than using the hardcoded FRU ID, parse it from the device tree. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'platforms')
-rw-r--r--platforms/astbmc/common.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c
index 7e84ec9..c89af63 100644
--- a/platforms/astbmc/common.c
+++ b/platforms/astbmc/common.c
@@ -88,6 +88,25 @@ static void astbmc_ipmi_setenables(void)
}
+static int astbmc_fru_init(void)
+{
+ const struct dt_property *prop;
+ struct dt_node *node;
+ uint8_t fru_id;
+
+ node = dt_find_by_path(dt_root, "bmc");
+ if (!node)
+ return -1;
+
+ prop = dt_find_property(node, "firmware-fru-id");
+ if (!prop)
+ return -1;
+
+ fru_id = dt_property_get_cell(prop, 0) & 0xff;
+ ipmi_fru_init(fru_id);
+ return 0;
+}
+
void astbmc_init(void)
{
@@ -99,7 +118,7 @@ void astbmc_init(void)
ipmi_wdt_init();
ipmi_rtc_init();
ipmi_opal_init();
- ipmi_fru_init(0x01);
+ astbmc_fru_init();
elog_init();
ipmi_sensor_init();