• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Use this file to generate dtb.img and dtbo.img instead of using
2# BOARD_PREBUILT_DTBIMAGE_DIR. We need to keep dtb and dtbo files at the fixed
3# positions in images, so that bootloader can rely on their indexes in the
4# image. As dtbo.img must be signed with AVB tool, we generate intermediate
5# dtbo.img, and the resulting $(PRODUCT_OUT)/dtbo.img will be created with
6# Android build system, by exploiting BOARD_PREBUILT_DTBOIMAGE variable.
7
8ifneq ($(filter yukawa%, $(TARGET_DEVICE)),)
9
10MKDTIMG := system/libufdt/utils/src/mkdtboimg.py
11DTBIMAGE := $(PRODUCT_OUT)/dtb.img
12DTBOIMAGE := $(PRODUCT_OUT)/$(DTBO_UNSIGNED)
13
14# Please keep this list fixed: add new files in the end of the list
15DTB_FILES := \
16	$(LOCAL_DTB)/meson-sm1-khadas-vim3l.dtb \
17	$(LOCAL_DTB)/meson-g12b-a311d-khadas-vim3.dtb
18
19# Please keep this list fixed: add new files in the end of the list
20DTBO_FILES := \
21	$(LOCAL_DTB)/meson-sm1-khadas-vim3l-android.dtb \
22	$(LOCAL_DTB)/meson-g12b-a311d-khadas-vim3-android.dtb
23
24$(DTBIMAGE): $(DTB_FILES)
25	cat $^ > $@
26
27$(DTBOIMAGE): PRIVATE_MKDTIMG := $(MKDTIMG)
28$(DTBOIMAGE): PRIVATE_DTBO_FILES := $(DTBO_FILES)
29$(DTBOIMAGE): $(DTBO_FILES) $(MKDTIMG)
30	$(PRIVATE_MKDTIMG) create $@ $(PRIVATE_DTBO_FILES)
31
32include $(CLEAR_VARS)
33LOCAL_MODULE := dtbimage
34LOCAL_LICENSE_KINDS := legacy_restricted
35LOCAL_LICENSE_CONDITIONS := restricted
36LOCAL_ADDITIONAL_DEPENDENCIES := $(DTBIMAGE)
37include $(BUILD_PHONY_PACKAGE)
38
39include $(CLEAR_VARS)
40LOCAL_MODULE := dtboimage
41LOCAL_LICENSE_KINDS := legacy_restricted
42LOCAL_LICENSE_CONDITIONS := restricted
43LOCAL_ADDITIONAL_DEPENDENCIES := $(DTBOIMAGE)
44include $(BUILD_PHONY_PACKAGE)
45
46droidcore: dtbimage dtboimage
47
48$(call dist-for-goals, dist_files, $(DTBOIMAGE))
49
50endif
51