difference between fdtdec and fdt_support ?

Simon Glass sjg at chromium.org
Thu Jan 6 16:48:48 CET 2022


Hi Marek,

On Thu, 6 Jan 2022 at 05:21, Marek Behún <marek.behun at nic.cz> wrote:
>
> Hi Simon,
>
> I am a little confused.
>
> We have
>   common/fdt_support.c
> and
>   lib/fdtdec.c
>
> The second one implements for example fdtdec_get_is_enabled(), which I
> would rather expect in fdt_support by name fdt_node_is_available(), or
> something like that.

Should be moved to ofnode

>
> Also fdtdec does a strange thing with compatible strings: it declares
> an enum for compatible strings and then a map which maps this enum
> values to compatible strings... Why not just use the compatible strings?

Did you see the comment?

 * NOTE: This list is basically a TODO list for things that need to be
 * converted to driver model. So don't add new things here unless there is a
 * good reason why driver-model conversion is infeasible. Examples include
 * things which are used before driver model is available.

This is effectively a list of things that should be converted to
driver model. The list should then go away.

>
> What is the purpose of having two files implementing fdt stuff?

fdtdec - for reading from the DT. Should go away and be replaced with
the ofnode API, and fdtaddr.c
fdt_support - for updating the DT, e.g. for fixups before booting an OS

Regards,
Simon


More information about the U-Boot mailing list