Skip to content

Commit ee8df1b

Browse files
committed
Overlays: Port RPi Overlay building
Signed-off-by: Robert Nelson <[email protected]>
1 parent 393417c commit ee8df1b

File tree

5 files changed

+25
-29
lines changed

5 files changed

+25
-29
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,10 +1261,11 @@ endif
12611261

12621262
ifneq ($(dtstree),)
12631263

1264-
%.dtb %.dtbo: dtbdir=$(patsubst %/,%,$(patsubst %./,%,$(dtstree)/$(dir $@)))
1264+
%.dtb: include/config/kernel.release scripts_dtc
1265+
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
12651266

1266-
%.dtb %.dtbo: include/config/kernel.release scripts_dtc
1267-
$(Q)$(MAKE) $(build)=$(dtbdir) $(dtstree)/$@
1267+
%.dtbo: include/config/kernel.release scripts_dtc
1268+
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
12681269

12691270
PHONY += dtbs dtbs_install dtbs_check
12701271
dtbs: include/config/kernel.release scripts_dtc
@@ -1744,7 +1745,6 @@ clean: $(clean-dirs)
17441745
\( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \
17451746
-o -name '*.ko.*' \
17461747
-o -name '*.dtb' -o -name '*.dtb.S' -o -name '*.dt.yaml' \
1747-
-o -name '*.dtbo' -o -name '*.dtbo.S' \
17481748
-o -name '*.dwo' -o -name '*.lst' \
17491749
-o -name '*.su' -o -name '*.mod' -o -name '*.ns_deps' \
17501750
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \

arch/arm/boot/dts/Makefile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,12 +1345,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
13451345
aspeed-bmc-portwell-neptune.dtb \
13461346
aspeed-bmc-quanta-q71l.dtb
13471347

1348-
always += $(dtb-merge-y)
1348+
targets += dtbs dtbs_install
1349+
targets += $(dtb-y)
13491350

1350-
$(addprefix $(obj)/,$(dtb-merge-y)): TI_DTBOS
1351-
@$(srctree)/scripts/dtb-merge $(srctree) $(objtree) $@ $(objtree)/scripts/dtc/fdtoverlay $(src)/ti
1352-
1353-
TI_DTBOS:
1354-
$(Q)$(MAKE) $(build)=$(src)/ti
1355-
1356-
PHONY += TI_DTBOS
1351+
subdir-y := overlays

scripts/Makefile.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ intermediate_targets = $(foreach sfx, $(2), \
452452
# %.tab.o <- %.tab.[ch] <- %.y
453453
targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \
454454
$(call intermediate_targets, .dtb.o, .dtb.S .dtb) \
455-
$(call intermediate_targets, .dtbo.o, .dtbo.S .dtbo) \
456455
$(call intermediate_targets, .lex.o, .lex.c) \
457456
$(call intermediate_targets, .tab.o, .tab.c .tab.h)
458457

scripts/Makefile.dtbinst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ include scripts/Kbuild.include
2020
include $(src)/Makefile
2121

2222
dtbinst-files := $(sort $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-)))
23+
dtboinst-files := $(sort $(dtbo-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-)))
2324
dtbinst-dirs := $(subdir-y) $(subdir-m)
2425

2526
# Helper targets for Installing DTBs into the boot directory
@@ -28,16 +29,16 @@ quiet_cmd_dtb_install = INSTALL $<
2829

2930
install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj))
3031

31-
$(filter %.dtb,$(dtbinst-files)): %.dtb: $(obj)/%.dtb
32+
$(dtbinst-files): %.dtb: $(obj)/%.dtb
33+
$(call cmd,dtb_install,$(install-dir))
34+
35+
$(dtboinst-files): %.dtbo: $(obj)/%.dtbo
3236
$(call cmd,dtb_install,$(install-dir))
3337

3438
$(dtbinst-dirs):
3539
$(Q)$(MAKE) $(dtbinst)=$(obj)/$@
3640

37-
dummy:
38-
@echo > /dev/null
39-
40-
PHONY += $(dtbinst-files) $(dtbinst-dirs) dummy
41-
__dtbs_install: $(dtbinst-files) $(dtbinst-dirs) dummy
41+
PHONY += $(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs)
42+
__dtbs_install: $(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs)
4243

4344
.PHONY: $(PHONY)

scripts/Makefile.lib

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ extra-$(CONFIG_OF_ALL_DTBS) += $(dtb-)
6363
ifneq ($(CHECK_DTBS),)
6464
extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y))
6565
extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-))
66-
extra-y += $(patsubst %.dtbo,%.dt.yaml, $(dtb-y))
67-
extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtbo,%.dt.yaml, $(dtb-))
6866
endif
6967

7068
# Add subdir path
@@ -275,9 +273,6 @@ cmd_dt_S_dtb= \
275273
$(obj)/%.dtb.S: $(obj)/%.dtb FORCE
276274
$(call if_changed,dt_S_dtb)
277275

278-
$(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE
279-
$(call if_changed,dt_S_dtb)
280-
281276
quiet_cmd_dtc = DTC $@
282277
cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
283278
$(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
@@ -289,9 +284,6 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
289284
$(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE
290285
$(call if_changed_dep,dtc,dtb)
291286

292-
$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE
293-
$(call if_changed_dep,dtc,dtb)
294-
295287
DT_CHECKER ?= dt-validate
296288
DT_BINDING_DIR := Documentation/devicetree/bindings
297289
DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.yaml
@@ -307,8 +299,17 @@ endef
307299
$(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
308300
$(call if_changed_rule,dtc,yaml)
309301

310-
$(obj)/%.dt.yaml: $(src)/%.dtso $(DTC) $(DT_TMP_SCHEMA) FORCE
311-
$(call if_changed_rule,dtc_dt_yaml)
302+
quiet_cmd_dtco = DTCO $@
303+
cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \
304+
$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
305+
$(DTC) -@ -H epapr -O dtb -o $@ -b 0 \
306+
-i $(dir $<) $(DTC_FLAGS) \
307+
-Wno-interrupts_property \
308+
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
309+
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
310+
311+
$(obj)/%.dtbo: $(src)/%.dts FORCE
312+
$(call if_changed_dep,dtco)
312313

313314
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
314315

0 commit comments

Comments
 (0)