From 268f6ac1f95c1734e7eea369e93062e52c4aa04a Mon Sep 17 00:00:00 2001 From: Patrice Chotard Date: Mon, 19 Jul 2021 11:21:51 +0200 Subject: 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 Reviewed-by: Patrick Delaunay Cc: mark.kettenis@xs4all.nl Signed-off-by: Patrick Delaunay --- arch/arm/cpu/armv8/cache_v8.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arch/arm/cpu/armv8/cache_v8.c') diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c index 15cecb5e0b..3de18c7675 100644 --- a/arch/arm/cpu/armv8/cache_v8.c +++ b/arch/arm/cpu/armv8/cache_v8.c @@ -719,6 +719,11 @@ int icache_status(void) return (get_sctlr() & CR_I) != 0; } +int mmu_status(void) +{ + return (get_sctlr() & CR_M) != 0; +} + void invalidate_icache_all(void) { __asm_invalidate_icache_all(); @@ -740,6 +745,11 @@ int icache_status(void) return 0; } +int mmu_status(void) +{ + return 0; +} + void invalidate_icache_all(void) { } -- cgit v1.2.3