* MTD: Add fixup for S29NS512P NOR flash.
@ 2012-05-11 10:15 Javier Martin
2012-05-12 14:01 ` Artem Bityutskiy
2012-05-13 18:18 ` Artem Bityutskiy
0 siblings, 2 replies; 4+ messages in thread
From: Javier Martin @ 2012-05-11 10:15 UTC (permalink / raw)
To: linux-mtd
Cc: Gernot.Hoyler, Artem.Bityutskiy, joakim.tjernlund, tabe,
Javier Martin, dwmw2
Spansion S29NS512P flash uses a 16bit transfer to report number
of sectors instead of two 8bit accesses as CFI specifies.
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
---
drivers/mtd/chips/cfi_cmdset_0002.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 23175ed..5873b1f 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -332,6 +332,19 @@ static void fixup_s29gl032n_sectors(struct mtd_info *mtd)
}
}
+static void fixup_s29ns512p_sectors(struct mtd_info *mtd)
+{
+ struct map_info *map = mtd->priv;
+ struct cfi_private *cfi = map->fldrv_priv;
+
+ /*
+ * S29NS512P flash uses more than 8bits to report number of sectors,
+ * which is not permitted by CFI.
+ */
+ cfi->cfiq->EraseRegionInfo[0] = 0x020001ff;
+ pr_warning("%s: Bad S29NS512P CFI data, adjust to 512 sectors\n", mtd->name);
+}
+
/* Used to fix CFI-Tables of chips without Extended Query Tables */
static struct cfi_fixup cfi_nopri_fixup_table[] = {
{ CFI_MFR_SST, 0x234a, fixup_sst39vf }, /* SST39VF1602 */
@@ -362,6 +375,7 @@ static struct cfi_fixup cfi_fixup_table[] = {
{ CFI_MFR_AMD, 0x1301, fixup_s29gl064n_sectors },
{ CFI_MFR_AMD, 0x1a00, fixup_s29gl032n_sectors },
{ CFI_MFR_AMD, 0x1a01, fixup_s29gl032n_sectors },
+ { CFI_MFR_AMD, 0x3f00, fixup_s29ns512p_sectors },
{ CFI_MFR_SST, 0x536a, fixup_sst38vf640x_sectorsize }, /* SST38VF6402 */
{ CFI_MFR_SST, 0x536b, fixup_sst38vf640x_sectorsize }, /* SST38VF6401 */
{ CFI_MFR_SST, 0x536c, fixup_sst38vf640x_sectorsize }, /* SST38VF6404 */
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: MTD: Add fixup for S29NS512P NOR flash.
2012-05-11 10:15 MTD: Add fixup for S29NS512P NOR flash Javier Martin
@ 2012-05-12 14:01 ` Artem Bityutskiy
2012-05-13 18:18 ` Artem Bityutskiy
1 sibling, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-05-12 14:01 UTC (permalink / raw)
To: Javier Martin
Cc: Gernot.Hoyler, Artem.Bityutskiy, joakim.tjernlund, dwmw2,
linux-mtd, tabe
[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]
On Fri, 2012-05-11 at 12:15 +0200, Javier Martin wrote:
> Spansion S29NS512P flash uses a 16bit transfer to report number
> of sectors instead of two 8bit accesses as CFI specifies.
>
> Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
> ---
> drivers/mtd/chips/cfi_cmdset_0002.c | 14 ++++++++++++++
> 1 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
> index 23175ed..5873b1f 100644
> --- a/drivers/mtd/chips/cfi_cmdset_0002.c
> +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
> @@ -332,6 +332,19 @@ static void fixup_s29gl032n_sectors(struct mtd_info *mtd)
> }
> }
>
> +static void fixup_s29ns512p_sectors(struct mtd_info *mtd)
> +{
> + struct map_info *map = mtd->priv;
> + struct cfi_private *cfi = map->fldrv_priv;
> +
> + /*
> + * S29NS512P flash uses more than 8bits to report number of sectors,
> + * which is not permitted by CFI.
> + */
> + cfi->cfiq->EraseRegionInfo[0] = 0x020001ff;
> + pr_warning("%s: Bad S29NS512P CFI data, adjust to 512 sectors\n", mtd->name);
What is the purpose of printing this warning - how the user should act
upon it? If you successfully work-around a known HW issue, you should
not warn. HW workarounds are normal.
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MTD: Add fixup for S29NS512P NOR flash.
2012-05-11 10:15 MTD: Add fixup for S29NS512P NOR flash Javier Martin
2012-05-12 14:01 ` Artem Bityutskiy
@ 2012-05-13 18:18 ` Artem Bityutskiy
2012-05-14 8:06 ` javier Martin
1 sibling, 1 reply; 4+ messages in thread
From: Artem Bityutskiy @ 2012-05-13 18:18 UTC (permalink / raw)
To: Javier Martin
Cc: Gernot.Hoyler, Artem.Bityutskiy, joakim.tjernlund, dwmw2,
linux-mtd, tabe
[-- Attachment #1: Type: text/plain, Size: 458 bytes --]
On Fri, 2012-05-11 at 12:15 +0200, Javier Martin wrote:
> + /*
> + * S29NS512P flash uses more than 8bits to report number of sectors,
> + * which is not permitted by CFI.
> + */
> + cfi->cfiq->EraseRegionInfo[0] = 0x020001ff;
> + pr_warning("%s: Bad S29NS512P CFI data, adjust to 512 sectors\n", mtd->name);
I've removed the warning and pushed to l2-mtd.git, thanks! If you
disagree - please complain.
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MTD: Add fixup for S29NS512P NOR flash.
2012-05-13 18:18 ` Artem Bityutskiy
@ 2012-05-14 8:06 ` javier Martin
0 siblings, 0 replies; 4+ messages in thread
From: javier Martin @ 2012-05-14 8:06 UTC (permalink / raw)
To: Artem Bityutskiy
Cc: Gernot.Hoyler, Artem.Bityutskiy, joakim.tjernlund, dwmw2,
linux-mtd, tabe
On 13 May 2012 20:18, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Fri, 2012-05-11 at 12:15 +0200, Javier Martin wrote:
>> + /*
>> + * S29NS512P flash uses more than 8bits to report number of sectors,
>> + * which is not permitted by CFI.
>> + */
>> + cfi->cfiq->EraseRegionInfo[0] = 0x020001ff;
>> + pr_warning("%s: Bad S29NS512P CFI data, adjust to 512 sectors\n", mtd->name);
>
> I've removed the warning and pushed to l2-mtd.git, thanks! If you
> disagree - please complain.
Great, I totally agree.
Thanks.
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-14 8:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-11 10:15 MTD: Add fixup for S29NS512P NOR flash Javier Martin
2012-05-12 14:01 ` Artem Bityutskiy
2012-05-13 18:18 ` Artem Bityutskiy
2012-05-14 8:06 ` javier Martin
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).