From: "Flávio Silveira" <fggs@terra.com.br>
To: "Fabio Giovagnini" <fabio.giovagnini@aurion-tech.com>,
<linux-mtd@lists.infradead.org>
Cc: yidong zhang <zhangyd6@gmail.com>,
David.Woodhouse@intel.com, Wolfram Sang <w.sang@pengutronix.de>,
yegorslists@googlemail.com, Guillaume LECERF <glecerf@gmail.com>,
taliaferro62@gmail.com
Subject: Re: [Help] SST39VF6401B Support
Date: Wed, 15 Jun 2011 21:55:57 -0300 [thread overview]
Message-ID: <DEF16A5C46894A5DB447E0F7C81A9D5F@THOR> (raw)
In-Reply-To: <201010221950.57594.fabio.giovagnini@aurion-tech.com>
Hi guys,
I've tested this patch on kernel 2.6.23 (actually it's called 2.6.24.111)
and didn't work.
Below are my diffs and I can post original files as well, please help me
make it work!
Thanks in advance!
cfi_util.c
29a30,107
> int __xipram cfi_qry_present(struct map_info *map, __u32 base,
> struct cfi_private *cfi)
> {
> int osf = cfi->interleave * cfi->device_type; /* scale factor */
> map_word val[3];
> map_word qry[3];
>
> qry[0] = cfi_build_cmd('Q', map, cfi);
> qry[1] = cfi_build_cmd('R', map, cfi);
> qry[2] = cfi_build_cmd('Y', map, cfi);
>
> val[0] = map_read(map, base + osf*0x10);
> val[1] = map_read(map, base + osf*0x11);
> val[2] = map_read(map, base + osf*0x12);
>
> if (!map_word_equal(map, qry[0], val[0]))
> return 0;
>
> if (!map_word_equal(map, qry[1], val[1]))
> return 0;
>
> if (!map_word_equal(map, qry[2], val[2]))
> return 0;
>
> return 1; /* "QRY" found */
> }
> EXPORT_SYMBOL_GPL(cfi_qry_present);
>
> int __xipram cfi_qry_mode_on(uint32_t base, struct map_info *map,
> struct cfi_private *cfi)
> {
> cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
> cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
> if (cfi_qry_present(map, base, cfi))
> return 1;
> /* QRY not found probably we deal with some odd CFI chips */
> /* Some revisions of some old Intel chips? */
> cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
> cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL);
> cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
> if (cfi_qry_present(map, base, cfi))
> return 1;
> /* ST M29DW chips */
> cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
> cfi_send_gen_cmd(0x98, 0x555, base, map, cfi, cfi->device_type, NULL);
> if (cfi_qry_present(map, base, cfi))
> return 1;
> /* some old SST chips, e.g. 39VF160x/39VF320x */
> cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
> cfi_send_gen_cmd(0xAA, 0x5555, base, map, cfi, cfi->device_type, NULL);
> cfi_send_gen_cmd(0x55, 0x2AAA, base, map, cfi, cfi->device_type, NULL);
> cfi_send_gen_cmd(0x98, 0x5555, base, map, cfi, cfi->device_type, NULL);
> if (cfi_qry_present(map, base, cfi))
> return 1;
> /* SST 39VF640xB */
> cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
> cfi_send_gen_cmd(0xAA, 0x555, base, map, cfi, cfi->device_type, NULL);
> cfi_send_gen_cmd(0x55, 0x2AA, base, map, cfi, cfi->device_type, NULL);
> cfi_send_gen_cmd(0x98, 0x555, base, map, cfi, cfi->device_type, NULL);
> if (cfi_qry_present(map, base, cfi))
> return 1;
> /* QRY not found */
> return 0;
> }
> EXPORT_SYMBOL_GPL(cfi_qry_mode_on);
>
> void __xipram cfi_qry_mode_off(uint32_t base, struct map_info *map,
> struct cfi_private *cfi)
> {
> cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
> cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL);
> /* M29W128G flashes require an additional reset command
> when exit qry mode */
> if ((cfi->mfr == CFI_MFR_ST) && (cfi->id == 0x227E || cfi->id == 0x7E))
> cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
> }
> EXPORT_SYMBOL_GPL(cfi_qry_mode_off);
>
cfi_cmdset_0002.c
219a220,253
> static void fixup_old_sst_eraseregion(struct mtd_info *mtd)
> {
> struct map_info *map = mtd->priv;
> struct cfi_private *cfi = map->fldrv_priv;
>
> /*
> * These flashes report two seperate eraseblock regions based on the
> * sector_erase-size and block_erase-size, although they both operate
> on the
> * same memory. This is not allowed according to CFI, so we just pick
> the
> * sector_erase-size.
> */
> cfi->cfiq->NumEraseRegions = 1;
> }
>
> static void fixup_sst39vf_rev_b(struct mtd_info *mtd, void *param)
> {
> struct map_info *map = mtd->priv;
> struct cfi_private *cfi = map->fldrv_priv;
>
> fixup_old_sst_eraseregion(mtd);
>
> cfi->addr_unlock1 = 0x555;
> cfi->addr_unlock2 = 0x2AA;
> }
>
> /* Used to fix CFI-Tables of chips without Extended Query Tables */
> static struct cfi_fixup cfi_nopri_fixup_table[] = {
> { CFI_MFR_SST, 0x235C, fixup_sst39vf_rev_b, NULL, }, // SST39VF3202B
> { CFI_MFR_SST, 0x235D, fixup_sst39vf_rev_b, NULL, }, // SST39VF3201B
> { CFI_MFR_SST, 0x236C, fixup_sst39vf_rev_b, NULL, }, // SST39VF6402B
> { CFI_MFR_SST, 0x236D, fixup_sst39vf_rev_b, NULL, }, // SST39VF6401B
> { 0, 0, NULL, NULL }
> };
>
----- Original Message -----
From: "Fabio Giovagnini" <fabio.giovagnini@aurion-tech.com>
To: <linux-mtd@lists.infradead.org>
Cc: "yidong zhang" <zhangyd6@gmail.com>; <David.Woodhouse@intel.com>;
"Wolfram Sang" <w.sang@pengutronix.de>; <yegorslists@googlemail.com>;
"Guillaume LECERF" <glecerf@gmail.com>; <taliaferro62@gmail.com>
Sent: Friday, October 22, 2010 2:50 PM
Subject: Re: [Help] SST39VF6401B Support
Hi Guys,
As Gullelm remeber for sure, I used the jedec probe for such a flash in a
very
old 2.6 kernel.
Now I'm migrating to the newets one kernel.
Do you tell me how the kernel will be updated with the last mtd stuff
developed; or in place of it how to patch a standard kernel?
Thanks a lot and sorry for my question if it is improper
In data venerdì 22 ottobre 2010 17:42:39, yidong zhang ha scritto:
: > On Fri, Oct 22, 2010 at 11:36 PM, Guillaume LECERF <glecerf@gmail.com>
wrote:
> > 2010/10/22 yidong zhang <zhangyd6@gmail.com>:
> >>> Could you try setting cif->cfiq->EraseRegionInfo[0] to 0x02003FF in
> >>> fixup_sst39vf_rev_b() ?
> >>
> >> Hi
> >> how about this attached patch.
> >
> > If it works for you, I'll send a patch series for SST 39VF640xB and
> > 38VF640x, because both chips needs 0x50 as erase command.
>
> Sorry, i cannot test it right now. I will sent the result as soon as i
> can.
>
> > --
> > Guillaume LECERF
> > GeeXboX developer - www.geexbox.org
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
--
Ing. Fabio Giovagnini
Aurion s.r.l.
P.I e C.F.
00885711200
skype: aurion.giovagnini
Tel. +39.051.594.78.24
Cell. +39.335.83.50.919
www.aurion-tech.com
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2011-06-16 0:56 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-16 7:08 Re :Re: [Help] SST39VF6401B Support yidong zhang
2010-10-16 10:07 ` Wolfram Sang
2010-10-16 12:25 ` yidong zhang
2010-10-16 13:17 ` Wolfram Sang
2010-10-16 14:20 ` yidong zhang
2010-10-18 4:00 ` yidong zhang
2010-10-18 11:41 ` Wolfram Sang
2010-10-18 13:05 ` yidong zhang
2010-10-18 13:41 ` Guillaume LECERF
2010-10-21 10:33 ` Guillaume LECERF
[not found] ` <AANLkTinLTW25faUTBfKBVcpFXFrtv1UhWWDN9Dgm1jOH@mail.gmail.com>
[not found] ` <AANLkTiknoWR_v-TfV5M5ZwsV3Lsk=EDDD185kXp4B96V@mail.gmail.com>
[not found] ` <AANLkTin-4fGYzD8a9rDp9M7YEk1y7JbXmZVLjA=3iU3Q@mail.gmail.com>
2010-10-21 15:24 ` Guillaume LECERF
2010-10-22 0:17 ` yidong zhang
2010-10-22 7:52 ` Guillaume LECERF
2010-10-22 8:46 ` yidong zhang
2010-10-22 10:41 ` Guillaume LECERF
2010-10-22 15:07 ` yidong zhang
2010-10-22 15:36 ` Guillaume LECERF
2010-10-22 15:42 ` yidong zhang
2010-10-22 17:50 ` Fabio Giovagnini
2011-06-16 0:55 ` Flávio Silveira [this message]
2011-06-20 3:12 ` Flávio Silveira
2011-06-20 3:36 ` yidong zhang
2011-06-20 23:55 ` Flávio Silveira
2011-12-08 21:21 ` Flávio Silveira
2011-12-09 23:15 ` Flávio Silveira
2011-12-10 0:54 ` Guillaume LECERF
2011-12-10 1:56 ` Flávio Silveira
-- strict thread matches above, loose matches on Subject: below --
2010-09-23 3:43 Flávio Silveira
2010-09-23 7:28 ` Yegor Yefremov
2010-09-23 11:01 ` Flávio Silveira
2010-09-23 12:05 ` Wolfram Sang
2010-09-23 12:15 ` Flávio Silveira
2010-09-23 12:37 ` Wolfram Sang
2010-09-23 12:23 ` Guillaume LECERF
2010-09-23 12:34 ` Flávio Silveira
2010-09-23 15:21 ` Fabio Giovagnini
2010-09-23 12:18 ` Yegor Yefremov
2010-09-23 12:30 ` Flávio Silveira
2010-09-23 12:33 ` Yegor Yefremov
2010-09-23 12:40 ` Flávio Silveira
2010-09-23 13:45 ` Yegor Yefremov
2010-09-23 13:56 ` Flávio Silveira
2010-09-23 14:56 ` Flávio Silveira
2010-09-23 15:14 ` Yegor Yefremov
2010-09-23 15:33 ` Guillaume LECERF
2010-09-24 10:56 ` Flávio Silveira
2010-10-05 9:38 ` Guillaume LECERF
2010-10-05 10:07 ` Flávio Silveira
2010-10-05 10:12 ` Guillaume LECERF
2010-10-12 10:48 ` Guillaume LECERF
2010-10-17 20:22 ` Flávio Silveira
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DEF16A5C46894A5DB447E0F7C81A9D5F@THOR \
--to=fggs@terra.com.br \
--cc=David.Woodhouse@intel.com \
--cc=fabio.giovagnini@aurion-tech.com \
--cc=glecerf@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=taliaferro62@gmail.com \
--cc=w.sang@pengutronix.de \
--cc=yegorslists@googlemail.com \
--cc=zhangyd6@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox