[U-Boot] [PATCH v3 01/16] dm: allow limiting pre-reloc markings to spl or tpl

Heiko Stübner
2017-02-17T00:36:15Z

Hi Simon,

Am Montag, 6. Februar 2017, 07:34:54 CET schrieb Simon Glass:
> On 3 February 2017 at 08:09, Heiko Stuebner <heiko@sntech.de> wrote:
> > Right now the u-boot,dm-pre-reloc flag will make each marked node
> > always appear in both spl and tpl. But systems needing an additional
> > tpl might have special constraints for each, like the spl needing to
> > be very tiny.
> >
> > So introduce two additional flags to mark nodes for only spl or tpl
> > environments and introduce a function dm_fdt_pre_reloc to automate
> > the necessary checks in code instances checking for pre-relocation
> > flags.
> >
> > The behaviour of the original flag stays untouched and still marks
> > a node for both spl and tpl.
> >
> > Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> > ---
> >
> > doc/driver-model/README.txt | 4 ++++
> > drivers/clk/at91/pmc.c | 3 ++-
> > drivers/core/root.c | 2 +-
> > drivers/core/util.c | 29 +++++++++++++++++++++++++++++
> > drivers/pinctrl/pinctrl-uclass.c | 3 ++-
> > include/dm/util.h | 2 ++
> > scripts/Makefile.spl | 7 ++++++-
> > tools/dtoc/dtoc.py | 2 ++
> > 8 files changed, 48 insertions(+), 4 deletions(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> s/u-boot/U-Boot
>
> Please add a comment for dm_fdt_pre_reloc() in the header file.
>
> Two things to consider:
>
> - Should we drop the use of u-boot,dm-pre-reloc in Makefile.spl, and
> convert all users to your version? This would mean having both
> u-boot,dm-pre-reloc and u-boot,dm-spl in some cases, I suspect.
^^ u-boot,dm-spl and u-boot,dm-tpl I guess

Dropping u-boot,dm-pre-reloc is for you to decide, as you wrote the original
implementation ;-) . It will save one fdt-query but might need several
iterations as I guess new boards will add new ones after we remove the old
ones.

> - Can you use #ifdef in SPL/TPL to reduce code size fractionally in
> dm_fdt_pre_reloc()?

Do you mean moving the
+ dm_spl = fdt_getprop(blob, offset, "u-boot,dm-spl", NULL);
+ dm_tpl = fdt_getprop(blob, offset, "u-boot,dm-tpl", NULL);

into the existing #ifdef CONFIG_TPL_BUILD / SPL_BUILD blocks or something
else?

Thanks
Heiko