u-boot-brain/arch
Wolfgang Denk 460c2ce362 MPC5200: workaround data corruption for unaligned local bus accesses
The MPC5200 has a nasty problem that will cause silent data corruption
when performing unaligned 16 or 32 byte accesses when reading from the
local bus - typically this affects reading from flash. The problem can
be easily shown:

=> md fc0c0000 10
fc0c0000: 323e4337 01626f6f 74636d64 3d72756e    2>C7.bootcmd=run
fc0c0010: 206e6574 5f6e6673 00626f6f 7464656c     net_nfs.bootdel
fc0c0020: 61793d35 00626175 64726174 653d3131    ay=5.baudrate=11
fc0c0030: 35323030 00707265 626f6f74 3d656368    5200.preboot=ech
=> md fc0c0001 10
fc0c0001: 65636801 00000074 0000003d 00000020    ech....t...=...
fc0c0011: 0000005f 00000000 00000074 00000061    ..._.......t...a
fc0c0021: 00000000 00000064 00000065 00000035    .......d...e...5
fc0c0031: 00000000 00000062 0000003d 0000006f    .......b...=...o
=> md.w fc0c0001 10
fc0c0001: 0000 3701 0000 6f74 0000 643d 0000 6e20    ..7...ot..d=..n
fc0c0011: 0000 745f 0000 7300 0000 6f74 0000 6c61    ..t_..s...ot..la

This commit implements a workaround at least for the most blatant
problem: using memcpy() from NOR flash. We rename the assembler
routine into __memcpy() and provide a wrapper, which will use a
byte-wise copy loop for unaligned source or target addresses when
reading from NOR flash, and branch to the optimized __memcpy()
in all other cases, thus minimizing the performance impact.

Tested on lite5200b and TQM5200S.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
2010-06-23 02:09:20 +02:00
..
arm ARM: remove unused VIDEOLFB ATAG 2010-06-23 00:11:10 +02:00
avr32 avr32: Move cpu/at32ap/* to arch/avr32/cpu/* 2010-04-13 09:13:25 +02:00
blackfin blackfin: Move cpu/blackfin/* to arch/blackfin/cpu/* 2010-04-13 09:13:25 +02:00
i386 Coding style cleanup, update CHANGELOG. 2010-05-26 23:51:22 +02:00
m68k add CONFIG_SYS_FEC_FULL_MII for MCF5445x 2010-05-28 02:15:57 -05:00
microblaze microblaze: Consolidate cache code 2010-04-16 12:56:33 +02:00
mips mips: Move cpu/mips/* to arch/mips/cpu/* 2010-04-13 09:13:25 +02:00
nios2 nios2: allow STANDALONE_LOAD_ADDR overriding 2010-05-28 10:56:04 -04:00
powerpc MPC5200: workaround data corruption for unaligned local bus accesses 2010-06-23 02:09:20 +02:00
sh sh: Move cpu/$CPU to arch/sh/cpu/$CPU 2010-04-13 09:13:17 +02:00
sparc sparc: Move cpu/leon[23] to arch/sparc/cpu/leon[23] 2010-04-13 09:13:26 +02:00
.gitignore update include/asm/ gitignore after move 2010-05-07 00:17:30 +02:00