Re: [U-Boot] [PATCH] nand_base: Add timeout for NAND reset command

2009-02-06 Thread Scott Wood
On Wed, Feb 04, 2009 at 01:47:22PM -0600, Peter Tyser wrote: > Without the timeout present an infinite loop can occur if the > NAND device is broken or not present. > > Signed-off-by: Peter Tyser Applied to u-boot-nand-flash. -Scott ___ U-Boot mailing

Re: [U-Boot] [PATCH] nand_base: Add timeout for NAND reset command

2009-02-05 Thread Scott Wood
Peter Tyser wrote: > Hi Scott, > > On Wed, 2009-02-04 at 22:54 +0100, Wolfgang Denk wrote: >> Dear Scott, >> >> In message <498a0917.8080...@freescale.com> you wrote: get_ticks() not a public interface. It should not be used in any common code. >>> Then what is it doing in include/common

Re: [U-Boot] [PATCH] nand_base: Add timeout for NAND reset command

2009-02-05 Thread Peter Tyser
Hi Scott, On Wed, 2009-02-04 at 22:54 +0100, Wolfgang Denk wrote: > Dear Scott, > > In message <498a0917.8080...@freescale.com> you wrote: > > > > > get_ticks() not a public interface. It should not be used in any > > > common code. > > > > Then what is it doing in include/common.h? > > > > > P

Re: [U-Boot] [PATCH] nand_base: Add timeout for NAND reset command

2009-02-04 Thread Wolfgang Denk
Dear Scott, In message <498a0917.8080...@freescale.com> you wrote: > > > get_ticks() not a public interface. It should not be used in any > > common code. > > Then what is it doing in include/common.h? > > > Please use get_timer(). > > But as was pointed out, that depends on interrupts, and thu

Re: [U-Boot] [PATCH] nand_base: Add timeout for NAND reset command

2009-02-04 Thread Wolfgang Denk
Dear Peter Tyser, In message <1233782967.7067.338.ca...@localhost.localdomain> you wrote: > > > get_ticks() not a public interface. It should not be used in any > > common code. > > > > Please use get_timer(). Ah, I see. > The problem is that the NAND code is used prior to interrupts being > en

Re: [U-Boot] [PATCH] nand_base: Add timeout for NAND reset command

2009-02-04 Thread Scott Wood
Wolfgang Denk wrote: > get_ticks() not a public interface. It should not be used in any > common code. Then what is it doing in include/common.h? > Please use get_timer(). But as was pointed out, that depends on interrupts, and thus does not work until very late in the boot process. -Scott ___

Re: [U-Boot] [PATCH] nand_base: Add timeout for NAND reset command

2009-02-04 Thread Peter Tyser
On Wed, 2009-02-04 at 22:22 +0100, Wolfgang Denk wrote: > Dear Scott Wood, > > In message <4989fe57.80...@freescale.com> you wrote: > > Peter Tyser wrote: > > > The 25ns was calculated based on the addition of trp and trhoh from the > > > Micron MT29F8G08 datasheet. Based on the timing diagram fo

Re: [U-Boot] [PATCH] nand_base: Add timeout for NAND reset command

2009-02-04 Thread Wolfgang Denk
Dear Scott Wood, In message <4989fe57.80...@freescale.com> you wrote: > Peter Tyser wrote: > > The 25ns was calculated based on the addition of trp and trhoh from the > > Micron MT29F8G08 datasheet. Based on the timing diagram for a "Read > > Status" cycle I thought this would be the minimum cycl

Re: [U-Boot] [PATCH] nand_base: Add timeout for NAND reset command

2009-02-04 Thread Scott Wood
Peter Tyser wrote: > The 25ns was calculated based on the addition of trp and trhoh from the > Micron MT29F8G08 datasheet. Based on the timing diagram for a "Read > Status" cycle I thought this would be the minimum cycle time needed to > read the chip's status. Other chips (ST, Samsung) I glanced

Re: [U-Boot] [PATCH] nand_base: Add timeout for NAND reset command

2009-02-04 Thread Peter Tyser
On Wed, 2009-02-04 at 13:54 -0600, Scott Wood wrote: > Peter Tyser wrote: > > +/* > > + * CONFIG_SYS_NAND_RESET_CNT is used as a timeout mechanism when resetting > > + * a flash. NAND flash is initialized prior to interrupts so standard > > timers > > + * can't be used. CONFIG_SYS_NAND_RESET_CNT

Re: [U-Boot] [PATCH] nand_base: Add timeout for NAND reset command

2009-02-04 Thread Scott Wood
Peter Tyser wrote: > +/* > + * CONFIG_SYS_NAND_RESET_CNT is used as a timeout mechanism when resetting > + * a flash. NAND flash is initialized prior to interrupts so standard timers > + * can't be used. CONFIG_SYS_NAND_RESET_CNT should be set to a value > + * which is greater than (max NAND rese

[U-Boot] [PATCH] nand_base: Add timeout for NAND reset command

2009-02-04 Thread Peter Tyser
Without the timeout present an infinite loop can occur if the NAND device is broken or not present. Signed-off-by: Peter Tyser --- drivers/mtd/nand/nand_base.c | 19 +-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/n