[Skiboot] [PATCH 3/4] hdat: Add model-name property for OpenPower system
Vasant Hegde
hegdevasant at linux.vnet.ibm.com
Sun Apr 2 21:07:28 AEST 2017
Lets add model-name property for OpenPower system as well.
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
hdata/test/p8-840-spira.dts | 2 +-
hdata/test/p81-811.spira.dts | 2 +-
hdata/vpd-common.c | 2 +-
hdata/vpd.c | 14 ++++++++++----
include/vpd.h | 2 +-
5 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/hdata/test/p8-840-spira.dts b/hdata/test/p8-840-spira.dts
index 0f12745..b4a0797 100644
--- a/hdata/test/p8-840-spira.dts
+++ b/hdata/test/p8-840-spira.dts
@@ -12,9 +12,9 @@
nest-frequency = <0x0 0x77359400>;
vendor = "IBM";
model = "8286-41A";
- model-name = "IBM Power System S814";
system-id = "TU00163";
system-brand = "S0";
+ model-name = "IBM Power System S814";
ibm,hbrt-mini-fdt = <0xcafebeef 0x1000 0x31ce42d>;
reserved-ranges = <0x7 0xfd700000 0x0 0x100000 0x7 0xfd6a0000 0x0 0x60000 0x7 0xfd510000 0x0 0x190000>;
reserved-names = "ibm,hbrt-vpd-image", "ibm,hbrt-target-image", "ibm,hbrt-code-image";
diff --git a/hdata/test/p81-811.spira.dts b/hdata/test/p81-811.spira.dts
index cdbca66..a668d45 100644
--- a/hdata/test/p81-811.spira.dts
+++ b/hdata/test/p81-811.spira.dts
@@ -12,9 +12,9 @@
nest-frequency = <0x0 0x77359400>;
vendor = "IBM";
model = "8247-22L";
- model-name = "IBM Power System S822L";
system-id = "1010C8A";
system-brand = "S0";
+ model-name = "IBM Power System S822L";
ibm,hbrt-mini-fdt = <0xcafebeef 0x1000 0xfad5bb>;
reserved-ranges = <0x1f 0xfd700000 0x0 0x100000 0x1f 0xfd6bd000 0x0 0x43000 0x1f 0xfd586000 0x0 0x137000>;
reserved-names = "ibm,hbrt-vpd-image", "ibm,hbrt-target-image", "ibm,hbrt-code-image";
diff --git a/hdata/vpd-common.c b/hdata/vpd-common.c
index eecda7e..674c8c3 100644
--- a/hdata/vpd-common.c
+++ b/hdata/vpd-common.c
@@ -28,7 +28,7 @@ static const struct machine_info machine_table[] = {
{"8286-42A", "IBM Power System S824"},
};
-const struct machine_info *machine_info_lookup(char *mtm)
+const struct machine_info *machine_info_lookup(const char *mtm)
{
int i;
for(i = 0; i < ARRAY_SIZE(machine_table); i++)
diff --git a/hdata/vpd.c b/hdata/vpd.c
index 6cb9bec..5a66140 100644
--- a/hdata/vpd.c
+++ b/hdata/vpd.c
@@ -501,12 +501,17 @@ struct dt_node *dt_add_vpd_node(const struct HDIF_common_hdr *hdr,
return node;
}
-static void dt_add_model_name(char *model)
+static void dt_add_model_name(void)
{
const char *model_name = NULL;
const struct machine_info *mi;
const struct iplparams_sysparams *p;
const struct HDIF_common_hdr *iplp;
+ const struct dt_property *model;
+
+ model = dt_find_property(dt_root, "model");
+ if (!model)
+ goto def_model;
iplp = get_hdif(&spira.ntuples.ipl_parms, "IPLPMS");
if (!iplp)
@@ -521,12 +526,12 @@ static void dt_add_model_name(char *model)
def_model:
if (!model_name || model_name[0] == '\0') {
- mi = machine_info_lookup(model);
+ mi = machine_info_lookup(model->prop);
if (mi) {
model_name = mi->name;
} else {
model_name = "Unknown";
- prlog(PR_WARNING, "VPD: Model name %s not known\n", model);
+ prlog(PR_WARNING, "VPD: Model name %s not known\n", model->prop);
}
}
@@ -566,7 +571,6 @@ static void sysvpd_parse_legacy(const void *sysvpd, unsigned int sysvpd_sz)
if (str) {
memcpy(str, model, sz);
dt_add_property_string(dt_root, "model", str);
- dt_add_model_name(str);
free(str);
}
} else
@@ -619,6 +623,8 @@ static void sysvpd_parse(void)
sysvpd_parse_opp(sysvpd, sysvpd_sz);
} else
sysvpd_parse_legacy(sysvpd, sysvpd_sz);
+
+ dt_add_model_name();
}
static void iokid_vpd_parse(const struct HDIF_common_hdr *iohub_hdr)
diff --git a/include/vpd.h b/include/vpd.h
index 02bbde2..6889455 100644
--- a/include/vpd.h
+++ b/include/vpd.h
@@ -22,7 +22,7 @@ struct machine_info {
const char *name;
};
-const struct machine_info *machine_info_lookup(char *mtm);
+const struct machine_info *machine_info_lookup(const char *mtm);
const void *vpd_find_keyword(const void *rec, size_t rec_sz,
const char *kw, uint8_t *kw_size);
--
2.9.3
More information about the Skiboot
mailing list