Patchwork m25p80: Fix wrong jedec id for Numonyx n25q128

login
register
mail settings
Submitter walimis
Date Nov. 19, 2012, 1:03 p.m.
Message ID <1353330191-13332-1-git-send-email-walimisdev@gmail.com>
Download mbox | patch
Permalink /patch/200005/
State New
Headers show

Comments

walimis - Nov. 19, 2012, 1:03 p.m.
The jedec id of "n25q128" should be 0x20bb18, not 0x20ba18.

Signed-off-by: Liming Wang <walimisdev@gmail.com>
---
 hw/m25p80.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Peter Crosthwaite - Nov. 20, 2012, 4:32 a.m.
Hi Liming,

On Mon, Nov 19, 2012 at 11:03 PM, Liming Wang <walimisdev@gmail.com> wrote:
> The jedec id of "n25q128" should be 0x20bb18, not 0x20ba18.
>
> Signed-off-by: Liming Wang <walimisdev@gmail.com>
> ---
>  hw/m25p80.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/m25p80.c b/hw/m25p80.c
> index 3895e73..58ae754 100644
> --- a/hw/m25p80.c
> +++ b/hw/m25p80.c
> @@ -177,7 +177,7 @@ static const FlashPartInfo known_devices[] = {
>      { INFO("w25q64",      0xef4017,      0,  64 << 10, 128, ER_4K) },
>
>      /* Numonyx -- n25q128 */
> -    { INFO("n25q128",      0x20ba18,      0,  64 << 10, 256, 0) },
> +    { INFO("n25q128",      0x20bb18,      0,  64 << 10, 256, 0) },
>

Im not sure this is right. Ive looked through the datasheets for this
part. Rev 1.0 (Feb 2010) of the data sheet has the 0x20bb18 Jedec code
but Rev 7 (Feb 2011) has 0x20ba18. We have however, noticed here with
some actual parts that the Jedec code varies from one board to the
next between these two. The mainline Linux Kernel uses 0x20ba18
(drivers/mtd/devices/m25p80.c):

665
666         /* Micron */
667         { "n25q128",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
668         { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
669

And the Xilinx Linux kernel has both:

	/* Micron */
	{ "n25q128",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
	{ "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
	/* Numonyx flash n25q128 - FIXME check the name */
	{ "n25q128",   INFO(0x20bb18, 0, 64 * 1024, 256, 0) },

I think 20ba18 is correct given its specifed by the more recent
datasheets, but if you are comparing to an earlier revision Zynq board
then you may see a diff. Also if you are using Linux, check your
kernel to see if you have the 0x20ba10 line as older versions of the
Xilinx kernel may only have 0x20bb18. May be a case of just a revup of
your kernel.

Another solution is to add both to QEMU, although having to
distinguish between the two different parts with the same name is
messy.

Regards,
Peter

>      { },
>  };
> --
> 1.7.9.5
>
>
walimis - Nov. 20, 2012, 6:05 a.m.
On Tue, Nov 20, 2012 at 02:32:33PM +1000, Peter Crosthwaite wrote:
>Hi Liming,
>
>On Mon, Nov 19, 2012 at 11:03 PM, Liming Wang <walimisdev@gmail.com> wrote:
>> The jedec id of "n25q128" should be 0x20bb18, not 0x20ba18.
>>
>> Signed-off-by: Liming Wang <walimisdev@gmail.com>
>> ---
>>  hw/m25p80.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/m25p80.c b/hw/m25p80.c
>> index 3895e73..58ae754 100644
>> --- a/hw/m25p80.c
>> +++ b/hw/m25p80.c
>> @@ -177,7 +177,7 @@ static const FlashPartInfo known_devices[] = {
>>      { INFO("w25q64",      0xef4017,      0,  64 << 10, 128, ER_4K) },
>>
>>      /* Numonyx -- n25q128 */
>> -    { INFO("n25q128",      0x20ba18,      0,  64 << 10, 256, 0) },
>> +    { INFO("n25q128",      0x20bb18,      0,  64 << 10, 256, 0) },
>>
>
>Im not sure this is right. Ive looked through the datasheets for this
>part. Rev 1.0 (Feb 2010) of the data sheet has the 0x20bb18 Jedec code
>but Rev 7 (Feb 2011) has 0x20ba18. We have however, noticed here with
>some actual parts that the Jedec code varies from one board to the
>next between these two. The mainline Linux Kernel uses 0x20ba18
>(drivers/mtd/devices/m25p80.c):
>
>665
>666         /* Micron */
>667         { "n25q128",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },

Yes, it is. Sorry, I did't look at te mainline Linux kernel.

>668         { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
>669
>
>And the Xilinx Linux kernel has both:
>
>	/* Micron */
>	{ "n25q128",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
>	{ "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
>	/* Numonyx flash n25q128 - FIXME check the name */
>	{ "n25q128",   INFO(0x20bb18, 0, 64 * 1024, 256, 0) },

I don't know what's the Xilinx Linux kernel you used. 
But from Xilinx Linux git tree, master brach, the file "drivers/mtd/devices/m25p80.c":
http://git.xilinx.com/?p=linux-xlnx.git;a=blob;f=drivers/mtd/devices/m25p80.c;h=9d11fdeb375bb097ec2eb13497a1e67ad8babbb8;hb=refs/heads/master

has only 0x20bb18 jedec code for "n25q128":

 712         /* Numonyx flash n25q128 */
 713         { "n25q128",   INFO(0x20bb18,  0,  64 * 1024, 256, 0) },

I looked more deeply in the n25q128 flash and I found there are
two type of "n25q128" flashes.

1. One type is with 1.8V supply voltage:
http://www.micron.com/products/nor-flash/serial-nor-flash#fullPart&236=128Mb&490=N25Q&192=1.7V-2.0V

It has prefix of "N25Q128A11". The datasheet is located in:
http://www.micron.com/~/media/Documents/Products/Data%20Sheet/NOR%20Flash/Serial%20NOR/N25Q/n25q_128mb_1_8v_65nm.pdf
In the first page, it tells that the jedec code is 0xbb18.

1. One type is with 3V supply voltage:
http://www.micron.com/products/nor-flash/serial-nor-flash#fullPart&236=128Mb&490=N25Q&192=2.7V-3.6V

It has prefix of "N25Q128A13". The datasheet is located in:
http://www.micron.com/~/media/Documents/Products/Data%20Sheet/NOR%20Flash/Serial%20NOR/N25Q/N25Q_128_3_Volt_with_boot_sector.pdf
In the first page, it tells that the jedec code is 0xba18.

So I think both 0x20bb18 and 0x20ba18 are right. It depends on what type flash
is used in the Xilinx board and what Xilinx Linux kernel you use.

For my Xilinx zc702 board, I found it has the one 1.8V flash(N25Q128A11E40) and my 
Xilinx kernel has just 0x20bb18 jedec code.
How about your Xilinx board?

And I found there is confusion in Xilinx zc702 board manual:
It declares it uses one N25Q128A13BSF40F flash, but with supply voltage 1.8V.

Qemu maybe has no need to change, but Linux kernel needs to change to distinguish
the two type of flashes.

Regards,
Liming Wang

>
>I think 20ba18 is correct given its specifed by the more recent
>datasheets, but if you are comparing to an earlier revision Zynq board
>then you may see a diff. Also if you are using Linux, check your
>kernel to see if you have the 0x20ba10 line as older versions of the
>Xilinx kernel may only have 0x20bb18. May be a case of just a revup of
>your kernel.
>
>Another solution is to add both to QEMU, although having to
>distinguish between the two different parts with the same name is
>messy.
>
>Regards,
>Peter
>
>>      { },
>>  };
>> --
>> 1.7.9.5
>>
>>
walimis - Nov. 29, 2012, 2:21 a.m.
On Tue, Nov 20, 2012 at 02:32:33PM +1000, Peter Crosthwaite wrote:
>Hi Liming,
>
>On Mon, Nov 19, 2012 at 11:03 PM, Liming Wang <walimisdev@gmail.com> wrote:
>> The jedec id of "n25q128" should be 0x20bb18, not 0x20ba18.
>>
>> Signed-off-by: Liming Wang <walimisdev@gmail.com>
>> ---
>>  hw/m25p80.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/m25p80.c b/hw/m25p80.c
>> index 3895e73..58ae754 100644
>> --- a/hw/m25p80.c
>> +++ b/hw/m25p80.c
>> @@ -177,7 +177,7 @@ static const FlashPartInfo known_devices[] = {
>>      { INFO("w25q64",      0xef4017,      0,  64 << 10, 128, ER_4K) },
>>
>>      /* Numonyx -- n25q128 */
>> -    { INFO("n25q128",      0x20ba18,      0,  64 << 10, 256, 0) },
>> +    { INFO("n25q128",      0x20bb18,      0,  64 << 10, 256, 0) },
>>
>
>Im not sure this is right. Ive looked through the datasheets for this
>part. Rev 1.0 (Feb 2010) of the data sheet has the 0x20bb18 Jedec code
>but Rev 7 (Feb 2011) has 0x20ba18. We have however, noticed here with
>some actual parts that the Jedec code varies from one board to the
>next between these two. The mainline Linux Kernel uses 0x20ba18
>(drivers/mtd/devices/m25p80.c):
>
>665
>666         /* Micron */
>667         { "n25q128",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
>668         { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },

I have submitted a patch to mainline kernel to add 0x20bb18 jedec code.

http://git.infradead.org/users/dedekind/l2-mtd.git/commit/0f722de047e3e041d33446b570f8c960ad188965

Anyway, I think we don't need this patch.

Regards,
Liming Wang

>669
>
>And the Xilinx Linux kernel has both:
>
>	/* Micron */
>	{ "n25q128",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
>	{ "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
>	/* Numonyx flash n25q128 - FIXME check the name */
>	{ "n25q128",   INFO(0x20bb18, 0, 64 * 1024, 256, 0) },
>
>I think 20ba18 is correct given its specifed by the more recent
>datasheets, but if you are comparing to an earlier revision Zynq board
>then you may see a diff. Also if you are using Linux, check your
>kernel to see if you have the 0x20ba10 line as older versions of the
>Xilinx kernel may only have 0x20bb18. May be a case of just a revup of
>your kernel.
>
>Another solution is to add both to QEMU, although having to
>distinguish between the two different parts with the same name is
>messy.
>
>Regards,
>Peter
>
>>      { },
>>  };
>> --
>> 1.7.9.5
>>
>>

Patch

diff --git a/hw/m25p80.c b/hw/m25p80.c
index 3895e73..58ae754 100644
--- a/hw/m25p80.c
+++ b/hw/m25p80.c
@@ -177,7 +177,7 @@  static const FlashPartInfo known_devices[] = {
     { INFO("w25q64",      0xef4017,      0,  64 << 10, 128, ER_4K) },
 
     /* Numonyx -- n25q128 */
-    { INFO("n25q128",      0x20ba18,      0,  64 << 10, 256, 0) },
+    { INFO("n25q128",      0x20bb18,      0,  64 << 10, 256, 0) },
 
     { },
 };