mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] nand: mxs: NO_SUBPAGE_WRITE flag was overwritten
@ 2012-12-17 15:36 Wolfram Sang
  2012-12-19  9:27 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2012-12-17 15:36 UTC (permalink / raw)
  To: barebox; +Cc: Wolfram Sang

It is not the chip, but this controller which cannot do subpage writes.
So, make sure we add the flag at the proper place, so it doesn't get
overwritten by flash detection anymore.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 drivers/mtd/nand/nand_mxs.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/nand_mxs.c b/drivers/mtd/nand/nand_mxs.c
index c4509d3..bc34526 100644
--- a/drivers/mtd/nand/nand_mxs.c
+++ b/drivers/mtd/nand/nand_mxs.c
@@ -1217,7 +1217,6 @@ static int mxs_nand_probe(struct device_d *dev)
 	mtd->parent = dev;
 
 	nand->priv = nand_info;
-	nand->options |= NAND_NO_SUBPAGE_WRITE;
 
 	nand->cmd_ctrl		= mxs_nand_cmd_ctrl;
 
@@ -1241,8 +1240,15 @@ static int mxs_nand_probe(struct device_d *dev)
 	nand->ecc.bytes		= 9;
 	nand->ecc.size		= 512;
 
-	/* Scan to find existence of the device */
-	err = nand_scan(mtd, 1);
+	/* first scan to find the device and get the page size */
+	err = nand_scan_ident(mtd, 1);
+	if (err)
+		goto err2;
+
+	nand->options |= NAND_NO_SUBPAGE_WRITE;
+
+	/* second phase scan */
+	err = nand_scan_tail(mtd);
 	if (err)
 		goto err2;
 
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] nand: mxs: NO_SUBPAGE_WRITE flag was overwritten
  2012-12-17 15:36 [PATCH] nand: mxs: NO_SUBPAGE_WRITE flag was overwritten Wolfram Sang
@ 2012-12-19  9:27 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2012-12-19  9:27 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: barebox

On Mon, Dec 17, 2012 at 04:36:57PM +0100, Wolfram Sang wrote:
> It is not the chip, but this controller which cannot do subpage writes.
> So, make sure we add the flag at the proper place, so it doesn't get
> overwritten by flash detection anymore.
> 
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>

Applied, thanks

Sascha

> ---
>  drivers/mtd/nand/nand_mxs.c |   12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_mxs.c b/drivers/mtd/nand/nand_mxs.c
> index c4509d3..bc34526 100644
> --- a/drivers/mtd/nand/nand_mxs.c
> +++ b/drivers/mtd/nand/nand_mxs.c
> @@ -1217,7 +1217,6 @@ static int mxs_nand_probe(struct device_d *dev)
>  	mtd->parent = dev;
>  
>  	nand->priv = nand_info;
> -	nand->options |= NAND_NO_SUBPAGE_WRITE;
>  
>  	nand->cmd_ctrl		= mxs_nand_cmd_ctrl;
>  
> @@ -1241,8 +1240,15 @@ static int mxs_nand_probe(struct device_d *dev)
>  	nand->ecc.bytes		= 9;
>  	nand->ecc.size		= 512;
>  
> -	/* Scan to find existence of the device */
> -	err = nand_scan(mtd, 1);
> +	/* first scan to find the device and get the page size */
> +	err = nand_scan_ident(mtd, 1);
> +	if (err)
> +		goto err2;
> +
> +	nand->options |= NAND_NO_SUBPAGE_WRITE;
> +
> +	/* second phase scan */
> +	err = nand_scan_tail(mtd);
>  	if (err)
>  		goto err2;
>  
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2012-12-19  9:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-17 15:36 [PATCH] nand: mxs: NO_SUBPAGE_WRITE flag was overwritten Wolfram Sang
2012-12-19  9:27 ` Sascha Hauer

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