[Skiboot] [PATCH 2/4] hdat: Read description from ibm, vpd binary blob

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Sun Apr 2 21:07:27 AEST 2017


In P8, for few FRU's we hardcoded description table (I don't call
the reason behind this). Hence on newers system, for most devices
description propetry under /vpd contains "Unknown".

Hence lets read description from vpd blob.

Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 hdata/test/p8-840-spira.dts  |  6 +++---
 hdata/test/p81-811.spira.dts | 10 +++++-----
 hdata/vpd.c                  | 14 ++++++++++----
 3 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/hdata/test/p8-840-spira.dts b/hdata/test/p8-840-spira.dts
index 7db2932..0f12745 100644
--- a/hdata/test/p8-840-spira.dts
+++ b/hdata/test/p8-840-spira.dts
@@ -738,7 +738,7 @@
 						card-type = [00];
 						hw-characteristics = [00];
 						ccin = "54E1";
-						description = "Unknown";
+						description = "06-WAY PROC CUOD";
 						ibm,chip-id = <0x0>;
 					};
 
@@ -755,7 +755,7 @@
 						card-type = [00];
 						hw-characteristics = [00];
 						ccin = "54E1";
-						description = "Unknown";
+						description = "06-WAY PROC CUOD";
 						ibm,chip-id = <0x1>;
 					};
 
@@ -821,7 +821,7 @@
 					card-type = [80 b5 00];
 					hw-characteristics = [00];
 					ccin = "2B08";
-					description = "Unknown";
+					description = "CEC OP PANEL    ";
 				};
 
 				power-supply at 3102 {
diff --git a/hdata/test/p81-811.spira.dts b/hdata/test/p81-811.spira.dts
index c9e3d2c..cdbca66 100644
--- a/hdata/test/p81-811.spira.dts
+++ b/hdata/test/p81-811.spira.dts
@@ -1911,7 +1911,7 @@
 						card-type = [00];
 						hw-characteristics = [00];
 						ccin = "54E8";
-						description = "Unknown";
+						description = "10-WAY PROC CUOD";
 						ibm,chip-id = <0x0>;
 					};
 
@@ -1928,7 +1928,7 @@
 						card-type = [00];
 						hw-characteristics = [00];
 						ccin = "54E8";
-						description = "Unknown";
+						description = "10-WAY PROC CUOD";
 						ibm,chip-id = <0x1>;
 					};
 
@@ -1945,7 +1945,7 @@
 						card-type = [00];
 						hw-characteristics = [00];
 						ccin = "54E8";
-						description = "Unknown";
+						description = "10-WAY PROC CUOD";
 						ibm,chip-id = <0x10>;
 					};
 
@@ -1962,7 +1962,7 @@
 						card-type = [00];
 						hw-characteristics = [00];
 						ccin = "54E8";
-						description = "Unknown";
+						description = "10-WAY PROC CUOD";
 						ibm,chip-id = <0x11>;
 					};
 
@@ -2016,7 +2016,7 @@
 					card-type = [80 b5 00];
 					hw-characteristics = [00];
 					ccin = "2B08";
-					description = "Unknown";
+					description = "CEC OP PANEL    ";
 				};
 
 				power-supply at 3100 {
diff --git a/hdata/vpd.c b/hdata/vpd.c
index 1533f3f..6cb9bec 100644
--- a/hdata/vpd.c
+++ b/hdata/vpd.c
@@ -317,10 +317,16 @@ static void vpd_vini_parse(struct dt_node *node,
 			dt_add_property_string(node,
 				       "description", cinfo->description);
 		} else {
-			dt_add_property_string(node, "description", "Unknown");
-			prlog(PR_WARNING,
-				"VPD: CCIN desc not available for: %s\n",
-								(char *)kw);
+			kw = vpd_find(fruvpd, fruvpd_sz, "VINI", "DR", &sz);
+			if (kw) {
+				dt_add_property_nstr(node,
+						     "description", kw, sz);
+			} else {
+				dt_add_property_string(node, "description", "Unknown");
+				prlog(PR_WARNING,
+				      "VPD: CCIN desc not available for: %s\n",
+				      (char *)kw);
+			}
 		}
 	}
 
-- 
2.9.3



More information about the Skiboot mailing list