[U-Boot] [PATCH] nand: fix up badblock skipping

Miquel Raynal miquel.raynal at bootlin.com
Wed Oct 24 13:56:16 UTC 2018


Hi Jiri,

Jiri Valek <jirik.valek at seznam.cz> wrote on Fri, 19 Oct 2018 10:15:55
+0200:

> From: Jiri Valek <valek at 2n.cz>
> 
> Currently the badblock skipping fails. SPL loader fails to boot from NAND.
> End up on message "SPL: failed to boot from all boot devices"
> 
> Signed-off-by: Jiri Valek <jirik.valek at seznam.cz>
> ---
> 
>  drivers/mtd/nand/raw/mxs_nand_spl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/nand/raw/mxs_nand_spl.c b/drivers/mtd/nand/raw/mxs_nand_spl.c
> index 2d7bbe83cc..56618c95dc 100644
> --- a/drivers/mtd/nand/raw/mxs_nand_spl.c
> +++ b/drivers/mtd/nand/raw/mxs_nand_spl.c
> @@ -239,6 +239,7 @@ int nand_spl_load_image(uint32_t offs, unsigned int size, void *buf)
>  			 */
>  			while (is_badblock(mtd, offs, 1)) {
>  				page = page + nand_page_per_block;
> +				offs = offs + mtd.erasesize;
>  				/* Check i we've reached the end of flash. */
>  				if (page >= mtd->size >> chip->page_shift)
>  					return -ENOMEM;

Reviewed-by: Miquel Raynal <miquel.raynal at bootlin.com>

Thanks,
Miquèl


More information about the U-Boot mailing list