public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: Add Kconfig option to use mkimage -T kernel_noload
@ 2012-02-29  0:03 Stephen Warren
       [not found] ` <1330473804-23348-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  2012-02-29 12:29 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 2 replies; 32+ messages in thread
From: Stephen Warren @ 2012-02-29  0:03 UTC (permalink / raw)
  To: Russell King, Olof Johansson, Colin Cross
  Cc: Nicolas Pitre, Peter De Schrijver,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

uImage files typically encode a single absolute load and entry address.
This is inconvenient when attempting to share that uImage across multiple
SoCs with different physical RAM addresses. Recent versions of mkimage
implement a "kernel_noload" image type which encodes no absolute load
address, and a relative entry address. This works well for uImage-wrapped
ARM zImages, since they are relocatable.

This is enabled by commit b9b50e89d317c58becd0e2d7fac2e21e3a81dd0a
"image: Implement IH_TYPE_KERNEL_NOLOAD" in U-Boot.

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
I assume I should put this into the ARM patch tracker if it's OK?

 arch/arm/Kconfig       |   15 +++++++++++++++
 arch/arm/boot/Makefile |   15 ++++++++++++++-
 2 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0884b67..27e7672 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2066,6 +2066,21 @@ config AUTO_ZRELADDR
 	  0xf8000000. This assumes the zImage being placed in the first 128MB
 	  from start of memory.
 
+config UIMAGE_NOLOAD
+	bool "Using mkimage's kernel_noload image type"
+	depends on AUTO_ZRELADDR
+	help
+	  Say Y here to build a uImage using type "kernel_noload" instead of
+	  "kernel".
+
+	  uImage files typically encode a single absolute load and entry
+	  address. This is inconvenient when attempting to share that uImage
+	  across multiple SoCs with different physical RAM addresses. Recent
+	  versions of mkimage implement a "kernel_noload" image type which
+	  encodes no absolute load address, and a relative entry address.
+	  This works well for uImage-wrapped ARM zImages, since they are
+	  relocatable.
+
 endmenu
 
 menu "CPU Power Management"
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index fc871e7..45c3cbe 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -70,10 +70,21 @@ $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))
 clean-files := *.dtb
 
 quiet_cmd_uimage = UIMAGE  $@
-      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
+      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux \
+		   -T $(UIMAGE_TYPE) \
 		   -C none -a $(LOADADDR) -e $(STARTADDR) \
 		   -n 'Linux-$(KERNELRELEASE)' -d $< $@
 
+ifeq ($(CONFIG_UIMAGE_NOLOAD),y)
+
+$(obj)/uImage: UIMAGE_TYPE := kernel_noload
+$(obj)/uImage: override LOADADDR := 0
+$(obj)/uImage: STARTADDR := 0 # Relative to load address
+
+else
+
+$(obj)/uImage: UIMAGE_TYPE := kernel
+
 ifeq ($(CONFIG_ZBOOT_ROM),y)
 $(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
 else
@@ -82,6 +93,8 @@ endif
 
 $(obj)/uImage: STARTADDR=$(LOADADDR)
 
+endif
+
 check_for_multiple_loadaddr = \
 if [ $(words $(LOADADDR)) -gt 1 ]; then \
 	echo 'multiple load addresses: $(LOADADDR)'; \
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2012-03-12 17:44 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-29  0:03 [PATCH 1/2] ARM: Add Kconfig option to use mkimage -T kernel_noload Stephen Warren
     [not found] ` <1330473804-23348-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-02-29  0:03   ` [PATCH 2/2] ARM: tegra: Add zreladdr etc to Makefile.boot for Tegra30 Stephen Warren
2012-03-01 17:01   ` [PATCH 1/2] ARM: Add Kconfig option to use mkimage -T kernel_noload Stephen Warren
     [not found]     ` <74CDBE0F657A3D45AFBB94109FB122FF17BE861683-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-03-05  4:21       ` Olof Johansson
2012-03-05 20:29       ` Nicolas Pitre
2012-02-29 12:29 ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]   ` <20120229122942.GF3318-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2012-02-29 16:58     ` Stephen Warren
     [not found]       ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF206A-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-02-29 18:14         ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]           ` <20120229181430.GI3318-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2012-02-29 18:33             ` Tim Bird
2012-02-29 18:50               ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]                 ` <20120229185013.GJ3318-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2012-03-12 17:40                   ` Marek Vasut
     [not found]                     ` <201203121840.49776.marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-03-12 17:44                       ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]               ` <4F4E6F96.8080907-mEdOJwZ7QcZBDgjK7y7TUQ@public.gmane.org>
2012-02-29 19:12                 ` Uwe Kleine-König
     [not found]                   ` <20120229191209.GN14173-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-29 19:17                     ` Stephen Warren
     [not found]                       ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF2122-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-02-29 19:44                         ` Uwe Kleine-König
     [not found]                           ` <20120229194409.GO14173-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-29 19:59                             ` Stephen Warren
     [not found]                               ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF2155-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-02-29 20:12                                 ` Andre Renaud
     [not found]                                   ` <4F4E86A1.8010506-7Wk5F4Od5/oYd5yxfr4S2w@public.gmane.org>
2012-02-29 20:16                                     ` Stephen Warren
2012-02-29 20:19                                     ` Russell King - ARM Linux
     [not found]                                       ` <20120229201938.GB16999-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2012-02-29 20:25                                         ` Andre Renaud
     [not found]                                           ` <4F4E89A8.4080909-7Wk5F4Od5/oYd5yxfr4S2w@public.gmane.org>
2012-02-29 20:29                                             ` Russell King - ARM Linux
2012-02-29 20:39                                             ` Uwe Kleine-König
     [not found]                                               ` <20120229203958.GQ14173-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-29 20:45                                                 ` Russell King - ARM Linux
     [not found]                                                   ` <20120229204527.GD16999-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2012-02-29 20:59                                                     ` Uwe Kleine-König
2012-03-01  4:55                                                       ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]                                                       ` <20120229205901.GR14173-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-03-12 17:42                                                         ` Marek Vasut
2012-02-29 21:27                                                     ` Stephen Warren
     [not found]                                                       ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF21A1-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-02-29 22:28                                                         ` Andre Renaud
2012-02-29 20:30                                     ` Uwe Kleine-König
2012-02-29 23:53                             ` Ryan Mallon
     [not found]                               ` <4F4EBA8C.1040408-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-03-12 17:44                                 ` Marek Vasut
2012-03-01 15:34                             ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox