mips: vcoreiii: Fix cache coherency issues
authorLars Povlsen <lars.povlsen@microchip.com>
Thu, 6 Feb 2020 09:45:40 +0000 (10:45 +0100)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Thu, 9 Apr 2020 16:55:59 +0000 (18:55 +0200)
commit7048bb13b2d6309ef8386fca665247d3afa36ab0
tree236eb7433c2c06d3469b0bce455f1e569ef3095f
parentea148789318c8152acb0a3974d4a8342dbd6b901
mips: vcoreiii: Fix cache coherency issues

This patch fixes an stability issue seen on some vcoreiii targets,
which was root caused to a cache inconsistency situation.

The inconsistency was caused by having kuseg pointing to NOR area but
used as a stack/gd/heap area during initialization, while only
relatively late remapping the RAM area into kuseg position.

The fix is to initialize the DDR right after the TLB setup, and then
remapping it into position before gd/stack/heap usage.

Reported-by: Ramin Seyed-Moussavi <ramin.moussavi@yacoub.de>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
arch/mips/mach-mscc/cpu.c
arch/mips/mach-mscc/dram.c
arch/mips/mach-mscc/include/mach/ddr.h
arch/mips/mach-mscc/lowlevel_init.S