the function is cfi_cmdset_0002(). I have attached a patch. The patch is completely untested, please use at your own risk!!
-Erwin Am Sonntag, den 07.03.2010, 10:50 +0100 schrieb Fabio Giovagnini: > Could you write the funciton where I have to act? > I agree the issue about a bug into the cfi_cmdset_0002.c > > Ciao > > > > > Alle 10:47, domenica 7 marzo 2010, Fabio Giovagnini ha scritto: > > Ok I'll try. > > > > Alle 02:17, domenica 7 marzo 2010, Erwin Authried ha scritto: > > > Am Samstag, den 06.03.2010, 16:59 -0500 schrieb Mike Frysinger: > > > > On Saturday 06 March 2010 12:17:12 Fabio Giovagnini wrote: > > > > > According to you, it is easier to add jedec entry or it is better to > > > > > modify cfi_cmdset_0002.c? > > > > > I'm newbe, so I aks: what could be the trade off between the two > > > > > solutions? > > > > > > > > one can be sent upstream (jedec) and one cannot (hacking cmdset in non- > > > > standard ways) > > > > -mike > > > > > > I took a look at AMD's CFI specification. Both of the extended query > > > tables are optional. Thus, it looks like relying that at least one of > > > those tables exist is a bug in cfi_cmdset_0002. I believe this can be > > > fixed this way: > > > > > > ... > > > __u16 adr = primary?cfi->cfiq->P_ADR:cfi->cfiq->A_ADR; > > > if (cfi->cfi_mode==CFI_MODE_CFI && adr){ > > > unsigned char bootloc; > > > /* > > > * It's a real CFI chip, not one for which the probe > > > * routine faked a CFI structure. So we read the feature > > > * table from it. > > > */ > > > struct cfi_pri_amdstd *extp; > > > ... > > > > > > Fabio, would you like to try if this works? I don't have a flash without > > > extended query table, thus I can't test this. > > > > > > -Erwin > > > > > > _______
diff -bu linux-2.6.25/drivers/mtd/chips/cfi_cmdset_0002.c.orig linux-2.6.25/drivers/mtd/chips/cfi_cmdset_0002.c --- linux-2.6.25/drivers/mtd/chips/cfi_cmdset_0002.c.orig 2010-03-07 13:10:25.000000000 +0100 +++ linux-2.6.25/drivers/mtd/chips/cfi_cmdset_0002.c 2010-03-07 13:11:45.000000000 +0100 @@ -282,14 +282,14 @@ mtd->name = map->name; mtd->writesize = 1; - if (cfi->cfi_mode==CFI_MODE_CFI){ + __u16 adr = primary?cfi->cfiq->P_ADR:cfi->cfiq->A_ADR; + if (cfi->cfi_mode==CFI_MODE_CFI && adr){ unsigned char bootloc; /* * It's a real CFI chip, not one for which the probe * routine faked a CFI structure. So we read the feature * table from it. */ - __u16 adr = primary?cfi->cfiq->P_ADR:cfi->cfiq->A_ADR; struct cfi_pri_amdstd *extp; extp = (struct cfi_pri_amdstd*)cfi_read_pri(map, adr, sizeof(*extp), "Amd/Fujitsu");
_______________________________________________ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev