Wrong CFI offset in cfi_cmdset_0001.c
Josh Boyer
jdub at us.ibm.com
Tue Oct 25 09:46:29 EDT 2005
On Mon, 2005-10-24 at 18:00 -0700, Jared Hulbert wrote:
> Sorry. It took me longer than it should have to track down a P30 part
> and get it on my machine. Does this work for you?
No worries. The patch seems to be working fine on my P30 chips. I
don't have any other chips to test on at the moment, but it looks like
it should work.
Nicolas, could you try it on the chips you have?
>
> [MTD] CHIPS: fix for P30 cfi parsing
>
> Change to the extended cfi table parsing for Intel NOR flash that uses
> the info in the extended table to 'walk' the table rather than using
> hard coding for various primary extended query table version numbers.
> [From: Jared Hulbert <jaredeh at gmail.com>]
>
> Index: trunk/drivers/mtd/chips/cfi_cmdset_0001.c
> ===================================================================
> --- trunk/drivers/mtd/chips/cfi_cmdset_0001.c (revision 8)
> +++ trunk/drivers/mtd/chips/cfi_cmdset_0001.c (revision 10)
> @@ -285,7 +285,7 @@
> sizeof(struct cfi_intelext_otpinfo);
>
> /* Burst Read info */
> - extra_size += (extp->MinorVersion < '4') ? 6 : 5;
> + extra_size += (unsigned int)extp->extra[extra_size+1]+2;
>
> /* Number of hardware-partitions */
> extra_size += 1;
> @@ -519,7 +519,7 @@
> sizeof(struct cfi_intelext_otpinfo);
>
> /* Burst Read info */
> - offs += (extp->MinorVersion < '4') ? 6 : 5;
> + offs += (int)extp->extra[offs+1]+2;
Why (int) here and (unsigned int) above? Not a big deal, but I'm
curious.
thx,
josh
More information about the linux-mtd
mailing list