arm64: Update memcpy_{from, to}io() helpers
authorPatrice Chotard <patrice.chotard@foss.st.com>
Mon, 19 Jul 2021 09:21:51 +0000 (11:21 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 28 Jul 2021 23:30:22 +0000 (19:30 -0400)
commit268f6ac1f95c1734e7eea369e93062e52c4aa04a
tree0ec302db5e1a97b04eb51f5cabbc174380488181
parent558e699d156ebe7f0b51e05a2e38f35fbaa78b0f
arm64: Update memcpy_{from, to}io() helpers

At early U-Boot stage, before relocation, MMU is not yet configured
and disabled. DDR may not be configured with the correct memory
attributes (can be configured in MT_DEVICE instead of MT_MEMORY).

In this case, usage of memcpy_{from, to}io() may leads to synchronous
abort in AARCH64 in case the normal memory address is not 64Bits aligned.

To avoid such situation, forbid usage of normal memory cast to (u64 *) in
case MMU is not enabled.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: mark.kettenis@xs4all.nl
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
arch/arm/cpu/armv8/cache_v8.c
arch/arm/include/asm/io.h
include/cpu_func.h