]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: event: add EVT_DM_POST_INIT_R event type
authorChanho Park <chanho61.park@samsung.com>
Fri, 18 Aug 2023 05:11:02 +0000 (14:11 +0900)
committerSimon Glass <sjg@chromium.org>
Tue, 22 Aug 2023 14:07:43 +0000 (08:07 -0600)
This patch introduces EVT_DM_POST_INIT_R event type for handling hooks
after relocation.

Fixes: 55171aedda88 ("dm: Emit the arch_cpu_init_dm() even only before relocation")
Suggested-by: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Tested-by: Milan P. Stanić <mps@arvanta.net>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Roland Ruckerbauer <mail@ruabmbua.dev>
Tested-by: Roland Ruckerbauer <mail@ruabmbua.dev>
Fixed missing event name in event.c:
Signed-off-by: Simon Glass <sjg@chromium.org>
common/event.c
drivers/core/root.c
include/event.h

index 3224e2812224da85b0b61c0f3d758e4427bfe577..6653300e6cf48db043f41064c71bc6539cd5cec9 100644 (file)
@@ -28,6 +28,7 @@ const char *const type_name[] = {
 
        /* Events related to driver model */
        "dm_post_init_f",
+       "dm_post_init_r",
        "dm_pre_probe",
        "dm_post_probe",
        "dm_pre_remove",
index 6775fb0b65755e6df564c63797442591fdfb860b..79d871ab291aece7dcbf234bfa8ab194d4e0dcf3 100644 (file)
@@ -436,8 +436,10 @@ int dm_init_and_scan(bool pre_reloc_only)
                        return ret;
                }
        }
-       if (CONFIG_IS_ENABLED(DM_EVENT) && !(gd->flags & GD_FLG_RELOC)) {
-               ret = event_notify_null(EVT_DM_POST_INIT_F);
+       if (CONFIG_IS_ENABLED(DM_EVENT)) {
+               ret = event_notify_null(gd->flags & GD_FLG_RELOC ?
+                                       EVT_DM_POST_INIT_R :
+                                       EVT_DM_POST_INIT_F);
                if (ret)
                        return log_msg_ret("ev", ret);
        }
index daf44bf8a83b2ec2edcee981c23bed16df78df5d..bb38ba98e73bb685561ec79d1f60126f6b387916 100644 (file)
@@ -24,6 +24,7 @@ enum event_t {
 
        /* Events related to driver model */
        EVT_DM_POST_INIT_F,
+       EVT_DM_POST_INIT_R,
        EVT_DM_PRE_PROBE,
        EVT_DM_POST_PROBE,
        EVT_DM_PRE_REMOVE,