cfi_cmdset_0001.c: do_write_buffer: wrong length

Shane Nay shane at agendacomputing.com
Mon Dec 18 18:07:47 EST 2000


On Tuesday 19 December 2000 09:41, David Vrabel wrote:
> On Mon, 18 Dec 2000, Shane Nay wrote:
> > Okay, last message was way cryptic again..., I'm not a master
> > communicator. Anyway, I have succesfully tested the following change on
> > two interleaves. First device:
> > two x16 devices in x8 mode interleaved
> > Second device:
> > one x16 device in x16 mode
> >
> > It's only one change... cfi_cmdset_0001.c:
> > /* Write length of data to come */
> > -cfi_write(map,CMD((len/(cfi->device_type*CFIDEV_INTERLEAVE))-1),cmd_adr)
> >; +cfi_write(map,CMD((len/(cfi->device_type))-1),cmd_adr);
>
> However this would break the case 1 in the table below.  Whereas
>     cfi_write(map, CMD(len/CFIDEV_BUSWIDTH-1), cmd_adr);
> would work.
>
> To add to the table...
>
> device type  interleave  bus width  buf write len
> 2 (x16)      1           1 (x8)     len/1-1
> 2 (x16)      1           2 (x16)    len/2-1
> 2 (x16)      2           4 (x32)    len/4-1
> 2 (x16)      2           2 (x16)    len/2-1
>
> It's still len/buswidth-1.
>

Hmm..., good point.  But what about interleaved x8 devices?  Would they be 
fine?  (Brains not functioning at the moment, but my instinct says it would 
be divided by 2 when it should be divided by 1, but I might be messing up the 
"len" calculation that happens before this.  I initially did it the way you 
mention here, but thought I found a flaw, but could definetly be wrong.)

Thanks,
Shane.


To unsubscribe, send "unsubscribe mtd" to majordomo at infradead.org



More information about the linux-mtd mailing list