[OpenWrt-Devel] [PATCH v4] Fix arch used during dts compilation

Nikolay Martynov mar.kolya at gmail.com
Mon Dec 7 18:39:33 EST 2015


Use kernel arch for dts compilation.
Also use Image/BuildDTB to build dts for ramips.

This is reworked patch, based on comments by Jonas Gorski

Signed-off-by: Nikolay Martynov <mar.kolya at gmail.com>
---
 include/image.mk                   | 6 +++---
 target/linux/ramips/image/Makefile | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index fd5e3f4..6b2fb1a 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -16,7 +16,7 @@ override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
 
 KDIR=$(KERNEL_BUILD_DIR)
 KDIR_TMP=$(KDIR)/tmp
-DTS_DIR:=$(LINUX_DIR)/arch/$(ARCH)/boot/dts/
+DTS_DIR:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts
 
 IMG_PREFIX:=openwrt-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
 
@@ -143,8 +143,8 @@ endef
 # $(4) extra DTC flags
 define Image/BuildDTB
 	$(CPP) -nostdinc -x assembler-with-cpp \
-		-I$(LINUX_DIR)/arch/$(ARCH)/boot/dts \
-		-I$(LINUX_DIR)/arch/$(ARCH)/boot/dts/include \
+		-I$(DTS_DIR) \
+		-I$(DTS_DIR)/include \
 		-undef -D__DTS__ $(3) \
 		-o $(2).tmp $(1)
 	$(LINUX_DIR)/scripts/dtc/dtc -O dtb \
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index e58d012..01e3fcb 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -39,7 +39,7 @@ define Device/Default
 endef
 
 define Build/patch-dtb
-	$(LINUX_DIR)/scripts/dtc/dtc -O dtb -o $@.dtb ../dts/$(DTS).dts
+	$(call Image/BuildDTB,../dts/$(DTS).dts,$@.dtb)
 	$(STAGING_DIR_HOST)/bin/patch-dtb $@ $@.dtb
 endef
 
-- 
2.6.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list