From: David Brownell <david-b@pacbell.net>
To: Bryan Wu <cooloney@kernel.org>,
Michael Hennerich <michael.hennerich@analog.com>
Cc: linux-mtd@lists.infradead.org, linux@maxim.org.za,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] MTD DataFlash: fix bug - ATMEL AT45DF321D spi flash card fails to be copied to
Date: Sun, 1 Jun 2008 13:28:58 -0700 [thread overview]
Message-ID: <200806011328.58594.david-b@pacbell.net> (raw)
In-Reply-To: <1212230324-22201-1-git-send-email-cooloney@kernel.org>
On Saturday 31 May 2008, Bryan Wu wrote:
> From: Michael Hennerich <michael.hennerich@analog.com>
>
> - Add support for binary page size DataFlashes.
> - The driver now prints out pagesize and erasesize.
> Printout valuable information for creating flash filesystems.
I like the idea, but I'm afraid this approach isn't sufficient.
Thing is, the LSB of the status register is explicitly
undefined for earlier chip revisions (e.g. see datasheets
for AT45DB321B and AT45DB321C vs AT45DB321D), so you should
use a different chip discovery algorithm. Perhaps:
* Try the original scheme (read status register);
* If it indicates a chip that has new versions with
binary page size options, use the 0x9F command to
read the JEDEC id (and chip revision);
* If it's a sufficently new revision, *then* you can
interpret that LSB as indicating the page size
Example, on the AT45DB321x chips, that JEDEC instruction was
added for the 'C' revision (according to my copies of the
datasheets) and wasn't there for the 'B' revision ... while
it was the 'D' revision which introduced the binary page size.
Maybe the JEDEC code from the m25p80 driver can be reused.
Also, I'd like to see a pre-existing typo fixed (in case anyone
uses a flash that small) ... see below.
- Dave
> @@ -546,29 +551,44 @@ static int __devinit dataflash_probe(struct spi_device *spi)
> * board setup should have set spi->max_speed_max to
> * match f(car) for continuous reads, mode 0 or 3.
> */
> - switch (status & 0x3c) {
> + switch (status & 0x3d) {
> case 0x0c: /* 0 0 1 1 x x */
> + case 0x0d:
> status = add_dataflash(spi, "AT45DB011B", 512, 264, 9);
> break;
> case 0x14: /* 0 1 0 1 x x */
> + case 0x15:
> status = add_dataflash(spi, "AT45DB021B", 1025, 264, 9);
1024 pages (of 264 bytes), not 1025. :)
> break;
> case 0x1c: /* 0 1 1 1 x x */
> + case 0x1d:
> ...
next prev parent reply other threads:[~2008-06-01 20:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-31 10:38 [PATCH 1/1] MTD DataFlash: fix bug - ATMEL AT45DF321D spi flash card fails to be copied to Bryan Wu
2008-06-01 20:28 ` David Brownell [this message]
2008-06-02 7:39 ` Hennerich, Michael
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=200806011328.58594.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=cooloney@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux@maxim.org.za \
--cc=michael.hennerich@analog.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