mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] kbuild: don't mix overlay and normal DTC and CPP flags
@ 2023-11-30  7:03 Ahmad Fatoum
  2023-11-30  7:03 ` [PATCH 2/2] kbuild: don't warn about reg formatting Ahmad Fatoum
  2023-12-05  8:01 ` [PATCH 1/2] kbuild: don't mix overlay and normal DTC and CPP flags Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-11-30  7:03 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We currently conflate flags for *.dtb and *.dtbo targets:

  - -@ doesn't make sense for overlays, but is used there anyway when
    CONFIG_OF_OVERLAY_LIVE

  - DTC_CPP_FLAGS_basetarget.dtbo and DTC_CPP_FLAGS_basetarget.dtb are
    interchangeable

Fix this by allowing flags to be specific to either *.dtb or *.dtbo
generation.

Fixes: 3610ec11f72b ("kbuild: Add target to build dtb overlay files")
Fixes: 5b3d7e66aac0 ("kbuild: support DTC_CPP_FLAGS_file.dtbo")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 scripts/Makefile.lib | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 18b4fc1b9dd2..8aa49b1ee1b0 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -220,8 +220,7 @@ dtc_cpp_flags  = -Wp,-MD,$(depfile).pre -nostdinc                        \
 		 -I$(srctree)/include                                    \
 		 -I$(srctree)/dts/include                                \
 		 -I$(srctree)/dts/src/                                   \
-		 $(DTC_CPP_FLAGS_$(basetarget).dtb)                      \
-		 $(DTC_CPP_FLAGS_$(basetarget).dtbo)                     \
+		 $(DTC_CPP_FLAGS_$(basetarget)$(suffix $@))              \
 		 -undef -D__DTS__
 
 ifdef CONFIG_BOOTM_FITIMAGE_PUBKEY
@@ -369,7 +368,7 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \
 	 -Wno-interrupt_provider
 
 ifeq ($(CONFIG_OF_OVERLAY_LIVE), y)
-DTC_FLAGS += -@
+DTC_FLAGS.dtb += -@
 endif
 
 # Generate an assembly file to wrap the output of the device tree compiler
@@ -391,7 +390,7 @@ quiet_cmd_dtc = DTC     $@
 cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) \
 	-D'$(subst -,_,$(*F))_dts=1' $(foreach f,$< $(2),-include '$(f)') /dev/null ; \
 	$(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \
-		-i $(srctree)/arch/$(SRCARCH)/dts $(DTC_FLAGS) \
+		-i $(srctree)/arch/$(SRCARCH)/dts $(DTC_FLAGS) $(DTC_FLAGS$(suffix $@)) \
 		-i $(srctree)/dts/src/$(SRCARCH) \
 		-i $(srctree)/dts/src/arm/ti/omap \
 		-d $(depfile).dtc $(dtc-tmp) ; \
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-05  8:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-30  7:03 [PATCH 1/2] kbuild: don't mix overlay and normal DTC and CPP flags Ahmad Fatoum
2023-11-30  7:03 ` [PATCH 2/2] kbuild: don't warn about reg formatting Ahmad Fatoum
2023-12-05  8:01 ` [PATCH 1/2] kbuild: don't mix overlay and normal DTC and CPP flags Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox