[PATCH 14/14] imx-bbu-nand-fcb: Add fcb command

Sascha Hauer s.hauer at pengutronix.de
Wed Nov 2 04:29:50 PDT 2022


On Wed, Nov 02, 2022 at 12:01:15PM +0100, Marco Felsch wrote:
> On 22-11-02, Sascha Hauer wrote:
> > On Wed, Nov 02, 2022 at 09:44:41AM +0100, Marco Felsch wrote:
> > > > +static void dump_fcb_n(struct fcb_block **fcbs, int n)
> > > > +{
> > > > +	int i;
> > > > +
> > > > +	if (!n || !fcbs[n])
> > > > +		goto skip_compare;
> > > > +
> > > > +	for (i = 0; i < n; i++) {
> > > > +		if (!fcbs[i] || !fcbs[n])
> > > > +			continue;
> > > > +
> > > > +		if (!memcmp(fcbs[i], fcbs[n], sizeof(struct fcb_block))) {
> > > > +			printf("FCB block#%d: same as FCB block#%d\n", n, i);
> > > > +			return;
> > > > +		}
> > > > +	}
> > > > +
> > > > +skip_compare:
> > > > +	if (fcbs[n]) {
> > > > +		printf("FCB block#%d:\n", n);
> > > > +		dump_fcb(fcbs[n]);
> > > > +	} else {
> > > > +		printf("FCB block#%d: NULL\n", n);
> > > > +	}
> > > > +}
> > > > +
> > > > +#ifdef CONFIG_ARCH_IMX28
> > > 
> > > Why this #ifdef? Can't we do this by cpu_is_mx28()?
> > 
> > i.MX28 is a different architecture in barebox, it's in
> > arch/arm/mach-mxs/. We do not have the cpu_is_mx7() and cpu_is_mx6ul()
> > macros there.
> 
> Argh.. always messing the mxs/mxc stuff up in my head. Got your point,
> but shouldn't we add the macros instead of adding the #ifdef here?

Right. We have several cpu_is_mx* macros there already, so we can just
add the missing ones and avoid the ifdeffery.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list