diff options
author | Simon Glass <sjg@chromium.org> | 2024-11-20 08:36:41 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-01-14 11:42:51 -0600 |
commit | 6995f2c8be901b5f3f4183ccc4a58c209e8bce52 (patch) | |
tree | 92f8addda6ee3a888101a736c1fb7c5e5d5f719c /common | |
parent | 21dd873572a01d74bfdfceb7a30b056f8ccba187 (diff) |
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>
Diffstat (limited to 'common')
-rw-r--r-- | common/board_f.c | 4 | ||||
-rw-r--r-- | common/board_r.c | 2 | ||||
-rw-r--r-- | common/spl/spl.c | 4 |
3 files changed, 9 insertions, 1 deletions
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) diff --git a/common/board_r.c b/common/board_r.c index f63c6aed4d5..179259b00de 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -250,7 +250,7 @@ static int initr_dm(void) if (ret) return ret; - return 0; + return dm_autoprobe(); } #endif diff --git a/common/spl/spl.c b/common/spl/spl.c index ad31a2f8b6c..02269fff93c 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -500,6 +500,10 @@ static int spl_common_init(bool setup_malloc) debug("dm_init_and_scan() returned error %d\n", ret); return ret; } + + ret = dm_autoprobe(); + if (ret) + return ret; } return 0; |