public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: David Vrabel <dvrabel@arcom.com>
To: linux-mtd list <linux-mtd@lists.infradead.org>
Subject: Re: Why CFI_DEVICETYPE_X8 in cfi_send_gen_cmd()?
Date: Wed, 25 Feb 2004 11:08:21 +0000	[thread overview]
Message-ID: <403C8225.3040801@arcom.com> (raw)
In-Reply-To: <20040225012449.90118.qmail@web20722.mail.yahoo.com>

Shawn Jin wrote:
> 
> In cfi_cmdset_0002.c, there is a piece of comment stating that the
> CFI_DEVICETYPE_X8 is needed even when cfi->device_type !=
> CFI_DEVICETYPE_X8. Why is it the case?

It appears to be to handle the case of x16 chips in x8 mode.  In such a 
case the device width is 2, interleave is 1 and buswidth is 1. 
Therefore, cfi_build_cmd_addr() will not generate the correct unlock 
addresses. (i.e., there's no integral solution to 0xaaa = addr * 
device_width (2) * interleave (1) which is the required unlock address.)

Not sure how to handle all possible arrangements of chips.

Dev. width | interleave  | buswidth |   addr1 |   addr2
-------------------------------------------------------
2          | 1           | 2        |   0xaaa |   0x554
2          | 1           | 1        |   0xaaa |   0x555
4          | 2           | 8        |  0x2aa8 |  0x1550

(addr1 and addr2 are byte addresses -- the AMD datasheets typically 
gives word addresses)

> So I replaced CFI_DEVICETYPE_X8 with cfi->device_type in both
> do_erase_oneblock() and do_write_oneword(). I tested and found that erase
> can succeed but write still fails.

Maybe you're using do_write_buffer(..) instead? There's a comment near 
it that says it may well be broken for interleaved chips, though.

David Vrabel
-- 
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/

  reply	other threads:[~2004-02-25 11:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-25  1:24 Why CFI_DEVICETYPE_X8 in cfi_send_gen_cmd()? Shawn Jin
2004-02-25 11:08 ` David Vrabel [this message]
2004-02-25 12:31   ` David Woodhouse
     [not found] <3236F92B82933347807DFF6A8BA632802133B9@wcosmb04.cos.agilent.com>
2004-02-27 10:03 ` David Vrabel

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=403C8225.3040801@arcom.com \
    --to=dvrabel@arcom.com \
    --cc=linux-mtd@lists.infradead.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