[U-Boot] [PATCH 2/8] dts/Makefile: simplify dtc invocation

Simon Glass sjg at chromium.org
Wed Jun 19 22:37:28 CEST 2013


Hi Stephen,

On Mon, Jun 10, 2013 at 4:16 PM, Stephen Warren <swarren at wwwdotorg.org>wrote:

> From: Stephen Warren <swarren at nvidia.com>
>
> The invocation of dtc is significantly more complex that it could be,
> in order to work around an issue on old versions of dtc, which print
> a message to stdout every time they run.
>
> Remove this workaround, on the assumption that people have or will
> upgrade to a newer version of dtc. This simplifies the build rule
> significantly.
>
> Related, split the invocation of cpp and dtc into separate commands
> rather than a pipeline, so that if either fail, it is detected. This has
> the nice benefit of saving off the result of the pre-processing step,
> allowing it to be easily inspected.
>
> Signed-off-by: Stephen Warren <swarren at nvidia.com>
> ---
>  .gitignore   | 1 +
>  dts/Makefile | 9 ++-------
>  2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/.gitignore b/.gitignore
> index 4116448..be9abd6 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -16,6 +16,7 @@
>  *.patch
>  *.bin
>  *.cfgtmp
> +*.dtstmp
>
>  # Build tree
>  /build-*
> diff --git a/dts/Makefile b/dts/Makefile
> index 03e163e..4d81d79 100644
> --- a/dts/Makefile
> +++ b/dts/Makefile
> @@ -51,13 +51,8 @@ all: $(obj).depend $(LIB)
>  DT_BIN := $(obj)dt.dtb
>
>  $(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
> -       rc=$$( \
> -               cat $< | $(CPP) -P $(DTS_CPPFLAGS) - | \
> -               { { $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} - 2>&1 ; \
> -                   echo $$? >&3 ; } | \
> -                 grep -v '^DTC: dts->dtb  on file' ; \
> -               } 3>&1 1>&2 ) ; \
> -       exit $$rc
> +       $(CPP) -P $(DTS_CPPFLAGS) $< -o $(DT_BIN).dtstmp
> +       $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dtstmp
>

When you get an error here, will dtc report a bogus filename? Or will the
CPP line information deal with that> - iwc please add a comment to the
commit message.


>
>  process_lds = \
>         $(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p'
> --
> 1.8.1.5
>
>
Regards,
Simon


More information about the U-Boot mailing list