From 70c79dc88f9678653919c1d1545817876f1c0802 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 20 Nov 2024 08:36:39 -0700 Subject: common: Drop check for DM in initf_dm() This is enabled by all boards, so drop the condition. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- common/board_f.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/board_f.c') diff --git a/common/board_f.c b/common/board_f.c index 54c48d42ee9..d2c24d418fb 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -815,9 +815,11 @@ static int initf_bootstage(void) static int initf_dm(void) { -#if defined(CONFIG_DM) && CONFIG_IS_ENABLED(SYS_MALLOC_F) int ret; + if (!CONFIG_IS_ENABLED(SYS_MALLOC_F)) + return 0; + bootstage_start(BOOTSTAGE_ID_ACCUM_DM_F, "dm_f"); ret = dm_init_and_scan(true); bootstage_accum(BOOTSTAGE_ID_ACCUM_DM_F); @@ -829,7 +831,6 @@ static int initf_dm(void) if (ret) return ret; } -#endif return 0; } -- cgit v1.2.3 From 6995f2c8be901b5f3f4183ccc4a58c209e8bce52 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 20 Nov 2024 08:36:41 -0700 Subject: common: Move autoprobe out to board init Rather than doing autoprobe within the driver model code, move it out to the board-init code. This makes it clear that it is a separate step from binding devices. For now this is always done twice, before and after relocation, but we should discuss whether it might be possible to drop the post-relocation probe. For boards with SPL, the autoprobe is still done there as well. Note that with this change, autoprobe happens after the EVT_DM_POST_INIT_R/F events are sent, rather than before. Link: https://lore.kernel.org/u-boot/20240626235717.272219-1-marex@denx.de/ Signed-off-by: Simon Glass --- common/board_f.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'common/board_f.c') diff --git a/common/board_f.c b/common/board_f.c index d2c24d418fb..6c5c3bfab48 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -826,6 +826,10 @@ static int initf_dm(void) if (ret) return ret; + ret = dm_autoprobe(); + if (ret) + return ret; + if (IS_ENABLED(CONFIG_TIMER_EARLY)) { ret = dm_timer_init(); if (ret) -- cgit v1.2.3