Re: [U-Boot] [PATCH 1/2] kbuild: make arch-dtbs target PHONY

2019-02-28 Thread Stephen Warren

On 2/26/19 12:20 PM, Stephen Warren wrote:

From: Stephen Warren 

Without this, the arch-dtbs target only gets evaluated when building
U-Boot the first time, not when re-building (incrementally building)
U-Boot. Thus incremental builds ignore changes to DTB files.


Commit b630d57d0ab4 "clk: Add fixed-factor clock driver", which was 
recently applied to u-boot/master, also triggers this same issue. It'd 
be nice to get this fix applied ASAP. Thanks!

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] kbuild: make arch-dtbs target PHONY

2019-02-27 Thread Stephen Warren

On 2/26/19 7:36 PM, Masahiro Yamada wrote:

On Wed, Feb 27, 2019 at 11:17 AM Masahiro Yamada
 wrote:


On Wed, Feb 27, 2019 at 4:21 AM Stephen Warren  wrote:


From: Stephen Warren 

Without this, the arch-dtbs target only gets evaluated when building
U-Boot the first time, not when re-building (incrementally building)
U-Boot. Thus incremental builds ignore changes to DTB files.



Really?

I tested "touch DT, then incremental build",
and it correctly re-compiled device tree.


I attached the log of the following build sequence:

[1] make jetson-tk1_defconfig
[2] make CROSS_COMPILE=arm-linux-gnueabihf-
[3] touch  arch/arm/dts/tegra124-jetson-tk1.dts
[4] make CROSS_COMPILE=arm-linux-gnueabihf-


Hmm, OK. Understood.

The jetson DT was recompiled,
but the other tegra DT files were not.


Yes, perhaps I should have mentioned that I found this issue when 
building sandbox. Sandbox's default DTB of sandbox.dtb does get 
recompiled as expected, but test.dtb (used by the test/py/ test system) 
does not, for incremental builds.

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] kbuild: make arch-dtbs target PHONY

2019-02-26 Thread Masahiro Yamada
On Wed, Feb 27, 2019 at 4:21 AM Stephen Warren  wrote:
>
> From: Stephen Warren 
>
> Without this, the arch-dtbs target only gets evaluated when building
> U-Boot the first time, not when re-building (incrementally building)
> U-Boot. Thus incremental builds ignore changes to DTB files.
>
> Signed-off-by: Stephen Warren 


Reviewed-by: Masahiro Yamada 



> ---
>  dts/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/dts/Makefile b/dts/Makefile
> index a7a604303cc6..4970223b3d2e 100644
> --- a/dts/Makefile
> +++ b/dts/Makefile
> @@ -40,6 +40,7 @@ endif
> echo >&2;   \
> /bin/false)
>
> +PHONY += arch-dtbs
>  arch-dtbs:
> $(Q)$(MAKE) $(build)=$(ARCH_PATH) dtbs
>
> --
> 2.20.1
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot



-- 
Best Regards
Masahiro Yamada
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] kbuild: make arch-dtbs target PHONY

2019-02-26 Thread Masahiro Yamada
On Wed, Feb 27, 2019 at 11:17 AM Masahiro Yamada
 wrote:
>
> On Wed, Feb 27, 2019 at 4:21 AM Stephen Warren  wrote:
> >
> > From: Stephen Warren 
> >
> > Without this, the arch-dtbs target only gets evaluated when building
> > U-Boot the first time, not when re-building (incrementally building)
> > U-Boot. Thus incremental builds ignore changes to DTB files.
>
>
> Really?
>
> I tested "touch DT, then incremental build",
> and it correctly re-compiled device tree.
>
>
> I attached the log of the following build sequence:
>
> [1] make jetson-tk1_defconfig
> [2] make CROSS_COMPILE=arm-linux-gnueabihf-
> [3] touch  arch/arm/dts/tegra124-jetson-tk1.dts
> [4] make CROSS_COMPILE=arm-linux-gnueabihf-
>
>

Hmm, OK. Understood.

The jetson DT was recompiled,
but the other tegra DT files were not.


So, I am fine with this patch,
but this Makefile is problematic already.




Looking into dts/Makefile,
I noticed there are two ways to descend into arch/*/dts.


$(DTB): $(dtb_depends)
ifeq ($(EXT_DTB),)
$(Q)$(MAKE) $(build)=$(ARCH_PATH) $@  <- [1]
endif
$(Q)test -e $@ || ( \
echo >&2; \
echo >&2 "Device Tree Source is not correctly specified."; \
echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'"; \
echo >&2 "or build with 'DEVICE_TREE=' argument"; \
echo >&2; \
/bin/false)

arch-dtbs:
$(Q)$(MAKE) $(build)=$(ARCH_PATH) dtbs  <- [2]



[1] and [2] would cause a race in parallel building
and might produce an invalid DTB.


I do not understand commit 27cb7300ffda7a3f1581f0f5a2d3bfe59b97ad67




-- 
Best Regards
Masahiro Yamada
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] kbuild: make arch-dtbs target PHONY

2019-02-26 Thread Masahiro Yamada
On Wed, Feb 27, 2019 at 4:21 AM Stephen Warren  wrote:
>
> From: Stephen Warren 
>
> Without this, the arch-dtbs target only gets evaluated when building
> U-Boot the first time, not when re-building (incrementally building)
> U-Boot. Thus incremental builds ignore changes to DTB files.


Really?

I tested "touch DT, then incremental build",
and it correctly re-compiled device tree.


I attached the log of the following build sequence:

[1] make jetson-tk1_defconfig
[2] make CROSS_COMPILE=arm-linux-gnueabihf-
[3] touch  arch/arm/dts/tegra124-jetson-tk1.dts
[4] make CROSS_COMPILE=arm-linux-gnueabihf-






masahiro@pug:~/ref/u-boot$ git log --oneline  -1
b3820ba Merge tag 'efi-2019-04-rc3' of https://github.com/xypron2/u-boot
masahiro@pug:~/ref/u-boot$ make jetson-tk1_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACCscripts/kconfig/zconf.tab.c
  LEX scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
masahiro@pug:~/ref/u-boot$ make CROSS_COMPILE=arm-linux-gnueabihf-
scripts/kconfig/conf  --syncconfig Kconfig
  CHK include/config.h
  UPD include/config.h
  CFG u-boot.cfg
  GEN include/autoconf.mk
  GEN include/autoconf.mk.dep
  CFG spl/u-boot.cfg
  GEN spl/include/autoconf.mk
  CHK include/config/uboot.release
  UPD include/config/uboot.release
  CHK include/generated/version_autogenerated.h
  UPD include/generated/version_autogenerated.h
  CHK include/generated/timestamp_autogenerated.h
  UPD include/generated/timestamp_autogenerated.h
  CC  lib/asm-offsets.s
  CHK include/generated/generic-asm-offsets.h
  UPD include/generated/generic-asm-offsets.h
  CC  arch/arm/lib/asm-offsets.s
  CHK include/generated/asm-offsets.h
  UPD include/generated/asm-offsets.h
  SHIPPED scripts/dtc/pylibfdt/libfdt.i
  PYMOD   scripts/dtc/pylibfdt/_libfdt.so
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  LEX scripts/dtc/dtc-lexer.lex.c
  YACCscripts/dtc/dtc-parser.tab.h
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  YACCscripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  tools/gen_eth_addr
  HOSTCC  tools/gen_ethaddr_crc.o
  WRAPtools/lib/crc8.c
  HOSTCC  tools/lib/crc8.o
  HOSTLD  tools/gen_ethaddr_crc
  HOSTCC  tools/img2srec
  HOSTCC  tools/mkenvimage.o
  HOSTCC  tools/os_support.o
  WRAPtools/lib/crc32.c
  HOSTCC  tools/lib/crc32.o
  HOSTLD  tools/mkenvimage
  HOSTCC  tools/aisimage.o
  HOSTCC  tools/atmelimage.o
  WRAPtools/common/bootm.c
  HOSTCC  tools/common/bootm.o
  HOSTCC  tools/default_image.o
  WRAPtools/lib/fdtdec_common.c
  HOSTCC  tools/lib/fdtdec_common.o
  WRAPtools/lib/fdtdec.c
  HOSTCC  tools/lib/fdtdec.o
  HOSTCC  tools/fit_common.o
  HOSTCC  tools/fit_image.o
  WRAPtools/common/image-fit.c
  HOSTCC  tools/common/image-fit.o
  HOSTCC  tools/image-host.o
  WRAPtools/common/image.c
  HOSTCC  tools/common/image.o
  HOSTCC  tools/imagetool.o
  HOSTCC  tools/imximage.o
  HOSTCC  tools/imx8image.o
  HOSTCC  tools/imx8mimage.o
  HOSTCC  tools/kwbimage.o
  WRAPtools/lib/md5.c
  HOSTCC  tools/lib/md5.o
  HOSTCC  tools/lpc32xximage.o
  HOSTCC  tools/mxsimage.o
  HOSTCC  tools/omapimage.o
  HOSTCC  tools/pblimage.o
  HOSTCC  tools/pbl_crc32.o
  HOSTCC  tools/vybridimage.o
  HOSTCC  tools/stm32image.o
  WRAPtools/lib/rc4.c
  HOSTCC  tools/lib/rc4.o
  HOSTCC  tools/rkcommon.o
  HOSTCC  tools/rkimage.o
  HOSTCC  tools/rksd.o
  HOSTCC  tools/rkspi.o
  HOSTCC  tools/socfpgaimage.o
  WRAPtools/lib/crc16.c
  HOSTCC  tools/lib/crc16.o
  WRAPtools/lib/sha1.c
  HOSTCC  tools/lib/sha1.o
  WRAPtools/lib/sha256.c
  HOSTCC  tools/lib/sha256.o
  WRAPtools/common/hash.c
  HOSTCC  tools/common/hash.o
  HOSTCC  tools/ublimage.o
  HOSTCC  tools/zynqimage.o
  HOSTCC  tools/zynqmpimage.o
  HOSTCC  tools/zynqmpbif.o
  HOSTCC  tools/libfdt/fdt.o
  HOSTCC  tools/libfdt/fdt_wip.o
  HOSTCC  tools/libfdt/fdt_sw.o
  HOSTCC  tools/libfdt/fdt_rw.o
  HOSTCC  tools/libfdt/fdt_strerror.o
  HOSTCC  tools/libfdt/fdt_empty_tree.o
  HOSTCC  tools/libfdt/fdt_addresses.o
  HOSTCC  tools/libfdt/fdt_overlay.o
  WRAPtools/lib/libfdt/fdt_ro.c
  HOSTCC  tools/lib/libfdt/fdt_ro.o
  WRAPtools/lib/libfdt/fdt_region.c
  HOSTCC  tools/lib/libfdt/fdt_region.o
  HOSTCC  tools/gpimage.o
  HOSTCC  tools/gpimage-common.o
  HOSTCC  tools/mtk_image.o
  HOSTCC  tools/dumpimage.o
  HOSTLD  tools/dumpimage
  HOSTCC  tools/mkimage.o
  HOSTLD  tools/mkimage
  HOSTCC  tools/proftool
  HOSTCC  tools/fdtgrep.o
  HOSTLD  tools/fdtgrep
  LD  arch/arm/cpu/built-in.o
  CC  arch/arm/cpu/armv7/cache_v7.o
  AS  

[U-Boot] [PATCH 1/2] kbuild: make arch-dtbs target PHONY

2019-02-26 Thread Stephen Warren
From: Stephen Warren 

Without this, the arch-dtbs target only gets evaluated when building
U-Boot the first time, not when re-building (incrementally building)
U-Boot. Thus incremental builds ignore changes to DTB files.

Signed-off-by: Stephen Warren 
---
 dts/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dts/Makefile b/dts/Makefile
index a7a604303cc6..4970223b3d2e 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -40,6 +40,7 @@ endif
echo >&2;   \
/bin/false)
 
+PHONY += arch-dtbs
 arch-dtbs:
$(Q)$(MAKE) $(build)=$(ARCH_PATH) dtbs
 
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot