* [PATCH] clk: at91: compat: partially revert "dm: Remove uses of device_bind_offset()"
@ 2021-02-02 8:47 Eugen Hristev
2021-02-03 12:59 ` Simon Glass
0 siblings, 1 reply; 3+ messages in thread
From: Eugen Hristev @ 2021-02-02 8:47 UTC (permalink / raw)
To: u-boot
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>
---
drivers/clk/at91/compat.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/clk/at91/compat.c b/drivers/clk/at91/compat.c
index e514f26656..dfdc3a6a92 100644
--- a/drivers/clk/at91/compat.c
+++ b/drivers/clk/at91/compat.c
@@ -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)
{
- ofnode parent = dev_ofnode(dev);
- ofnode node;
+ const void *fdt = gd->fdt_blob;
+ int offset = dev_of_offset(dev);
bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
const char *name;
int ret;
- ofnode_for_each_subnode(node, parent) {
- if (pre_reloc_only && !ofnode_pre_reloc(node))
+ for (offset = fdt_first_subnode(fdt, offset);
+ offset > 0;
+ offset = fdt_next_subnode(fdt, offset)) {
+ if (pre_reloc_only &&
+ !ofnode_pre_reloc(offset_to_ofnode(offset)))
continue;
/*
* If this node has "compatible" property, this is not
* 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;
if (ret != -FDT_ERR_NOTFOUND)
return ret;
- name = ofnode_get_name(node);
+ name = fdt_get_name(fdt, offset, NULL);
if (!name)
return -EINVAL;
- ret = device_bind_driver_to_node(dev, drv_name, name, node,
- NULL);
+ ret = device_bind_driver_to_node(dev, drv_name, name,
+ offset_to_ofnode(offset), NULL);
if (ret)
return ret;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] clk: at91: compat: partially revert "dm: Remove uses of device_bind_offset()"
2021-02-02 8:47 [PATCH] clk: at91: compat: partially revert "dm: Remove uses of device_bind_offset()" Eugen Hristev
@ 2021-02-03 12:59 ` Simon Glass
2021-02-11 7:27 ` Eugen.Hristev at microchip.com
0 siblings, 1 reply; 3+ messages in thread
From: Simon Glass @ 2021-02-03 12:59 UTC (permalink / raw)
To: u-boot
On Tue, 2 Feb 2021 at 01:48, Eugen Hristev <eugen.hristev@microchip.com> wrote:
>
> 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>
> ---
> drivers/clk/at91/compat.c | 20 ++++++++++++--------
> 1 file changed, 12 insertions(+), 8 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
Nice work.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] clk: at91: compat: partially revert "dm: Remove uses of device_bind_offset()"
2021-02-03 12:59 ` Simon Glass
@ 2021-02-11 7:27 ` Eugen.Hristev at microchip.com
0 siblings, 0 replies; 3+ messages in thread
From: Eugen.Hristev at microchip.com @ 2021-02-11 7:27 UTC (permalink / raw)
To: u-boot
On 03.02.2021 14:59, Simon Glass wrote:
> On Tue, 2 Feb 2021 at 01:48, Eugen Hristev <eugen.hristev@microchip.com> wrote:
>>
>> 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>
>> ---
>> drivers/clk/at91/compat.c | 20 ++++++++++++--------
>> 1 file changed, 12 insertions(+), 8 deletions(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> Nice work.
>
Applied to u-boot-atmel/master
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-11 7:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 8:47 [PATCH] clk: at91: compat: partially revert "dm: Remove uses of device_bind_offset()" Eugen Hristev
2021-02-03 12:59 ` Simon Glass
2021-02-11 7:27 ` Eugen.Hristev at microchip.com
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.