Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org>
To: Boris Brezillon
	<boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: Roger Quadros <rogerq-l0cyMroinI0@public.gmane.org>,
	Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Wenyou Yang <wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>,
	Josh Wu <rainyfeeling-1ViLX0X+lBJBDgjK7y7TUQ@public.gmane.org>,
	Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org>,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Brian Norris
	<computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Kamal Dasu <kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Han Xu <han.xu-3arQi8VN3Tc@public.gmane.org>,
	Ezequiel Garcia
	<ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Stefan Agner <stefan-XLVq0VzYD2Y@public.gmane.org>,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Nicolas Ferre
	<nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>,
	Jean-Christophe Plagniol-Villard
	<plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>,
	Alexandre Belloni
	<alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Thomas Petazzoni
	<thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Gregory CLEMENT
	<gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
	Sebastian Hesselbarth
	<sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>,
	Daniel Mack <daniel@zonque>
Subject: Re: [PATCH 10/12] mtd: nand: pxa3xx: rely on generic DT parsing done in nand_scan_ident()
Date: Wed, 13 Apr 2016 11:48:22 -0300	[thread overview]
Message-ID: <20160413144822.GA1065@laptop.cereza> (raw)
In-Reply-To: <1459515272-31011-11-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>

On 01 Apr 02:54 PM, Boris Brezillon wrote:
> The core now takes care of parsing generic DT properties in
> nand_scan_ident() when nand_set_flash_node() has been called.
> Rely on this initialization instead of calling of_get_nand_xxx()
> manually.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>

Acked-by: Ezequiel Garcia <ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org>

Thanks,

> ---
>  drivers/mtd/nand/pxa3xx_nand.c | 28 +++++++++++-----------------
>  1 file changed, 11 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
> index d650885..38d26ab 100644
> --- a/drivers/mtd/nand/pxa3xx_nand.c
> +++ b/drivers/mtd/nand/pxa3xx_nand.c
> @@ -29,7 +29,6 @@
>  #include <linux/slab.h>
>  #include <linux/of.h>
>  #include <linux/of_device.h>
> -#include <linux/of_mtd.h>
>  #include <linux/platform_data/mtd-nand-pxa3xx.h>
>  
>  #define	CHIP_DELAY_TIMEOUT	msecs_to_jiffies(200)
> @@ -1651,6 +1650,12 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
>  	if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
>  		nand_writel(info, NDECCCTRL, 0x0);
>  
> +	if (pdata->flash_bbt)
> +		chip->bbt_options |= NAND_BBT_USE_FLASH;
> +
> +	chip->ecc.strength = pdata->ecc_strength;
> +	chip->ecc.size = pdata->ecc_step_size;
> +
>  	if (nand_scan_ident(mtd, 1, NULL))
>  		return -ENODEV;
>  
> @@ -1663,13 +1668,12 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
>  		}
>  	}
>  
> -	if (pdata->flash_bbt) {
> +	if (chip->bbt_options & NAND_BBT_USE_FLASH) {
>  		/*
>  		 * We'll use a bad block table stored in-flash and don't
>  		 * allow writing the bad block marker to the flash.
>  		 */
> -		chip->bbt_options |= NAND_BBT_USE_FLASH |
> -				     NAND_BBT_NO_OOB_BBM;
> +		chip->bbt_options |= NAND_BBT_NO_OOB_BBM;
>  		chip->bbt_td = &bbt_main_descr;
>  		chip->bbt_md = &bbt_mirror_descr;
>  	}
> @@ -1689,10 +1693,9 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
>  		}
>  	}
>  
> -	if (pdata->ecc_strength && pdata->ecc_step_size) {
> -		ecc_strength = pdata->ecc_strength;
> -		ecc_step = pdata->ecc_step_size;
> -	} else {
> +	ecc_strength = chip->ecc.strength;
> +	ecc_step = chip->ecc.size;
> +	if (!ecc_strength || !ecc_step) {
>  		ecc_strength = chip->ecc_strength_ds;
>  		ecc_step = chip->ecc_step_ds;
>  	}
> @@ -1903,15 +1906,6 @@ static int pxa3xx_nand_probe_dt(struct platform_device *pdev)
>  	if (of_get_property(np, "marvell,nand-keep-config", NULL))
>  		pdata->keep_config = 1;
>  	of_property_read_u32(np, "num-cs", &pdata->num_cs);
> -	pdata->flash_bbt = of_get_nand_on_flash_bbt(np);
> -
> -	pdata->ecc_strength = of_get_nand_ecc_strength(np);
> -	if (pdata->ecc_strength < 0)
> -		pdata->ecc_strength = 0;
> -
> -	pdata->ecc_step_size = of_get_nand_ecc_step_size(np);
> -	if (pdata->ecc_step_size < 0)
> -		pdata->ecc_step_size = 0;
>  
>  	pdev->dev.platform_data = pdata;
>  
> -- 
> 2.5.0
> 

-- 
Ezequiel Garcia, VanguardiaSur
www.vanguardiasur.com.ar

  parent reply	other threads:[~2016-04-13 14:48 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01 12:54 [PATCH 00/12] mtd: get rid of of_mtd.{c,h} and of_get_nand_xx() Boris Brezillon
     [not found] ` <1459515272-31011-1-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-04-01 12:54   ` [PATCH 01/12] mtd: nand: remove unneeded of_mtd.h inclusions Boris Brezillon
     [not found]     ` <1459515272-31011-2-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-04-01 13:09       ` Harvey Hunt
2016-04-12 22:22       ` Boris Brezillon
2016-04-01 12:54   ` [PATCH 02/12] mtd: nand: atmel: rely on generic DT parsing done in nand_scan_ident() Boris Brezillon
2016-04-13 12:55     ` Nicolas Ferre
     [not found]     ` <1459515272-31011-3-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-04-13 12:31       ` Boris Brezillon
2016-04-13 13:51       ` Boris Brezillon
2016-04-01 12:54   ` [PATCH 03/12] mtd: nand: omap2: " Boris Brezillon
     [not found]     ` <1459515272-31011-4-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-04-04  7:23       ` Roger Quadros
2016-04-12 22:22       ` Boris Brezillon
2016-04-01 12:54   ` [PATCH 04/12] mtd: nand: brcm: " Boris Brezillon
     [not found]     ` <1459515272-31011-5-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-04-12 22:31       ` Brian Norris
2016-04-13  7:42         ` Boris Brezillon
2016-04-01 12:54   ` [PATCH 05/12] mtd: nand: davinci: " Boris Brezillon
2016-04-01 12:54   ` [PATCH 06/12] mtd: nand: gpmi: " Boris Brezillon
     [not found]     ` <1459515272-31011-7-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-04-16  9:07       ` Boris Brezillon
2016-04-16 18:46         ` Han Xu
2016-04-01 12:54   ` [PATCH 07/12] mtd: nand: hisi504: " Boris Brezillon
2016-04-01 12:54   ` [PATCH 08/12] mtd: nand: lpc32xx: " Boris Brezillon
2016-04-01 12:54   ` [PATCH 09/12] mtd: nand: mxc: " Boris Brezillon
2016-04-01 12:54   ` [PATCH 10/12] mtd: nand: pxa3xx: " Boris Brezillon
     [not found]     ` <1459515272-31011-11-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-04-13 14:48       ` Ezequiel Garcia [this message]
     [not found]         ` <20160413144822.GA1065-AdgCB+f5QAzyhT9Hgw/vGA@public.gmane.org>
2016-04-13 14:53           ` Boris Brezillon
2016-04-01 12:54   ` [PATCH 11/12] mtd: nand: sh_flctl: " Boris Brezillon
2016-04-01 12:54   ` [PATCH 12/12] mtd: nand: move of_get_nand_xxx() helpers into nand_base.c Boris Brezillon
2016-04-01 14:13     ` kbuild test robot
     [not found]       ` <201604012200.EksFk1z5%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-04-01 15:34         ` Boris Brezillon
2016-04-22  9:14   ` [PATCH 00/12] mtd: get rid of of_mtd.{c,h} and of_get_nand_xx() Boris Brezillon
2016-04-06 23:33 ` Franklin S Cooper Jr.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160413144822.GA1065@laptop.cereza \
    --to=ezequiel-30ulvvutt6g51wmpkgsgjgyuob5fgqpz@public.gmane.org \
    --cc=alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=andrew-g2DYL2Zd6BY@public.gmane.org \
    --cc=boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=daniel@zonque \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=han.xu-3arQi8VN3Tc@public.gmane.org \
    --cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
    --cc=kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org \
    --cc=plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org \
    --cc=rainyfeeling-1ViLX0X+lBJBDgjK7y7TUQ@public.gmane.org \
    --cc=richard-/L3Ra7n9ekc@public.gmane.org \
    --cc=rogerq-l0cyMroinI0@public.gmane.org \
    --cc=sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=stefan-XLVq0VzYD2Y@public.gmane.org \
    --cc=thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    --cc=wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox