[U-Boot] NAND crazy behavior - mtd->size changing without clear reason

Scott Wood scottwood at freescale.com
Thu Sep 26 01:07:34 CEST 2013


On Wed, 2013-09-25 at 09:26 -0300, Otavio Salvador wrote:
> Hello,
> 
> I am using a K9LBG08U0D-PCB0 NAND IC with the i.MX28EVK board.
> 
> I tested it with 2013.04 and current imx tree tip. Both same results.
> 
> I am having problems to use mtdparts with it as it thinks the NAND has
> size as 0 when it gets there. /However/ it properly detects it
> initially and the mtd->size variable is magically changes on the fly.
> 
> I added following patch in my local tree to debug the issue:
> 
> diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c
> index 4cf4c1c..03faf10 100644
> --- a/drivers/mtd/nand/nand.c
> +++ b/drivers/mtd/nand/nand.c
> @@ -66,11 +66,14 @@ int nand_register(int devnum)
>         add_mtd_device(mtd);
>  #endif
> 
> +       printf("%s (%d) mtd->size: %d\n", __FUNCTION__, __LINE__, mtd->size);
>         total_nand_size += mtd->size / 1024;
> +       printf("%s (%d) mtd->size: %d\n", __FUNCTION__, __LINE__, mtd->size);

Pay attention to compiler warnings...  mtd->size is uint64_t.

-Scott





More information about the U-Boot mailing list