summaryrefslogtreecommitdiff
path: root/src/soc/intel
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2022-04-19 10:03:56 +0200
committerFelix Held <felix-coreboot@felixheld.de>2022-04-21 13:05:44 +0000
commit28315f82040339c94941e17fcbe64c939e3a5994 (patch)
tree2fd965bed69e4efa875db1ccf2bec0215b30ac89 /src/soc/intel
parent37d93dc4883b738ed54804d0e030b05cec8ab8d5 (diff)
soc/intel/common/block/cse: Simplify CSE final ops
Looks like the `notify_data` struct array idea comes from the FSP 2.0 notify driver, which has a similar struct but with several additional fields. However, there's no need for this mechanism in the CSE driver because the struct only contains a condition (boolean) and a function to execute, which can be expressed as a regular if-block. Change-Id: I65fcb2fc02ea16b37c764f1fd69bdff3382fad18 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63708 Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel')
-rw-r--r--src/soc/intel/common/block/cse/cse.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c
index 2444ceefb0..64fd0412e2 100644
--- a/src/soc/intel/common/block/cse/cse.c
+++ b/src/soc/intel/common/block/cse/cse.c
@@ -1195,11 +1195,6 @@ static void cse_set_state(struct device *dev)
me_reset_with_count();
}
-struct cse_notify_phase_data {
- bool skip;
- void (*notify_func)(void);
-};
-
/*
* `cse_final_ready_to_boot` function is native implementation of equivalent events
* performed by FSP NotifyPhase(Ready To Boot) API invocations.
@@ -1235,27 +1230,17 @@ static void cse_final_end_of_firmware(void)
heci_set_to_d0i3();
}
-static const struct cse_notify_phase_data notify_data[] = {
- {
- .skip = CONFIG(USE_FSP_NOTIFY_PHASE_READY_TO_BOOT),
- .notify_func = cse_final_ready_to_boot,
- },
- {
- .skip = CONFIG(USE_FSP_NOTIFY_PHASE_END_OF_FIRMWARE),
- .notify_func = cse_final_end_of_firmware,
- },
-};
-
/*
* `cse_final` function is native implementation of equivalent events performed by
* each FSP NotifyPhase() API invocations.
*/
static void cse_final(struct device *dev)
{
- for (size_t i = 0; i < ARRAY_SIZE(notify_data); i++) {
- if (!notify_data[i].skip)
- notify_data[i].notify_func();
- }
+ if (!CONFIG(USE_FSP_NOTIFY_PHASE_READY_TO_BOOT))
+ cse_final_ready_to_boot();
+
+ if (!CONFIG(USE_FSP_NOTIFY_PHASE_END_OF_FIRMWARE))
+ cse_final_end_of_firmware();
}
static struct device_operations cse_ops = {