All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harald Seiler <hws@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] pcm058: fix NAND flash not using badblock table
Date: Fri, 07 Dec 2018 13:15:16 +0100	[thread overview]
Message-ID: <9186186fad1d986b1f66e4d9fdb7f94bd8eb00b9.camel@denx.de> (raw)
In-Reply-To: <0d8ac7c3-a4da-786b-65eb-287fd40370b6@denx.de>

Hello Marek,

On Fri, 2018-12-07 at 12:48 +0100, Marek Vasut wrote:
> On 12/07/2018 10:19 AM, Harald Seiler wrote:
> > Currently, U-Boot ignores the BBT stored in the last 4 blocks of NAND
> > flash because the NAND_BBT_USE_FLASH flag is not set.  This leads to
> > two issues:
> > 
> > * U-Boot silently uses a memory-only BBT which is initialized with all
> >   blocks marked as good.  This means, actual bad blocks are marked good
> >   and U-Boot might try writing to or reading from them.
> > * The BBT in flash, which will be created once Linux boots up, is not
> >   off limits for a driver ontop, like UBI.  While it does not seem to
> >   consistently produce an error, sometimes UBI will fail to attach
> >   because the BBT blocks obviously don't contain valid UBI data.
> > 
> > To fix this, this patch sets the CONFIG_SYS_NAND_USE_FLASH_BBT option,
> > which is used in ./drivers/mtd/nand/raw/mxs_nand.c to decide whether
> > a BBT in flash is used.
> > 
> > Signed-off-by: Harald Seiler <hws@denx.de>
> 
> V2 Changelog is missing.
> 
> > ---
> >  include/configs/pcm058.h | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/include/configs/pcm058.h b/include/configs/pcm058.h
> > index 49048c163f..b9bc08b388 100644
> > --- a/include/configs/pcm058.h
> > +++ b/include/configs/pcm058.h
> > @@ -55,6 +55,7 @@
> >  #define CONFIG_SYS_NAND_BASE		0x40000000
> >  #define CONFIG_SYS_NAND_5_ADDR_CYCLE
> >  #define CONFIG_SYS_NAND_ONFI_DETECTION
> > +#define CONFIG_SYS_NAND_USE_FLASH_BBT
> 
> Shouldn't this be enabled on all boards with GPMI NAND ?
> 

I looked at other boards and they all defined this config, so I
assumed this was the way to go ... But yes, as far as I understand,
it would make sense to have it enabled most of the time.  Although
there is some code which makes this configuration from the
devicetree, which might be an even better solution.

> >  #endif
> >  
> >  /* DMA stuff, needed for GPMI/MXS NAND support */
> > 
> 
> 

-- 
Harald

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-62  Fax: +49-8142-66989-80   Email: hws at denx.de 

  reply	other threads:[~2018-12-07 12:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05 12:29 [U-Boot] [PATCH] pcm058: fix NAND flash not using badblock table Harald Seiler
2018-12-07  8:45 ` Stefano Babic
2018-12-07  9:19   ` [U-Boot] [PATCH v2] " Harald Seiler
2018-12-07 11:48     ` Marek Vasut
2018-12-07 12:15       ` Harald Seiler [this message]
2018-12-07 12:18         ` Marek Vasut
2018-12-07 18:55           ` Stefano Babic
2018-12-07 21:18             ` Harald Seiler
2018-12-08 18:44               ` Stefano Babic

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=9186186fad1d986b1f66e4d9fdb7f94bd8eb00b9.camel@denx.de \
    --to=hws@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.