[Skiboot] [PATCH 2/5] opal/errorlog: Add support to include callout section in error log.

Mahesh J Salgaonkar mahesh at linux.ibm.com
Wed Jul 29 21:41:21 AEST 2020


On 2020-07-29 17:12:14 Wed, Oliver O'Halloran wrote:
> On Wed, Jul 29, 2020 at 1:00 PM Mahesh Salgaonkar <mahesh at linux.ibm.com> wrote:
> >
> > From: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>
> >
> > Allow inclusion of HW callout to eSEL being generated. This will help OPAL
> > to generate errorlog with fru callout section that includes location code,
> > part number and serial number of a faulty hardware that may need replacement.
> >
> > Signed-off-by: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>
> > ---
> >  core/errorlog.c    |   41 ++++++++++++++
> >  core/pel.c         |  148 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  include/errorlog.h |   17 ++++++
> >  include/pel.h      |   69 ++++++++++++++++++++++++
> >  4 files changed, 273 insertions(+), 2 deletions(-)
> >
[...]
> > diff --git a/include/pel.h b/include/pel.h
> > index 252d27e2e..e2e816036 100644
> > --- a/include/pel.h
> > +++ b/include/pel.h
[...]
> > @@ -71,6 +75,37 @@ struct opal_v6_header {
> >
> >  /* opal_srctype */
> >  #define OPAL_SRC_TYPE_ERROR 0xBB
> > +/* opal SRC subsection id */
> > +#define OPAL_SRC_SUB_SECTION_ID        0xC0
> > +
> > +/* FRU callout Type */
> > +#define OPAL_FRU_TYPE_NORMAL                   0x2
> > +/* FRU callout flags */
> > +#define OPAL_FRU_FLAG_IDENTITY_INCLUDED                0x8
> > +#define OPAL_FRU_FLAG_MRU_INCLUDED             0x4
> > +/* FRU callout priority */
> > +#define OPAL_FRU_PRIO_HIGH             'H'
> > +#define OPAL_FRU_PRIO_MEDIUM           'M'
> > +#define OPAL_FRU_PRIO_MEDIUM_GROUP_A   'A'
> > +#define OPAL_FRU_PRIO_MEDIUM_GROUP_B   'B'
> > +#define OPAL_FRU_PRIO_MEDIUM_GROUP_C   'C'
> > +#define OPAL_FRU_PRIO_LOW              'L'
> > +
> > +/* FRU identity srtucture id */
> > +#define OPAL_FRU_IDENT_ID              0x4944  /* ID */
> > +/* FRU identity flags bits 0-3 */
> > +#define OPAL_FRU_IDENT_FLAG_NORMAL     0x10    /* "normal" hardware FRU */
> > +#define OPAL_FRU_IDENT_FLAG_CODE       0x20    /* code FRU */
> > +#define OPAL_FRU_IDENT_FLAG_CONFIG     0x30    /* configuration error */
> > +#define OPAL_FRU_IDENT_FLAG_MAINT      0x40    /* Maintenance Procedure req */
> > +#define OPAL_FRU_IDENT_FLAG_EXT                0x90    /* External  FRU */
> > +#define OPAL_FRU_IDENT_FLAG_EXT_CODE   0xa0    /* External code FRU */
> > +#define OPAL_FRU_IDENT_FLAG_TOOL       0xb0    /* Tool FRU */
> > +#define OPAL_FRU_IDENT_FLAG_SYMBOL     0xc0    /* Symbolic  FRU */
> > +/* FRU identity flags bits 4-7 */
> > +#define OPAL_FRU_IDENT_FLAG_PART       0x08    /* FRU Part Number supplied */
> > +#define OPAL_FRU_IDENT_FLAG_CCIN       0x04    /* CCIN supplied */
> > +#define OPAL_FRU_IDENT_FLAG_SERIAL     0x01    /* FRU serial number supplied */
> >
> >  #define OPAL_CID_SAPPHIRE      'K'     /* creator ID for sapphire log */
> >  #define OPAL_CID_POWERNV       'P'     /* creator ID for powernv log */
> > @@ -129,6 +164,38 @@ struct opal_src_section {
> >         char            srcstring[OPAL_MAX_SRC_BYTES];
> >  } __packed;
> >
> > +struct opal_src_sub_section {
> > +       uint8_t         id;             /* SRC sub section id */
> > +       uint8_t         flags;
> > +       uint16_t        length;         /* in # of words (4 byte fields) */
> > +};
> 
> Are any of these structures actually defined by opal? they seem like
> FSP junk that we just happen to be using...

All the srtuctures defined in this file (pel.h) is as per the PEL
(Platform Error Log) format and we use it as is for generating PEL error
logs for FSP/BMC.

> 
> > +
> > +struct opal_fru_callout_section {
> > +       struct opal_src_sub_section     header;
> > +};
> > +
> > +struct opal_fru_callout {
> > +       uint8_t         length; /* in bytes */
> > +       uint8_t         type:4;
> > +       uint8_t         flags:4;
> 
> The layout of bitfields is endian dependent. don't use them unless you
> absolutely have to.

Agree. Will fix it.

Thanks for your review.
-Mahesh.


More information about the Skiboot mailing list