Skip to content

Commit 440cb03

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

File tree

6 files changed

+33
-30
lines changed

6 files changed

+33
-30
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
*.c.[012]*.*
1818
*.dt.yaml
1919
*.dtb
20-
*.dtb.S
2120
*.dtbo
21+
*.dtb.S
2222
*.dwo
2323
*.elf
2424
*.gcno

Makefile

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

12651265
ifneq ($(dtstree),)
12661266

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

1269-
%.dtb %.dtbo: include/config/kernel.release scripts_dtc
1270-
$(Q)$(MAKE) $(build)=$(dtbdir) $(dtstree)/$@
1270+
%.dtbo: include/config/kernel.release scripts_dtc
1271+
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
12711272

12721273
PHONY += dtbs dtbs_install dtbs_check
12731274
dtbs: include/config/kernel.release scripts_dtc
@@ -1747,7 +1748,6 @@ clean: $(clean-dirs)
17471748
\( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \
17481749
-o -name '*.ko.*' \
17491750
-o -name '*.dtb' -o -name '*.dtb.S' -o -name '*.dt.yaml' \
1750-
-o -name '*.dtbo' -o -name '*.dtbo.S' \
17511751
-o -name '*.dwo' -o -name '*.lst' \
17521752
-o -name '*.su' -o -name '*.mod' -o -name '*.ns_deps' \
17531753
-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
@@ -1340,12 +1340,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
13401340
aspeed-bmc-portwell-neptune.dtb \
13411341
aspeed-bmc-quanta-q71l.dtb
13421342

1343-
always += $(dtb-merge-y)
1343+
targets += dtbs dtbs_install
1344+
targets += $(dtb-y)
13441345

1345-
$(addprefix $(obj)/,$(dtb-merge-y)): TI_DTBOS
1346-
@$(srctree)/scripts/dtb-merge $(srctree) $(objtree) $@ $(objtree)/scripts/dtc/fdtoverlay $(src)/ti
1347-
1348-
TI_DTBOS:
1349-
$(Q)$(MAKE) $(build)=$(src)/ti
1350-
1351-
PHONY += TI_DTBOS
1346+
subdir-y := overlays

scripts/Makefile.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ intermediate_targets = $(foreach sfx, $(2), \
448448
# %.tab.o <- %.tab.[ch] <- %.y
449449
targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \
450450
$(call intermediate_targets, .dtb.o, .dtb.S .dtb) \
451-
$(call intermediate_targets, .dtbo.o, .dtbo.S .dtbo) \
452451
$(call intermediate_targets, .lex.o, .lex.c) \
453452
$(call intermediate_targets, .tab.o, .tab.c .tab.h)
454453

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: 18 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
@@ -242,6 +240,7 @@ DTC ?= $(objtree)/scripts/dtc/dtc
242240
ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
243241
DTC_FLAGS += -Wno-unit_address_vs_reg \
244242
-Wno-unit_address_format \
243+
-Wno-gpios_property \
245244
-Wno-avoid_unnecessary_addr_size \
246245
-Wno-alias_paths \
247246
-Wno-graph_child_address \
@@ -275,9 +274,6 @@ cmd_dt_S_dtb= \
275274
$(obj)/%.dtb.S: $(obj)/%.dtb FORCE
276275
$(call if_changed,dt_S_dtb)
277276

278-
$(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE
279-
$(call if_changed,dt_S_dtb)
280-
281277
quiet_cmd_dtc = DTC $@
282278
cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
283279
$(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
@@ -289,9 +285,6 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
289285
$(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE
290286
$(call if_changed_dep,dtc,dtb)
291287

292-
$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE
293-
$(call if_changed_dep,dtc,dtb)
294-
295288
DT_CHECKER ?= dt-validate
296289
DT_BINDING_DIR := Documentation/devicetree/bindings
297290
DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.yaml
@@ -307,8 +300,23 @@ endef
307300
$(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
308301
$(call if_changed_rule,dtc,yaml)
309302

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

313321
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
314322

0 commit comments

Comments
 (0)