[PATCH 1/2] kbuild: add dtc as dependency on .dtb files

[Linux commit b8fc5b2157b1]
If dtc is rebuilt, we should rebuild .dtb files with the new dtc.
[Import notes: Back then there was no .dtbo rule in Linux's Makefile.lib, but the current .dtbo rules in Linux also have the $(DTC) dependency, so also add it to our .dtbo rule.]
Signed-off-by: Rasmus Villemoes rasmus.villemoes@prevas.dk --- scripts/Makefile.lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 7b27224b5d..651d700369 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -331,7 +331,7 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ ; \ sed "s:$(pre-tmp):$(<):" $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
-$(obj)/%.dtb: $(src)/%.dts FORCE +$(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE $(call if_changed_dep,dtc)
pre-tmp = $(subst $(comma),_,$(dot-target).pre.tmp) @@ -351,7 +351,7 @@ cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \ -d $(depfile).dtc.tmp $(dtc-tmp) ; \ cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
-$(obj)/%.dtbo: $(src)/%.dts FORCE +$(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE $(call if_changed_dep,dtco)
# Fonts

[Linux commit 363547d2191c]
Currently DTB Overlays (.dtbo) are build from source files with the same extension (.dts) as the base DTs (.dtb). This may become confusing and even lead to wrong results. For example, a composite DTB (created from a base DTB and a set of overlays) might have the same name as one of the overlays that create it.
Different files should be generated from differently named sources. .dtb <-> .dts .dtbo <-> .dtso
We do not remove the ability to compile DTBO files from .dts files here, only add a new rule allowing the .dtso file name. The current .dts named overlays can be renamed with time. After all have been renamed we can remove the other rule.
[Import notes: Adapt to U-Boot by using the cmd_dtco function instead of cmd_dtc just like the current .dts -> .dtbo rule.]
Signed-off-by: Rasmus Villemoes rasmus.villemoes@prevas.dk --- scripts/Makefile.lib | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 651d700369..7362a392ad 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -354,6 +354,9 @@ cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \ $(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE $(call if_changed_dep,dtco)
+$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE + $(call if_changed_dep,dtco) + # Fonts # ---------------------------------------------------------------------------

On Thu, 4 May 2023 at 06:26, Rasmus Villemoes rasmus.villemoes@prevas.dk wrote:
[Linux commit 363547d2191c]
Currently DTB Overlays (.dtbo) are build from source files with the same extension (.dts) as the base DTs (.dtb). This may become confusing and even lead to wrong results. For example, a composite DTB (created from a base DTB and a set of overlays) might have the same name as one of the overlays that create it.
Different files should be generated from differently named sources. .dtb <-> .dts .dtbo <-> .dtso
We do not remove the ability to compile DTBO files from .dts files here, only add a new rule allowing the .dtso file name. The current .dts named overlays can be renamed with time. After all have been renamed we can remove the other rule.
[Import notes: Adapt to U-Boot by using the cmd_dtco function instead of cmd_dtc just like the current .dts -> .dtbo rule.]
Signed-off-by: Rasmus Villemoes rasmus.villemoes@prevas.dk
scripts/Makefile.lib | 3 +++ 1 file changed, 3 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org

On Thu, May 04, 2023 at 02:26:44PM +0200, Rasmus Villemoes wrote:
[Linux commit 363547d2191c]
Currently DTB Overlays (.dtbo) are build from source files with the same extension (.dts) as the base DTs (.dtb). This may become confusing and even lead to wrong results. For example, a composite DTB (created from a base DTB and a set of overlays) might have the same name as one of the overlays that create it.
Different files should be generated from differently named sources. .dtb <-> .dts .dtbo <-> .dtso
We do not remove the ability to compile DTBO files from .dts files here, only add a new rule allowing the .dtso file name. The current .dts named overlays can be renamed with time. After all have been renamed we can remove the other rule.
[Import notes: Adapt to U-Boot by using the cmd_dtco function instead of cmd_dtc just like the current .dts -> .dtbo rule.]
Signed-off-by: Rasmus Villemoes rasmus.villemoes@prevas.dk Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/next, thanks!

On Thu, 4 May 2023 at 06:26, Rasmus Villemoes rasmus.villemoes@prevas.dk wrote:
[Linux commit b8fc5b2157b1]
If dtc is rebuilt, we should rebuild .dtb files with the new dtc.
[Import notes: Back then there was no .dtbo rule in Linux's Makefile.lib, but the current .dtbo rules in Linux also have the $(DTC) dependency, so also add it to our .dtbo rule.]
Signed-off-by: Rasmus Villemoes rasmus.villemoes@prevas.dk
scripts/Makefile.lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Thu, May 04, 2023 at 02:26:43PM +0200, Rasmus Villemoes wrote:
[Linux commit b8fc5b2157b1]
If dtc is rebuilt, we should rebuild .dtb files with the new dtc.
[Import notes: Back then there was no .dtbo rule in Linux's Makefile.lib, but the current .dtbo rules in Linux also have the $(DTC) dependency, so also add it to our .dtbo rule.]
Signed-off-by: Rasmus Villemoes rasmus.villemoes@prevas.dk Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/next, thanks!
participants (3)
-
Rasmus Villemoes
-
Simon Glass
-
Tom Rini