soc/intel/common/cse_lite: Allow specific operation prior to update

Some boards may want to perform a specific operation before the CSE FW
update final operation begins. For instance, on Brya this new callback
can be used to inform the end-user that an update is in progress.

BUG=b:264648959
BRANCH=firmware-brya-14505.B
TEST=Compilation success

Change-Id: Ia4d32a71f3ae61d2e24197fee6b458512f7778a9
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72097
Reviewed-by: Tarun Tuli <taruntuli@google.com>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Bora Guvendik <bora.guvendik@intel.com>
Reviewed-by: Anil Kumar K <anil.kumar.k@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c
index 8f4afae..9866d55 100644
--- a/src/soc/intel/common/block/cse/cse_lite.c
+++ b/src/soc/intel/common/block/cse/cse_lite.c
@@ -378,6 +378,11 @@
 	/* Default weak implementation, does nothing. */
 }
 
+__weak void cse_fw_update_misc_oper(void)
+{
+	/* Default weak implementation, does nothing. */
+}
+
 /* Set the CSE's next boot partition and issues system reset */
 static enum cb_err cse_set_and_boot_from_next_bp(enum boot_partition_id bp)
 {
@@ -784,6 +789,7 @@
 		goto error_exit;
 	}
 
+	cse_fw_update_misc_oper();
 	rv = cse_update_rw(cse_bp_info, cse_cbfs_rw, size, target_rdev);
 
 error_exit:
diff --git a/src/soc/intel/common/block/include/intelblocks/cse.h b/src/soc/intel/common/block/include/intelblocks/cse.h
index 422f69c..b031aa3 100644
--- a/src/soc/intel/common/block/include/intelblocks/cse.h
+++ b/src/soc/intel/common/block/include/intelblocks/cse.h
@@ -500,6 +500,9 @@
 /* Perform a board-specific reset sequence for CSE RO<->RW jump */
 void cse_board_reset(void);
 
+/* Perform a misc operation before CSE firmware update. */
+void cse_fw_update_misc_oper(void);
+
 /* Trigger vboot recovery mode on a CSE error */
 void cse_trigger_vboot_recovery(enum csme_failure_reason reason);