diff options
author | Tom Rini <trini@konsulko.com> | 2021-07-29 12:10:23 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-07-29 12:10:55 -0400 |
commit | 15f7e0dc01d8a851fb1bfbf0e47eab5b67ed26b3 (patch) | |
tree | a05518590771cfaff996f35856b9d9d8edfa7221 /arch | |
parent | 38436abd5e58044eccddbcd7ec3610a9104e86b6 (diff) | |
parent | 62b27a561c2868d95445905ad554297e43cc0f2b (diff) | |
download | u-boot-15f7e0dc01d8a851fb1bfbf0e47eab5b67ed26b3.zip u-boot-15f7e0dc01d8a851fb1bfbf0e47eab5b67ed26b3.tar.gz u-boot-15f7e0dc01d8a851fb1bfbf0e47eab5b67ed26b3.tar.bz2 |
Merge branch '2021-07-28-assorted-fixes'
- Assorted bugfixes
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/cpu/armv8/cache_v8.c | 10 | ||||
-rw-r--r-- | arch/arm/include/asm/io.h | 25 | ||||
-rw-r--r-- | arch/arm/mach-mediatek/mt8183/init.c | 2 |
3 files changed, 26 insertions, 11 deletions
diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c index 15cecb5..3de18c7 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) { } diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index df264a1..36b8403 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -338,6 +338,7 @@ extern void __readwrite_bug(const char *fn); /* Optimized copy functions to read from/write to IO sapce */ #ifdef CONFIG_ARM64 +#include <cpu_func.h> /* * Copy data from IO memory space to "real" memory space. */ @@ -351,11 +352,13 @@ void __memcpy_fromio(void *to, const volatile void __iomem *from, size_t count) count--; } - while (count >= 8) { - *(u64 *)to = __raw_readq(from); - from += 8; - to += 8; - count -= 8; + if (mmu_status()) { + while (count >= 8) { + *(u64 *)to = __raw_readq(from); + from += 8; + to += 8; + count -= 8; + } } while (count) { @@ -379,11 +382,13 @@ void __memcpy_toio(volatile void __iomem *to, const void *from, size_t count) count--; } - while (count >= 8) { - __raw_writeq(*(u64 *)from, to); - from += 8; - to += 8; - count -= 8; + if (mmu_status()) { + while (count >= 8) { + __raw_writeq(*(u64 *)from, to); + from += 8; + to += 8; + count -= 8; + } } while (count) { diff --git a/arch/arm/mach-mediatek/mt8183/init.c b/arch/arm/mach-mediatek/mt8183/init.c index 877f387..7496029 100644 --- a/arch/arm/mach-mediatek/mt8183/init.c +++ b/arch/arm/mach-mediatek/mt8183/init.c @@ -48,7 +48,7 @@ int mtk_soc_early_init(void) return 0; } -void reset_cpu(ulong addr) +void reset_cpu(void) { psci_system_reset(); } |