Skip to content

Commit

Permalink
hdat: Read description from ibm, vpd binary blob
Browse files Browse the repository at this point in the history
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@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
Vasant Hegde authored and stewartsmith committed Apr 5, 2017
1 parent 01b0180 commit 810aaf1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
6 changes: 3 additions & 3 deletions hdata/test/p8-840-spira.dts
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@
card-type = [00];
hw-characteristics = [00];
ccin = "54E1";
description = "Unknown";
description = "06-WAY PROC CUOD";
ibm,chip-id = <0x0>;
};

Expand All @@ -755,7 +755,7 @@
card-type = [00];
hw-characteristics = [00];
ccin = "54E1";
description = "Unknown";
description = "06-WAY PROC CUOD";
ibm,chip-id = <0x1>;
};

Expand Down Expand Up @@ -821,7 +821,7 @@
card-type = [80 b5 00];
hw-characteristics = [00];
ccin = "2B08";
description = "Unknown";
description = "CEC OP PANEL ";
};

power-supply@3102 {
Expand Down
10 changes: 5 additions & 5 deletions hdata/test/p81-811.spira.dts
Original file line number Diff line number Diff line change
Expand Up @@ -1911,7 +1911,7 @@
card-type = [00];
hw-characteristics = [00];
ccin = "54E8";
description = "Unknown";
description = "10-WAY PROC CUOD";
ibm,chip-id = <0x0>;
};

Expand All @@ -1928,7 +1928,7 @@
card-type = [00];
hw-characteristics = [00];
ccin = "54E8";
description = "Unknown";
description = "10-WAY PROC CUOD";
ibm,chip-id = <0x1>;
};

Expand All @@ -1945,7 +1945,7 @@
card-type = [00];
hw-characteristics = [00];
ccin = "54E8";
description = "Unknown";
description = "10-WAY PROC CUOD";
ibm,chip-id = <0x10>;
};

Expand All @@ -1962,7 +1962,7 @@
card-type = [00];
hw-characteristics = [00];
ccin = "54E8";
description = "Unknown";
description = "10-WAY PROC CUOD";
ibm,chip-id = <0x11>;
};

Expand Down Expand Up @@ -2016,7 +2016,7 @@
card-type = [80 b5 00];
hw-characteristics = [00];
ccin = "2B08";
description = "Unknown";
description = "CEC OP PANEL ";
};

power-supply@3100 {
Expand Down
14 changes: 10 additions & 4 deletions hdata/vpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 810aaf1

Please sign in to comment.