Skip to content

Commit

Permalink
vpd: Add vendor property to processor node
Browse files Browse the repository at this point in the history
Processor FRU vpd doesn't contain vendor detail. We have to parse
module VPD to get vendor detail.

Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
Vasant Hegde authored and stewartsmith committed Jun 27, 2018
1 parent 77f510d commit 8613509
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hdata/hdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ extern const char *slca_get_vpd_name(uint16_t slca_index);
extern const char *slca_get_loc_code_index(uint16_t slca_index);
extern void slca_vpd_add_loc_code(struct dt_node *node, uint16_t slca_index);
extern void slca_dt_add_sai_node(void);
extern void dt_add_proc_vendor(struct dt_node *proc_node,
const void *mvpd, unsigned int mvpd_sz);

extern bool hservices_from_hdat(const void *fdt, size_t size);
int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
Expand Down
2 changes: 2 additions & 0 deletions hdata/spira.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ static bool add_xscom_sppcrd(uint64_t xscom_base)
dt_add_property(np, "ibm,module-vpd", vpd,
vpd_sz);
vpd_data_parse(np, vpd, vpd_sz);
if (vpd_node)
dt_add_proc_vendor(vpd_node, vpd, vpd_sz);
}
}

Expand Down
15 changes: 15 additions & 0 deletions hdata/vpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,21 @@ static struct dt_property *dt_add_prop_sanitize_val(struct dt_node *node,
return p;
}

/*
* OpenPower system does not provide processor vendor name under FRU VPD.
* Parse processor module VPD to get vendor detail
*/
void dt_add_proc_vendor(struct dt_node *proc_node,
const void *mvpd, unsigned int mvpd_sz)
{
const void *kw;
uint8_t sz;

kw = vpd_find(mvpd, mvpd_sz, "VINI", "VN", &sz);
if (kw)
dt_add_prop_sanitize_val(proc_node, "vendor", kw, sz);
}

/*
* For OpenPOWER, we only decipher OPFR records. While OP HDAT have VINI
* records too, populating the fields in there is optional. Also, there
Expand Down

0 comments on commit 8613509

Please sign in to comment.