Kapil Porwal has uploaded this change for review.

View Change

soc/intel/meteorlake: Log CSE RO write protection info for MTL

The patch logs CSE RO's write protection information for Alder Lake
platform. As part of write protection information, coreboot logs status
on CSE RO write protection and range. Also, logs error message if EOM
is disabled, and write protection for CSE RO is not enabled.

Port of commit abe0d81 (soc/intel/alderlake: Log CSE RO write protection info for ADL)

BUG=none
TEST=Verify the write protection details on google/rex.

Excerpt from google/rex coreboot log:
[DEBUG] ME: WP for RO is enabled : YES
[DEBUG] ME: RO write protection scope - Start=0x4000, End=0x396FFF

Signed-off-by: Kapil Porwal <kapilporwal@google.com>
Change-Id: Idb072a873a8b8323532799f5fc64f995c9f0a604
---
M src/soc/intel/meteorlake/me.c
1 file changed, 47 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/69571/1
diff --git a/src/soc/intel/meteorlake/me.c b/src/soc/intel/meteorlake/me.c
index ea94902..31b09da 100644
--- a/src/soc/intel/meteorlake/me.c
+++ b/src/soc/intel/meteorlake/me.c
@@ -2,6 +2,7 @@

#include <bootstate.h>
#include <intelblocks/cse.h>
+#include <intelblocks/spi.h>
#include <console/console.h>
#include <soc/me.h>
#include <stdint.h>
@@ -90,6 +91,25 @@
} __packed fields;
};

+static void log_me_ro_write_protection_info(bool mfg_mode)
+{
+ bool cse_ro_wp_en = is_spi_wp_cse_ro_en();
+
+ printk(BIOS_DEBUG, "ME: WP for RO is enabled : %s\n",
+ cse_ro_wp_en ? "YES" : "NO");
+
+ if (cse_ro_wp_en) {
+ uint32_t base, limit;
+ spi_get_wp_cse_ro_range(&base, &limit);
+ printk(BIOS_DEBUG, "ME: RO write protection scope - Start=0x%X, End=0x%X\n",
+ base, limit);
+ }
+
+ /* If EOM is disabled, but CSE RO is not write protected, log error */
+ if (!mfg_mode && !cse_ro_wp_en)
+ printk(BIOS_ERR, "ME: Write protection for CSE RO is not enabled\n");
+}
+
static void dump_me_status(void *unused)
{
union me_hfsts1 hfsts1;
@@ -161,6 +181,9 @@
hfsts6.fields.cpu_debug_disable ? "YES" : "NO");
printk(BIOS_DEBUG, "ME: TXT Support : %s\n",
hfsts6.fields.txt_support ? "YES" : "NO");
+
+ if (CONFIG(SOC_INTEL_CSE_LITE_SKU))
+ log_me_ro_write_protection_info(!!hfsts1.fields.mfg_mode);
}

BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_EXIT, print_me_fw_version, NULL);

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Idb072a873a8b8323532799f5fc64f995c9f0a604
Gerrit-Change-Number: 69571
Gerrit-PatchSet: 1
Gerrit-Owner: Kapil Porwal <kapilporwal@google.com>
Gerrit-MessageType: newchange