JFFS2 on big-endian system, 8-bit wide flash on 32-bit bus

Joshua Lamorie jpl at xiphos.ca
Thu Apr 15 00:41:46 EDT 2004


Well, I've found a fix, but it's a bit of a kludge, and I don't know if
there is a more proper way.  I kinda think that changing something in
the kernel is rather drastic, but anyway...  

The block device makes all of the access through cfi_amdstd_read which
will then call the map->copy_from function.  This gets mapped through to
a straight memcpy, with no respect paid to the buswidth of the flash
device.  So, I added a little switch.  Here is the code I'm now using in
drivers/mtd/maps/physmap.c

void physmap_copy_from(struct map_info *map, void *to, unsigned long
from, ssize_t len)
{
        int i;
        if(map->buswidth == 1){
                for(i=0;i<len;i++){
                        ((__u8 *)to)[i] = physmap_read8(map,from+i);
                }
        }else
                memcpy_fromio(to, map->map_priv_1 + from, len);

}

Is this a gross hack?  Should I be paying attention to endianness?

Anyway.. it seems to be working so far.  It's just soooo slow! (my
fault).

Now if I can get the root-filesystem there.

Joshua



-- 
Joshua Lamorie				jpl at xiphos.ca
Space Systems				514-848-9640 ext. 277
Xiphos Technologies Inc.		514-848-9644 (fax)




More information about the linux-mtd mailing list