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 --- include/dm/root.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/dm') diff --git a/include/dm/root.h b/include/dm/root.h index 5651b868c8b..286bd9a2ddd 100644 --- a/include/dm/root.h +++ b/include/dm/root.h @@ -136,6 +136,21 @@ int dm_scan_other(bool pre_reloc_only); */ int dm_init_and_scan(bool pre_reloc_only); +/** + * dm_autoprobe() - Probe devices which are marked for probe-after-bind + * + * This probes all devices with a DM_FLAG_PROBE_AFTER_BIND flag. It checks the + * entire tree, so parent nodes need not have the flag set. + * + * It recursively probes parent nodes, so they do not need to have the flag + * set themselves. Since parents are always probed before children, if a child + * has the flag set, then its parent (and any devices up the chain to the root + * device) will be probed too. + * + * Return: 0 if OK, -ve on error + */ +int dm_autoprobe(void); + /** * dm_init() - Initialise Driver Model structures * -- cgit v1.2.3