blob: e5ea3c3b05cb135f9d0487194618cb81a8132c8f [file] [log] [blame]
Amit Pundirbd765d62024-03-08 22:31:43 +05301ifneq ($(filter db845c db845c_mini linaro_swr sm8x50, $(TARGET_DEVICE)),)
Amit Pundirc0ad8942021-12-14 19:45:56 +05302
Amit Pundirbd765d62024-03-08 22:31:43 +05303DTC := $(HOST_OUT)/bin/dtc
4FDTOVERLAY := $(HOST_OUT)/bin/fdtoverlay
Elliot Berman4203c4a2024-09-12 17:36:41 -07005
6SM8X50_STAGING_DIR := $(call intermediates-dir-for,PACKAGING,dtb)
7
8SM8X50_BOARDS ?= sm8550-hdk sm8550-qrd sm8650-qrd
9SM8X50_DTBS := $(foreach board,$(SM8X50_BOARDS),$(wildcard $(TARGET_KERNEL_DIR)/$(board).dtb))
10SM8X50_DTBS := $(addprefix $(SM8X50_STAGING_DIR)/,$(notdir $(SM8X50_DTBS)))
11SM8X50_DTBOS := $(patsubst %.dtb,%.dtbo,$(SM8X50_DTBS))
12
13# generate the .dtbo which contains the msm-id and board-id
14$(SM8X50_DTBOS): $(SM8X50_STAGING_DIR)/%.dtbo: device/linaro/dragonboard/sm8x50/dtb-overlays/%.dts $(DTC)
15 -$(DTC) -@ -I dts -O dtb -o $@ $<
16
17# apply the above .dtbo to the prebuilt .dtb
18$(SM8X50_DTBS): $(SM8X50_STAGING_DIR)/%.dtb: $(TARGET_KERNEL_DIR)/%.dtb $(SM8X50_STAGING_DIR)/%.dtbo | $(FDTOVERLAY)
19 -$(FDTOVERLAY) -o $@ -i $^
Amit Pundirbd765d62024-03-08 22:31:43 +053020
21DB845C_DTB := $(TARGET_KERNEL_DIR)/sdm845-db845c.dtb
22RB5_DTB := $(wildcard $(TARGET_KERNEL_DIR)/qrb5165-rb5.dtb)
Amit Pundirbd765d62024-03-08 22:31:43 +053023
Elliot Berman4203c4a2024-09-12 17:36:41 -070024$(PRODUCT_OUT)/dtb.img: $(SM8X50_DTBS) $(RB5_DTB) $(DB845C_DTB)
25 -cat $(SM8X50_DTBS) $(RB5_DTB) $(DB845C_DTB) > $@
Amit Pundirc0ad8942021-12-14 19:45:56 +053026
27droidcore: $(PRODUCT_OUT)/dtb.img
28
29endif