[U-Boot] [PATCH v2 8/9] dm: core: Add ofnode to represent device tree nodes

Simon Glass sjg at chromium.org
Sat May 20 02:29:03 UTC 2017


Hi Masahiro,

On 16 May 2017 at 04:35, Masahiro Yamada <yamada.masahiro at socionext.com> wrote:
>
> Hi Simon,
>
>
> 2017-05-02 0:18 GMT+09:00 Simon Glass <sjg at chromium.org>:
> > With live tree we need a struct device_node * to reference a node. With
> > the existing flat tree, we need an int offset. We need to unify these into
> > a single value which can represent both.
> >
> > Add an ofnode union for this and adjust existing code to move to this.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
> >
> > Changes in v2: None
> >
> >  drivers/core/device.c |   2 +-
> >  drivers/core/root.c   |   2 +-
> >  include/dm.h          |   1 +
> >  include/dm/device.h   |  14 +++++--
> >  include/dm/ofnode.h   | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++
> >  5 files changed, 113 insertions(+), 6 deletions(-)
> >  create mode 100644 include/dm/ofnode.h

> When you add a new header, please make sure it is self-contained.
>
> You use bool for offset_toofnode() and ofnode_equal().
> So you need to include <stdbool.h> from this header.
>
> (or, use "int" for the return type.)

I'm wondering about this problem:

In general we want to minimise the size of headers included by U-Boot.
For something like ofnode which is used by several header files we end
up including it many times, once per header.

With dm.h we avoid this since the header is only included ones (and in
the correct order).

What is the best solution to this?

Regards,
Simon


More information about the U-Boot mailing list