blob: cbe1214a141878f8c7b09682bae86f8dbb3a828b [file] [log] [blame]
Luca Stefanid9347002018-07-12 17:23:54 +02001ifneq ($(TARGET_NO_KERNEL),true)
2ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DTBO)),true)
3
4MKDTIMG := $(HOST_OUT_EXECUTABLES)/mkdtimg$(HOST_EXECUTABLE_SUFFIX)
5
Luca Stefanid9347002018-07-12 17:23:54 +02006# Most specific paths must come first in possible_dtbo_dirs
7possible_dtbo_dirs = $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/dts $(KERNEL_OUT)/arch/arm/boot/dts
8
9define build-dtboimage-target
Rashed Abdel-Tawab60fe9352019-05-16 14:01:19 -070010 $(call pretty,"Target dtbo image: $(BOARD_PREBUILT_DTBOIMAGE)")
Luca Stefanid9347002018-07-12 17:23:54 +020011 $(hide) for dir in $(possible_dtbo_dirs); do \
12 if [ -d "$$dir" ]; then \
13 dtbo_dir="$$dir"; \
14 break; \
15 fi; \
16 done; \
17 $(MKDTIMG) create $@ --page_size=$(BOARD_KERNEL_PAGESIZE) $$(find "$$dtbo_dir" -name '*.dtbo')
18 $(hide) chmod a+r $@
19endef
20
Rashed Abdel-Tawab60fe9352019-05-16 14:01:19 -070021$(BOARD_PREBUILT_DTBOIMAGE): $(MKDTIMG) $(INSTALLED_KERNEL_TARGET)
Luca Stefanid9347002018-07-12 17:23:54 +020022 $(build-dtboimage-target)
Luca Stefanid9347002018-07-12 17:23:54 +020023
24endif # BOARD_KERNEL_SEPARATED_DTBO
25endif # TARGET_NO_KERNEL