summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-07-29 19:10:23 +0300
committerTom Rini <trini@konsulko.com>2021-07-29 19:10:55 +0300
commit15f7e0dc01d8a851fb1bfbf0e47eab5b67ed26b3 (patch)
treea05518590771cfaff996f35856b9d9d8edfa7221 /arch
parent38436abd5e58044eccddbcd7ec3610a9104e86b6 (diff)
parent62b27a561c2868d95445905ad554297e43cc0f2b (diff)
downloadu-boot-15f7e0dc01d8a851fb1bfbf0e47eab5b67ed26b3.tar.xz
Merge branch '2021-07-28-assorted-fixes'
- Assorted bugfixes
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv8/cache_v8.c10
-rw-r--r--arch/arm/include/asm/io.h25
-rw-r--r--arch/arm/mach-mediatek/mt8183/init.c2
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 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)
{
}
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index df264a170b..36b840378a 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 877f387102..7496029705 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();
}