aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2020-01-31 09:53:21 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2020-02-25 15:13:00 +0200
commit173e77b17febbdae3c815a9bbdba0c4433256bca (patch)
tree3456371a3ce9fcf28bb162b3a19474e8d7da8d70
downloadlinux-dt-173e77b17febbdae3c815a9bbdba0c4433256bca.tar.gz
Initial commit
-rw-r--r--.gitignore5
-rw-r--r--Makefile69
2 files changed, 74 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..74fde33
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+*.dtb
+*.dts.pre
+*.dtbo
+*.dtso.pre
+
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0093362
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,69 @@
+.PHONY: all clean
+
+O ?= .
+
+LINUX ?= ${PWD}/../linux
+DTC ?= ${LINUX}/scripts/dtc/dtc
+DTC_WARN_FLAGS := -Wno-unit_address_vs_reg -Wno-unit_address_format -Wno-avoid_unnecessary_addr_size -Wno-alias_paths -Wno-graph_child_address -Wno-simple_bus_reg -Wno-unique_unit_address -Wno-pci_device_reg
+DTC_FLAGS := -O dtb -@ -b 0 -i${LINUX}/include ${DTC_WARN_FLAGS}
+CPP_FLAGS := -E -nostdinc -I${LINUX}/scripts/dtc/include-prefixes -undef -D__DTS__ -x assembler-with-cpp
+
+dtbo_src := $(shell find arch -name *.dtso)
+dtbo_dst := $(dtbo_src:.dtso=.dtbo)
+dtbo_tmp := $(dtbo_src:.dtso=.dtso.pre)
+
+dtbo_dst := $(addprefix $(O)/,$(dtbo_dst))
+dtbo_tmp := $(addprefix $(O)/,$(dtbo_tmp))
+
+# List of all dts files that need symbols enabled.
+# These are taken from $LINUX.
+
+dtb_src_arm = \
+ am57xx-beagle-x15.dts \
+ am57xx-beagle-x15-revb1.dts \
+ am57xx-beagle-x15-revc.dts \
+ am572x-idk.dts \
+ am571x-idk.dts \
+ am574x-idk.dts \
+ dra7-evm.dts \
+ dra72-evm.dts \
+ dra72-evm-revc.dts \
+ dra71-evm.dts \
+ dra76-evm.dts
+
+dtb_src_arm64 = \
+ ti/k3-am654-base-board.dts \
+ ti/k3-j721e-common-proc-board.dts
+
+dtb_src = $(dtb_src_arm:%=$(LINUX)/arch/arm/boot/dts/%)
+dtb_src += $(dtb_src_arm64:%=$(LINUX)/arch/arm64/boot/dts/%)
+dtb_dst = $(dtb_src:$(LINUX)/%.dts=%.dtb)
+dtb_tmp = $(dtb_src:$(LINUX)/%.dts=%.dts.pre)
+
+dtb_dst := $(addprefix $(O)/,$(dtb_dst))
+dtb_tmp := $(addprefix $(O)/,$(dtb_tmp))
+
+all: dtbs dtbos
+
+$(dtbo_tmp): $(O)/%.dtso.pre: %.dtso
+ @mkdir -p `dirname $@`
+ @gcc $(CPP_FLAGS) -o $@ $<
+
+$(dtbo_dst): $(O)/%.dtbo: $(O)/%.dtso.pre
+ @echo " DTC $@"
+ @$(DTC) $(DTC_FLAGS) -o $@ $<
+
+dtbos: $(dtbo_dst)
+
+$(dtb_tmp): $(O)/%.dts.pre : $(LINUX)/%.dts
+ @mkdir -p `dirname $@`
+ @gcc $(CPP_FLAGS) -o $@ $<
+
+$(dtb_dst): $(O)/%.dtb : $(O)/%.dts.pre
+ @echo " DTC $@"
+ @$(DTC) $(DTC_FLAGS) -o $@ $<
+
+dtbs: $(dtb_dst)
+
+clean:
+ find -name "*.dtb" -or -name "*.dtbo" -or -name "*.pre" | xargs rm -f