public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] cfi_cmdset_0001.c: quirk for PF38F4476.
@ 2009-05-16 11:41 Daniel Ribeiro
  2009-05-17  7:32 ` Artem Bityutskiy
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Ribeiro @ 2009-05-16 11:41 UTC (permalink / raw)
  To: David Woodhouse; +Cc: openezx-devel, linux-mtd

This chip reports CFI 1.3, but the CFI PRI is like CFI 1.1. Add a quirk
to pass probe on this chip.
(This patch depends on "cfi_cmdset_0001.c: CFI 1.0 and CFI 1.1")

Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
---
 drivers/mtd/chips/cfi_cmdset_0001.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index bf07d14..0e01ab9 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -46,6 +46,7 @@
 #define MANUFACTURER_INTEL	0x0089
 #define I82802AB	0x00ad
 #define I82802AC	0x00ac
+#define PF38F4476	0x881c
 #define MANUFACTURER_ST         0x0020
 #define M50LPW080       0x002F
 #define M50FLW080A	0x0080
@@ -315,9 +316,18 @@ static struct cfi_fixup fixup_table[] = {
 	{ 0, 0, NULL, NULL }
 };
 
+static void cfi_fixup_major_minor(struct cfi_private *cfi,
+						struct cfi_pri_intelext *extp)
+{
+	if (cfi->mfr == MANUFACTURER_INTEL &&
+			cfi->id == PF38F4476 && extp->MinorVersion == '3')
+		extp->MinorVersion = '1';
+}
+
 static inline struct cfi_pri_intelext *
 read_pri_intelext(struct map_info *map, __u16 adr)
 {
+	struct cfi_private *cfi = map->fldrv_priv;
 	struct cfi_pri_intelext *extp;
 	unsigned int extra_size = 0;
 	unsigned int extp_size = sizeof(*extp);
@@ -327,6 +337,8 @@ read_pri_intelext(struct map_info *map, __u16 adr)
 	if (!extp)
 		return NULL;
 
+	cfi_fixup_major_minor(cfi, extp);
+
 	if (extp->MajorVersion != '1' ||
 	    (extp->MinorVersion < '0' || extp->MinorVersion > '5')) {
 		printk(KERN_ERR "  Unknown Intel/Sharp Extended Query "
-- 
tg: (385157b..) mtd/pf38f4476-fix (depends on: mtd/cfi1.1-has-extra-too)

-- 
Daniel Ribeiro

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] cfi_cmdset_0001.c: quirk for PF38F4476.
  2009-05-16 11:41 [PATCH] cfi_cmdset_0001.c: quirk for PF38F4476 Daniel Ribeiro
@ 2009-05-17  7:32 ` Artem Bityutskiy
  0 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2009-05-17  7:32 UTC (permalink / raw)
  To: Daniel Ribeiro; +Cc: linux-mtd, openezx-devel, David Woodhouse

On Sat, 2009-05-16 at 08:41 -0300, Daniel Ribeiro wrote:
> This chip reports CFI 1.3, but the CFI PRI is like CFI 1.1. Add a quirk
> to pass probe on this chip.
> (This patch depends on "cfi_cmdset_0001.c: CFI 1.0 and CFI 1.1")
> 
> Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>

Would be good to CC Nicolas Pitre <nico@cam.org> when sending these
patches.

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] cfi_cmdset_0001.c: quirk for PF38F4476.
@ 2009-05-17 11:02 Daniel Ribeiro
  2009-05-18 23:29 ` Nicolas Pitre
  2009-05-19  6:03 ` Artem Bityutskiy
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Ribeiro @ 2009-05-17 11:02 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Nicolas Pitre, openezx-devel, linux-mtd

This chip reports CFI 1.3, but the CFI PRI is like CFI 1.1. Add a quirk
to pass probe on this chip.
(This patch depends on "cfi_cmdset_0001.c: CFI 1.0 and CFI 1.1")
(sent again with CC to Nicolas Pitre)

Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
---
 drivers/mtd/chips/cfi_cmdset_0001.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index bf07d14..0e01ab9 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -46,6 +46,7 @@
 #define MANUFACTURER_INTEL	0x0089
 #define I82802AB	0x00ad
 #define I82802AC	0x00ac
+#define PF38F4476	0x881c
 #define MANUFACTURER_ST         0x0020
 #define M50LPW080       0x002F
 #define M50FLW080A	0x0080
@@ -315,9 +316,18 @@ static struct cfi_fixup fixup_table[] = {
 	{ 0, 0, NULL, NULL }
 };
 
+static void cfi_fixup_major_minor(struct cfi_private *cfi,
+						struct cfi_pri_intelext *extp)
+{
+	if (cfi->mfr == MANUFACTURER_INTEL &&
+			cfi->id == PF38F4476 && extp->MinorVersion == '3')
+		extp->MinorVersion = '1';
+}
+
 static inline struct cfi_pri_intelext *
 read_pri_intelext(struct map_info *map, __u16 adr)
 {
+	struct cfi_private *cfi = map->fldrv_priv;
 	struct cfi_pri_intelext *extp;
 	unsigned int extra_size = 0;
 	unsigned int extp_size = sizeof(*extp);
@@ -327,6 +337,8 @@ read_pri_intelext(struct map_info *map, __u16 adr)
 	if (!extp)
 		return NULL;
 
+	cfi_fixup_major_minor(cfi, extp);
+
 	if (extp->MajorVersion != '1' ||
 	    (extp->MinorVersion < '0' || extp->MinorVersion > '5')) {
 		printk(KERN_ERR "  Unknown Intel/Sharp Extended Query "
-- 
tg: (385157b..) mtd/pf38f4476-fix (depends on: mtd/cfi1.1-has-extra-too)

-- 
Daniel Ribeiro

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] cfi_cmdset_0001.c: quirk for PF38F4476.
  2009-05-17 11:02 Daniel Ribeiro
@ 2009-05-18 23:29 ` Nicolas Pitre
  2009-05-19  6:03 ` Artem Bityutskiy
  1 sibling, 0 replies; 6+ messages in thread
From: Nicolas Pitre @ 2009-05-18 23:29 UTC (permalink / raw)
  To: Daniel Ribeiro; +Cc: linux-mtd, openezx-devel, David Woodhouse

On Sun, 17 May 2009, Daniel Ribeiro wrote:

> This chip reports CFI 1.3, but the CFI PRI is like CFI 1.1. Add a quirk
> to pass probe on this chip.
> (This patch depends on "cfi_cmdset_0001.c: CFI 1.0 and CFI 1.1")
> (sent again with CC to Nicolas Pitre)
> 
> Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>

Acked-by: Nicolas Pitre <nico@cam.org>

> ---
>  drivers/mtd/chips/cfi_cmdset_0001.c |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
> index bf07d14..0e01ab9 100644
> --- a/drivers/mtd/chips/cfi_cmdset_0001.c
> +++ b/drivers/mtd/chips/cfi_cmdset_0001.c
> @@ -46,6 +46,7 @@
>  #define MANUFACTURER_INTEL	0x0089
>  #define I82802AB	0x00ad
>  #define I82802AC	0x00ac
> +#define PF38F4476	0x881c
>  #define MANUFACTURER_ST         0x0020
>  #define M50LPW080       0x002F
>  #define M50FLW080A	0x0080
> @@ -315,9 +316,18 @@ static struct cfi_fixup fixup_table[] = {
>  	{ 0, 0, NULL, NULL }
>  };
>  
> +static void cfi_fixup_major_minor(struct cfi_private *cfi,
> +						struct cfi_pri_intelext *extp)
> +{
> +	if (cfi->mfr == MANUFACTURER_INTEL &&
> +			cfi->id == PF38F4476 && extp->MinorVersion == '3')
> +		extp->MinorVersion = '1';
> +}
> +
>  static inline struct cfi_pri_intelext *
>  read_pri_intelext(struct map_info *map, __u16 adr)
>  {
> +	struct cfi_private *cfi = map->fldrv_priv;
>  	struct cfi_pri_intelext *extp;
>  	unsigned int extra_size = 0;
>  	unsigned int extp_size = sizeof(*extp);
> @@ -327,6 +337,8 @@ read_pri_intelext(struct map_info *map, __u16 adr)
>  	if (!extp)
>  		return NULL;
>  
> +	cfi_fixup_major_minor(cfi, extp);
> +
>  	if (extp->MajorVersion != '1' ||
>  	    (extp->MinorVersion < '0' || extp->MinorVersion > '5')) {
>  		printk(KERN_ERR "  Unknown Intel/Sharp Extended Query "
> -- 
> tg: (385157b..) mtd/pf38f4476-fix (depends on: mtd/cfi1.1-has-extra-too)
> 
> -- 
> Daniel Ribeiro
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cfi_cmdset_0001.c: quirk for PF38F4476.
  2009-05-17 11:02 Daniel Ribeiro
  2009-05-18 23:29 ` Nicolas Pitre
@ 2009-05-19  6:03 ` Artem Bityutskiy
  2009-05-19 10:12   ` Daniel Ribeiro
  1 sibling, 1 reply; 6+ messages in thread
From: Artem Bityutskiy @ 2009-05-19  6:03 UTC (permalink / raw)
  To: Daniel Ribeiro; +Cc: Nicolas Pitre, openezx-devel, David Woodhouse, linux-mtd

On Sun, 2009-05-17 at 08:02 -0300, Daniel Ribeiro wrote:
> This chip reports CFI 1.3, but the CFI PRI is like CFI 1.1. Add a quirk
> to pass probe on this chip.
> (This patch depends on "cfi_cmdset_0001.c: CFI 1.0 and CFI 1.1")
> (sent again with CC to Nicolas Pitre)
> 
> Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>

I've pushed both to l2-mtd-2.6.git. The patches did not cleanly apply,
probably because they were against an older linux code-base. Please,
verify:

http://git.infradead.org/users/dedekind/l2-mtd-2.6.git

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cfi_cmdset_0001.c: quirk for PF38F4476.
  2009-05-19  6:03 ` Artem Bityutskiy
@ 2009-05-19 10:12   ` Daniel Ribeiro
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Ribeiro @ 2009-05-19 10:12 UTC (permalink / raw)
  To: dedekind; +Cc: Nicolas Pitre, openezx-devel, David Woodhouse, linux-mtd

Em Ter, 2009-05-19 às 09:03 +0300, Artem Bityutskiy escreveu:
> On Sun, 2009-05-17 at 08:02 -0300, Daniel Ribeiro wrote:
> > This chip reports CFI 1.3, but the CFI PRI is like CFI 1.1. Add a quirk
> > to pass probe on this chip.
> > (This patch depends on "cfi_cmdset_0001.c: CFI 1.0 and CFI 1.1")
> > (sent again with CC to Nicolas Pitre)
> > 
> > Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
> 
> I've pushed both to l2-mtd-2.6.git. The patches did not cleanly apply,
> probably because they were against an older linux code-base. Please,
> verify:
> 
> http://git.infradead.org/users/dedekind/l2-mtd-2.6.git
> 

Thanks Artem.

Patches were based on 2.6.30-rc4, last commit was "cfi_cmdset_0001.c:
Fix a bug in inval_cache_and_wait_for_operation()." (6ac15e), my guess
is that you had problems applying because you applied the "CFI: quirk
for PF38F4476." first. Next time I will send the patches as a series.

I verified the patches on your gitweb and they look ok.

-- 
Daniel Ribeiro

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-05-19 10:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-16 11:41 [PATCH] cfi_cmdset_0001.c: quirk for PF38F4476 Daniel Ribeiro
2009-05-17  7:32 ` Artem Bityutskiy
  -- strict thread matches above, loose matches on Subject: below --
2009-05-17 11:02 Daniel Ribeiro
2009-05-18 23:29 ` Nicolas Pitre
2009-05-19  6:03 ` Artem Bityutskiy
2009-05-19 10:12   ` Daniel Ribeiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox