Weirdness of ofnode_get_addr_size()

Dario Binacchi dariobin at libero.it
Tue May 4 22:01:26 CEST 2021


Hi Jan,

> Il 04/05/2021 17:26 Simon Glass <sjg at chromium.org> ha scritto:
> 
>  
> Hi Jan,
> 
> On Sun, 2 May 2021 at 01:53, Jan Kiszka <jan.kiszka at web.de> wrote:
> >
> > Hi,
> >
> > I'm trying to make some sense of ofnode_get_addr_size() in order to fix
> > [1] properly.
> >
> > First, the documentation if this functions says "This does no address
> > translation". But the node-pointer path happily calls
> > of_translate_address(), as the result of a6a45cd32539. For not
> > offset-bases path, it calls fdtdec_get_addr_size() which does no
> > translation.
> >
> > Related to [1]: The node-pointer path cleanly calls
> > of_n_addr/size_cells() in order to retrieve the configured number of
> > cells. But the offset-based path simply calls fdtdec_get_addr_size()
> > which assumes that the number of cells is derived from the physical
> > address width of that platform.
> >
> > So, what is that functions actually supposed to do?
> 
> +Dario Binacchi +Mario Six
> 
> I suspect the code has got ahead of the docs.
> 
> d64b9cdcd47 fdt: translate address if #size-cells = <0>

I submitted a patch to revert the commit:
https://patchwork.ozlabs.org/project/uboot/patch/20210501150527.10273-6-dariobin@libero.it/

Thanks and regards,
Dario

> e8d5291824e core: ofnode: Fix translation for #size-cells == 0
> 
> Regards,
> Simon
> 
> >
> > Jan
> >
> > [1] https://www.mail-archive.com/u-boot@lists.denx.de/msg405446.html


More information about the U-Boot mailing list