aboutsummaryrefslogtreecommitdiff
path: root/board/CZ.NIC/turris_mox
diff options
context:
space:
mode:
authorSimon Glass2023-08-21 21:17:01 -0600
committerTom Rini2023-08-31 13:16:55 -0400
commit91caa3bb89b112a1421ee2ee3661baf67c64bab9 (patch)
treef70b4d2452f8ca45025916cd85f0d1af684902bb /board/CZ.NIC/turris_mox
parent6a32bfae61652f9dae621410ca6e094f374a1f11 (diff)
event: Use an event to replace last_stage_init()
Add a new event which handles this function. Convert existing use of the function to use the new event instead. Make sure that EVENT is enabled by affected boards, by selecting it from the LAST_STAGE_INIT option. For x86, enable it by default since all boards need it. For controlcenterdc, inline the get_tpm() function and make sure the event is not built in SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board/CZ.NIC/turris_mox')
-rw-r--r--board/CZ.NIC/turris_mox/turris_mox.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/board/CZ.NIC/turris_mox/turris_mox.c b/board/CZ.NIC/turris_mox/turris_mox.c
index a52a032e4d5..370c2668b08 100644
--- a/board/CZ.NIC/turris_mox/turris_mox.c
+++ b/board/CZ.NIC/turris_mox/turris_mox.c
@@ -15,6 +15,7 @@
#include <dm.h>
#include <dm/of_extra.h>
#include <env.h>
+#include <event.h>
#include <fdt_support.h>
#include <init.h>
#include <led.h>
@@ -667,7 +668,7 @@ err:
return NULL;
}
-int last_stage_init(void)
+static int last_stage_init(void)
{
struct gpio_desc reset_gpio = {};
@@ -712,6 +713,7 @@ handle_reset_btn:
return 0;
}
+EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
#if defined(CONFIG_OF_BOARD_SETUP)