mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-11 07:24:46 +00:00
Revert "dm: core: Simplify dm_probe_devices()"
Unfortunately this change was not safe as some devices are bound before
relocation, but we don't want to probe them.
It causes 'raise: Signal # 8 caught' on jerry.
Move the bootstage timer to after autoprobe in initf_dm() since the
trace test does not tolerate any variance.
This reverts commit 21dd873572
.
Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
4164289db8
commit
cd48a21dbd
2 changed files with 13 additions and 6 deletions
|
@ -822,13 +822,13 @@ static int initf_dm(void)
|
||||||
|
|
||||||
bootstage_start(BOOTSTAGE_ID_ACCUM_DM_F, "dm_f");
|
bootstage_start(BOOTSTAGE_ID_ACCUM_DM_F, "dm_f");
|
||||||
ret = dm_init_and_scan(true);
|
ret = dm_init_and_scan(true);
|
||||||
bootstage_accum(BOOTSTAGE_ID_ACCUM_DM_F);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = dm_autoprobe();
|
ret = dm_autoprobe();
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
bootstage_accum(BOOTSTAGE_ID_ACCUM_DM_F);
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_TIMER_EARLY)) {
|
if (IS_ENABLED(CONFIG_TIMER_EARLY)) {
|
||||||
ret = dm_timer_init();
|
ret = dm_timer_init();
|
||||||
|
|
|
@ -295,22 +295,29 @@ void *dm_priv_to_rw(void *priv)
|
||||||
* all its children recursively to do the same.
|
* all its children recursively to do the same.
|
||||||
*
|
*
|
||||||
* @dev: Device to (maybe) probe
|
* @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
|
* 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;
|
struct udevice *child;
|
||||||
|
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) {
|
if (dev_get_flags(dev) & DM_FLAG_PROBE_AFTER_BIND) {
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = device_probe(dev);
|
ret = device_probe(dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
probe_children:
|
||||||
list_for_each_entry(child, &dev->child_head, sibling_node)
|
list_for_each_entry(child, &dev->child_head, sibling_node)
|
||||||
dm_probe_devices(child);
|
dm_probe_devices(child, pre_reloc_only);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -319,7 +326,7 @@ int dm_autoprobe(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = dm_probe_devices(gd->dm_root);
|
ret = dm_probe_devices(gd->dm_root, !(gd->flags & GD_FLG_RELOC));
|
||||||
if (ret)
|
if (ret)
|
||||||
return log_msg_ret("pro", ret);
|
return log_msg_ret("pro", ret);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue