[Skiboot] [PATCH v2 2/2] vpd: Add vendor property to processor node
ppaidipe
ppaidipe at linux.vnet.ibm.com
Wed Jun 27 23:10:30 AEST 2018
On 2018-06-26 16:50, Vasant Hegde wrote:
> Processor FRU vpd doesn't contain vendor detail. We have to parse
> module VPD to get vendor detail.
>
> Reported-by: Pridhiviraj Paidipeddi <ppaidipe at linux.vnet.ibm.com>
> Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
> ---
Tested-by: Pridhiviraj Paidipeddi <ppaidipe at linux.vnet.ibm.com>
> hdata/hdata.h | 2 ++
> hdata/spira.c | 2 ++
> hdata/vpd.c | 15 +++++++++++++++
> 3 files changed, 19 insertions(+)
>
> diff --git a/hdata/hdata.h b/hdata/hdata.h
> index 981affd40..426c9c983 100644
> --- a/hdata/hdata.h
> +++ b/hdata/hdata.h
> @@ -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,
> diff --git a/hdata/spira.c b/hdata/spira.c
> index d459df7c8..189584d5d 100644
> --- a/hdata/spira.c
> +++ b/hdata/spira.c
> @@ -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);
> }
> }
>
> diff --git a/hdata/vpd.c b/hdata/vpd.c
> index 98123e5a6..129b50623 100644
> --- a/hdata/vpd.c
> +++ b/hdata/vpd.c
> @@ -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
More information about the Skiboot
mailing list