Skip to content

Commit

Permalink
Overlays: Port RPi Overlay building
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Nelson <[email protected]>
  • Loading branch information
RobertCNelson committed Mar 8, 2022
1 parent 936feaf commit 057ce48
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*.bz2
*.c.[012]*.*
*.dtb
*.dtb.S
*.dtbo
*.dtb.S
*.dwo
*.elf
*.gcno
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export ZRELADDR INITRD_PHYS PARAMS_PHYS

targets := Image zImage xipImage bootpImage uImage

ifeq ($(CONFIG_OF_OVERLAY),y)
DTC_FLAGS += -@
endif

ifeq ($(CONFIG_XIP_KERNEL),y)

cmd_deflate_xip_data = $(CONFIG_SHELL) -c \
Expand Down
25 changes: 8 additions & 17 deletions arch/arm/boot/dts/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# SPDX-License-Identifier: GPL-2.0

ifeq ($(CONFIG_OF_OVERLAY),y)
DTC_FLAGS += -@
endif

dtb-$(CONFIG_ARCH_ALPINE) += \
alpine-db.dtb
dtb-$(CONFIG_MACH_ARTPEC6) += \
Expand Down Expand Up @@ -1259,22 +1264,8 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
aspeed-bmc-portwell-neptune.dtb \
aspeed-bmc-quanta-q71l.dtb

ifeq ($(BUILD_ITBS),y)
dtb-y=
dtb-merge-y=
else
dts-dirs=
endif

always += $(dtb-merge-y)

$(addprefix $(obj)/,$(dtb-merge-y)): TI_DTBOS
@$(srctree)/scripts/dtb-merge $(srctree) $(objtree) $@ $(objtree)/scripts/dtc/fdtoverlay $(src)/ti

TI_DTBOS:
$(Q)$(MAKE) $(build)=$(src)/ti
targets += dtbs dtbs_install
targets += $(dtb-y)

PHONY += TI_DTBOS
subdir-y := overlays

subdir-y += $(dts-dirs)
subdir- += ti
2 changes: 1 addition & 1 deletion scripts/Kbuild.include
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ ksym_dep_filter = \
$(CPP) $(call flags_nodeps,c_flags) -D__KSYM_DEPS__ $< ;; \
as_*_S|cpp_s_S) \
$(CPP) $(call flags_nodeps,a_flags) -D__KSYM_DEPS__ $< ;; \
boot*|build*|cpp_its_S|*cpp_lds_S|dtc|host*|vdso*) : ;; \
boot*|build*|cpp_its_S|*cpp_lds_S|dtc*|host*|vdso*) : ;; \
*) echo "Don't know how to preprocess $(1)" >&2; false ;; \
esac | tr ";" "\n" | sed -n 's/^.*=== __KSYM_\(.*\) ===.*$$/_\1/p'

Expand Down
15 changes: 5 additions & 10 deletions scripts/Makefile.dtbinst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ include scripts/Kbuild.include
include $(src)/Makefile

dtbinst-files := $(sort $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-)))
dtboinst-files := $(sort $(dtbo-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-)))
dtbinst-dirs := $(subdir-y) $(subdir-m)

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

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

$(filter %.dtb,$(dtbinst-files)): %.dtb: $(obj)/%.dtb
$(dtbinst-files): %.dtb: $(obj)/%.dtb
$(call cmd,dtb_install,$(install-dir))

$(filter %.dtbo,$(dtbinst-files)): %.dtbo: $(obj)/%.dtbo
$(call cmd,dtb_install,$(install-dir))

$(filter %.itb,$(dtbinst-files)): %.itb: $(obj)/%.itb
$(dtboinst-files): %.dtbo: $(obj)/%.dtbo
$(call cmd,dtb_install,$(install-dir))

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

dummy:
@echo > /dev/null

PHONY += $(dtbinst-files) $(dtbinst-dirs) dummy
__dtbs_install: $(dtbinst-files) $(dtbinst-dirs) dummy
PHONY += $(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs)
__dtbs_install: $(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs)

.PHONY: $(PHONY)
13 changes: 13 additions & 0 deletions scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ DTC ?= $(objtree)/scripts/dtc/dtc
ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)
DTC_FLAGS += -Wno-unit_address_vs_reg \
-Wno-unit_address_format \
-Wno-gpios_property \
-Wno-avoid_unnecessary_addr_size \
-Wno-alias_paths \
-Wno-graph_child_address \
Expand Down Expand Up @@ -293,6 +294,18 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
$(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE
$(call if_changed_dep,dtc)

quiet_cmd_dtco = DTCO $@
cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \
$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
$(DTC) -@ -H epapr -O dtb -o $@ -b 0 \
-i $(dir $<) $(DTC_FLAGS) \
-Wno-interrupts_property \
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)

$(obj)/%.dtbo: $(src)/%.dts FORCE
$(call if_changed_dep,dtco)

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

# Bzip2
Expand Down

0 comments on commit 057ce48

Please sign in to comment.