summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTekkamanV <tekkamanv@starfivetech.com>2021-09-19 09:13:15 +0300
committerTekkaman Ninja <tekkamanninja@163.com>2021-09-29 09:51:21 +0300
commit70040b561ce0f5befdf1f9a43b1625a184f40c6e (patch)
treeccf1eb54aa98d731d4d5a27ccb971446052166f6 /arch
parentec56b4f5ea2f9a0a93047c20c5fe3b2c0cdf6f96 (diff)
downloadu-boot-70040b561ce0f5befdf1f9a43b1625a184f40c6e.tar.xz
sifive_cache: add flush_range func in sifive cache driver
Signed-off-by: TekkamanV <tekkamanv@starfivetech.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/riscv/lib/sifive_cache.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/riscv/lib/sifive_cache.c b/arch/riscv/lib/sifive_cache.c
index 28154878fc..de4aba6630 100644
--- a/arch/riscv/lib/sifive_cache.c
+++ b/arch/riscv/lib/sifive_cache.c
@@ -25,3 +25,24 @@ void enable_caches(void)
log_debug("ccache enable failed");
}
}
+
+
+void flush_dcache_range(unsigned long start, unsigned long end)
+{
+ struct udevice *dev;
+ int ret;
+
+ /* Enable ways of ccache */
+ ret = uclass_get_device_by_driver(UCLASS_CACHE,
+ DM_DRIVER_GET(sifive_ccache),
+ &dev);
+ if (ret) {
+ log_debug("Cannot flush dcache in %p - %p",
+ (void *)start, (void *)end);
+ } else {
+ ret = flush_range(dev, start, end);
+ if (ret)
+ log_debug("ccache flush failed in %p - %p",
+ (void *)start, (void *)end);
+ }
+} \ No newline at end of file