u-boot/arch/powerpc/cpu/mpc5xxx
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
..
config.mk Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
cpu.c powerpc: Consolidate bootcount_{store|load} for PowerPC 2010-05-06 23:28:48 +02:00
cpu_init.c Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
firmware_sc_task_bestcomm.impl.S Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
i2c.c Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
ide.c Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
interrupts.c Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
io.S Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
loadtask.c Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
Makefile MPC5200: workaround data corruption for unaligned local bus accesses 2010-06-23 02:09:20 +02:00
memcpy_mpc5200.c MPC5200: workaround data corruption for unaligned local bus accesses 2010-06-23 02:09:20 +02:00
pci_mpc5200.c Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
serial.c serial: struct serial_device: add uninit() entry for drivers 2010-04-24 21:34:07 +02:00
speed.c Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
start.S Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
traps.c Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
u-boot-customlayout.lds Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
u-boot.lds Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
usb.c Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
usb_ohci.c Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
usb_ohci.h Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00