diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2019-02-15 12:19:41 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-02-19 22:15:29 -0800 |
commit | 869f0477a16c7a41fb3e6128cf8c852cee0dd59a (patch) | |
tree | d6433b8e1a82fd731a91029764950151137a1e97 /core | |
parent | 06c7c1bff3705fd5e8c8c0bb20a89bbd54d95bb8 (diff) | |
download | chrome-ec-869f0477a16c7a41fb3e6128cf8c852cee0dd59a.tar.gz |
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 <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1475092
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/cortex-m/cpu.h | 5 |
1 files changed, 5 insertions, 0 deletions
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 */ |