diff options
author | David Milosevic <David.Milosevic@9elements.com> | 2023-11-16 21:29:09 +0100 |
---|---|---|
committer | Lean Sheng Tan <sheng.tan@9elements.com> | 2024-04-24 18:21:07 +0000 |
commit | 6ad7513e03952c32650988d2a825f4f1661d5ee9 (patch) | |
tree | 95caf958dab38f03fc50f89670c22c19383dbd33 /src/arch/arm64/include | |
parent | 75dd80649925a5a30486a40068b7bb287c07b167 (diff) |
arch/arm64: Extend cache helper functions
This patch extends the cpu_get_cache_info function, so that
additional information like size of cache lines can be retrieved.
Patch was tested against the qemu-sbsa mainboard.
Change-Id: If6fe731dc67ffeaff9344d2bd2627f45185c27de
Signed-off-by: David Milosevic <David.Milosevic@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79106
Reviewed-by: Benjamin Doron <benjamin.doron00@gmail.com>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/arch/arm64/include')
-rw-r--r-- | src/arch/arm64/include/armv8/arch/cache.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/arch/arm64/include/armv8/arch/cache.h b/src/arch/arm64/include/armv8/arch/cache.h index 5097196308..da6edfdcb7 100644 --- a/src/arch/arm64/include/armv8/arch/cache.h +++ b/src/arch/arm64/include/armv8/arch/cache.h @@ -31,8 +31,16 @@ enum cache_type { CACHE_UNIFIED = 4, }; +struct cache_info { + uint64_t size; // total size of cache in bytes + uint64_t associativity; // number of cache lines in a set + uint64_t numsets; // number of sets in a cache + uint8_t line_bytes; // size of cache line in bytes +}; + enum cache_type cpu_get_cache_type(enum cache_level level); -void cpu_get_cache_info(enum cache_level level, enum cache_type, size_t *cache_size, size_t *assoc); +enum cb_err cpu_get_cache_info(const enum cache_level level, const enum cache_type type, + struct cache_info *info); /* dcache clean by virtual address to PoC */ void dcache_clean_by_mva(void const *addr, size_t len); |