Skip to contentSkip to conversation

ARM: Add Kconfig option to use mkimage -T kernel_noload

PATCH New Stephen Warren 11 participants 32 messages Feb 29, 2012 – Mar 12, 2012

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

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

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.

---
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(-)
arch/arm/Kconfig +15 -0
index 0884b67..27e7672 100644
@@ -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"
arch/arm/boot/Makefile +14 -1
index fc871e7..45c3cbe 100644
@@ -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)'; \
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Stephen Warren wrote at Tuesday, February 28, 2012 5:03 PM:

Quoted 9 lines

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.

So Russell, are you NAKing this patch then?

If so, I guess I'll just go and add more cruft to my copy-a-kernel-to- an-sd-card script. Which is a pity since every other person will have to do the same, but oh well.

Signature · 1 line
nvpublic
#2 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Quoted 8 lines · Stephen Warren

Stephen Warren wrote at Tuesday, February 28, 2012 5:03 PM:

Quoted 7 lines

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.

Quoted 8 lines
Quoted 2 lines

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

So Russell, are you NAKing this patch then?

If so, I guess I'll just go and add more cruft to my copy-a-kernel-to- an-sd-card script. Which is a pity since every other person will have to do the same, but oh well.

I'd say send them on to his patch tracker and he can decide from there?

Feel free to add:

Some people seem to have a bone to pick with u-boot, and apparantly want us to make it harder to use the kernel with the firmware that is already out there. I personally disagree, but as you said, I'll just add my own wrapper script if it comes to it. So will everyone else though, and that just seems wasteful.

There hasn't been much churn lately around boot images (unlike the situation back 5 years ago in the thread that was referenced earlier in this thread, as far as I can tell).

So while the churn in this case is compensated by added convenience and productivity for me personally, it's up to Russell to decide if it goes in.

-Olof

#3 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

In reply to Stephen Warren
Quoted 8 lines · Stephen Warren

Stephen Warren wrote at Tuesday, February 28, 2012 5:03 PM:

Quoted 7 lines

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.

Quoted 8 lines
Quoted 2 lines

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

So Russell, are you NAKing this patch then?

If so, I guess I'll just go and add more cruft to my copy-a-kernel-to- an-sd-card script. Which is a pity since every other person will have to do the same, but oh well.

What about moving all the u-Boot bells and whistles to a generic top-level Kconfig+Makefile to be shared with all architectures? Really, there is nothing very ARM specific here.

Nicolas

#4 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

In reply to Stephen Warren
Quoted 7 lines · 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.

Quoted 6 lines

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

---
I assume I should put this into the ARM patch tracker if it's OK?

Again a new option for uImage no why not just boot the zImage

in this case the uImage is useless

Best Regards,
J.

#5 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Jean-Christophe PLAGNIOL-VILLARD wrote at Wednesday, February 29, 2012 5:30 AM:

Quoted 11 lines · Stephen Warren
Quoted 10 lines

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.

Quoted 7 lines
Quoted 3 lines

---
I assume I should put this into the ARM patch tracker if it's OK?

Again a new option for uImage no why not just boot the zImage

in this case the uImage is useless

U-Boot doesn't support zImage at present.

A patch was posted to support it at least for ARM, but needed a little work before it could be committed.

Signature · 1 line
nvpublic
#6 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Quoted 16 lines · Stephen Warren

Jean-Christophe PLAGNIOL-VILLARD wrote at Wednesday, February 29, 2012 5:30 AM:

Quoted 15 lines · Stephen Warren
Quoted 13 lines

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.

---
I assume I should put this into the ARM patch tracker if it's OK?

Quoted 8 lines
Quoted 3 lines

Again a new option for uImage no why not just boot the zImage

in this case the uImage is useless

U-Boot doesn't support zImage at present.

A patch was posted to support it at least for ARM, but needed a little work before it could be committed.

Sorry I see no advantage to have the uImage build by the kernel anymore as we have a relocatable zImage

I'll even drop its support

Best Regards,
J.

#7 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Quoted 21 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 20 lines · Stephen Warren

Jean-Christophe PLAGNIOL-VILLARD wrote at Wednesday, February 29, 2012 5:30 AM:

Quoted 18 lines · Stephen Warren
Quoted 7 lines

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.

Quoted 6 lines

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

---
I assume I should put this into the ARM patch tracker if it's OK?

Again a new option for uImage no why not just boot the zImage

in this case the uImage is useless

Quoted 8 lines
Quoted 4 lines

U-Boot doesn't support zImage at present.

A patch was posted to support it at least for ARM, but needed a little work before it could be committed.

Sorry I see no advantage to have the uImage build by the kernel anymore as we have a relocatable zImage

I'll even drop its support

This seems at least premature, and possibly ill-advised in general. There are lots of U-Boot images out in the field, many of which that are rarely updated. A lot of workflow will be disrupted unnecessarily by a change like this.

Could you wait to drop uImage build support in the kernel until U-Boot supports zImage, and has worked it's way into the field for a few years?
-- Tim

=============================
Tim Bird
Architecture Group Chair, CE Workgroup of the Linux Foundation Senior Staff Engineer, Sony Network Entertainment
=============================

#8 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Quoted 31 lines · Tim Bird
Quoted 21 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 20 lines · Stephen Warren

Jean-Christophe PLAGNIOL-VILLARD wrote at Wednesday, February 29, 2012 5:30 AM:

Quoted 18 lines · Stephen Warren
Quoted 7 lines

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.

Quoted 6 lines

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

---
I assume I should put this into the ARM patch tracker if it's OK?

Again a new option for uImage no why not just boot the zImage

in this case the uImage is useless

Quoted 8 lines
Quoted 4 lines

U-Boot doesn't support zImage at present.

A patch was posted to support it at least for ARM, but needed a little work before it could be committed.

Sorry I see no advantage to have the uImage build by the kernel anymore as we have a relocatable zImage

I'll even drop its support

Quoted 8 lines

This seems at least premature, and possibly ill-advised in general. There are lots of U-Boot images out in the field, many of which that are rarely updated. A lot of workflow will be disrupted unnecessarily by a change like this.

Could you wait to drop uImage build support in the kernel until U-Boot supports zImage, and has worked it's way into the field for a few years?

I'm fine to keep for now on but not to add new feature

Barebox (former U-Boot v2) support zImage for quite a while and relocable one for too.

Best Regards,
J.

Quoted 8 lines

-- Tim

=============================
Tim Bird
Architecture Group Chair, CE Workgroup of the Linux Foundation Senior Staff Engineer, Sony Network Entertainment
=============================

#9 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 4 lines · Tim Bird
Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 2 lines · Stephen Warren
Quoted 1 line

Jean-Christophe PLAGNIOL-VILLARD wrote at Wednesday, February 29, 2012

5:30 AM:

Quoted 35 lines
Quoted 35 lines
Quoted 22 lines
Quoted 22 lines
Quoted 12 lines · Stephen Warren
Quoted 11 lines

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.

Quoted 7 lines
Quoted 3 lines

---
I assume I should put this into the ARM patch tracker if it's OK?

Again a new option for uImage no why not just boot the zImage

in this case the uImage is useless

U-Boot doesn't support zImage at present.

Quoted 7 lines
Quoted 2 lines

A patch was posted to support it at least for ARM, but needed a little work before it could be committed.

Sorry I see no advantage to have the uImage build by the kernel anymore as we have a relocatable zImage

I'll even drop its support

This seems at least premature, and possibly ill-advised in general. There are lots of U-Boot images out in the field, many of which that are rarely updated. A lot of workflow will be disrupted unnecessarily by a change like this.

Quoted 8 lines
Quoted 3 lines

Could you wait to drop uImage build support in the kernel until U-Boot supports zImage, and has worked it's way into the field for a few years?

I'm fine to keep for now on but not to add new feature

Barebox (former U-Boot v2) support zImage for quite a while and relocable one for too.

On the other hand, noone uses barebox and you should stop with this obvious malice towards uboot please. I believe for most people it's easier to spend time only on implementing their hardware support into U-Boot, not waste time implementing basic components that are still missing in barebox.

Last but not least, the uImage contains additional checksum on the whole image, which is useful on flash media.

That said, I'm all for having uImage support in kernel and for adding this NOLOAD option.

Best regards,
Marek Vasut

#10 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Quoted 48 lines · Marek Vasut

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 4 lines · Tim Bird
Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 2 lines · Stephen Warren
Quoted 1 line

Jean-Christophe PLAGNIOL-VILLARD wrote at Wednesday, February 29, 2012

5:30 AM:

Quoted 41 lines
Quoted 30 lines
Quoted 22 lines
Quoted 22 lines
Quoted 12 lines · Stephen Warren
Quoted 11 lines

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.

Quoted 7 lines
Quoted 3 lines

---
I assume I should put this into the ARM patch tracker if it's OK?

Again a new option for uImage no why not just boot the zImage

in this case the uImage is useless

U-Boot doesn't support zImage at present.

Quoted 7 lines
Quoted 2 lines

A patch was posted to support it at least for ARM, but needed a little work before it could be committed.

Sorry I see no advantage to have the uImage build by the kernel anymore as we have a relocatable zImage

I'll even drop its support

Quoted 8 lines

This seems at least premature, and possibly ill-advised in general. There are lots of U-Boot images out in the field, many of which that are rarely updated. A lot of workflow will be disrupted unnecessarily by a change like this.

Could you wait to drop uImage build support in the kernel until U-Boot supports zImage, and has worked it's way into the field for a few years?

I'm fine to keep for now on but not to add new feature

Quoted 7 lines
Quoted 2 lines

Barebox (former U-Boot v2) support zImage for quite a while and relocable one for too.

On the other hand, noone uses barebox and you should stop with this obvious malice towards uboot please. I believe for most people it's easier to spend time only on implementing their hardware support into U-Boot, not waste time implementing basic components that are still missing in barebox.

Speak for yourself please

Quoted 6 lines

Last but not least, the uImage contains additional checksum on the whole image, which is useful on flash media.

That said, I'm all for having uImage support in kernel and for adding this NOLOAD option.

I'm going to repeat myself, we work on kernel here NOT bootloader specific bla bla. The standard image for the kernel is zImage. After if you want to use your specifc bootloader stuff do it outside of the kernel.

My comment is the same for ANY bootloader. Do your specifc stuff at your place not HERE.

Best Regards,
J.

#11 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

In reply to Tim Bird
Quoted 31 lines · Tim Bird
Quoted 21 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 20 lines · Stephen Warren

Jean-Christophe PLAGNIOL-VILLARD wrote at Wednesday, February 29, 2012 5:30 AM:

Quoted 18 lines · Stephen Warren
Quoted 7 lines

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.

Quoted 6 lines

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

---
I assume I should put this into the ARM patch tracker if it's OK?

Again a new option for uImage no why not just boot the zImage

in this case the uImage is useless

Quoted 8 lines
Quoted 4 lines

U-Boot doesn't support zImage at present.

A patch was posted to support it at least for ARM, but needed a little work before it could be committed.

Sorry I see no advantage to have the uImage build by the kernel anymore as we have a relocatable zImage

I'll even drop its support

Quoted 8 lines

This seems at least premature, and possibly ill-advised in general. There are lots of U-Boot images out in the field, many of which that are rarely updated. A lot of workflow will be disrupted unnecessarily by a change like this.

Could you wait to drop uImage build support in the kernel until U-Boot supports zImage, and has worked it's way into the field for a few years?

I admit I didn't check for a few years, but regarding that the values used to build the uImage from a zImage are (or at least were) quite bad, I'd say deprecate the uImage target today.

Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#12 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Uwe Kleine-K?nig wrote at Wednesday, February 29, 2012 12:12 PM:

Quoted 37 lines · Tim Bird
Quoted 36 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 21 lines · Stephen Warren
Quoted 20 lines

Jean-Christophe PLAGNIOL-VILLARD wrote at Wednesday, February 29, 2012 5:30 AM:

Quoted 18 lines · Stephen Warren
Quoted 7 lines

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.

Quoted 6 lines

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

---
I assume I should put this into the ARM patch tracker if it's OK?

Again a new option for uImage no why not just boot the zImage

in this case the uImage is useless

Quoted 8 lines
Quoted 4 lines

U-Boot doesn't support zImage at present.

A patch was posted to support it at least for ARM, but needed a little work before it could be committed.

Sorry I see no advantage to have the uImage build by the kernel anymore as we have a relocatable zImage

I'll even drop its support

This seems at least premature, and possibly ill-advised in general. There are lots of U-Boot images out in the field, many of which that are rarely updated. A lot of workflow will be disrupted unnecessarily by a change like this.

Quoted 7 lines
Quoted 3 lines

Could you wait to drop uImage build support in the kernel until U-Boot supports zImage, and has worked it's way into the field for a few years?

I admit I didn't check for a few years, but regarding that the values used to build the uImage from a zImage are (or at least were) quite bad, I'd say deprecate the uImage target today.

That would prevent anyone from using U-Boot without having to go through manual steps to duplicate what already exists in the uImage target in the kernel.

The existing target works just fine today.

This patch even allows the existing target to be useful for multi-Soc.

I really don't understand the "lets drop support for something that works just fine and isn't a maintenance burden" argument.

Signature · 1 line
nvpublic
#13 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Quoted 46 lines · Stephen Warren

Uwe Kleine-K?nig wrote at Wednesday, February 29, 2012 12:12 PM:

Quoted 37 lines · Tim Bird
Quoted 36 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 21 lines · Stephen Warren
Quoted 20 lines

Jean-Christophe PLAGNIOL-VILLARD wrote at Wednesday, February 29, 2012 5:30 AM:

Quoted 18 lines · Stephen Warren
Quoted 7 lines

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.

Quoted 6 lines

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

---
I assume I should put this into the ARM patch tracker if it's OK?

Again a new option for uImage no why not just boot the zImage

in this case the uImage is useless

Quoted 8 lines
Quoted 4 lines

U-Boot doesn't support zImage at present.

A patch was posted to support it at least for ARM, but needed a little work before it could be committed.

Sorry I see no advantage to have the uImage build by the kernel anymore as we have a relocatable zImage

I'll even drop its support

This seems at least premature, and possibly ill-advised in general. There are lots of U-Boot images out in the field, many of which that are rarely updated. A lot of workflow will be disrupted unnecessarily by a change like this.

Quoted 7 lines
Quoted 3 lines

Could you wait to drop uImage build support in the kernel until U-Boot supports zImage, and has worked it's way into the field for a few years?

I admit I didn't check for a few years, but regarding that the values used to build the uImage from a zImage are (or at least were) quite bad, I'd say deprecate the uImage target today.

Quoted 5 lines

That would prevent anyone from using U-Boot without having to go through manual steps to duplicate what already exists in the uImage target in the kernel.

The existing target works just fine today.

It depends what you want to achieve. If you want to make everything maximally easy for everyone you can optimize the uImage target.

If you want to give incentive for U-Boot to improve, drop the target today. And note that at least people caring about boot time must not use the kernel's uImage target anyhow.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#14 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Uwe Kleine-K?nig wrote at Wednesday, February 29, 2012 12:44 PM:
...

Quoted 3 lines

If you want to give incentive for U-Boot to improve, drop the target today. And note that at least people caring about boot time must not use the kernel's uImage target anyhow.

If you enable the new config option in this patch, then the performance issue is solved; U-Boot doesn't copy the kernel image any more, and the kernel decompressor can write directly to the appropriate location without moving the image first (assuming your board boot script loads the uImage to a non-conflicting address).

--
nvpublic

#15 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Quoted 11 lines · Stephen Warren

Uwe Kleine-K?nig wrote at Wednesday, February 29, 2012 12:44 PM:
...

Quoted 3 lines

If you want to give incentive for U-Boot to improve, drop the target today. And note that at least people caring about boot time must not use the kernel's uImage target anyhow.

If you enable the new config option in this patch, then the performance issue is solved; U-Boot doesn't copy the kernel image any more, and the kernel decompressor can write directly to the appropriate location without moving the image first (assuming your board boot script loads the uImage to a non-conflicting address).

I may have missed part of this, but isn't one of the points regarding this that the zImage decompressor always runs with data cache disabled, resulting in a slow decompress, where as if the U-Boot decompressor is used (ie, gzipping the Image, and telling U-Boot to decompress), then it can run with caches enabled, improving boot speed?

Thus the relocation issue is not really the speed hit, rather it is the image decompression.

Regards,
Andre

#16 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Andre Renaud wrote at Wednesday, February 29, 2012 1:12 PM:

Quoted 13 lines · Stephen Warren
Quoted 11 lines

Uwe Kleine-K?nig wrote at Wednesday, February 29, 2012 12:44 PM:
...

Quoted 3 lines

If you want to give incentive for U-Boot to improve, drop the target today. And note that at least people caring about boot time must not use the kernel's uImage target anyhow.

If you enable the new config option in this patch, then the performance issue is solved; U-Boot doesn't copy the kernel image any more, and the kernel decompressor can write directly to the appropriate location without moving the image first (assuming your board boot script loads the uImage to a non-conflicting address).

Quoted 8 lines

I may have missed part of this, but isn't one of the points regarding this that the zImage decompressor always runs with data cache disabled, resulting in a slow decompress, where as if the U-Boot decompressor is used (ie, gzipping the Image, and telling U-Boot to decompress), then it can run with caches enabled, improving boot speed?

Thus the relocation issue is not really the speed hit, rather it is the image decompression.

OK, there probably are multiple different issues affecting the performance, and this patch only affects the one that applies once you've decided to use uImage to wrap a zImage in the first place.

Signature · 1 line
nvpublic
#17 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

In reply to Andre Renaud
Quoted 7 lines · Andre Renaud
Quoted 6 lines · Stephen Warren

Uwe Kleine-K?nig wrote at Wednesday, February 29, 2012 12:44 PM:
...

Quoted 3 lines

If you want to give incentive for U-Boot to improve, drop the target today. And note that at least people caring about boot time must not use the kernel's uImage target anyhow.

Quoted 8 lines
Quoted 5 lines

If you enable the new config option in this patch, then the performance issue is solved; U-Boot doesn't copy the kernel image any more, and the kernel decompressor can write directly to the appropriate location without moving the image first (assuming your board boot script loads the uImage to a non-conflicting address).

I may have missed part of this, but isn't one of the points regarding this that the zImage decompressor always runs with data cache disabled,

Most certainly not. We've had the data cache enabled for years and years. And I mean 10+ years. We may have been lacking support on some CPUs, but that was because of lack of contributions.

Quoted 3 lines

resulting in a slow decompress, where as if the U-Boot decompressor is used (ie, gzipping the Image, and telling U-Boot to decompress), then it can run with caches enabled, improving boot speed?

That's pure FUD.

#18 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Hi Russell,

Quoted 7 lines
Quoted 2 lines

I may have missed part of this, but isn't one of the points regarding this that the zImage decompressor always runs with data cache disabled,

Most certainly not. We've had the data cache enabled for years and years. And I mean 10+ years. We may have been lacking support on some CPUs, but that was because of lack of contributions.

Quoted 5 lines
Quoted 3 lines

resulting in a slow decompress, where as if the U-Boot decompressor is used (ie, gzipping the Image, and telling U-Boot to decompress), then it can run with caches enabled, improving boot speed?

That's pure FUD.

I don't want to open a can of worms on this, and I certainly haven't looked into the image decompressor within the Linux kernel, but from a boot speed point of view we certainly see a significant speed improvement switching from zImage to gzipped-Image. Do you know which platforms include the data-cache support in the decompressor?

Regards,
Andre

#19 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Quoted 12 lines · Andre Renaud

Hi Russell,

Quoted 11 lines
Quoted 2 lines

I may have missed part of this, but isn't one of the points regarding this that the zImage decompressor always runs with data cache disabled,

Most certainly not. We've had the data cache enabled for years and years. And I mean 10+ years. We may have been lacking support on some CPUs, but that was because of lack of contributions.

Quoted 3 lines

resulting in a slow decompress, where as if the U-Boot decompressor is used (ie, gzipping the Image, and telling U-Boot to decompress), then it can run with caches enabled, improving boot speed?

Quoted 7 lines
Quoted 1 line

That's pure FUD.

I don't want to open a can of worms on this, and I certainly haven't looked into the image decompressor within the Linux kernel, but from a boot speed point of view we certainly see a significant speed improvement switching from zImage to gzipped-Image. Do you know which platforms include the data-cache support in the decompressor?

All.

#20 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

In reply to Andre Renaud
Quoted 12 lines · Andre Renaud

Hi Russell,

Quoted 11 lines
Quoted 2 lines

I may have missed part of this, but isn't one of the points regarding this that the zImage decompressor always runs with data cache disabled,

Most certainly not. We've had the data cache enabled for years and years. And I mean 10+ years. We may have been lacking support on some CPUs, but that was because of lack of contributions.

Quoted 3 lines

resulting in a slow decompress, where as if the U-Boot decompressor is used (ie, gzipping the Image, and telling U-Boot to decompress), then it can run with caches enabled, improving boot speed?

Quoted 7 lines
Quoted 1 line

That's pure FUD.

I don't want to open a can of worms on this, and I certainly haven't looked into the image decompressor within the Linux kernel, but from a boot speed point of view we certainly see a significant speed improvement switching from zImage to gzipped-Image. Do you know which platforms include the data-cache support in the decompressor?

I'd bet your platform has cache support in the decompressor without knowing which platform you use. I suggest commenting out

bl cache_on

in arch/arm/boot/compressed/head.S to see the difference.

How do you build the uImage containing the zImage? If you use the in-kernel uImage target booting that usually means:

- move the zImage to ZRELADDR
- jump into zImage
- decompress zImage to somewhere else
- move decompressed image to ZRELADDR
- jump to ZRELADDR

That is you have two relocations because the first location for sure conflicts with the decompressed image.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#21 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Quoted 10 lines · Uwe Kleine-K?nig

I'd bet your platform has cache support in the decompressor without knowing which platform you use. I suggest commenting out

bl cache_on

in arch/arm/boot/compressed/head.S to see the difference.

How do you build the uImage containing the zImage? If you use the in-kernel uImage target booting that usually means:

Quoted 8 lines

- move the zImage to ZRELADDR
- jump into zImage
- decompress zImage to somewhere else
- move decompressed image to ZRELADDR
- jump to ZRELADDR

That is you have two relocations because the first location for sure conflicts with the decompressed image.

Actually, we do this slightly differently nowadays. Inside zImage:

- if zImage location conflicts, move the decompressed data and decompressor to another location
- decompress zImage to ZRELADDR
- jump to ZRELADDR

That reduces the size required for copying. Of course, that copy can (as it's always been the case) be totally eliminated by ensuring that you load the zImage out of the way of the decompressed image.

So, really, comparing a standard uImage produced by the standard kernel with gzipped Image is far from a fair comparison. And that's actually another argument for getting rid of the uImage target... it may make people think a bit about what they're doing rather than accepting whatever default location someone else chose for their kernel.

#22 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Quoted 17 lines · Russell King - ARM Linux
Quoted 16 lines · Uwe Kleine-K?nig

I'd bet your platform has cache support in the decompressor without knowing which platform you use. I suggest commenting out

bl cache_on

in arch/arm/boot/compressed/head.S to see the difference.

How do you build the uImage containing the zImage? If you use the in-kernel uImage target booting that usually means:

- move the zImage to ZRELADDR
- jump into zImage
- decompress zImage to somewhere else
- move decompressed image to ZRELADDR
- jump to ZRELADDR

Quoted 6 lines
Quoted 2 lines

That is you have two relocations because the first location for sure conflicts with the decompressed image.

Actually, we do this slightly differently nowadays. Inside zImage:

- if zImage location conflicts, move the decompressed data

s/de//

Quoted 8 lines

and decompressor to another location
- decompress zImage to ZRELADDR
- jump to ZRELADDR

That reduces the size required for copying. Of course, that copy can (as it's always been the case) be totally eliminated by ensuring that you load the zImage out of the way of the decompressed image.

Quoted 5 lines

So, really, comparing a standard uImage produced by the standard kernel with gzipped Image is far from a fair comparison. And that's actually another argument for getting rid of the uImage target... it may make people think a bit about what they're doing rather than accepting whatever default location someone else chose for their kernel.

I'm all in favour to remove the uImage target because back in 2007 we already had a similar discussion[1]. (Back then I still thought that improving the uImage support would be a good idea.)

That said I think *in general* having support for U-Boot in the kernel is fine because I think U-Boot is the bootloader used most. But if you need some Kconfig settings or more than one Makefile target I think just building an Image or zImage and doing the U-Boot wrapping without the help of Linux' build system is preferable.

Best regards
Uwe

[1] http://thread.gmane.org/gmane.linux.ports.arm.kernel/36547/focus=36588

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#23 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Quoted 43 lines · Uwe Kleine-K?nig
Quoted 17 lines · Russell King - ARM Linux
Quoted 16 lines · Uwe Kleine-K?nig

I'd bet your platform has cache support in the decompressor without knowing which platform you use. I suggest commenting out

bl cache_on

in arch/arm/boot/compressed/head.S to see the difference.

How do you build the uImage containing the zImage? If you use the in-kernel uImage target booting that usually means:

- move the zImage to ZRELADDR
- jump into zImage
- decompress zImage to somewhere else
- move decompressed image to ZRELADDR
- jump to ZRELADDR

Quoted 6 lines
Quoted 2 lines

That is you have two relocations because the first location for sure conflicts with the decompressed image.

Actually, we do this slightly differently nowadays. Inside zImage:

- if zImage location conflicts, move the decompressed data

s/de//

Quoted 8 lines

and decompressor to another location
- decompress zImage to ZRELADDR
- jump to ZRELADDR

That reduces the size required for copying. Of course, that copy can (as it's always been the case) be totally eliminated by ensuring that you load the zImage out of the way of the decompressed image.

Quoted 5 lines

So, really, comparing a standard uImage produced by the standard kernel with gzipped Image is far from a fair comparison. And that's actually another argument for getting rid of the uImage target... it may make people think a bit about what they're doing rather than accepting whatever default location someone else chose for their kernel.

I'm all in favour to remove the uImage target because back in 2007 we already had a similar discussion[1]. (Back then I still thought that improving the uImage support would be a good idea.)

Quoted 5 lines

That said I think *in general* having support for U-Boot in the kernel is fine because I think U-Boot is the bootloader used most. But if you need some Kconfig settings or more than one Makefile target I think just building an Image or zImage and doing the U-Boot wrapping without the help of Linux' build system is preferable.

Agreed at 200%

Best Regards,
J.

#24 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

In reply to Uwe Kleine-König

Dear Uwe Kleine-K?nig,

Quoted 45 lines · Russell King - ARM Linux
Quoted 17 lines · Uwe Kleine-K?nig
Quoted 16 lines

I'd bet your platform has cache support in the decompressor without knowing which platform you use. I suggest commenting out

bl cache_on

in arch/arm/boot/compressed/head.S to see the difference.

How do you build the uImage containing the zImage? If you use the

in-kernel uImage target booting that usually means:
- move the zImage to ZRELADDR
- jump into zImage
- decompress zImage to somewhere else
- move decompressed image to ZRELADDR
- jump to ZRELADDR

Quoted 5 lines
Quoted 2 lines

That is you have two relocations because the first location for sure conflicts with the decompressed image.

Actually, we do this slightly differently nowadays. Inside zImage:
- if zImage location conflicts, move the decompressed data

s/de//

Quoted 9 lines

and decompressor to another location

- decompress zImage to ZRELADDR
- jump to ZRELADDR

That reduces the size required for copying. Of course, that copy can (as it's always been the case) be totally eliminated by ensuring that you load the zImage out of the way of the decompressed image.

Quoted 5 lines

So, really, comparing a standard uImage produced by the standard kernel with gzipped Image is far from a fair comparison. And that's actually another argument for getting rid of the uImage target... it may make people think a bit about what they're doing rather than accepting whatever default location someone else chose for their kernel.

I'm all in favour to remove the uImage target because back in 2007 we already had a similar discussion[1]. (Back then I still thought that improving the uImage support would be a good idea.)

Quoted 5 lines

That said I think *in general* having support for U-Boot in the kernel is fine because I think U-Boot is the bootloader used most. But if you need some Kconfig settings or more than one Makefile target I think just building an Image or zImage and doing the U-Boot wrapping without the help of Linux' build system is preferable.

I believe eventually everyone will converge to having this option enabled. Therefore this config option will just be always on and can be squashed away.

Quoted 5 lines

Best regards
Uwe

[1] http://thread.gmane.org/gmane.linux.ports.arm.kernel/36547/focus=36588

Best regards,
Marek Vasut

#25 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

In reply to Russell King - ARM Linux

Russell King wrote at Wednesday, February 29, 2012 1:45 PM:
...

Quoted 5 lines

So, really, comparing a standard uImage produced by the standard kernel with gzipped Image is far from a fair comparison. And that's actually another argument for getting rid of the uImage target... it may make people think a bit about what they're doing rather than accepting whatever default location someone else chose for their kernel.

That seems like more of an argument for making the uImage target use -T kernel_noload unconditionally, rather than removing the target. Since doing so would solve the issue about the kernel picking a load address.

That is, ignoring any arguments about breaking existing workflows at least...

Signature · 1 line
nvpublic
#26 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Quoted 8 lines · Stephen Warren

Russell King wrote at Wednesday, February 29, 2012 1:45 PM:
...

Quoted 5 lines

So, really, comparing a standard uImage produced by the standard kernel with gzipped Image is far from a fair comparison. And that's actually another argument for getting rid of the uImage target... it may make people think a bit about what they're doing rather than accepting whatever default location someone else chose for their kernel.

Quoted 7 lines

That seems like more of an argument for making the uImage target use -T kernel_noload unconditionally, rather than removing the target. Since doing so would solve the issue about the kernel picking a load address.

That is, ignoring any arguments about breaking existing workflows at least...

I think this is the case that I was seeing - the current behaviour of the uImage target, of using the zreladdr as the load/start addresses essentially guarantees the worst case relocation behaviour.

Regards,
Andre

#27 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

In reply to Andre Renaud
Quoted 13 lines · Andre Renaud
Quoted 11 lines · Stephen Warren

Uwe Kleine-K?nig wrote at Wednesday, February 29, 2012 12:44 PM:
...

Quoted 3 lines

If you want to give incentive for U-Boot to improve, drop the target today. And note that at least people caring about boot time must not use the kernel's uImage target anyhow.

If you enable the new config option in this patch, then the performance issue is solved; U-Boot doesn't copy the kernel image any more, and the kernel decompressor can write directly to the appropriate location without moving the image first (assuming your board boot script loads the uImage to a non-conflicting address).

Quoted 5 lines

I may have missed part of this, but isn't one of the points regarding this that the zImage decompressor always runs with data cache disabled, resulting in a slow decompress, where as if the U-Boot decompressor is used (ie, gzipping the Image, and telling U-Boot to decompress), then it can run with caches enabled, improving boot speed?

This is wrong. The zImage decompressor runs with caches on. The advantage that U-Boot (maybe) has when doing the decompression itself is that the cache for reading the zImage is already hot when U-Boot copied it from NAND to RAM first. (I don't know if U-Boot can decompress directly from NAND without writing the Image to RAM first?!)

Quoted 2 lines

Thus the relocation issue is not really the speed hit, rather it is the image decompression.

I'm sure that letting U-Boot decompress an image that first has to be moved to prevent it being overwritten during decompression is slower than jumping into zImage if the image isn't relocated.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#28 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

In reply to Uwe Kleine-König
Quoted 7 lines · Uwe Kleine-K?nig
Quoted 6 lines · Stephen Warren

Uwe Kleine-K?nig wrote at Wednesday, February 29, 2012 12:12 PM:

Quoted 5 lines · Tim Bird
Quoted 4 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 3 lines · Stephen Warren
Quoted 2 lines

Jean-Christophe PLAGNIOL-VILLARD wrote at Wednesday, February 29, 2012 5:30 AM:

Quoted 1 line · Stephen Warren

<snip>

Quoted 6 lines
Quoted 1 line

The existing target works just fine today.

It depends what you want to achieve. If you want to make everything maximally easy for everyone you can optimize the uImage target.

If you want to give incentive for U-Boot to improve, drop the target today.

This assumes that people will upgrade their bootloaders, which is not always possible or desirable.

~Ryan

#29 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

Dear Ryan Mallon,

Quoted 7 lines · Uwe Kleine-K?nig
Quoted 6 lines · Stephen Warren
Quoted 5 lines

Uwe Kleine-K?nig wrote at Wednesday, February 29, 2012 12:12 PM:

Quoted 4 lines · Tim Bird
Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 2 lines · Stephen Warren
Quoted 1 line

Jean-Christophe PLAGNIOL-VILLARD wrote at Wednesday, February 29, 2012

5:30 AM:

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Stephen Warren

<snip>

Quoted 5 lines
Quoted 1 line

The existing target works just fine today.

It depends what you want to achieve. If you want to make everything maximally easy for everyone you can optimize the uImage target.

Quoted 8 lines
Quoted 2 lines

If you want to give incentive for U-Boot to improve, drop the target today.

This assumes that people will upgrade their bootloaders, which is not always possible or desirable.

~Ryan

Agreed 201%

Best regards,
Marek Vasut

#30 lore raw

PATCH 1/2 ARM: Add Kconfig option to use mkimage -T kernel_noload

In reply to Uwe Kleine-König
Quoted 3 lines · Uwe Kleine-K?nig

If you want to give incentive for U-Boot to improve, drop the target today. And note that at least people caring about boot time must not use the kernel's uImage target anyhow.

It's not just u-boot, at least Qi also uses uImage (I'm stuck with it on one platform and don't currently have the time/enthusiasm to fix either the bootloader selection or the zImage support).

#31 lore raw

PATCH 2/2 ARM: tegra: Add zreladdr etc to Makefile.boot for Tegra30

In reply to Stephen Warren

These previously weren't present, because they're different for Tegra20 and Tegra30, which forced one to specify LOADADDR= when building uImages for kernels with both Tegra20 and Tegra30 support enabled.

My expectation now is that everyone will turn on CONFIG_UIMAGE_NOLOAD and hence not be inconvenienced by having this information present.

---
This somewhat depends on the previous patch or it'll be annoying to build multi-SoC Tegra kernels, so I guess it should get merged through the same tree.

 arch/arm/mach-tegra/Makefile.boot |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/mach-tegra/Makefile.boot +4 -0
index 9a82094..b6101f8 100644
@@ -2,6 +2,10 @@ zreladdr-$(CONFIG_ARCH_TEGRA_2x_SOC)	+= 0x00008000
 params_phys-$(CONFIG_ARCH_TEGRA_2x_SOC)	:= 0x00000100
 initrd_phys-$(CONFIG_ARCH_TEGRA_2x_SOC)	:= 0x00800000
 
+zreladdr-$(CONFIG_ARCH_TEGRA_3x_SOC)	+= 0x80008000
+params_phys-$(CONFIG_ARCH_TEGRA_3x_SOC)	:= 0x80000100
+initrd_phys-$(CONFIG_ARCH_TEGRA_3x_SOC)	:= 0x80800000
+
 dtb-$(CONFIG_MACH_HARMONY) += tegra-harmony.dtb
 dtb-$(CONFIG_MACH_PAZ00) += tegra-paz00.dtb
 dtb-$(CONFIG_MACH_SEABOARD) += tegra-seaboard.dtb
Signature · 1 line
1.7.0.4