MPC5200 + LocalPlus Bus + memcpy

Andrey Volkov avolkov at varma-el.com
Fri Apr 7 00:21:44 EST 2006


Hello, Sascha.

On Wednesday, April 5, 2006, Sascha Hauer wrote:

> Hi all,

> I try to use jffs2 on a flash device connected to the mpc5200
> LocalPlus Bus. This bus does not allow misaligned accesses.
> The jffs2 code uses memcpy to copy from a word aligned address to an
> odd address. The ppc memcpy implementation first copies three bytes to get
> the target address word aligned, but then the source address is on an
> odd address. The following word accesses on this unaligned address fail
> badly.
Invalid crc on 'name' field ;)?

> I have fixed my problem by modifying the physmap mtd driver, but some
> day someone wants to connect SRAM to the LocalPlus Bus and I guess he
> will expect memcpy to work.
Heh, I'll have same problem. Patch (dirty hack)
attached (vs head of vanilla 2.6. tree)

> (BTW the arm implementation of memcpy seems to work around this problem)
Wrong, memcpy to/from SDRAM _may_ be unaligned, only
memcpy_fromio/memcpy_toio _must_ be aligned to even addresses.

P.S.
Paul, Sylvain, any suggestions to fix it?
AFAIK, memcpy_to/from_io must be it string.s, isn't it?

P.P.S Sacha if you start to write mscan driver, then please wait a
week, I planned to send my work to can-socket at next Friday.

-- 
Regards,
Andrey Volkov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpc52xx_LPB_jffs2_hack.diff
Type: application/octet-stream
Size: 1492 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20060406/5f005c30/attachment.obj 


More information about the Linuxppc-embedded mailing list