On 10/27/2011 04:22 PM, Scott Wood wrote: > On 10/27/2011 06:13 PM, Tom Rini wrote: >> On 10/27/2011 04:10 PM, Igor Grinberg wrote: >>> On 10/27/2011 11:29 PM, Tom Rini wrote: >>>> On 10/27/2011 02:18 PM, Igor Grinberg wrote: >>>>> On 10/26/2011 11:13 PM, Tom Rini wrote: >> [snip] >>>>>> +/* nand_command: Send a flash command to the flash chip */ >>>>>> +static void nand_command(unsigned char command) >>>>>> +{ >>>>>> + WRITE_NAND_COMMAND(command, NAND_ADDR); >>>>>> + >>>>>> + if (command == NAND_CMD_RESET) { >>>>>> + unsigned char ret_val; >>>>>> + nand_command(NAND_CMD_STATUS); >>>>>> + do { >>>>>> + ret_val = READ_NAND(NAND_ADDR);/* wait till >>>>>> ready */ >>>>>> + } while ((ret_val & 0x40) != 0x40); >>>>> You should be using some kind of timeout, so you will not stuck in here >>>>> without being noticed. >>>> OK. I've been wondering if we shouldn't somehow make a >>>> not-tied-to-full-mtd nand_command more available since I suspect a few >>>> other boards will be in a similar situation, for probing early on. >>> >>> That would be much better solution. >> >> (Background if you've otherwise ignored the thread, on some omap3 boards >> we need to take a whack at NAND to see what DDR we have) >> >> OK, so, Scott, where would you suggest we put a very trivial set of nand >> infrastructure we need outside of the scope of loading u-boot itself >> from NAND ? > > Can the SPL code be used (not an actual SPL build, just the NAND code > associated with it)?
As-is, no, it'll fail to compile unless you fill in a number of blanks about ECC and so forth. If we split nand_spl_simple.c in two, we might be able to re-use nand_command there (maybe with some re-thinking of the #if logic for big or small pages). Give me filenames and I'll do the work :) -- Tom _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot