From 4f5efcb39b25a2a9c24c36c467e7f14ce6e818a5 Mon Sep 17 00:00:00 2001 From: John Klug Date: Fri, 10 May 2019 17:10:10 -0500 Subject: Device Tree Overlay Example --- Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5679f26 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +CC?=$(CROSS_COMPILE)gcc +DTC_OPTIONS?=-@ +DTC_OPTIONS += -Wno-unit_address_vs_reg -Wno-graph_child_address -Wno-pwms_property +KERNEL_DIR?=../linux +KERNEL_BUILD_DIR?=$(KERNEL_DIR) +# Need a dtc new enough to handle the DTC options. +DTC?=/usr/bin/dtc + +MTCDT_DTBO_OBJECTS:= $(patsubst %.dtso,%.dtbo,$(wildcard mtcdt/*.dtso)) +MTRV1_DTBO_OBJECTS:= $(patsubst %.dtso,%.dtbo,$(wildcard mtrv1/*.dtso)) + +%.pre.dtso: %.dtso + $(CC) -E -nostdinc -I$(KERNEL_DIR)/include -I$(KERNEL_DIR)/arch/arm/boot/dts -x assembler-with-cpp -undef -o $@ $^ + +%.dtbo: %.pre.dtso + $(DTC) $(DTC_OPTIONS) -I dts -O dtb -o $@ $^ + +%.itb: %.its %_dtbos + mkimage -D "-i$(KERNEL_BUILD_DIR)/arch/arm/boot/ -i$(KERNEL_BUILD_DIR)/arch/arm/boot/dts -p 1000 $(DTC_OPTIONS)" -f $< $@ + +mtcdt_dtbos: $(MTCDT_DTBO_OBJECTS) +mtrv1_dtbos: $(MTRV1_DTBO_OBJECTS) + +.PHONY: clean +clean: + rm -f */*.dtbo *.itb -- cgit v1.2.3