From 869f0477a16c7a41fb3e6128cf8c852cee0dd59a Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Fri, 15 Feb 2019 12:19:41 +0800 Subject: mt_scp: Add functions to clean/invalidated selected lines of D-cache For performance reasons, we want to be able to flush/invalidate only specific cache lines/addresses. BRANCH=none BUG=b:123676508 TEST=fill; flush; fill to generate incoherent DRAM/cache content: cached: 10000000: 89905d00 89905d01 89905d02 89905d03 89905d04 89905d05 89905d06 89905d07 10000020: 89905d08 89905d09 89905d0a 89905d0b 89905d0c 89905d0d 89905d0e 89905d0f direct: 30000000: 3848c300 3848c301 3848c302 3848c303 3848c304 3848c305 3848c306 3848c307 30000020: 3848c308 3848c309 3848c30a 3848c30b 3848c30c 3848c30d 3848c30e 3848c30f => Then clean a cache line > flush 0x10000000 c Clean cached: 10000000: 89905d00 89905d01 89905d02 89905d03 89905d04 89905d05 89905d06 89905d07 10000020: 89905d08 89905d09 89905d0a 89905d0b 89905d0c 89905d0d 89905d0e 89905d0f direct: 30000000: 89905d00 89905d01 89905d02 89905d03 89905d04 89905d05 89905d06 89905d07 30000020: 3848c308 3848c309 3848c30a 3848c30b 3848c30c 3848c30d 3848c30e 3848c30f => memory is updated => Then invalidate a cache line > flush 0x10000020 i Inval 10000020 cached: 10000000: 89905d00 89905d01 89905d02 89905d03 89905d04 89905d05 89905d06 89905d07 10000020: 3848c308 3848c309 3848c30a 3848c30b 3848c30c 3848c30d 3848c30e 3848c30f direct: 30000000: 89905d00 89905d01 89905d02 89905d03 89905d04 89905d05 89905d06 89905d07 30000020: 3848c308 3848c309 3848c30a 3848c30b 3848c30c 3848c30d 3848c30e 3848c30f => cache content is thrown away, and matches memory Change-Id: I5dbcc366236fef56f7cb048ce313247cf3d51276 Signed-off-by: Nicolas Boichat Reviewed-on: https://chromium-review.googlesource.com/1475092 Commit-Ready: ChromeOS CL Exonerator Bot Reviewed-by: Yilun Lin --- core/cortex-m/cpu.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/cortex-m/cpu.h') diff --git a/core/cortex-m/cpu.h b/core/cortex-m/cpu.h index a6029e2e7e..7f91b33179 100644 --- a/core/cortex-m/cpu.h +++ b/core/cortex-m/cpu.h @@ -71,4 +71,9 @@ void cpu_invalidate_dcache(void); /* Clean and Invalidate the D-cache to the Point of Coherency */ void cpu_clean_invalidate_dcache(void); +/* Invalidate a single address of the D-cache */ +void cpu_invalidate_dcache_address(uintptr_t address); +/* Clean and Invalidate a single address of the D-cache */ +void cpu_clean_invalidate_dcache_address(uintptr_t address); + #endif /* __CROS_EC_CPU_H */ -- cgit v1.2.1