diff mbox series

[v4,2/4] event: add new EVT_SETTINGS_R event

Message ID 20231009144151.773721-3-artur@conclusive.pl
State Superseded
Delegated to: Eugen Hristev
Headers show
Series Conclusive KSTR-SAMA5D27 support | expand

Commit Message

Artur Rojek Oct. 9, 2023, 2:41 p.m. UTC
Introduce EVT_SETTINGS_R, triggered post-relocation and before console
init.

This event gives an option to perform any platform-dependent setup,
which needs to take place before show_board_info(). Usage examples
include readout of EEPROM stored settings.

Signed-off-by: Artur Rojek <artur@conclusive.pl>
---

v4: new patch

 common/board_r.c | 1 +
 common/event.c   | 1 +
 include/event.h  | 9 +++++++++
 3 files changed, 11 insertions(+)

Comments

Simon Glass Oct. 9, 2023, 5:57 p.m. UTC | #1
On Mon, 9 Oct 2023 at 08:42, Artur Rojek <artur@conclusive.pl> wrote:
>
> Introduce EVT_SETTINGS_R, triggered post-relocation and before console
> init.
>
> This event gives an option to perform any platform-dependent setup,
> which needs to take place before show_board_info(). Usage examples
> include readout of EEPROM stored settings.
>
> Signed-off-by: Artur Rojek <artur@conclusive.pl>
> ---
>
> v4: new patch
>
>  common/board_r.c | 1 +
>  common/event.c   | 1 +
>  include/event.h  | 9 +++++++++
>  3 files changed, 11 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/common/board_r.c b/common/board_r.c
index 52786901be55..a7967849dc0c 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -693,6 +693,7 @@  static init_fnc_t init_sequence_r[] = {
 #if defined(CONFIG_ID_EEPROM)
 	mac_read_from_eeprom,
 #endif
+	INITCALL_EVENT(EVT_SETTINGS_R),
 	INIT_FUNC_WATCHDOG_RESET
 #if defined(CONFIG_PCI_INIT_R) && !defined(CONFIG_SYS_EARLY_PCI_INIT)
 	/*
diff --git a/common/event.c b/common/event.c
index 3080d9ed754d..dc61b9672f32 100644
--- a/common/event.c
+++ b/common/event.c
@@ -37,6 +37,7 @@  const char *const type_name[] = {
 	/* init hooks */
 	"misc_init_f",
 	"fsp_init_r",
+	"settings_r",
 	"last_stage_init",
 
 	/* Fpga load hook */
diff --git a/include/event.h b/include/event.h
index be4cefd6ae8a..a60a64718e01 100644
--- a/include/event.h
+++ b/include/event.h
@@ -104,6 +104,15 @@  enum event_t {
 	 */
 	EVT_FSP_INIT_F,
 
+	/**
+	 * @EVT_SETTINGS_R:
+	 * This event is triggered post-relocation and before console init.
+	 * This gives an option to perform any platform-dependent setup, which
+	 * needs to take place before show_board_info() (e.g. readout of EEPROM
+	 * stored settings).
+	 */
+	EVT_SETTINGS_R,
+
 	/**
 	 * @EVT_LAST_STAGE_INIT:
 	 * This event is triggered just before jumping to the main loop.