Blame SOURCES/skiboot-6.0.4-861350941f9a3fb76ebcae3e5a32b3cbec929d03.patch

5917b8
commit 861350941f9a3fb76ebcae3e5a32b3cbec929d03
5917b8
Author: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
5917b8
Date:   Tue Jun 26 16:50:52 2018 +0530
5917b8
5917b8
    vpd: Add vendor property to processor node
5917b8
    
5917b8
    Processor FRU vpd doesn't contain vendor detail. We have to parse
5917b8
    module VPD to get vendor detail.
5917b8
    
5917b8
    Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
5917b8
    Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
5917b8
    Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
5917b8
5917b8
diff --git a/hdata/hdata.h b/hdata/hdata.h
5917b8
index 981affd4..426c9c98 100644
5917b8
--- a/hdata/hdata.h
5917b8
+++ b/hdata/hdata.h
5917b8
@@ -50,6 +50,8 @@ extern const char *slca_get_vpd_name(uint16_t slca_index);
5917b8
 extern const char *slca_get_loc_code_index(uint16_t slca_index);
5917b8
 extern void slca_vpd_add_loc_code(struct dt_node *node, uint16_t slca_index);
5917b8
 extern void slca_dt_add_sai_node(void);
5917b8
+extern void dt_add_proc_vendor(struct dt_node *proc_node,
5917b8
+			       const void *mvpd, unsigned int mvpd_sz);
5917b8
 
5917b8
 extern bool hservices_from_hdat(const void *fdt, size_t size);
5917b8
 int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
5917b8
diff --git a/hdata/spira.c b/hdata/spira.c
5917b8
index d459df7c..189584d5 100644
5917b8
--- a/hdata/spira.c
5917b8
+++ b/hdata/spira.c
5917b8
@@ -561,6 +561,8 @@ static bool add_xscom_sppcrd(uint64_t xscom_base)
5917b8
 				dt_add_property(np, "ibm,module-vpd", vpd,
5917b8
 						vpd_sz);
5917b8
 				vpd_data_parse(np, vpd, vpd_sz);
5917b8
+				if (vpd_node)
5917b8
+					dt_add_proc_vendor(vpd_node, vpd, vpd_sz);
5917b8
 			}
5917b8
 		}
5917b8
 
5917b8
diff --git a/hdata/vpd.c b/hdata/vpd.c
5917b8
index 98123e5a..129b5062 100644
5917b8
--- a/hdata/vpd.c
5917b8
+++ b/hdata/vpd.c
5917b8
@@ -248,6 +248,21 @@ static struct dt_property *dt_add_prop_sanitize_val(struct dt_node *node,
5917b8
 	return p;
5917b8
 }
5917b8
 
5917b8
+/*
5917b8
+ * OpenPower system does not provide processor vendor name under FRU VPD.
5917b8
+ * Parse processor module VPD to get vendor detail
5917b8
+ */
5917b8
+void dt_add_proc_vendor(struct dt_node *proc_node,
5917b8
+			const void *mvpd, unsigned int mvpd_sz)
5917b8
+{
5917b8
+	const void *kw;
5917b8
+	uint8_t sz;
5917b8
+
5917b8
+	kw = vpd_find(mvpd, mvpd_sz, "VINI", "VN", &sz);
5917b8
+	if (kw)
5917b8
+		dt_add_prop_sanitize_val(proc_node, "vendor", kw, sz);
5917b8
+}
5917b8
+
5917b8
 /*
5917b8
  * For OpenPOWER, we only decipher OPFR records. While OP HDAT have VINI
5917b8
  * records too, populating the fields in there is optional. Also, there