Skip to content
Commit 1c64b98c authored by Emanuele Ghidoli's avatar Emanuele Ghidoli Committed by Tom Rini
Browse files

common/memsize.c: Fix get_ram_size() when cache is enabled



Ensure that every write is flushed to memory and afterward reads are
from memory.
Since the algorithm rely on the fact that accessing to not existent
memory lead to write at addr / 2 without this modification accesses
to aliased (not physically present) addresses are cached and
wrong size is returned.

This was discovered while working on a TI AM625 based board
where cache is normally enabled, see commit c02712a7 ("arm: mach-k3: Enable dcache in SPL").

Signed-off-by: default avatarEmanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: default avatarFrancesco Dolcini <francesco.dolcini@toradex.com>
parent a1e225b8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment