linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: b35362@freescale.com
Cc: scottwood <scottwood@freescale.com>,
	linuxppc-dev@ozlabs.org, dwmw2@infradead.org,
	linux-mtd@lists.infradead.org
Subject: Re: [PATCH v2] mtd/nand : workaround for Freescale FCM to support large-page Nand chip
Date: Mon, 15 Aug 2011 18:59:09 +0300	[thread overview]
Message-ID: <1313423954.8691.17.camel@sauron> (raw)
In-Reply-To: <1310446122-18050-1-git-send-email-b35362@freescale.com>

On Tue, 2011-07-12 at 12:48 +0800, b35362@freescale.com wrote:
> +	/*
> +	 * Hack for supporting the flash chip whose writesize is
> +	 * larger than 2K bytes.
> +	 */
> +	if (mtd->writesize > 2048) {
> +		elbc_fcm_ctrl->subpage_shift = ffs(mtd->writesize >> 11) - 1;
> +		elbc_fcm_ctrl->subpage_mask =
> +			(1 << elbc_fcm_ctrl->subpage_shift) - 1;
> +		/*
> +		 * Rewrite mtd->writesize, mtd->oobsize, chip->page_shift
> +		 * and chip->pagemask.
> +		 */
> +		mtd->writesize = 2048;
> +		mtd->oobsize = 64;
> +		chip->page_shift = ffs(mtd->writesize) - 1;
> +		chip->pagemask = (chip->chipsize >> chip->page_shift) - 1;
> +	}

So basically if the flash has 4KiB NAND pages, you are considering it as
a flash with 2KiB NAND pages. But surely this will work only if the
underlying flash has NOP 2 at least. Or even, if you consider that JFFS2
and YAFFS want to write to OOB, you need NOP 4 (2 ECC writes and 2
writes from YAFFS/JFFS2) ? So this won't work for NOP1 flashes? Isn't it
an ugly hack?

-- 
Best Regards,
Artem Bityutskiy

  parent reply	other threads:[~2011-08-15 15:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12  4:48 [PATCH v2] mtd/nand : workaround for Freescale FCM to support large-page Nand chip b35362
2011-08-03  6:15 ` Li Yang-R58472
2011-08-15 15:59 ` Artem Bityutskiy [this message]
2011-08-15 16:11   ` Scott Wood
2011-08-15 16:24     ` Artem Bityutskiy
2011-09-02  7:10     ` Stijn Devriendt

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=1313423954.8691.17.camel@sauron \
    --to=dedekind1@gmail.com \
    --cc=b35362@freescale.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=scottwood@freescale.com \
    /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;
as well as URLs for NNTP newsgroup(s).