[RFC/PATCH] map drivers. DCACHE option for physmap and mphysmap drivers
Josh Boyer
jwboyer at gmail.com
Thu Jan 26 12:48:03 EST 2006
On 1/26/06, Korolev, Alexey <alexey.korolev at intel.com> wrote:
> Hi All,
>
> Some mapping drivers of linux-mtd has feature of cached mapping. This
> can improve read performance on FLASH significantly .
> I think adding the option of data cache mapping would also be helpful
> for physmap and mphysmap drivers.
Is this a read-only caching? I know several architectures and
hardware configurations that would quickly throw a machine check if
trying to flush the cache back to flash since they don't support
bursted writes.
> ========================================================================
> =====
> diff -uNr a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
> --- a/drivers/mtd/maps/Kconfig 2005-12-22 15:06:38.000000000 +0300
> +++ b/drivers/mtd/maps/Kconfig 2005-12-22 15:05:24.000000000 +0300
> @@ -60,6 +60,12 @@
> Ignore this option if you use run-time physmap configuration
> (i.e., run-time calling physmap_configure()).
>
> +config MTD_PHYSMAP_DCACHE
> + bool "Enable dcache for flash mapping"
> + depends on MTD_PHYSMAP
> + help
> + This option enables CPU data cache for flash mapping
> + This improves flash read speed significantly.
I would recommend adding a dependency on ARM for all of this for now.
As other architectures are proven to be working, they can be added.
> +#ifdef CONFIG_MTD_MULTI_PHYSMAP_DCACHE
> + if (map->inval_cache)
> + {
> +#ifdef CONFIG_ARM
> + map->cached = ioremap_cached(map->phys, map->size);
> +#else
> + map->cached = __ioremap(map->phys, map->size,
> L_PTE_CACHEABLE);
> +#endif
Gah. The above doesn't work. L_PTE_CACHEABLE seems to be an ARM only
flag. And it wouldn't work on PPC for example. That version of
__ioremap makes everything implicitly cached unless _PAGE_NO_CACHED is
passed in.
As I said before, I would make this an ARM only option for now.
> +#ifdef CONFIG_MTD_PHYSMAP_DCACHE
> +#ifdef CONFIG_ARM
> + physmap_map.cached = ioremap_cached(physmap_map.phys,
> physmap_map.size);
> +#else
> + physmap_map.cached = __ioremap(physmap_map.phys, physmap_map.size,
> L_PTE_CACHEABLE);
> +#endif
Same issues as in mphysmap.
josh
More information about the linux-mtd
mailing list