public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] JFFS2 Loading Error on non 8k blocksize NAND [DEMO	PATCH 1/1]
Date: Mon, 4 Jan 2010 12:21:06 -0600	[thread overview]
Message-ID: <20100104182106.GA24474@loki.buserror.net> (raw)
In-Reply-To: <20091221203702.2B59E3F6EF@gemini.denx.de>

On Mon, Dec 21, 2009 at 09:37:02PM +0100, Wolfgang Denk wrote:
> > --- u-boot/fs/jffs2/jffs2_1pass.c 2009-12-15 14:20:33.000000000 -0600
> > +++ uboot/fs/jffs2/jffs2_1pass.c 2009-12-15 14:19:27.000000000 -0600
> > @@ -158,12 +158,12 @@
> >   *
> >   */
> > 
> > -#define NAND_PAGE_SIZE 512
> > +#define NAND_PAGE_SIZE CONFIG_SYS_NAND_PAGE_SIZE
> >  #define NAND_PAGE_SHIFT 9
> 
> If you change the definition of NAND_PAGE_SIZE, then the value of
> NAND_PAGE_SHIFT makes no longer sense. Having a close look it is not
> used anywhere in the code, so I recommend to simply delete this line.
> While doing this, please also delete the (likewise unsued) definition
> of ONENAND_PAGE_SHIFT.

Also note that the page size is sometimes determined dynamically -- not all
boards define CONFIG_SYS_NAND_PAGE_SIZE, and it's only used by some NAND
boot code.

If this code really needs to know the page size, it should use
mtd->writesize -- but it looks like it doesn't use it for anything other
than calculating the size of the cache.

> >  #define NAND_PAGE_MASK (~(NAND_PAGE_SIZE-1))
> > 
> >  #ifndef NAND_CACHE_PAGES
> > -#define NAND_CACHE_PAGES 16
> > +#define NAND_CACHE_PAGES CONFIG_SYS_NAND_PAGE_COUNT
> >  #endif
> >  #define NAND_CACHE_SIZE (NAND_CACHE_PAGES*NAND_PAGE_SIZE)
> 
> I think here we should remove the "#ifndef NAND_CACHE_PAGES" /
> "#endif" lines and change all remaining definitions of
> NAND_CACHE_PAGES in old board config files
> (include/configs/CATcenter.h,
> include/configs/PPChameleonEVB.h,
> include/configs/NC650.h, and
> include/configs/SIMPC8313.h) into CONFIG_SYS_NAND_PAGE_COUNT.

This doesn't seem to be CONFIG_SYS material, but rather a software choice of
how large a cache for JFFS2 to create.

It should perhaps be renamed something like CONFIG_JFFS2_NAND_CACHE_SIZE --
and maybe specified in terms of bytes rather than number of pages?  If it
even needs to be tunable at all...

-Scott

      reply	other threads:[~2010-01-04 18:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 21:41 [U-Boot] JFFS2 Loading Error on non 8k blocksize NAND [DEMO PATCH 1/1] Hunter Cobbs
2009-12-21 20:37 ` Wolfgang Denk
2010-01-04 18:21   ` Scott Wood [this message]

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=20100104182106.GA24474@loki.buserror.net \
    --to=scottwood@freescale.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox