* [PATCH] mtd: cfi_cmdset_0002: fix the check for valid primary extension versions
@ 2010-07-02 12:39 Guillaume LECERF
2010-07-19 11:33 ` Gernot Hoyler
0 siblings, 1 reply; 4+ messages in thread
From: Guillaume LECERF @ 2010-07-02 12:39 UTC (permalink / raw)
To: linux-mtd; +Cc: David Woodhouse, Florian Fainelli
Valid primary extension versions are: 1.0, 1.1, 1.2, 1.3 [1][2].
Fix the check in cfi_cmdset_0002 accordingly.
[1] http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_r20.pdf, page 19
[2] http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_100_20011201.pdf
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
---
drivers/mtd/chips/cfi_cmdset_0002.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index d81079e..749203f 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -417,16 +417,25 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
*/
cfi_fixup_major_minor(cfi, extp);
+ /*
+ * Valid primary extension versions are: 1.0, 1.1, 1.2, 1.3
+ * see: http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_r20.pdf, page 19 and on
+ * http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_100_20011201.pdf
+ */
if (extp->MajorVersion != '1' ||
- (extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
+ (extp->MajorVersion == '1' && ( extp->MinorVersion < '0' || extp->MinorVersion > '3'))) {
printk(KERN_ERR " Unknown Amd/Fujitsu Extended Query "
- "version %c.%c.\n", extp->MajorVersion,
- extp->MinorVersion);
+ "version %c.%c (%#02x/%#02x).\n",
+ extp->MajorVersion, extp->MinorVersion,
+ extp->MajorVersion, extp->MinorVersion);
kfree(extp);
kfree(mtd);
return NULL;
}
+ printk(KERN_INFO " Amd/Fujitsu Extended Query version %c.%c.\n",
+ extp->MajorVersion, extp->MinorVersion);
+
/* Install our own private info structure */
cfi->cmdset_priv = extp;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: Re: [PATCH] mtd: cfi_cmdset_0002: fix the check for valid primary extension versions
2010-07-02 12:39 [PATCH] mtd: cfi_cmdset_0002: fix the check for valid primary extension versions Guillaume LECERF
@ 2010-07-19 11:33 ` Gernot Hoyler
0 siblings, 0 replies; 4+ messages in thread
From: Gernot Hoyler @ 2010-07-19 11:33 UTC (permalink / raw)
To: linux-mtd
> Valid primary extension versions are: 1.0, 1.1, 1.2, 1.3 [1][2].
> Fix the check in cfi_cmdset_0002 accordingly.
> ...
I would prefer not to remove CFI 1.4 support from the AMD/Spansion
driver. For example, the Spansion S29WS-P device family uses CFI version
1.4, see page 90 of the datasheet
http://www.spansion.com/Support/Datasheets/s29ws-p_00_a12_e.pdf.
--Gernot
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] mtd: cfi_cmdset_0002: fix the check for valid primary extension versions
@ 2010-08-04 19:36 Guillaume LECERF
2010-08-05 6:07 ` Artem Bityutskiy
0 siblings, 1 reply; 4+ messages in thread
From: Guillaume LECERF @ 2010-08-04 19:36 UTC (permalink / raw)
To: linux-mtd; +Cc: Gernot Hoyler, David Woodhouse, Florian Fainelli
Valid primary extension versions are: 1.0, 1.1, 1.2, 1.3, 1.4 [1][2][3].
Fix the check in cfi_cmdset_0002 accordingly.
[1] http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_r20.pdf, page 19
[2] http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_100_20011201.pdf
[3] http://www.spansion.com/Support/Datasheets/s29ws-p_00_a12_e.pdf
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
---
drivers/mtd/chips/cfi_cmdset_0002.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index d81079e..16c4eee 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -417,16 +417,26 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
*/
cfi_fixup_major_minor(cfi, extp);
+ /*
+ * Valid primary extension versions are: 1.0, 1.1, 1.2, 1.3, 1.4
+ * see: http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_r20.pdf, page 19
+ * http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_100_20011201.pdf
+ * http://www.spansion.com/Support/Datasheets/s29ws-p_00_a12_e.pdf
+ */
if (extp->MajorVersion != '1' ||
- (extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
+ (extp->MajorVersion == '1' && ( extp->MinorVersion < '0' || extp->MinorVersion > '4'))) {
printk(KERN_ERR " Unknown Amd/Fujitsu Extended Query "
- "version %c.%c.\n", extp->MajorVersion,
- extp->MinorVersion);
+ "version %c.%c (%#02x/%#02x).\n",
+ extp->MajorVersion, extp->MinorVersion,
+ extp->MajorVersion, extp->MinorVersion);
kfree(extp);
kfree(mtd);
return NULL;
}
+ printk(KERN_INFO " Amd/Fujitsu Extended Query version %c.%c.\n",
+ extp->MajorVersion, extp->MinorVersion);
+
/* Install our own private info structure */
cfi->cmdset_priv = extp;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: cfi_cmdset_0002: fix the check for valid primary extension versions
2010-08-04 19:36 Guillaume LECERF
@ 2010-08-05 6:07 ` Artem Bityutskiy
0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2010-08-05 6:07 UTC (permalink / raw)
To: Guillaume LECERF
Cc: Gernot Hoyler, David Woodhouse, linux-mtd, Florian Fainelli
On Wed, 2010-08-04 at 21:36 +0200, Guillaume LECERF wrote:
> Valid primary extension versions are: 1.0, 1.1, 1.2, 1.3, 1.4 [1][2][3].
> Fix the check in cfi_cmdset_0002 accordingly.
>
> [1] http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_r20.pdf, page 19
> [2] http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_100_20011201.pdf
> [3] http://www.spansion.com/Support/Datasheets/s29ws-p_00_a12_e.pdf
>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
Please, make it applicable to mtd-2.6.git / master tree and re-send.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-05 6:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-02 12:39 [PATCH] mtd: cfi_cmdset_0002: fix the check for valid primary extension versions Guillaume LECERF
2010-07-19 11:33 ` Gernot Hoyler
-- strict thread matches above, loose matches on Subject: below --
2010-08-04 19:36 Guillaume LECERF
2010-08-05 6:07 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).