All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@stericsson.com>
To: devicetree-discuss@lists.ozlabs.org
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>,
	Niklas Hernaeus <niklas.hernaeus@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	David Brown <davidb@codeaurora.org>,
	Lee Jones <lee.jones@linaro.org>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: supply a DTB file to be appended
Date: Thu, 8 Sep 2011 12:14:44 +0200	[thread overview]
Message-ID: <1315476884-28470-1-git-send-email-linus.walleij@stericsson.com> (raw)

From: Linus Walleij <linus.walleij@linaro.org>

This adds a Kconfig string where you can specify a
file to be appended to the zImage on build, then
auto-appends it. The idea is to mimic how we supply
an initramfs image by a similar parameter.

This makes it easy to script the kernel build with
different device trees, and it also vastly simplifies
building uImages since "make uImage" will now pick
up the devcie tree and include it in the final image
as part of the build process.

Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: David Brown <davidb@codeaurora.org>
Cc: Niklas Hernaeus <niklas.hernaeus@linaro.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
This builds on top of Nicos pending appended device tree
patches. Nico, if this gains some liking, please include
it in your series.
---
 arch/arm/Kconfig       |   10 ++++++++++
 arch/arm/boot/Makefile |    8 +++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4ea9974..cb8ee68 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1789,6 +1789,16 @@ config ARM_APPENDED_DTB
 	  (dtb) appended to zImage
 	  (e.g. cat zImage <filename>.dtb > zImage_w_dtb).
 
+config ARM_APPENDED_DTB_FILE
+	string "DTB file"
+	depends on ARM_APPENDED_DTB
+	default ""
+	help
+	  This gives the name of file from the build directory to append
+	  to the zImage after it has been built.
+
+	  If you are not sure, leave it blank.
+
 config ARM_ATAG_DTB_COMPAT
 	bool "Supplement the appended DTB with traditional ATAG information"
 	depends on ARM_APPENDED_DTB
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index a1edfd5..5ab6abf 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -53,8 +53,14 @@ $(obj)/Image: vmlinux FORCE
 $(obj)/compressed/vmlinux: $(obj)/Image FORCE
 	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
 
-$(obj)/zImage:	$(obj)/compressed/vmlinux FORCE
+# Rule to optionally append a DTB
+dtbfile := $(shell echo $(CONFIG_ARM_APPENDED_DTB_FILE))
+quiet_cmd_append = CAT     $@
+      cmd_append = (cat /dev/null $(dtbfile) >> $@)
+
+$(obj)/zImage:	$(obj)/compressed/vmlinux $(dtbfile) FORCE
 	$(call if_changed,objcopy)
+	$(call if_changed,append)
 	@echo '  Kernel: $@ is ready'
 
 endif
-- 
1.7.3.2

WARNING: multiple messages have this Message-ID (diff)
From: linus.walleij@stericsson.com (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: supply a DTB file to be appended
Date: Thu, 8 Sep 2011 12:14:44 +0200	[thread overview]
Message-ID: <1315476884-28470-1-git-send-email-linus.walleij@stericsson.com> (raw)

From: Linus Walleij <linus.walleij@linaro.org>

This adds a Kconfig string where you can specify a
file to be appended to the zImage on build, then
auto-appends it. The idea is to mimic how we supply
an initramfs image by a similar parameter.

This makes it easy to script the kernel build with
different device trees, and it also vastly simplifies
building uImages since "make uImage" will now pick
up the devcie tree and include it in the final image
as part of the build process.

Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: David Brown <davidb@codeaurora.org>
Cc: Niklas Hernaeus <niklas.hernaeus@linaro.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
This builds on top of Nicos pending appended device tree
patches. Nico, if this gains some liking, please include
it in your series.
---
 arch/arm/Kconfig       |   10 ++++++++++
 arch/arm/boot/Makefile |    8 +++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4ea9974..cb8ee68 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1789,6 +1789,16 @@ config ARM_APPENDED_DTB
 	  (dtb) appended to zImage
 	  (e.g. cat zImage <filename>.dtb > zImage_w_dtb).
 
+config ARM_APPENDED_DTB_FILE
+	string "DTB file"
+	depends on ARM_APPENDED_DTB
+	default ""
+	help
+	  This gives the name of file from the build directory to append
+	  to the zImage after it has been built.
+
+	  If you are not sure, leave it blank.
+
 config ARM_ATAG_DTB_COMPAT
 	bool "Supplement the appended DTB with traditional ATAG information"
 	depends on ARM_APPENDED_DTB
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index a1edfd5..5ab6abf 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -53,8 +53,14 @@ $(obj)/Image: vmlinux FORCE
 $(obj)/compressed/vmlinux: $(obj)/Image FORCE
 	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
 
-$(obj)/zImage:	$(obj)/compressed/vmlinux FORCE
+# Rule to optionally append a DTB
+dtbfile := $(shell echo $(CONFIG_ARM_APPENDED_DTB_FILE))
+quiet_cmd_append = CAT     $@
+      cmd_append = (cat /dev/null $(dtbfile) >> $@)
+
+$(obj)/zImage:	$(obj)/compressed/vmlinux $(dtbfile) FORCE
 	$(call if_changed,objcopy)
+	$(call if_changed,append)
 	@echo '  Kernel: $@ is ready'
 
 endif
-- 
1.7.3.2

             reply	other threads:[~2011-09-08 10:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-08 10:14 Linus Walleij [this message]
2011-09-08 10:14 ` [PATCH] ARM: supply a DTB file to be appended Linus Walleij
     [not found] ` <1315476884-28470-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
2011-09-08 16:32   ` Grant Likely
2011-09-08 16:32     ` Grant Likely
     [not found]     ` <20110908163209.GB22308-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2011-09-08 21:50       ` Linus Walleij
2011-09-08 21:50         ` Linus Walleij
2011-09-08 16:49   ` Nicolas Pitre
2011-09-08 16:49     ` Nicolas Pitre
2011-09-09  4:52   ` Rob Herring
2011-09-09  4:52     ` Rob Herring
2011-09-19  8:52   ` Linus Walleij
2011-09-19  8:52     ` Linus Walleij
     [not found]     ` <CACRpkdZ+s_y=4VJuz5WetaU1tUFF-f6g38bpy6TSRjt9Q_VgLg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-19 15:22       ` Nicolas Pitre
2011-09-19 15:22         ` Nicolas Pitre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1315476884-28470-1-git-send-email-linus.walleij@stericsson.com \
    --to=linus.walleij@stericsson.com \
    --cc=davidb@codeaurora.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=nicolas.pitre@linaro.org \
    --cc=niklas.hernaeus@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.