[Skiboot] [PATCH v3 6/6] platform: Identify correct bmc platform based on bmc hw version

Mahesh J Salgaonkar mahesh at linux.ibm.com
Tue Feb 18 17:39:44 AEDT 2025


On 2025-02-18 11:33:53 Tue, Nicholas Piggin wrote:
> On Thu Feb 6, 2025 at 11:56 PM AEST, Mahesh Salgaonkar wrote:
> > At the moment the generic platform sets bmc_generic() as bmc platform
> > which does not have any support to initialize the flash and hence it
> > fails to load petitboot kernel.
> >
> > [  583.105000325,4] FLASH: Failed to load VERSION data
> > [  583.105490257,5] INIT: Waiting for kernel...
> > [  583.105523156,5] INIT: platform wait for kernel load failed
> > [  583.105555219,5] INIT: Assuming kernel at 0x20000000
> > [  583.105589925,3] INIT: ELF header not found. Assuming raw binary.
> > [...]
> > [  583.299682673,5] INIT: Starting kernel at 0x20000000, fdt at 0x30a44eb0
> > 1274673 bytes
> > [  583.344432417,3] ***********************************************
> > [  583.344490230,3] Fatal Exception 0x800 at 0000000020000000
> > MSR 9000000000000000
> > [  583.344535875,3] CFAR : 0000000030022948 MSR  : 9000000000000000
> > [  583.344578019,3] SRR0 : 0000000020000000 SRR1 : 9000000000000000
> > [  583.344620242,3] HSRR0: 0000000020000000 HSRR1: 9000000000000000
> >
> > OPAL builds the device tree for BMC based system using HDAT. It
> > populates bmc/compatible node with bmc hw version e.g.
> > "ibm,ast2600,openbmc". Use that to identify proper BMC hw board and
> > initialize BMC platform with proper backend. This allows opal to
> > successfully load and boot into petitboot kernel.
> 
> Interesting hack. So you need this because there no real platform
> for P11 yet? I'd almost rather rip the generic stuff out entirely, it
> looks like you'll miss the power down and some other things for
> example.

Yes, until we have real platform GA'ed this will get us booted with
linux kernel sucessfully.

> 
> If you're finding it useful for now then okay, but would be nice to
> have a platform for it.

We do have a platform patch ready but not sure whether I should post it
out before HW gets GA'ed. I am not sure how we did this in past for
Power10 rainier platform, before GA or after GA.

> 
> Reviewed-by: Nicholas Piggin <npiggin at gmail.com>

Thanks for your review.

-Mahesh.

> 
> >
> > Signed-off-by: Mahesh Salgaonkar <mahesh at linux.ibm.com>
> > ---
> >  core/platform.c | 14 +++++++++++++-
> >  1 file changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/core/platform.c b/core/platform.c
> > index 320fdea03d..34ef5e5d7b 100644
> > --- a/core/platform.c
> > +++ b/core/platform.c
> > @@ -135,15 +135,27 @@ static int64_t opal_cec_reboot2(uint32_t reboot_type, char *diag)
> >  }
> >  opal_call(OPAL_CEC_REBOOT2, opal_cec_reboot2, 2);
> >  
> > +static void generic_platform_fixup_bmc(struct dt_node *bmc)
> > +{
> > +	/* Try setting proper bmc platform by checking compatible property */
> > +	if (dt_node_is_compatible(bmc, "ibm,ast2600,openbmc"))
> > +		platform.bmc = &bmc_plat_ast2600_openbmc;
> > +}
> > +
> >  static bool generic_platform_probe(void)
> >  {
> > -	if (dt_find_by_path(dt_root, "bmc")) {
> > +	struct dt_node *bmc;
> > +
> > +	bmc = dt_find_by_path(dt_root, "bmc");
> > +	if (bmc) {
> >  		/* We appear to have a BMC... so let's cross our fingers
> >  		 * and see if we can do anything!
> >  		 */
> >  		prlog(PR_ERR, "GENERIC BMC PLATFORM: **GUESSING** that there's "
> >  		      "*maybe* a BMC we can talk to.\n");
> >  		prlog(PR_ERR, "THIS IS ****UNSUPPORTED****, BRINGUP USE ONLY.\n");
> > +
> > +		generic_platform_fixup_bmc(bmc);
> >  		astbmc_early_init();
> >  	} else {
> >  		uart_init();
> 

-- 
Mahesh J Salgaonkar


More information about the Skiboot mailing list