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 <sjg@chromium.org>
(cherry picked from commit 6995f2c8be)
This commit is contained in:
Simon Glass
2025-12-21 06:01:44 -07:00
parent e010443b06
commit b64009e9a6
6 changed files with 64 additions and 3 deletions

View File

@@ -829,10 +829,14 @@ static int initf_dm(void)
bootstage_start(BOOTSTAGE_ID_ACCUM_DM_F, "dm_f");
ret = dm_init_and_scan(true);
bootstage_accum(BOOTSTAGE_ID_ACCUM_DM_F);
if (ret)
return ret;
ret = dm_autoprobe();
if (ret)
return ret;
bootstage_accum(BOOTSTAGE_ID_ACCUM_DM_F);
if (IS_ENABLED(CONFIG_TIMER_EARLY)) {
ret = dm_timer_init();
if (ret)