From 5214c4091f2c747616873f37c086dbd57387f6a0 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Thu, 24 Nov 2022 20:43:37 +0530 Subject: =?UTF-8?q?soc/intel/cmn/cse:=20Send=20EOP=20cmd=20from=C2=A0.fina?= =?UTF-8?q?l=20aka=20`cse=5Ffinal()`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch refactors common code to allow cse_final() function to send EOP cmd if the SoC user selects `SOC_INTEL_CSE_SET_EOP` kconfig. This patch helps cse_final_ready_to_boot() and cse_final_end_of_firmware() function for being meaningful with its operation and let cse_final() being that outer layer to perform three operations based on the selected kconfig. 1. send cse eop command 2. perform cse_final_ready_to_boot() operations 3. perform cse_final_end_of_firmware() operations Additionally, ensures the platform that choose to send EOP late (like JSL and TGL) is not being impacted due to this code refactoring hence, skip calling into CSE.final if SoC selects `SOC_INTEL_CSE_SEND_EOP_LATE` config. BUG=b:260041679 TEST=Able to send EOP command successfully for Google/Taeko. Signed-off-by: Subrata Banik Change-Id: I412291c9378011509d3825f9b01e81bfced53303 Reviewed-on: https://review.coreboot.org/c/coreboot/+/69975 Reviewed-by: Kapil Porwal Reviewed-by: Lean Sheng Tan Tested-by: build bot (Jenkins) --- src/soc/intel/common/block/cse/cse.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/soc') diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c index 2cb3452a89..9b8db54efd 100644 --- a/src/soc/intel/common/block/cse/cse.c +++ b/src/soc/intel/common/block/cse/cse.c @@ -1228,17 +1228,13 @@ static void cse_set_state(struct device *dev) * performed by FSP NotifyPhase(Ready To Boot) API invocations. * * Operations are: - * 1. Send EOP to CSE if not done. - * 2. Perform global reset lock. - * 3. Put HECI1 to D0i3 and disable the HECI1 if the user selects + * 1. Perform global reset lock. + * 2. Put HECI1 to D0i3 and disable the HECI1 if the user selects * DISABLE_HECI1_AT_PRE_BOOT config or CSE HFSTS1 Operation Mode is * `Software Temporary Disable`. */ static void cse_final_ready_to_boot(void) { - if (CONFIG(SOC_INTEL_CSE_SET_EOP)) - cse_send_end_of_post(); - cse_control_global_reset_lock(); if (CONFIG(DISABLE_HECI1_AT_PRE_BOOT) || cse_is_hfs1_com_soft_temp_disable()) { @@ -1265,6 +1261,14 @@ static void cse_final_end_of_firmware(void) */ static void cse_final(struct device *dev) { + /* SoC user decided to send EOP late */ + if (CONFIG(SOC_INTEL_CSE_SEND_EOP_LATE)) + return; + + /* 1. Send EOP to CSE if not done.*/ + if (CONFIG(SOC_INTEL_CSE_SET_EOP)) + cse_send_end_of_post(); + if (!CONFIG(USE_FSP_NOTIFY_PHASE_READY_TO_BOOT)) cse_final_ready_to_boot(); -- cgit v1.2.3