aboutsummaryrefslogtreecommitdiff
path: root/hdata
diff options
context:
space:
mode:
authorRobert Lippert <roblip@gmail.com>2017-11-15 14:59:14 -0800
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-11-19 21:13:54 -0600
commit422cdcabb218353efad46ec90484062f5c4e8fae (patch)
tree3d840f2ae70463424f6e26caf9291ee145703e04 /hdata
parentb3a1d3d4229492632346f31a47499c4157a77b9e (diff)
downloadskiboot-422cdcabb218353efad46ec90484062f5c4e8fae.zip
skiboot-422cdcabb218353efad46ec90484062f5c4e8fae.tar.gz
skiboot-422cdcabb218353efad46ec90484062f5c4e8fae.tar.bz2
hdata/vpd: add support for parsing CPU VRML records
Allows skiboot to parse out the processor part/serial numbers on OpenPOWER P9 machines. Change-Id: Ie22a3c50d32f480671334b4b6c820476e29301c9 Signed-off-by: Robert Lippert <rlippert@google.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata')
-rw-r--r--hdata/vpd.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/hdata/vpd.c b/hdata/vpd.c
index 6abbd59..d114e6b 100644
--- a/hdata/vpd.c
+++ b/hdata/vpd.c
@@ -260,6 +260,28 @@ static void vpd_opfr_parse(struct dt_node *node,
return;
}
+/*
+ * For CPUs, parse the VRML data.
+ */
+static void vpd_vrml_parse(struct dt_node *node,
+ const void *fruvpd, unsigned int fruvpd_sz)
+{
+ const void *kw;
+ uint8_t sz;
+
+ /* Part number */
+ kw = vpd_find(fruvpd, fruvpd_sz, "VRML", "PN", &sz);
+ if (kw)
+ dt_add_property_nstr(node, "part-number", kw, sz);
+
+ /* Serial number */
+ kw = vpd_find(fruvpd, fruvpd_sz, "VRML", "SN", &sz);
+ if (kw)
+ dt_add_property_nstr(node, "serial-number", kw, sz);
+
+ return;
+}
+
static void vpd_vini_parse(struct dt_node *node,
const void *fruvpd, unsigned int fruvpd_sz)
{
@@ -341,6 +363,8 @@ void vpd_data_parse(struct dt_node *node, const void *fruvpd, u32 fruvpd_sz)
{
if (vpd_find_record(fruvpd, fruvpd_sz, "OPFR", NULL))
vpd_opfr_parse(node, fruvpd, fruvpd_sz);
+ else if (vpd_find_record(fruvpd, fruvpd_sz, "VRML", NULL))
+ vpd_vrml_parse(node, fruvpd, fruvpd_sz);
else
vpd_vini_parse(node, fruvpd, fruvpd_sz);
}