public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] [MTD] orion_nand: add chip_delay parameter
@ 2008-06-23 13:55 Nicolas Pitre
  2008-06-26 17:24 ` Nicolas Pitre
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Pitre @ 2008-06-23 13:55 UTC (permalink / raw)
  To: linux-mtd

From: Saeed Bishara <saeed@marvell.com>

Some SoC's need a different chip_delay value.

Signed-off-by: Saeed Bishara <saeed@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: Nicolas Pitre <nico@marvell.com>

diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 59e05a1..ee2ac39 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -85,6 +85,9 @@ static int __init orion_nand_probe(struct platform_device *pdev)
 	nc->cmd_ctrl = orion_nand_cmd_ctrl;
 	nc->ecc.mode = NAND_ECC_SOFT;
 
+	if (board->chip_delay)
+		nc->chip_delay = board->chip_delay;
+
 	if (board->width == 16)
 		nc->options |= NAND_BUSWIDTH_16;
 
diff --git a/include/asm-arm/plat-orion/orion_nand.h b/include/asm-arm/plat-orion/orion_nand.h
index ffd3852..ad4ce94 100644
--- a/include/asm-arm/plat-orion/orion_nand.h
+++ b/include/asm-arm/plat-orion/orion_nand.h
@@ -18,6 +18,7 @@ struct orion_nand_data {
 	u8 ale;		/* address line number connected to ALE */
 	u8 cle;		/* address line number connected to CLE */
 	u8 width;	/* buswidth */
+	u8 chip_delay;
 };
 
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] [MTD] orion_nand: add chip_delay parameter
  2008-06-23 13:55 [PATCH] [MTD] orion_nand: add chip_delay parameter Nicolas Pitre
@ 2008-06-26 17:24 ` Nicolas Pitre
  2008-06-27  7:23   ` Jörn Engel
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Pitre @ 2008-06-26 17:24 UTC (permalink / raw)
  To: linux-mtd; +Cc: David Woodhouse

On Mon, 23 Jun 2008, Nicolas Pitre wrote:

> From: Saeed Bishara <saeed@marvell.com>
> 
> Some SoC's need a different chip_delay value.
> 
> Signed-off-by: Saeed Bishara <saeed@marvell.com>
> Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
> Signed-off-by: Nicolas Pitre <nico@marvell.com>

I posted this patch on Monday for inclusion in 2.6.27.  However we have 
additional patches meant to be pushed through the ARM tree that depend 
on this one.  So to simplify dependency issues, I would like for this 
patch to be acked and then we'll simply push it along with the others 
through the ARM path.

Any objections??

> diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
> index 59e05a1..ee2ac39 100644
> --- a/drivers/mtd/nand/orion_nand.c
> +++ b/drivers/mtd/nand/orion_nand.c
> @@ -85,6 +85,9 @@ static int __init orion_nand_probe(struct platform_device *pdev)
>  	nc->cmd_ctrl = orion_nand_cmd_ctrl;
>  	nc->ecc.mode = NAND_ECC_SOFT;
>  
> +	if (board->chip_delay)
> +		nc->chip_delay = board->chip_delay;
> +
>  	if (board->width == 16)
>  		nc->options |= NAND_BUSWIDTH_16;
>  
> diff --git a/include/asm-arm/plat-orion/orion_nand.h b/include/asm-arm/plat-orion/orion_nand.h
> index ffd3852..ad4ce94 100644
> --- a/include/asm-arm/plat-orion/orion_nand.h
> +++ b/include/asm-arm/plat-orion/orion_nand.h
> @@ -18,6 +18,7 @@ struct orion_nand_data {
>  	u8 ale;		/* address line number connected to ALE */
>  	u8 cle;		/* address line number connected to CLE */
>  	u8 width;	/* buswidth */
> +	u8 chip_delay;
>  };
>  
>  
> 


Nicolas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [MTD] orion_nand: add chip_delay parameter
  2008-06-26 17:24 ` Nicolas Pitre
@ 2008-06-27  7:23   ` Jörn Engel
  2008-06-28  1:18     ` Nicolas Pitre
  0 siblings, 1 reply; 4+ messages in thread
From: Jörn Engel @ 2008-06-27  7:23 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: David Woodhouse, linux-mtd

On Thu, 26 June 2008 13:24:14 -0400, Nicolas Pitre wrote:
> 
> I posted this patch on Monday for inclusion in 2.6.27.  However we have 
> additional patches meant to be pushed through the ARM tree that depend 
> on this one.  So to simplify dependency issues, I would like for this 
> patch to be acked and then we'll simply push it along with the others 
> through the ARM path.
> 
> Any objections??

While I don't really understand what this patch does, it seems harmless
enough and I generally trust your judgement.  Good enough for me.

> > diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
> > index 59e05a1..ee2ac39 100644
> > --- a/drivers/mtd/nand/orion_nand.c
> > +++ b/drivers/mtd/nand/orion_nand.c
> > @@ -85,6 +85,9 @@ static int __init orion_nand_probe(struct platform_device *pdev)
> >  	nc->cmd_ctrl = orion_nand_cmd_ctrl;
> >  	nc->ecc.mode = NAND_ECC_SOFT;
> >  
> > +	if (board->chip_delay)
> > +		nc->chip_delay = board->chip_delay;
> > +

What I'm wondering about is whether the assignment should be made
unconditional.  After all, if board->chip_delay is zero, the assignment
should simply write zero to a variable that already is zero.  Or if it
isn't, the driver is missing a memset() somewhere.

Jörn

-- 
There is no worse hell than that provided by the regrets
for wasted opportunities.
-- Andre-Louis Moreau in Scarabouche

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [MTD] orion_nand: add chip_delay parameter
  2008-06-27  7:23   ` Jörn Engel
@ 2008-06-28  1:18     ` Nicolas Pitre
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Pitre @ 2008-06-28  1:18 UTC (permalink / raw)
  To: Jörn Engel; +Cc: David Woodhouse, linux-mtd

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1500 bytes --]

On Fri, 27 Jun 2008, Jörn Engel wrote:

> On Thu, 26 June 2008 13:24:14 -0400, Nicolas Pitre wrote:
> > 
> > I posted this patch on Monday for inclusion in 2.6.27.  However we have 
> > additional patches meant to be pushed through the ARM tree that depend 
> > on this one.  So to simplify dependency issues, I would like for this 
> > patch to be acked and then we'll simply push it along with the others 
> > through the ARM path.
> > 
> > Any objections??
> 
> While I don't really understand what this patch does, it seems harmless
> enough and I generally trust your judgement.  Good enough for me.

OK thanks.

> > > diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
> > > index 59e05a1..ee2ac39 100644
> > > --- a/drivers/mtd/nand/orion_nand.c
> > > +++ b/drivers/mtd/nand/orion_nand.c
> > > @@ -85,6 +85,9 @@ static int __init orion_nand_probe(struct platform_device *pdev)
> > >  	nc->cmd_ctrl = orion_nand_cmd_ctrl;
> > >  	nc->ecc.mode = NAND_ECC_SOFT;
> > >  
> > > +	if (board->chip_delay)
> > > +		nc->chip_delay = board->chip_delay;
> > > +
> 
> What I'm wondering about is whether the assignment should be made
> unconditional.  After all, if board->chip_delay is zero, the assignment
> should simply write zero to a variable that already is zero.  Or if it
> isn't, the driver is missing a memset() somewhere.

There is the case that a default could be set by the driver and having 
board->chip_delay == 0 should mean the driver default is fine.


Nicolas

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-06-28  1:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-23 13:55 [PATCH] [MTD] orion_nand: add chip_delay parameter Nicolas Pitre
2008-06-26 17:24 ` Nicolas Pitre
2008-06-27  7:23   ` Jörn Engel
2008-06-28  1:18     ` Nicolas Pitre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox