Debian Codegraph @

src/soc/intel/common/block/cpu/car/car_lib.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <arch/cpu.h>
4 #include <console/console.h>
5 #include <intelblocks/car_lib.h>
6
7 /*
8 * Gathers and prints information about the CPU's L3 cache.
9 *
10 * This function does the following:
11 * 1. Sets the cache level of interest to L3.
12 * 2. Prints the following cache details to the console:
13 * - Cache level
14 * - Associativity (number of ways)
15 * - Number of physical partitions
16 * - Line size (in bytes)
17 * - Number of sets
18 * - Total cache size (in MiB), calculated using the 'get_cache_size' function.
19 */
20 void car_report_cache_info(void)
21 {
22 int cache_level = CACHE_L3;
23 struct cpu_cache_info info;
24
25 if (!fill_cpu_cache_info(cache_level, &info))
26 return;
27
28 printk(BIOS_INFO, "Cache: Level %d: ", cache_level);
29 printk(BIOS_INFO, "Associativity = %zd Partitions = %zd Line Size = %zd Sets = %zd\n",
30 info.num_ways, info.physical_partitions, info.line_size, info.num_sets);
31
32 printk(BIOS_INFO, "Cache size = %zu MiB\n", get_cache_size(&info)/MiB);
33 }