[U-Boot] OMAP3: NAND init problems

Hi list,
I'am trying to get the NAND-flash to work in my OMAP3 SPL. I essentially call these functions after the base init: gpmc_init(); nand_init();
But in nand_init() the cpu jumps somewhere in memory. I tracked that down to nand_get_flash_type() to the call chip->select_chip(mtd, 0); Some digging shows that the select_chip function pointer isn't initialized -> just garbage.
Just before the call to nand_get_flash_type() is a call to nand_set_defaults(chip, busw) which IMHO should be responsible to set the function-pointers. But this function tests for non-zero value -> garbage is non-zero.
Do I miss something for NAND init?
Thanks in advance! Simon

Dear Simon Schwarz,
Am 17.06.2011 um 12:03 schrieb Simon Schwarz:
Hi list,
I'am trying to get the NAND-flash to work in my OMAP3 SPL. I essentially call these functions after the base init: gpmc_init(); nand_init();
But in nand_init() the cpu jumps somewhere in memory. I tracked that down to nand_get_flash_type() to the call chip->select_chip(mtd, 0); Some digging shows that the select_chip function pointer isn't initialized -> just garbage.
Just before the call to nand_get_flash_type() is a call to nand_set_defaults(chip, busw) which IMHO should be responsible to set the function-pointers. But this function tests for non-zero value -> garbage is non-zero.
so is this uninitialized? Why don't you set this to an explicit value (e.g. zero) just before going into the nand_init() chain. Where is your 'struct nand_chip' instance located (in .bss, in .data)?
regards
Andreas Bießmann

hi, On Fri Jun 17, 2011 at 12:03:31PM +0200, Simon Schwarz wrote:
I'am trying to get the NAND-flash to work in my OMAP3 SPL. I essentially call these functions after the base init: gpmc_init(); nand_init();
I guess this is the same as nand_spl. Do you use nand_boot.c in the spl code. This file has the nand_chip object declared as a local variable on the stack, and not bss.
But in nand_init() the cpu jumps somewhere in memory. I tracked that down to nand_get_flash_type() to the call chip->select_chip(mtd, 0); Some digging shows that the select_chip function pointer isn't initialized -> just garbage.
If you check the nand_boot function in the nand_boot.c, it calls board_nand_init, and not nand_init, so i guess you are using a different path here.
-sughosh

Dear Sughosh,
I guess this is the same as nand_spl. Do you use nand_boot.c in the spl code. This file has the nand_chip object declared as a local variable on the stack, and not bss.
I first tried to use the standard NAND implementation - but I think you are right - using nand_spl implementation is much smaller. the auto recognition functions are nice but the trade-off in size is huge.
I solved the problem - it was the .bss section not initialized to zero - thanks for the hint!
Regards Simon
participants (3)
-
Andreas Bießmann
-
Simon Schwarz
-
Sughosh Ganu