aboutsummaryrefslogtreecommitdiff
path: root/hdata
diff options
context:
space:
mode:
authorAnanth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>2017-03-14 15:57:29 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-03-31 16:57:06 +1100
commit694546c1f72bfafca515fe8402bd96d0cf03c333 (patch)
treef7cc939523b2bb18162b347410ff3baae58ef893 /hdata
parent19be61905d08ec4d66f2ebe4f5448924c5ce7498 (diff)
downloadskiboot-694546c1f72bfafca515fe8402bd96d0cf03c333.zip
skiboot-694546c1f72bfafca515fe8402bd96d0cf03c333.tar.gz
skiboot-694546c1f72bfafca515fe8402bd96d0cf03c333.tar.bz2
hdata/vpd: Parse the OpenPOWER OPFR record
Parse the OpenPOWER FRU VPD (OPFR) record on OpenPOWER instead of the VINI records. TODO: Add the dts and updates for make check for P9 OPFR systems once the HDAT in those are complete. Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata')
-rw-r--r--hdata/vpd.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/hdata/vpd.c b/hdata/vpd.c
index 462a7f0..639fa33 100644
--- a/hdata/vpd.c
+++ b/hdata/vpd.c
@@ -226,6 +226,45 @@ static const struct card_info *card_info_lookup(char *ccin)
return NULL;
}
+/*
+ * For OpenPOWER, we only decipher OPFR records. While OP HDAT have VINI
+ * records too, populating the fields in there is optional. Also, there
+ * is an overlap in the fields contained therein.
+ */
+static void vpd_opfr_parse(struct dt_node *node,
+ const void *fruvpd, unsigned int fruvpd_sz)
+{
+ const void *kw;
+ uint8_t sz;
+
+ /* Vendor Name */
+ kw = vpd_find(fruvpd, fruvpd_sz, "OPFR", "VN", &sz);
+ if (kw)
+ dt_add_property_nstr(node, "vendor", kw, sz);
+
+ /* FRU Description */
+ kw = vpd_find(fruvpd, fruvpd_sz, "OPFR", "DR", &sz);
+ if (kw)
+ dt_add_property_nstr(node, "description", kw, sz);
+
+ /* Part number */
+ kw = vpd_find(fruvpd, fruvpd_sz, "OPFR", "VP", &sz);
+ if (kw)
+ dt_add_property_nstr(node, "part-number", kw, sz);
+
+ /* Serial number */
+ kw = vpd_find(fruvpd, fruvpd_sz, "OPFR", "VS", &sz);
+ if (kw)
+ dt_add_property_nstr(node, "serial-number", kw, sz);
+
+ /* Build date in BCD */
+ kw = vpd_find(fruvpd, fruvpd_sz, "OPFR", "MB", &sz);
+ if (kw)
+ dt_add_property_nstr(node, "build-date", kw, sz);
+
+ return;
+}
+
static void vpd_vini_parse(struct dt_node *node,
const void *fruvpd, unsigned int fruvpd_sz)
{
@@ -446,7 +485,11 @@ struct dt_node *dt_add_vpd_node(const struct HDIF_common_hdr *hdr,
if (vpd_valid(fruvpd, fruvpd_sz)
&& !dt_find_property(node, "ibm,vpd")) {
dt_add_property(node, "ibm,vpd", fruvpd, fruvpd_sz);
- vpd_vini_parse(node, fruvpd, fruvpd_sz);
+
+ if (op_platform)
+ vpd_opfr_parse(node, fruvpd, fruvpd_sz);
+ else
+ vpd_vini_parse(node, fruvpd, fruvpd_sz);
}
return node;