[RFC,1/4] hdata/vpd: Reorganize VPD code

Submitted by Ananth N Mavinakayanahalli on Feb. 28, 2017, 5:14 a.m.

Details

Message ID 148825885204.16559.4259406167378461185.stgit@thinktux.in.ibm.com
State New
Headers show

Commit Message

Ananth N Mavinakayanahalli Feb. 28, 2017, 5:14 a.m.
This series is just a preliminary RFC -- untested on real hardware. Some
of the OP HDAT/VPD updates aren't part of the firmware yet, based on the
latest HDAT blob from a Witherspoon.

To make it convenient to add OpenPOWER platform support. No change in
functionality.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
---
 hdata/vpd.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/hdata/vpd.c b/hdata/vpd.c
index c61621d..4c787c6 100644
--- a/hdata/vpd.c
+++ b/hdata/vpd.c
@@ -23,6 +23,8 @@ 
 #include "hdata.h"
 #include <inttypes.h>
 
+static bool op_platform;
+
 struct card_info {
 	const char *ccin; 	/* Customer card identification number */
 	const char *description;
@@ -571,9 +573,10 @@  static void sysvpd_parse(void)
 	}
 
 	/* Look for the new OpenPower "OSYS" first */
-	if (vpd_find_record(sysvpd, sysvpd_sz, "OSYS", NULL))
+	if (vpd_find_record(sysvpd, sysvpd_sz, "OSYS", NULL)) {
+		op_platform = true;
 		sysvpd_parse_opp(sysvpd, sysvpd_sz);
-	else
+	} else
 		sysvpd_parse_legacy(sysvpd, sysvpd_sz);
 }
 
@@ -651,15 +654,15 @@  void vpd_parse(void)
 {
 	const struct HDIF_common_hdr *fruvpd_hdr;
 
+	/* System VPD uses the VSYS record, so its special */
+	sysvpd_parse();
+
 	/* Enclosure */
 	_vpd_parse(spira.ntuples.nt_enclosure_vpd);
 
 	/* Backplane */
 	_vpd_parse(spira.ntuples.backplane_vpd);
 
-	/* System VPD uses the VSYS record, so its special */
-	sysvpd_parse();
-
 	/* clock card -- does this use the FRUVPD sig? */
 	_vpd_parse(spira.ntuples.clock_vpd);