mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-22 04:44:46 +00:00
clk: at91: compat: partially revert "dm: Remove uses of device_bind_offset()"
Revert changes in at91 compat.c that cause u-boot to fail booting on
sama5d4_xplained and sama5d2_xplained
Log below:
<debug_uart>
No serial driver found
Could not initialize timer (err -19)
Could not initialize timer (err -19)
Could not initialize timer (err -19)
Could not initialize timer (err -19)
Could not initialize timer (err -19)
Could not initialize timer (err -19)
Could not initialize timer (err -19)
Could not initialize timer (err -19)
Fixes: a2703ce10c
("dm: Remove uses of device_bind_offset()")
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
5dc68b07e7
commit
65bde1c087
1 changed files with 12 additions and 8 deletions
|
@ -62,30 +62,34 @@ static int at91_pmc_core_probe(struct udevice *dev)
|
||||||
*/
|
*/
|
||||||
int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name)
|
int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name)
|
||||||
{
|
{
|
||||||
ofnode parent = dev_ofnode(dev);
|
const void *fdt = gd->fdt_blob;
|
||||||
ofnode node;
|
int offset = dev_of_offset(dev);
|
||||||
bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
|
bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
|
||||||
const char *name;
|
const char *name;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ofnode_for_each_subnode(node, parent) {
|
for (offset = fdt_first_subnode(fdt, offset);
|
||||||
if (pre_reloc_only && !ofnode_pre_reloc(node))
|
offset > 0;
|
||||||
|
offset = fdt_next_subnode(fdt, offset)) {
|
||||||
|
if (pre_reloc_only &&
|
||||||
|
!ofnode_pre_reloc(offset_to_ofnode(offset)))
|
||||||
continue;
|
continue;
|
||||||
/*
|
/*
|
||||||
* If this node has "compatible" property, this is not
|
* If this node has "compatible" property, this is not
|
||||||
* a clock sub-node, but a normal device. skip.
|
* a clock sub-node, but a normal device. skip.
|
||||||
*/
|
*/
|
||||||
if (ofnode_read_prop(node, "compatible", NULL))
|
fdt_get_property(fdt, offset, "compatible", &ret);
|
||||||
|
if (ret >= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (ret != -FDT_ERR_NOTFOUND)
|
if (ret != -FDT_ERR_NOTFOUND)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
name = ofnode_get_name(node);
|
name = fdt_get_name(fdt, offset, NULL);
|
||||||
if (!name)
|
if (!name)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
ret = device_bind_driver_to_node(dev, drv_name, name, node,
|
ret = device_bind_driver_to_node(dev, drv_name, name,
|
||||||
NULL);
|
offset_to_ofnode(offset), NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue