summaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-03-10 18:12:27 -0600
committerTom Rini <[email protected]>2025-03-10 20:18:51 -0600
commit1b42f57ec82ceba4d5f08cfb359717232301cfa5 (patch)
tree31d06c51e893855c3f52c0aa9bc9330b17376374 /drivers/core
parent124b75644cf4a9b381746f6deed1472e7915b9f1 (diff)
parenta383b9bd4d7e430fe7c254297540bae596649dba (diff)
Merge tag 'v2025.04-rc4' into next
This uses Heinrich's merge of lib/efi_loader/efi_net.c which results in no changes.
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/root.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 15b8c83fee9..e53381e3b32 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -295,22 +295,29 @@ void *dm_priv_to_rw(void *priv)
* all its children recursively to do the same.
*
* @dev: Device to (maybe) probe
+ * @pre_reloc_only: Probe only devices marked with the DM_FLAG_PRE_RELOC flag
* Return 0 if OK, -ve on error
*/
-static int dm_probe_devices(struct udevice *dev)
+static int dm_probe_devices(struct udevice *dev, bool pre_reloc_only)
{
+ ofnode node = dev_ofnode(dev);
struct udevice *child;
+ int ret;
- if (dev_get_flags(dev) & DM_FLAG_PROBE_AFTER_BIND) {
- int ret;
+ if (pre_reloc_only &&
+ (!ofnode_valid(node) || !ofnode_pre_reloc(node)) &&
+ !(dev->driver->flags & DM_FLAG_PRE_RELOC))
+ goto probe_children;
+ if (dev_get_flags(dev) & DM_FLAG_PROBE_AFTER_BIND) {
ret = device_probe(dev);
if (ret)
return ret;
}
+probe_children:
list_for_each_entry(child, &dev->child_head, sibling_node)
- dm_probe_devices(child);
+ dm_probe_devices(child, pre_reloc_only);
return 0;
}
@@ -319,7 +326,7 @@ int dm_autoprobe(void)
{
int ret;
- ret = dm_probe_devices(gd->dm_root);
+ ret = dm_probe_devices(gd->dm_root, !(gd->flags & GD_FLG_RELOC));
if (ret)
return log_msg_ret("pro", ret);