Weird 5200/mtd-ram problem

Albrecht Dreß albrecht.dress at arcor.de
Tue May 26 03:41:14 EST 2009


Hi Gary & Wolfram:

Thanks for youre help, and sorry for the late reply - I've been on  
vacation...

Am 20.05.09 21:59 schrieb(en) Gary Thomas:
> Try to access this without using the cache.

Unfortunately, this is not cache related - I switched the dcache off  
completely - same results.

Am 20.05.09 22:01 schrieb(en) Wolfram Sang:
> Does it work with byte, word and long accesses?

A word or long copy of 0x0055aaff with U-Boot works fine, but a byte  
copy filled the whole ram with 0x0000aaaa.  The reason is apparently  
that the chip is attached to the local bus in 16-bit mode, which is  
incompatible with byte accesses.  However, the Local Bus doesn't  
provide "low byte" or "high byte" indicators in non-muxed mode.  How is  
this supposed to work then?

For the mtd driver, I tracked down the problem via mapram_write() (in  
drivers/mtd/chips/map_ram.c) down to the call of map_copy_to() which is  
actually inline_map_copy_to(), which in turn calls memcpy_toio().  I  
*think* this is _memcpy_toio() in arch/powerpc/kernel/io.c, which  
copies all data in long (4-byte) moves, except for the last 4 bytes.  I  
guess I have to write my own copy function which respects the fact that  
byte writes actually must be a read word - modify - write word  
sequence, right?

Thanks, Albrecht.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20090525/61ed7020/attachment.pgp>


More information about the Linuxppc-dev mailing list