summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2019-05-10 17:10:10 -0500
committerJohn Klug <john.klug@multitech.com>2019-05-10 17:10:10 -0500
commit4f5efcb39b25a2a9c24c36c467e7f14ce6e818a5 (patch)
treed3e4c704b655ca16f2686c7696d3dac070131a3a /Makefile
downloadmt-dt-overlay-4f5efcb39b25a2a9c24c36c467e7f14ce6e818a5.tar.gz
mt-dt-overlay-4f5efcb39b25a2a9c24c36c467e7f14ce6e818a5.tar.bz2
mt-dt-overlay-4f5efcb39b25a2a9c24c36c467e7f14ce6e818a5.zip
Device Tree Overlay Example1.0.0
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 26 insertions, 0 deletions
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