blob: 02630c8603106e328f95bd20f0cd242b74f13b93 [file] [log] [blame]
Luca Stefanid9347002018-07-12 17:23:54 +02001ifneq ($(TARGET_NO_KERNEL),true)
2ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DTBO)),true)
3
Kshitij Gupta37956282020-02-10 18:24:44 +00004ifneq ($(BOARD_CUSTOM_DTBOIMG_MK),)
5include $(BOARD_CUSTOM_DTBOIMG_MK)
6else
7
Luca Stefanid9347002018-07-12 17:23:54 +02008MKDTIMG := $(HOST_OUT_EXECUTABLES)/mkdtimg$(HOST_EXECUTABLE_SUFFIX)
9
Luca Stefanid9347002018-07-12 17:23:54 +020010# Most specific paths must come first in possible_dtbo_dirs
11possible_dtbo_dirs = $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/dts $(KERNEL_OUT)/arch/arm/boot/dts
12
13define build-dtboimage-target
Rashed Abdel-Tawab60fe9352019-05-16 14:01:19 -070014 $(call pretty,"Target dtbo image: $(BOARD_PREBUILT_DTBOIMAGE)")
Luca Stefanid9347002018-07-12 17:23:54 +020015 $(hide) for dir in $(possible_dtbo_dirs); do \
16 if [ -d "$$dir" ]; then \
17 dtbo_dir="$$dir"; \
18 break; \
19 fi; \
20 done; \
Andreas Schneiderb5328252020-02-27 12:46:17 +010021 $(MKDTIMG) create $@ --page_size=$(BOARD_KERNEL_PAGESIZE) $$(find "$$dtbo_dir" -type f -name '*.dtbo' | sort)
Luca Stefanid9347002018-07-12 17:23:54 +020022 $(hide) chmod a+r $@
23endef
24
Rashed Abdel-Tawab60fe9352019-05-16 14:01:19 -070025$(BOARD_PREBUILT_DTBOIMAGE): $(MKDTIMG) $(INSTALLED_KERNEL_TARGET)
Luca Stefanid9347002018-07-12 17:23:54 +020026 $(build-dtboimage-target)
Luca Stefanid9347002018-07-12 17:23:54 +020027
Kshitij Gupta37956282020-02-10 18:24:44 +000028endif # BOARD_CUSTOM_DTBOIMG_MK
Luca Stefanid9347002018-07-12 17:23:54 +020029endif # BOARD_KERNEL_SEPARATED_DTBO
30endif # TARGET_NO_KERNEL