Skip to contentSkip to conversation

arc: dts - remove default value if CONFIG_ARC_BUILTIN_DTB_NAME is blank

PATCH In review Alexey Brodkin 3 participants 3 messages Oct 31, 2015 – Nov 2, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arc: dts - remove default value if CONFIG_ARC_BUILTIN_DTB_NAME is blank

As of today default .dtb will be built (and subsequently will be built-in kernel binary) even if CONFIG_ARC_BUILTIN_DTB_NAME is not set.

But it is possible we're going to use external .dtb and so we don't want to have .dtb built-in kernel binary.

For example that could be the case with:
a) U-Boot which loads .dtb in DDR and passes its address to the kernel
b) OpenWRT which embeds .dtb in existing kernel binary

This change excludes .dtb building if CONFIG_ARC_BUILTIN_DTB_NAME is blank.

Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Vineet Gupta <vgupta at synopsys.com>
---
 arch/arc/Makefile          | 2 ++
 arch/arc/boot/dts/Makefile | 6 ++----
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arc/Makefile +2 -0
index 8a27a48..b0cb6de 100644
@@ -94,7 +94,9 @@ head-y		:= arch/arc/kernel/head.o
 core-y		+= arch/arc/
 
 # w/o this dtb won't embed into kernel binary
+ifneq ($(CONFIG_ARC_BUILTIN_DTB_NAME),"")
 core-y		+= arch/arc/boot/dts/
+endif
 
 core-$(CONFIG_ARC_PLAT_SIM)	+= arch/arc/plat-sim/
 core-$(CONFIG_ARC_PLAT_TB10X)	+= arch/arc/plat-tb10x/
arch/arc/boot/dts/Makefile +2 -4
index b0e3f19..4dcab5b 100644
@@ -1,13 +1,11 @@
 # Built-in dtb
-builtindtb-y		:= nsim_700
 
 ifneq ($(CONFIG_ARC_BUILTIN_DTB_NAME),"")
 	builtindtb-y	:= $(patsubst "%",%,$(CONFIG_ARC_BUILTIN_DTB_NAME))
+	obj-y   += $(builtindtb-y).dtb.o
+	targets += $(builtindtb-y).dtb
 endif
 
-obj-y   += $(builtindtb-y).dtb.o
-targets += $(builtindtb-y).dtb
-
 .SECONDARY: $(obj)/$(builtindtb-y).dtb.S
 
 dtbs:  $(addprefix  $(obj)/, $(builtindtb-y).dtb)
Signature · 1 line
2.4.3
#1 lore raw
Quoted 10 lines

From: linux-snps-arc <linux-snps-arc-bounces at lists.infradead.org> on behalf of Alexey Brodkin <Alexey.Brodkin at synopsys.com>
Sent: Sunday, November 1, 2015 1:21 AM
To: linux-snps-arc at lists.infradead.org
Cc: Vineet Gupta; Alexey Brodkin; linux-kernel at vger.kernel.org
Subject: [PATCH] arc: dts - remove default value if CONFIG_ARC_BUILTIN_DTB_NAME is blank

As of today default .dtb will be built (and subsequently will be built-in kernel binary) even if CONFIG_ARC_BUILTIN_DTB_NAME is not set.

But it is possible we're going to use external .dtb and so we don't want to

have .dtb built-in kernel binary.

Quoted 5 lines

For example that could be the case with:
a) U-Boot which loads .dtb in DDR and passes its address to the kernel
b) OpenWRT which embeds .dtb in existing kernel binary

This change excludes .dtb building if CONFIG_ARC_BUILTIN_DTB_NAME is

blank.

You can add my Ack (worked on my platform)
Noam

#2 lore raw
In reply to Alexey Brodkin
Quoted 10 lines · Alexey Brodkin

As of today default .dtb will be built (and subsequently will be built-in kernel binary) even if CONFIG_ARC_BUILTIN_DTB_NAME is not set.

But it is possible we're going to use external .dtb and so we don't want to have .dtb built-in kernel binary.

For example that could be the case with:
a) U-Boot which loads .dtb in DDR and passes its address to the kernel
b) OpenWRT which embeds .dtb in existing kernel binary

Quoted 5 lines

This change excludes .dtb building if CONFIG_ARC_BUILTIN_DTB_NAME is blank.

Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Vineet Gupta <vgupta at synopsys.com>

Rob has been doing a series to build all DTBs and he also provided a fix to ARC makefiles to use common make variables which collides with ur patch.

@Alexey, can u wait until rc1 comes out and rebase it on top, assuming Rob's series is merged in 4.4 window ?
If his doesn't, I will merge this as it is for rc2 !

-Vineet

Quoted 39 lines
---
 arch/arc/Makefile          | 2 ++
 arch/arc/boot/dts/Makefile | 6 ++----
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arc/Makefile +2 -0
index 8a27a48..b0cb6de 100644
@@ -94,7 +94,9 @@ head-y		:= arch/arc/kernel/head.o
 core-y		+= arch/arc/
 
 # w/o this dtb won't embed into kernel binary
+ifneq ($(CONFIG_ARC_BUILTIN_DTB_NAME),"")
 core-y		+= arch/arc/boot/dts/
+endif
 
 core-$(CONFIG_ARC_PLAT_SIM)	+= arch/arc/plat-sim/
 core-$(CONFIG_ARC_PLAT_TB10X)	+= arch/arc/plat-tb10x/
arch/arc/boot/dts/Makefile +2 -4
index b0e3f19..4dcab5b 100644
@@ -1,13 +1,11 @@
 # Built-in dtb
-builtindtb-y		:= nsim_700
 
 ifneq ($(CONFIG_ARC_BUILTIN_DTB_NAME),"")
 	builtindtb-y	:= $(patsubst "%",%,$(CONFIG_ARC_BUILTIN_DTB_NAME))
+	obj-y   += $(builtindtb-y).dtb.o
+	targets += $(builtindtb-y).dtb
 endif
 
-obj-y   += $(builtindtb-y).dtb.o
-targets += $(builtindtb-y).dtb
-
 .SECONDARY: $(obj)/$(builtindtb-y).dtb.S
 
 dtbs:  $(addprefix  $(obj)/, $(builtindtb-y).dtb)