Subrata Banik submitted this change.

View Change

Approvals: Eric Lai: Looks good to me, approved build bot (Jenkins): Verified
soc/intel/meteorlake: Use common CAR API for cache reporting

Replace the SoC-specific `report_cache_info()` function with the
common `car_report_cache_info()` API from `car_lib`. This promotes code
reuse and reduces SoC-specific implementation for cache reporting.

BUG=none
TEST=Builds and boots successfully on google/rex platform.

Change-Id: Id5ffcab54232294ffa101f975d0ec51ac63f1910
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83482
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
---
M src/soc/intel/meteorlake/bootblock/report_platform.c
1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/src/soc/intel/meteorlake/bootblock/report_platform.c b/src/soc/intel/meteorlake/bootblock/report_platform.c
index bc8ae92..4056989 100644
--- a/src/soc/intel/meteorlake/bootblock/report_platform.c
+++ b/src/soc/intel/meteorlake/bootblock/report_platform.c
@@ -10,6 +10,7 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
+#include <intelblocks/car_lib.h>
#include <soc/bootblock.h>
#include <soc/pci_devs.h>

@@ -71,21 +72,6 @@
return pci_read_config16(dev, PCI_DEVICE_ID);
}

-static void report_cache_info(void)
-{
- int cache_level = CACHE_L3;
- struct cpu_cache_info info;
-
- if (!fill_cpu_cache_info(cache_level, &info))
- return;
-
- printk(BIOS_INFO, "Cache: Level %d: ", cache_level);
- printk(BIOS_INFO, "Associativity = %zd Partitions = %zd Line Size = %zd Sets = %zd\n",
- info.num_ways, info.physical_partitions, info.line_size, info.num_sets);
-
- printk(BIOS_INFO, "Cache size = %zu MiB\n", get_cache_size(&info)/MiB);
-}
-
static void report_cpu_info(void)
{
u32 i, cpu_id, cpu_feature_flag;
@@ -117,7 +103,7 @@
"CPU: AES %ssupported, TXT %ssupported, VT %ssupported\n",
mode[aes], mode[txt], mode[vt]);

- report_cache_info();
+ car_report_cache_info();
}

static void report_mch_info(void)

To view, visit change 83482. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Id5ffcab54232294ffa101f975d0ec51ac63f1910
Gerrit-Change-Number: 83482
Gerrit-PatchSet: 2
Gerrit-Owner: Subrata Banik <subratabanik@google.com>
Gerrit-Reviewer: Dinesh Gehlot <digehlot@google.com>
Gerrit-Reviewer: Eran Mitrani <mitrani@google.com>
Gerrit-Reviewer: Eric Lai <ericllai@google.com>
Gerrit-Reviewer: Jakub Czapiga <czapiga@google.com>
Gerrit-Reviewer: Kapil Porwal <kapilporwal@google.com>
Gerrit-Reviewer: Subrata Banik <subratabanik@google.com>
Gerrit-Reviewer: Tarun <tstuli@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>