[U-Boot] [PATCH] MTD: nand: mxs_nand_spl: Fix empty function pointer for BBT

Jörg Krause joerg.krause at embedded.rocks
Sat Feb 2 15:11:29 UTC 2019


On Thu, 2019-01-03 at 15:52 +0000, Stefan Agner wrote:
> On 30.12.18 17:11, Adam Ford wrote:
> > The initialization function calls a nand_chip.scan_bbt(mtd) but
> > scan_bbt is never initialized resulting in an undefined function
> > pointer.  This will direct the function pointer to nand_default_bbt
> > defined in the same file.
> > 
> > Signed-off-by: Adam Ford <aford173 at gmail.com>
> 
> Seems sensible
> 
> Acked-by: Stefan Agner <stefan.agner at toradex.com>

Fixes crashing NAND SPL loader on my i.MX6ULL board, which was
introduced in commit 5346c31e305a37d39f535cc0d5ae87d8b7e81230 and is
present in U-Boot since version 2018.07.

Tested on a custom i.MX6ULL board with a Micron NAND flash.

Tested-by: Jörg Krause <joerg.krause at embedded.rocks>

> 
> > diff --git a/drivers/mtd/nand/raw/mxs_nand_spl.c b/drivers/mtd/nand/raw/mxs_nand_spl.c
> > index 2d7bbe83cc..c628f3adec 100644
> > --- a/drivers/mtd/nand/raw/mxs_nand_spl.c
> > +++ b/drivers/mtd/nand/raw/mxs_nand_spl.c
> > @@ -185,6 +185,7 @@ static int mxs_nand_init(void)
> >  	mtd = nand_to_mtd(&nand_chip);
> >  	/* set mtd functions */
> >  	nand_chip.cmdfunc = mxs_nand_command;
> > +	nand_chip.scan_bbt = nand_default_bbt;
> >  	nand_chip.numchips = 1;
> >  
> >  	/* identify flash device */



More information about the U-Boot mailing list