diff options
author | Benjamin Doron <benjamin.doron@9elements.com> | 2023-06-14 18:12:43 -0400 |
---|---|---|
committer | Shelley Chen <shchen@google.com> | 2023-10-25 22:21:58 +0000 |
commit | 1087a17edc4d1b02e57ddd4fcaf7c5fade174c79 (patch) | |
tree | 7bceeb0ce5740a35d186bc47bc5942f8963c9563 /src/arch/arm64/include | |
parent | 6f66ca82de79b3b5c143332c1b9dbf06df0e303d (diff) |
arch/arm64/cache: Implement helpers to obtain CPU cache details
This is required for compliant ACPI/SMBIOS implementations on AArch64,
and can optionally be displayed to the user.
Change-Id: I7022fc3c0035208bc3fdc716fc33f6b78d8e74fc
Signed-off-by: Benjamin Doron <benjamin.doron@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78042
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Diffstat (limited to 'src/arch/arm64/include')
-rw-r--r-- | src/arch/arm64/include/armv8/arch/cache.h | 21 | ||||
-rw-r--r-- | src/arch/arm64/include/armv8/arch/lib_helpers.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/arch/arm64/include/armv8/arch/cache.h b/src/arch/arm64/include/armv8/arch/cache.h index bb9d6febec..3a72d40c7a 100644 --- a/src/arch/arm64/include/armv8/arch/cache.h +++ b/src/arch/arm64/include/armv8/arch/cache.h @@ -13,6 +13,27 @@ #include <stddef.h> #include <arch/barrier.h> +enum cache_level { + CACHE_L1 = 1, + CACHE_L2 = 2, + CACHE_L3 = 3, + CACHE_L4 = 4, + CACHE_L5 = 5, + CACHE_L6 = 6, + CACHE_L7 = 7, +}; + +enum cache_type { + NO_CACHE = 0, + CACHE_INSTRUCTION = 1, + CACHE_DATA = 2, + CACHE_SEPARATE = 3, + CACHE_UNIFIED = 4, +}; + +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); + /* dcache clean by virtual address to PoC */ void dcache_clean_by_mva(void const *addr, size_t len); diff --git a/src/arch/arm64/include/armv8/arch/lib_helpers.h b/src/arch/arm64/include/armv8/arch/lib_helpers.h index 4b3730f48b..ff3459a91e 100644 --- a/src/arch/arm64/include/armv8/arch/lib_helpers.h +++ b/src/arch/arm64/include/armv8/arch/lib_helpers.h @@ -162,6 +162,7 @@ MAKE_REGISTER_ACCESSORS(hacr_el2) MAKE_REGISTER_ACCESSORS(hcr_el2) MAKE_REGISTER_ACCESSORS(hpfar_el2) MAKE_REGISTER_ACCESSORS(hstr_el2) +MAKE_REGISTER_ACCESSORS(id_aa64mmfr2_el1) MAKE_REGISTER_ACCESSORS(isr_el1) MAKE_REGISTER_ACCESSORS_EL123(mair) MAKE_REGISTER_ACCESSORS_EL123(mdcr) |