[U-Boot] [PATCH 1/3 v3] dm: Add callback to modify the device tree

Simon Glass sjg at chromium.org
Fri Mar 3 04:52:31 UTC 2017


Hi Mario,

On 22 February 2017 at 08:07, Mario Six <mario.six at gdsys.cc> wrote:
> Certain boards come in different variations by way of utilizing daughter
> boards, for example. These boards might contain additional chips, which
> are added to the main board's busses, e.g. I2C.
>
> The device tree support for such boards would either, quite naturally,
> employ the overlay mechanism to add such chips to the tree, or would use
> one large default device tree, and delete the devices that are actually
> not present.
>
> Regardless of approach, even on the U-Boot level, a modification of the
> device tree is a prerequisite to have such modular families of boards
> supported properly.
>
> Therefore, we add an option to make the U-Boot device tree (the actual
> copy later used by the driver model) writeable, and add a callback
> method that allows boards to modify the device tree at an early stage,
> at which, hopefully, also the application of device tree overlays will
> be possible.
>
> Signed-off-by: Mario Six <mario.six at gdsys.cc>
> ---
> Changes in v3:
>
> None
>
> Changes in v2:
>
> * Switched from usage of globally writeable global data pointer to a locally
>   writeable pointer passed to board_fix_fdt
> * Added comments for board_fix_fdt in include/common.h
> * Added documentation for pre-relocation device tree manipulation
> ---
>  common/board_f.c               |  10 ++++
>  doc/driver-model/fdt-fixup.txt | 132 +++++++++++++++++++++++++++++++++++++++++
>  dts/Kconfig                    |  10 ++++
>  include/common.h               |   1 +
>  4 files changed, 153 insertions(+)
>  create mode 100644 doc/driver-model/fdt-fixup.txt

Reviewed-by: Simon Glass <sjg at chromium.org>

I think as things stand this is reasonable.

But IMO it would be better (i.e. faster) to manipulate the live DT,
assuming we have one (see my series on that).

Regards,
Simon


More information about the U-Boot mailing list