aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2020-03-02 14:53:40 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2020-03-25 13:36:01 +0200
commit7f105b012db07b35f8a3d82089717aa518cec491 (patch)
tree8d28975b6958b1fbbb784fae25ad47d935f6bd43
parent6a25ea7a15ee0d41b4ba97bee31fad5c6a1297ee (diff)
downloadlinux-dt-7f105b012db07b35f8a3d82089717aa518cec491.tar.gz
Add ARCH variable
Supported ARCH values are arm and arm64.
-rw-r--r--Makefile27
-rw-r--r--README.md3
2 files changed, 27 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 0093362..3e24f28 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,16 @@
.PHONY: all clean
O ?= .
+ARCH ?=
+
+ifeq ($(strip $(ARCH)),)
+ARCH_ARM = y
+ARCH_ARM64 = y
+else ifeq (${ARCH}, arm)
+ARCH_ARM = y
+else ifeq (${ARCH}, arm64)
+ARCH_ARM64 = y
+endif
LINUX ?= ${PWD}/../linux
DTC ?= ${LINUX}/scripts/dtc/dtc
@@ -8,7 +18,11 @@ DTC_WARN_FLAGS := -Wno-unit_address_vs_reg -Wno-unit_address_format -Wno-avoid_u
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_src-y =
+dtbo_src-$(ARCH_ARM) += $(shell find arch/arm -name *.dtso)
+dtbo_src-$(ARCH_ARM64) += $(shell find arch/arm64 -name *.dtso)
+dtbo_src = ${dtbo_src-y}
+
dtbo_dst := $(dtbo_src:.dtso=.dtbo)
dtbo_tmp := $(dtbo_src:.dtso=.dtso.pre)
@@ -31,12 +45,19 @@ dtb_src_arm = \
dra71-evm.dts \
dra76-evm.dts
+dtb_src_arm := $(dtb_src_arm:%=$(LINUX)/arch/arm/boot/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_src_arm64 := $(dtb_src_arm64:%=$(LINUX)/arch/arm64/boot/dts/%)
+
+dtb_src-y =
+dtb_src-$(ARCH_ARM) += $(dtb_src_arm)
+dtb_src-$(ARCH_ARM64) += $(dtb_src_arm64)
+
+dtb_src = $(dtb_src-y)
dtb_dst = $(dtb_src:$(LINUX)/%.dts=%.dtb)
dtb_tmp = $(dtb_src:$(LINUX)/%.dts=%.dts.pre)
diff --git a/README.md b/README.md
index 8f30e31..056be5c 100644
--- a/README.md
+++ b/README.md
@@ -8,3 +8,6 @@ The makefile does two things:
- Compiles DT overlays in this repository
Output path can be given the same way as when building the kernel, with O=dir
+
+ARCH variable can be used to build a single arch instead of all, e.g. ARCH=arm64
+