JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow:(

Wojciech Kromer krom at dgt-lab.com.pl
Mon Sep 3 08:19:03 EDT 2001


>
> It won't make your mount any faster. You have a sane CPU which can handle
> having both a cached and uncached mapping of a physical region - try doing
> that in your map driver (see ocelot.c for inspiration) and see if it helps.
>

OK, now I'm testing the ocelot's trick. But I do not understand it.

........................

        ocelot_flash_map.map_priv_1 =
        (unsigned long)ioremap_nocache(FLASH_WINDOW_ADDR, FLASH_WINDOW_SIZE);

        ocelot_flash_map.map_priv_2 =
         (unsigned long)__ioremap(FLASH_WINDOW_ADDR, FLASH_WINDOW_SIZE, 0);

^^^^^^^^ so we have chached version in map_priv_2

..........................


__u8 ocelot_read8(struct map_info *map, unsigned long ofs)
{
        return __raw_readb(map->map_priv_1 + ofs);
}

void ocelot_write8(struct map_info *map, __u8 d, unsigned long adr)
{
        cacheflush = 1;
        __raw_writeb(d, map->map_priv_1 + adr);
        mb();
}

^^^^^ and now we're using uncached version for reading and wrining
!!!!!!!!!!!!!!!!!!!!!!!!! ?????????????????

void ocelot_copy_from_cache(struct map_info *map, void *to, unsigned long from,
ss
{
        if (cacheflush) {
                dma_cache_inv(map->map_priv_2, map->size);
                cacheflush = 0;
        }
        memcpy_fromio(to, map->map_priv_1 + from, len);
}

^^^^^^^ and flushing chache after some writes !!!! ???


Q1 What is cahed version usef for?
Q2 Is it a bug?


--
* * * * * * * * * * * *
* per pedes ad astra! *
* * * * * * * * * * * *    mailto:krom at dgt-lab.com.pl






More information about the linux-mtd mailing list