summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/intel/common/block/cse/cse_lite.c13
-rw-r--r--src/soc/intel/common/block/include/intelblocks/cse.h7
2 files changed, 20 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c
index c5f0560d2a..09281ab150 100644
--- a/src/soc/intel/common/block/cse/cse_lite.c
+++ b/src/soc/intel/common/block/cse/cse_lite.c
@@ -1071,6 +1071,19 @@ bool is_cse_fw_update_required(void)
return !!cse_compare_sub_part_version(&cbfs_rw_version, cse_get_rw_version());
}
+bool is_cse_boot_to_rw(void)
+{
+ if (cse_get_bp_info() != CB_SUCCESS) {
+ printk(BIOS_ERR, "cse_lite: Failed to get CSE boot partition info\n");
+ return false;
+ }
+
+ if (cse_get_current_bp() == RW)
+ return true;
+
+ return false;
+}
+
static uint8_t cse_fw_update(void)
{
struct region_device target_rdev;
diff --git a/src/soc/intel/common/block/include/intelblocks/cse.h b/src/soc/intel/common/block/include/intelblocks/cse.h
index 552eb7b2d4..c97e4ec65c 100644
--- a/src/soc/intel/common/block/include/intelblocks/cse.h
+++ b/src/soc/intel/common/block/include/intelblocks/cse.h
@@ -611,4 +611,11 @@ void cse_fill_bp_info(void);
* Returns true if an update is required, false otherwise
*/
bool is_cse_fw_update_required(void);
+
+/*
+ * Check if the CSE firmware is booting from RW slot.
+ * Returns true if CSE is booting from RW slot, false otherwise
+ */
+bool is_cse_boot_to_rw(void);
+
#endif // SOC_INTEL_COMMON_CSE_H