public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* CFI problems with 32bit bus and 4 devices
@ 2001-01-10 19:15 Stéphane Laroche
  2001-01-10 20:13 ` Nicolas Pitre
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Stéphane Laroche @ 2001-01-10 19:15 UTC (permalink / raw)
  To: mtd

Hi,

I've just updated to the latest CVS and my CFI AMD chips are not
accessible anymore.

I lokked briefly into it and saw that the cfi->interleave and
cfi->device_type were removed from offset calculations when accessing
the devices.

So, for my setup, which has 4 x16 devices on a 32 bit bus (AMDs),  the
CFI query structure is located at offsets 0x80, 0x88, 0x90, etc.

cfi_read_query()  uses only the buswidth to calculate the offset, which
is not general enough (it used to be like that before I played with the
code a bit last summer).  It's obviously wrong in my case ( 0x10 << 2 !=
0x80 ).

Rewriting cfi_read_query like this made the CFI query structure
readable:

static inline __u8 cfi_read_query(struct map_info *map, __u32 base,
__u32 addr)
{
    struct cfi_private *cfi = map->fldrv_priv;
    addr *= cfi->interleave * cfi->device_type;  /* instead of addr <<
(buswidth / 2) */
    if (cfi_buswidth_is_1()) {
        return map->read8(map, base + addr);
    } else if (cfi_buswidth_is_2()) {
        return cfi16_to_cpu(map->read16(map, base + addr));
    } else if (cfi_buswidth_is_4()) {
        return cfi32_to_cpu(map->read32(map, base + addr));
    } else {
        return 0;
    }
}

With this change, the chips are now properly recognized.  But I can't
still not use them (reads are wrong), so I think I have to look at
cfi_cmdset_002.c to bring back the use of cfi->interleave in some
calculations...

Any comments?  Is it possible that I'm the only one using that kind of
geometry?

-Stephane



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

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: CFI problems with 32bit bus and 4 devices
@ 2001-01-10 22:45 Michael Thompson
  0 siblings, 0 replies; 13+ messages in thread
From: Michael Thompson @ 2001-01-10 22:45 UTC (permalink / raw)
  To: mtd


dwmw2 wrote:
> 
> Technically, I think this setup would fit into the original model as
> buswidth == 8, and we should be using read64/write64 for accesses to the
> flash.
> 
> Just how crap is gcc's long long support these days? Could we use __u64
> for this?

Actually, I just got buswidth==8 working on a 32-bit ppc (my configuration
is 4 devices in 16 bit mode).  However, I found that I could use __u64 for
passing data around, but __u64 would not work when accessing the devices..
For this, I had to use a little trick: floating point loads and stores.
On the ppc, these are 64 bits wide.

I'd be willing to submit patches...  Shall I send them to you?

-Michael Thompson
mickey@berkeley.innomedia.com


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2001-01-11  0:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-10 19:15 CFI problems with 32bit bus and 4 devices Stéphane Laroche
2001-01-10 20:13 ` Nicolas Pitre
2001-01-10 20:37 ` David Woodhouse
2001-01-10 21:06   ` Stéphane Laroche
2001-01-10 22:35     ` David Woodhouse
2001-01-10 21:37   ` Nicolas Pitre
2001-01-10 22:22     ` David Woodhouse
2001-01-10 22:39       ` Stéphane Laroche
2001-01-10 23:06         ` David Woodhouse
2001-01-11  0:21       ` Nicolas Pitre
2001-01-10 23:34 ` Alice Hennessy
2001-01-10 23:55   ` Alice Hennessy
  -- strict thread matches above, loose matches on Subject: below --
2001-01-10 22:45 Michael Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox