[Skiboot] [PATCH] hw/imc: Detect BML and fix core counters

Ryan Grimm grimm at linux.vnet.ibm.com
Tue Aug 15 00:22:33 AEST 2023


On Mon, 2023-08-14 at 09:28 +0530, Madhavan Srinivasan wrote:
> On 8/11/23 2:41 AM, Ryan Grimm wrote:
> > 
> > diff --git a/hw/imc.c b/hw/imc.c
> > index 97e0809f..dc3a59ae 100644
> > --- a/hw/imc.c
> > +++ b/hw/imc.c
> > @@ -475,7 +475,7 @@ void imc_catalog_preload(void)
> >   	int ret = OPAL_SUCCESS;
> >   	compress_buf_size = MAX_COMPRESSED_IMC_DTB_SIZE;
> > 
> > -	if (proc_chip_quirks & QUIRK_MAMBO_CALLOUTS)
> > +	if (proc_chip_quirks & (QUIRK_MAMBO_CALLOUTS | QUIRK_BML))
> >   		return;
> > 
> >   	/* Enable only for power 9/10 */
> > @@ -613,13 +613,13 @@ void imc_init(void)
> >   	struct dt_node *dev;
> >   	int err_flag = -1;
> > 
> > -	if (proc_chip_quirks & QUIRK_MAMBO_CALLOUTS) {
> > +	if ((proc_chip_quirks & (QUIRK_MAMBO_CALLOUTS) || QUIRK_BML)) {
> 
> Guess idea is to check for MAMBO or BML bits set in proc_chip_quirks.
> But then why Close Parentheses after QUIRK_MAMBO_CALLOUTS?
> 

Oh, oops, unintentional extra parenthesis, will fix, thanks!

Ryan

> Maddy
> 
> >   		dev = dt_find_compatible_node(dt_root, NULL,
> >   					"ibm,opal-in-memory-counters");
> >   		if (!dev)
> >   			return;
> > 
> > -		goto imc_mambo;
> > +		goto imc_mambo_bml;
> >   	}
> > 
> >   	/* Enable only for power 9/10 */
> > @@ -662,7 +662,7 @@ void imc_init(void)
> >   		goto err;
> >   	}
> > 
> > -imc_mambo:
> > +imc_mambo_bml:
> >   	if (setup_imc_scoms()) {
> >   		prerror("IMC: Failed to setup the scoms\n");
> >   		goto err;
> > @@ -683,7 +683,7 @@ imc_mambo:
> >   	/* Update the base_addr and chip-id for nest nodes */
> >   	imc_dt_update_nest_node(dev);
> > 
> > -	if (proc_chip_quirks & QUIRK_MAMBO_CALLOUTS)
> > +	if (proc_chip_quirks & (QUIRK_MAMBO_CALLOUTS | QUIRK_BML))
> >   		return;
> > 
> >   	/*
> > diff --git a/include/chip.h b/include/chip.h
> > index cfa5ce35..c90b8a7f 100644
> > --- a/include/chip.h
> > +++ b/include/chip.h
> > @@ -187,6 +187,7 @@ enum proc_chip_quirks {
> >   	QUIRK_NO_RNG		= 0x00000100,
> >   	QUIRK_QEMU              = 0x00000200,
> >   	QUIRK_AWAN		= 0x00000400,
> > +	QUIRK_BML		= 0x00000800,
> >   };
> > 
> >   extern enum proc_chip_quirks proc_chip_quirks;



More information about the Skiboot mailing list