All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] common/memsize.c: Fix get_ram_size() when cache is enabled
@ 2023-05-30 13:33 Francesco Dolcini
  2023-05-30 13:33 ` [PATCH v2 1/2] sandbox: Add a dummy dcache_status() function Francesco Dolcini
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Francesco Dolcini @ 2023-05-30 13:33 UTC (permalink / raw)
  To: Pali Rohár, u-boot, Tom Rini, Simon Glass; +Cc: Francesco Dolcini

From: Francesco Dolcini <francesco.dolcini@toradex.com>

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 c02712a74849 ("arm: mach-k3: Enable dcache in SPL").

Test results here: https://github.com/u-boot/u-boot/pull/293

v2:
 * added additional patch to fix sandbox build
 * ensure that the changes are fine with every arch/build,
   check if cache is enabled and check for cache line size define

Emanuele Ghidoli (2):
  sandbox: Add a dummy dcache_status() function
  common/memsize.c: Fix get_ram_size() when cache is enabled

 arch/sandbox/cpu/cpu.c |  5 +++++
 common/memsize.c       | 24 ++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-06-22 14:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30 13:33 [PATCH v2 0/2] common/memsize.c: Fix get_ram_size() when cache is enabled Francesco Dolcini
2023-05-30 13:33 ` [PATCH v2 1/2] sandbox: Add a dummy dcache_status() function Francesco Dolcini
2023-06-01  3:28   ` Simon Glass
2023-05-30 13:33 ` [PATCH v2 2/2] common/memsize.c: Fix get_ram_size() when cache is enabled Francesco Dolcini
2023-05-30 13:42   ` Michael Nazzareno Trimarchi
2023-05-30 13:48     ` Francesco Dolcini
2023-05-30 14:04       ` Michael Nazzareno Trimarchi
2023-06-22 14:00 ` [PATCH v2 0/2] " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.