Patchwork mtd: m25p80: Add support for Micron N25Q512A memory

login
register
mail settings
Submitter Priyanka Jain
Date Sept. 4, 2013, 4:46 a.m.
Message ID <1378270016-9280-1-git-send-email-Priyanka.Jain@freescale.com>
Download mbox | patch
Permalink /patch/272457/
State New
Headers show

Comments

Priyanka Jain - Sept. 4, 2013, 4:46 a.m.
Micron N25Q512A is a spi flash memory with following features:
-64MB size, 1.8V, Mulitple I/O, 4KB Sector erase memory.
-Memory is organised as 1024(64KB) main sectors.
-Each sector is divided into 256 pages.
-Register set/Opcodes are similar to other N25Q family products.

Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
---
 drivers/mtd/devices/m25p80.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Brian Norris - Oct. 2, 2013, 6:51 p.m.
+ Marek

On Wed, Sep 04, 2013 at 10:16:56AM +0530, Priyanka Jain wrote:
> Micron N25Q512A is a spi flash memory with following features:
> -64MB size, 1.8V, Mulitple I/O, 4KB Sector erase memory.
> -Memory is organised as 1024(64KB) main sectors.
> -Each sector is divided into 256 pages.
> -Register set/Opcodes are similar to other N25Q family products.
> 
> Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
> ---
>  drivers/mtd/devices/m25p80.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index 26b14f9..94e3b53 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -774,6 +774,7 @@ static const struct spi_device_id m25p_ids[] = {
>  	{ "n25q128a11",  INFO(0x20bb18, 0, 64 * 1024, 256, 0) },
>  	{ "n25q128a13",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
>  	{ "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
> +	{ "n25q512a", INFO(0x20bb20, 0, 64 * 1024, 512, SECT_4K) },

This device actually has the same ID as Micron's next line (MT25QL512A).
They have the same geometry, so maybe that's not a problem.

(FWIW, I haven't gotten either flash working here, but I'm suspecting
board problems.)

>  
>  	/* PMC */
>  	{ "pm25lv512", INFO(0, 0, 32 * 1024, 2, SECT_4K_PMC) },

I'll give Marek a chance to look at this, then I'll take this into
l2-mtd.git if there are no objections.

Brian
Brian Norris - Oct. 2, 2013, 6:55 p.m.
+ Marek for real!

On Wed, Oct 2, 2013 at 11:51 AM, Brian Norris
<computersforpeace@gmail.com> wrote:
> + Marek
>
> On Wed, Sep 04, 2013 at 10:16:56AM +0530, Priyanka Jain wrote:
>> Micron N25Q512A is a spi flash memory with following features:
>> -64MB size, 1.8V, Mulitple I/O, 4KB Sector erase memory.
>> -Memory is organised as 1024(64KB) main sectors.
>> -Each sector is divided into 256 pages.
>> -Register set/Opcodes are similar to other N25Q family products.
>>
>> Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
>> ---
>>  drivers/mtd/devices/m25p80.c |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
>> index 26b14f9..94e3b53 100644
>> --- a/drivers/mtd/devices/m25p80.c
>> +++ b/drivers/mtd/devices/m25p80.c
>> @@ -774,6 +774,7 @@ static const struct spi_device_id m25p_ids[] = {
>>       { "n25q128a11",  INFO(0x20bb18, 0, 64 * 1024, 256, 0) },
>>       { "n25q128a13",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
>>       { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
>> +     { "n25q512a", INFO(0x20bb20, 0, 64 * 1024, 512, SECT_4K) },
>
> This device actually has the same ID as Micron's next line (MT25QL512A).
> They have the same geometry, so maybe that's not a problem.
>
> (FWIW, I haven't gotten either flash working here, but I'm suspecting
> board problems.)
>
>>
>>       /* PMC */
>>       { "pm25lv512", INFO(0, 0, 32 * 1024, 2, SECT_4K_PMC) },
>
> I'll give Marek a chance to look at this, then I'll take this into
> l2-mtd.git if there are no objections.
>
> Brian
Marek Vasut - Oct. 2, 2013, 8:02 p.m.
Hi Brian,

>  + Marek for real!
> 
> On Wed, Oct 2, 2013 at 11:51 AM, Brian Norris
> 
> <computersforpeace@gmail.com> wrote:
> > + Marek
> > 
> > On Wed, Sep 04, 2013 at 10:16:56AM +0530, Priyanka Jain wrote:
> >> Micron N25Q512A is a spi flash memory with following features:
> >> -64MB size, 1.8V, Mulitple I/O, 4KB Sector erase memory.
> >> -Memory is organised as 1024(64KB) main sectors.
> >> -Each sector is divided into 256 pages.
> >> -Register set/Opcodes are similar to other N25Q family products.
> >> 
> >> Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
> >> ---
> >> 
> >>  drivers/mtd/devices/m25p80.c |    1 +
> >>  1 files changed, 1 insertions(+), 0 deletions(-)
> >> 
> >> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> >> index 26b14f9..94e3b53 100644
> >> --- a/drivers/mtd/devices/m25p80.c
> >> +++ b/drivers/mtd/devices/m25p80.c
> >> @@ -774,6 +774,7 @@ static const struct spi_device_id m25p_ids[] = {
> >> 
> >>       { "n25q128a11",  INFO(0x20bb18, 0, 64 * 1024, 256, 0) },
> >>       { "n25q128a13",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
> >>       { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
> >> 
> >> +     { "n25q512a", INFO(0x20bb20, 0, 64 * 1024, 512, SECT_4K) },

Why does this n25q256a and n25q512a have exactly the same geometry? I mean, 
those chips differ in size, do they not ? ;-)

> > This device actually has the same ID as Micron's next line (MT25QL512A).
> > They have the same geometry, so maybe that's not a problem.
> > 
> > (FWIW, I haven't gotten either flash working here, but I'm suspecting
> > board problems.)
> > 
> >>       /* PMC */
> >>       { "pm25lv512", INFO(0, 0, 32 * 1024, 2, SECT_4K_PMC) },
> > 
> > I'll give Marek a chance to look at this, then I'll take this into
> > l2-mtd.git if there are no objections.

btw. I got me a board with n25q256a. The chip works fine with recent linux 
kernel, so the ST-related 4-byte addressing change works perfectly.

Best regards,
Marek Vasut
Brian Norris - Oct. 2, 2013, 8:11 p.m.
On Wed, Oct 2, 2013 at 1:02 PM, Marek Vasut <marex@denx.de> wrote:
> Hi Brian,
>
>>  + Marek for real!
>>
>> On Wed, Oct 2, 2013 at 11:51 AM, Brian Norris
>>
>> <computersforpeace@gmail.com> wrote:
>> > + Marek
>> >
>> > On Wed, Sep 04, 2013 at 10:16:56AM +0530, Priyanka Jain wrote:
>> >> Micron N25Q512A is a spi flash memory with following features:
>> >> -64MB size, 1.8V, Mulitple I/O, 4KB Sector erase memory.
>> >> -Memory is organised as 1024(64KB) main sectors.
>> >> -Each sector is divided into 256 pages.
>> >> -Register set/Opcodes are similar to other N25Q family products.
>> >>
>> >> Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
>> >> ---
>> >>
>> >>  drivers/mtd/devices/m25p80.c |    1 +
>> >>  1 files changed, 1 insertions(+), 0 deletions(-)
>> >>
>> >> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
>> >> index 26b14f9..94e3b53 100644
>> >> --- a/drivers/mtd/devices/m25p80.c
>> >> +++ b/drivers/mtd/devices/m25p80.c
>> >> @@ -774,6 +774,7 @@ static const struct spi_device_id m25p_ids[] = {
>> >>
>> >>       { "n25q128a11",  INFO(0x20bb18, 0, 64 * 1024, 256, 0) },
>> >>       { "n25q128a13",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
>> >>       { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
>> >>
>> >> +     { "n25q512a", INFO(0x20bb20, 0, 64 * 1024, 512, SECT_4K) },
>
> Why does this n25q256a and n25q512a have exactly the same geometry? I mean,
> those chips differ in size, do they not ? ;-)
>
>> > This device actually has the same ID as Micron's next line (MT25QL512A).
>> > They have the same geometry, so maybe that's not a problem.

I was referring to Micron n25q512a (which this patch mentions) and
Micron's new generation of flash MT25QL512A (not mentioned in the
original code or patch). They are different flash and are named
differently but have the same ID. Perhaps my usage of the word "line"
was confusing.

>> > (FWIW, I haven't gotten either flash working here, but I'm suspecting
>> > board problems.)
>> >
>> >>       /* PMC */
>> >>       { "pm25lv512", INFO(0, 0, 32 * 1024, 2, SECT_4K_PMC) },
>> >
>> > I'll give Marek a chance to look at this, then I'll take this into
>> > l2-mtd.git if there are no objections.
>
> btw. I got me a board with n25q256a. The chip works fine with recent linux
> kernel, so the ST-related 4-byte addressing change works perfectly.

Good to know. Thanks.

Brian
Marek Vasut - Oct. 2, 2013, 8:55 p.m.
Dear Brian Norris,

> On Wed, Oct 2, 2013 at 1:02 PM, Marek Vasut <marex@denx.de> wrote:
> > Hi Brian,
> > 
> >>  + Marek for real!
> >> 
> >> On Wed, Oct 2, 2013 at 11:51 AM, Brian Norris
> >> 
> >> <computersforpeace@gmail.com> wrote:
> >> > + Marek
> >> > 
> >> > On Wed, Sep 04, 2013 at 10:16:56AM +0530, Priyanka Jain wrote:
> >> >> Micron N25Q512A is a spi flash memory with following features:
> >> >> -64MB size, 1.8V, Mulitple I/O, 4KB Sector erase memory.
> >> >> -Memory is organised as 1024(64KB) main sectors.
> >> >> -Each sector is divided into 256 pages.
> >> >> -Register set/Opcodes are similar to other N25Q family products.
> >> >> 
> >> >> Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
> >> >> ---
> >> >> 
> >> >>  drivers/mtd/devices/m25p80.c |    1 +
> >> >>  1 files changed, 1 insertions(+), 0 deletions(-)
> >> >> 
> >> >> diff --git a/drivers/mtd/devices/m25p80.c
> >> >> b/drivers/mtd/devices/m25p80.c index 26b14f9..94e3b53 100644
> >> >> --- a/drivers/mtd/devices/m25p80.c
> >> >> +++ b/drivers/mtd/devices/m25p80.c
> >> >> @@ -774,6 +774,7 @@ static const struct spi_device_id m25p_ids[] = {
> >> >> 
> >> >>       { "n25q128a11",  INFO(0x20bb18, 0, 64 * 1024, 256, 0) },
> >> >>       { "n25q128a13",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
> >> >>       { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
> >> >> 
> >> >> +     { "n25q512a", INFO(0x20bb20, 0, 64 * 1024, 512, SECT_4K) },
> > 
> > Why does this n25q256a and n25q512a have exactly the same geometry? I
> > mean, those chips differ in size, do they not ? ;-)
> > 
> >> > This device actually has the same ID as Micron's next line
> >> > (MT25QL512A). They have the same geometry, so maybe that's not a
> >> > problem.
> 
> I was referring to Micron n25q512a (which this patch mentions) and
> Micron's new generation of flash MT25QL512A (not mentioned in the
> original code or patch). They are different flash and are named
> differently but have the same ID. Perhaps my usage of the word "line"
> was confusing.

Yes I know. Still, that n25q512a line being the exact copy of n25q256a doesn't 
seem right.

The new ql512a seems line just a compatible replacement part for older lineup. 
Happens all the time.

Best regards,
Marek Vasut
Brian Norris - Oct. 2, 2013, 9:01 p.m.
On Wed, Oct 2, 2013 at 1:55 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Brian Norris,
>
>> On Wed, Oct 2, 2013 at 1:02 PM, Marek Vasut <marex@denx.de> wrote:
>> > Hi Brian,
>> >
>> >>  + Marek for real!
>> >>
>> >> On Wed, Oct 2, 2013 at 11:51 AM, Brian Norris
>> >>
>> >> <computersforpeace@gmail.com> wrote:
>> >> > + Marek
>> >> >
>> >> > On Wed, Sep 04, 2013 at 10:16:56AM +0530, Priyanka Jain wrote:
>> >> >> Micron N25Q512A is a spi flash memory with following features:
>> >> >> -64MB size, 1.8V, Mulitple I/O, 4KB Sector erase memory.
>> >> >> -Memory is organised as 1024(64KB) main sectors.
>> >> >> -Each sector is divided into 256 pages.
>> >> >> -Register set/Opcodes are similar to other N25Q family products.
>> >> >>
>> >> >> Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
>> >> >> ---
>> >> >>
>> >> >>  drivers/mtd/devices/m25p80.c |    1 +
>> >> >>  1 files changed, 1 insertions(+), 0 deletions(-)
>> >> >>
>> >> >> diff --git a/drivers/mtd/devices/m25p80.c
>> >> >> b/drivers/mtd/devices/m25p80.c index 26b14f9..94e3b53 100644
>> >> >> --- a/drivers/mtd/devices/m25p80.c
>> >> >> +++ b/drivers/mtd/devices/m25p80.c
>> >> >> @@ -774,6 +774,7 @@ static const struct spi_device_id m25p_ids[] = {
>> >> >>
>> >> >>       { "n25q128a11",  INFO(0x20bb18, 0, 64 * 1024, 256, 0) },
>> >> >>       { "n25q128a13",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
>> >> >>       { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
>> >> >>
>> >> >> +     { "n25q512a", INFO(0x20bb20, 0, 64 * 1024, 512, SECT_4K) },
>> >
>> > Why does this n25q256a and n25q512a have exactly the same geometry? I
>> > mean, those chips differ in size, do they not ? ;-)
>> >
>> >> > This device actually has the same ID as Micron's next line
>> >> > (MT25QL512A). They have the same geometry, so maybe that's not a
>> >> > problem.
>>
>> I was referring to Micron n25q512a (which this patch mentions) and
>> Micron's new generation of flash MT25QL512A (not mentioned in the
>> original code or patch). They are different flash and are named
>> differently but have the same ID. Perhaps my usage of the word "line"
>> was confusing.
>
> Yes I know. Still, that n25q512a line being the exact copy of n25q256a doesn't
> seem right.

Sorry, I didn't check the original patch carefully enough, and I
subsequently misunderstood your question. I believe the patch is
incorrect; it should be 512Mbit (64MByte) which makes it 64KB sector x
1024 number of sectors, not 64KB sector x 512 number of sectors. Good
catch.

Priyanka, can you submit and test a corrected patch?

> The new ql512a seems line just a compatible replacement part for older lineup.
> Happens all the time.

Hmm, OK.

Brian
Jain Priyanka-B32167 - Oct. 15, 2013, 4:32 a.m.
Thanks Brian,,Marek, 

I will make the correction and send the updated patch . 

Regards
Priyanka
> -----Original Message-----
> From: Brian Norris [mailto:computersforpeace@gmail.com]
> Sent: Thursday, October 03, 2013 2:32 AM
> To: Marek Vasut
> Cc: Jain Priyanka-B32167; Artem Bityutskiy; linux-mtd@lists.infradead.org
> Subject: Re: [PATCH] mtd: m25p80: Add support for Micron N25Q512A memory
> 
> On Wed, Oct 2, 2013 at 1:55 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Brian Norris,
> >
> >> On Wed, Oct 2, 2013 at 1:02 PM, Marek Vasut <marex@denx.de> wrote:
> >> > Hi Brian,
> >> >
> >> >>  + Marek for real!
> >> >>
> >> >> On Wed, Oct 2, 2013 at 11:51 AM, Brian Norris
> >> >>
> >> >> <computersforpeace@gmail.com> wrote:
> >> >> > + Marek
> >> >> >
> >> >> > On Wed, Sep 04, 2013 at 10:16:56AM +0530, Priyanka Jain wrote:
> >> >> >> Micron N25Q512A is a spi flash memory with following features:
> >> >> >> -64MB size, 1.8V, Mulitple I/O, 4KB Sector erase memory.
> >> >> >> -Memory is organised as 1024(64KB) main sectors.
> >> >> >> -Each sector is divided into 256 pages.
> >> >> >> -Register set/Opcodes are similar to other N25Q family products.
> >> >> >>
> >> >> >> Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
> >> >> >> ---
> >> >> >>
> >> >> >>  drivers/mtd/devices/m25p80.c |    1 +
> >> >> >>  1 files changed, 1 insertions(+), 0 deletions(-)
> >> >> >>
> >> >> >> diff --git a/drivers/mtd/devices/m25p80.c
> >> >> >> b/drivers/mtd/devices/m25p80.c index 26b14f9..94e3b53 100644
> >> >> >> --- a/drivers/mtd/devices/m25p80.c
> >> >> >> +++ b/drivers/mtd/devices/m25p80.c
> >> >> >> @@ -774,6 +774,7 @@ static const struct spi_device_id
> >> >> >> m25p_ids[] = {
> >> >> >>
> >> >> >>       { "n25q128a11",  INFO(0x20bb18, 0, 64 * 1024, 256, 0) },
> >> >> >>       { "n25q128a13",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
> >> >> >>       { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K)
> >> >> >> },
> >> >> >>
> >> >> >> +     { "n25q512a", INFO(0x20bb20, 0, 64 * 1024, 512, SECT_4K)
> >> >> >> + },
> >> >
> >> > Why does this n25q256a and n25q512a have exactly the same geometry?
> >> > I mean, those chips differ in size, do they not ? ;-)
> >> >
> >> >> > This device actually has the same ID as Micron's next line
> >> >> > (MT25QL512A). They have the same geometry, so maybe that's not a
> >> >> > problem.
> >>
> >> I was referring to Micron n25q512a (which this patch mentions) and
> >> Micron's new generation of flash MT25QL512A (not mentioned in the
> >> original code or patch). They are different flash and are named
> >> differently but have the same ID. Perhaps my usage of the word "line"
> >> was confusing.
> >
> > Yes I know. Still, that n25q512a line being the exact copy of n25q256a
> > doesn't seem right.
> 
> Sorry, I didn't check the original patch carefully enough, and I
> subsequently misunderstood your question. I believe the patch is
> incorrect; it should be 512Mbit (64MByte) which makes it 64KB sector x
> 1024 number of sectors, not 64KB sector x 512 number of sectors. Good
> catch.
> 
> Priyanka, can you submit and test a corrected patch?
> 
> > The new ql512a seems line just a compatible replacement part for older
> lineup.
> > Happens all the time.
> 
> Hmm, OK.
> 
> Brian

Patch

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 26b14f9..94e3b53 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -774,6 +774,7 @@  static const struct spi_device_id m25p_ids[] = {
 	{ "n25q128a11",  INFO(0x20bb18, 0, 64 * 1024, 256, 0) },
 	{ "n25q128a13",  INFO(0x20ba18, 0, 64 * 1024, 256, 0) },
 	{ "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) },
+	{ "n25q512a", INFO(0x20bb20, 0, 64 * 1024, 512, SECT_4K) },
 
 	/* PMC */
 	{ "pm25lv512", INFO(0, 0, 32 * 1024, 2, SECT_4K_PMC) },