[Skiboot] [RFC PATCH 5/6] opal: Get chip part-number and serial-number.
Stewart Smith
stewart at linux.ibm.com
Tue Jun 4 14:19:02 AEST 2019
Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com> writes:
> Get chip part-number and serial-number and store it under proc_chip for
> quick reference during HMI error threshold-ing.
>
> Signed-off-by: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>
> ---
> core/chip.c | 13 +++++++++++++
> include/chip.h | 28 ++++++++++++++++++++++++++++
> 2 files changed, 41 insertions(+)
>
> diff --git a/core/chip.c b/core/chip.c
> index 652632534..9eb993391 100644
> --- a/core/chip.c
> +++ b/core/chip.c
> @@ -77,6 +77,8 @@ static void init_chip(struct dt_node *dn)
> struct proc_chip *chip;
> uint32_t id;
> const char *lc = NULL;
> + const char *part_no = NULL;
> + const char *serial_no = NULL;
>
> id = dt_get_chip_id(dn);
> assert(id < MAX_CHIPS);
> @@ -107,6 +109,17 @@ static void init_chip(struct dt_node *dn)
> if (lc)
> chip->loc_code = strdup(lc);
>
> + /* Update part number and serial number for this chip */
> + if (dt_has_node_property(dn, "part-number", NULL))
> + part_no = dt_prop_get(dn, "part-number");
> + if (part_no)
> + chip->part_no = strdup(part_no);
> +
> + if (dt_has_node_property(dn, "serial-number", NULL))
> + serial_no = dt_prop_get(dn, "serial-number");
> + if (serial_no)
> + chip->serial_no = strdup(serial_no);
> +
> prlog(PR_INFO, "CHIP: Initialised chip %d from %s\n", id, dn->name);
> chips[id] = chip;
> }
> diff --git a/include/chip.h b/include/chip.h
> index d6e7e355b..18bb9a2d8 100644
> --- a/include/chip.h
> +++ b/include/chip.h
> @@ -222,6 +222,10 @@ struct proc_chip {
> /* location code of this chip */
> const uint8_t *loc_code;
>
> + /* part-number and serial number for this chip */
> + const uint8_t *part_no;
> + const uint8_t *serial_no;
char not uint8_t, right?
--
Stewart Smith
OPAL Architect, IBM.
More information about the Skiboot
mailing list