summaryrefslogtreecommitdiff
path: root/payloads/libpayload
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2013-07-08 12:27:13 +0800
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-12-12 22:03:15 +0100
commitcb0aeef0a9ef58049a093eb42b8c7f06c9e1b271 (patch)
tree4cffbbf43bacd965d9703c1ac4a82a52f1a9faa3 /payloads/libpayload
parentd0fa1d1a616ce4fd08ca2348700b6e0201761da3 (diff)
downloadcoreboot-cb0aeef0a9ef58049a093eb42b8c7f06c9e1b271.tar.xz
libpayload: armv7: Add cache control function to invalidate range.
When dealing with DMA, we need a function to invalidate cache without corrupting contents on main memory (clean). Change-Id: I28e632ae57a7b7ed1accee74e76045b92f92a699 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/61078 Reviewed-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Reviewed-on: http://review.coreboot.org/4345 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'payloads/libpayload')
-rw-r--r--payloads/libpayload/arch/armv7/cache.c9
-rw-r--r--payloads/libpayload/include/armv7/arch/cache.h3
2 files changed, 12 insertions, 0 deletions
diff --git a/payloads/libpayload/arch/armv7/cache.c b/payloads/libpayload/arch/armv7/cache.c
index 4046451e34..efdf75ebbf 100644
--- a/payloads/libpayload/arch/armv7/cache.c
+++ b/payloads/libpayload/arch/armv7/cache.c
@@ -80,6 +80,7 @@ enum dcache_op {
OP_DCISW,
OP_DCCIMVAC,
OP_DCCMVAC,
+ OP_DCIMVAC,
};
/*
@@ -220,6 +221,9 @@ static void dcache_op_mva(unsigned long addr,
case OP_DCCMVAC:
dccmvac(line);
break;
+ case OP_DCIMVAC:
+ dcimvac(line);
+ break;
default:
break;
}
@@ -238,6 +242,11 @@ void dcache_clean_invalidate_by_mva(unsigned long addr, unsigned long len)
dcache_op_mva(addr, len, OP_DCCIMVAC);
}
+void dcache_invalidate_by_mva(unsigned long addr, unsigned long len)
+{
+ dcache_op_mva(addr, len, OP_DCIMVAC);
+}
+
void dcache_mmu_disable(void)
{
uint32_t sctlr;
diff --git a/payloads/libpayload/include/armv7/arch/cache.h b/payloads/libpayload/include/armv7/arch/cache.h
index 1db86dc57c..2571e81c35 100644
--- a/payloads/libpayload/include/armv7/arch/cache.h
+++ b/payloads/libpayload/include/armv7/arch/cache.h
@@ -266,6 +266,9 @@ void dcache_clean_by_mva(unsigned long addr, unsigned long len);
/* dcache clean and invalidate by modified virtual address to PoC */
void dcache_clean_invalidate_by_mva(unsigned long addr, unsigned long len);
+/* dcache invalidate by modified virtual address to PoC */
+void dcache_invalidate_by_mva(unsigned long addr, unsigned long len);
+
/* dcache invalidate all (on current level given by CCSELR) */
void dcache_invalidate_all(void);