[PATCH] powerpc/mpc52xx/mtd: fix mtd-ram access for 16-bit Local Plus Bus

Grant Likely grant.likely at secretlab.ca
Fri Jun 12 03:28:50 EST 2009


On Thu, Jun 11, 2009 at 10:55 AM, Wolfram Sang<w.sang at pengutronix.de> wrote:
>> Blech.  ugly #ifdef and not really multiplatform safe (yeah, I know it
>> shouldn't break non-5200 platforms, but it does have an undesirable
>> impact).  There's got to be a better way.
>
> What about putting the special memcpy in asm/io.h (like it is done for eeh)?

It is a beefy enough function that it is probably a net loss to make
it an inline static in the header file.  It should be an exported
function.

> Will this cause too much overhead for a memcpy which does not go to the LPB?

It doesn't solve my concerns.  bankwidth==2 is the wrong test; plenty
of non-mpc5200 platforms could have the same property set without
needing the workaround.

inline_map_copy_to is used in exactly 2 places in drivers/mtd/* and
include/linux/mtd/*:
1) the definition of map_copy_to() in include/linux/mtd/map.h
- map_copy_to() is only used by maprap_write() which is a mtd_info hook.
2) the definition of simple_map_copy_to() in drivers/mtd/maps/map_funcs.c
- a map_info hook.

So; the solution to me seems to be on an MPC5200 platform replace the
offending hooks with MPC5200 specific variants at runtime.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.


More information about the Linuxppc-dev mailing list