* [PATCH] ARM: add support for uncompressed uImage kernel
@ 2010-11-09 13:50 Alexander Stein
2010-11-09 14:04 ` Russell King - ARM Linux
2010-11-09 14:57 ` Uwe Kleine-König
0 siblings, 2 replies; 10+ messages in thread
From: Alexander Stein @ 2010-11-09 13:50 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---
arch/arm/boot/Makefile | 10 ++++++++--
init/Kconfig | 7 +++++++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 4a590f4..37618b8 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -77,11 +77,17 @@ else
$(obj)/uImage: STARTADDR=$(LOADADDR)
endif
-$(obj)/uImage: $(obj)/zImage FORCE
+ifeq ($(CONFIG_KERNEL_NONE),y)
+ARM_IMAGE := Image
+else
+ARM_IMAGE := zImage
+endif
+
+$(obj)/uImage: $(obj)/$(ARM_IMAGE) FORCE
$(call if_changed,uimage)
@echo ' Image $@ is ready'
-$(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
+$(obj)/bootp/bootp: $(obj)/$(ARM_IMAGE) initrd FORCE
$(Q)$(MAKE) $(build)=$(obj)/bootp $@
@:
diff --git a/init/Kconfig b/init/Kconfig
index 88c1046..355d7a5 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -155,6 +155,13 @@ choice
If in doubt, select 'gzip'
+config KERNEL_NONE
+ bool "None"
+ depends on ARM
+ help
+ If you want to use get a fast startup at the cost of kernel size
+ you can use an uncompressed kernel.
+
config KERNEL_GZIP
bool "Gzip"
depends on HAVE_KERNEL_GZIP
--
1.7.2.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] ARM: add support for uncompressed uImage kernel
2010-11-09 13:50 [PATCH] ARM: add support for uncompressed uImage kernel Alexander Stein
@ 2010-11-09 14:04 ` Russell King - ARM Linux
2010-11-09 14:51 ` Uwe Kleine-König
` (2 more replies)
2010-11-09 14:57 ` Uwe Kleine-König
1 sibling, 3 replies; 10+ messages in thread
From: Russell King - ARM Linux @ 2010-11-09 14:04 UTC (permalink / raw)
To: linux-arm-kernel
Is it really faster to copy an uncompressed image than it is to
decompress using LZMA with caches on?
Remember that in terms of fast boot, uboot sucks - it's way over the
top of what you need. Eg, it always copies the image to RAM before
executing it. That gives two problems:
1. the image has to be copied, which takes time
2. the image then decompresses itself, but because its more often than
not living at the address which the decompressed image has to reside,
it then has to copy the decompressed image afterwards.
(2) is solved by loading the kernel compressed image elsewhere in memory.
(1) is solved by having a boot loader which can call the image where-ever
it resides (eg, in flash) and using the ZBOOT_ROM options.
I suspect that if you do both 1 and 2, you'll be faster than having uboot
copy an uncompressed image into system memory.
On Tue, Nov 09, 2010 at 02:50:56PM +0100, Alexander Stein wrote:
> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
> ---
> arch/arm/boot/Makefile | 10 ++++++++--
> init/Kconfig | 7 +++++++
> 2 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
> index 4a590f4..37618b8 100644
> --- a/arch/arm/boot/Makefile
> +++ b/arch/arm/boot/Makefile
> @@ -77,11 +77,17 @@ else
> $(obj)/uImage: STARTADDR=$(LOADADDR)
> endif
>
> -$(obj)/uImage: $(obj)/zImage FORCE
> +ifeq ($(CONFIG_KERNEL_NONE),y)
> +ARM_IMAGE := Image
> +else
> +ARM_IMAGE := zImage
> +endif
> +
> +$(obj)/uImage: $(obj)/$(ARM_IMAGE) FORCE
> $(call if_changed,uimage)
> @echo ' Image $@ is ready'
>
> -$(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
> +$(obj)/bootp/bootp: $(obj)/$(ARM_IMAGE) initrd FORCE
> $(Q)$(MAKE) $(build)=$(obj)/bootp $@
> @:
>
> diff --git a/init/Kconfig b/init/Kconfig
> index 88c1046..355d7a5 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -155,6 +155,13 @@ choice
>
> If in doubt, select 'gzip'
>
> +config KERNEL_NONE
> + bool "None"
> + depends on ARM
> + help
> + If you want to use get a fast startup at the cost of kernel size
> + you can use an uncompressed kernel.
> +
> config KERNEL_GZIP
> bool "Gzip"
> depends on HAVE_KERNEL_GZIP
> --
> 1.7.2.2
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH] ARM: add support for uncompressed uImage kernel
2010-11-09 14:04 ` Russell King - ARM Linux
@ 2010-11-09 14:51 ` Uwe Kleine-König
2010-11-09 22:38 ` Sascha Hauer
2010-11-13 10:47 ` Albin Tonnerre
2 siblings, 0 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2010-11-09 14:51 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 09, 2010 at 02:04:55PM +0000, Russell King - ARM Linux wrote:
> Is it really faster to copy an uncompressed image than it is to
> decompress using LZMA with caches on?
>
> Remember that in terms of fast boot, uboot sucks - it's way over the
> top of what you need. Eg, it always copies the image to RAM before
> executing it. That gives two problems:
Last time I checked (which is a few years ago) U-Boot was well able to
start a ZBOOT_ROM image. I'd be surprised if U-Boot lost that ability.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] ARM: add support for uncompressed uImage kernel
2010-11-09 14:04 ` Russell King - ARM Linux
2010-11-09 14:51 ` Uwe Kleine-König
@ 2010-11-09 22:38 ` Sascha Hauer
2010-11-13 10:47 ` Albin Tonnerre
2 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2010-11-09 22:38 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 09, 2010 at 02:04:55PM +0000, Russell King - ARM Linux wrote:
> Is it really faster to copy an uncompressed image than it is to
> decompress using LZMA with caches on?
>
At least on an i.MX35 I can read a bigger image from NAND faster than I
can read + uncompress a smaller image. ZBOOT_ROM is no option for NAND.
Reading from NAND is done with mmu/dcache on in this case.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] ARM: add support for uncompressed uImage kernel
2010-11-09 14:04 ` Russell King - ARM Linux
2010-11-09 14:51 ` Uwe Kleine-König
2010-11-09 22:38 ` Sascha Hauer
@ 2010-11-13 10:47 ` Albin Tonnerre
2010-11-18 7:38 ` Alexander Stein
2 siblings, 1 reply; 10+ messages in thread
From: Albin Tonnerre @ 2010-11-13 10:47 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 9, 2010 at 3:04 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> Is it really faster to copy an uncompressed image than it is to
> decompress using LZMA with caches on?
In my experience, using LZMA is painfully slow on older ARM CPUs.
If you really need to boot quickly you might want to try LZO, which
should give you results close to the uncompressed performance. It
might still be slower though, especially if you're able to load your
kernel image to memory fairly quickly
Regards,
--
Albin Tonnerre
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] ARM: add support for uncompressed uImage kernel
2010-11-13 10:47 ` Albin Tonnerre
@ 2010-11-18 7:38 ` Alexander Stein
2010-11-18 8:15 ` Uwe Kleine-König
2010-11-18 9:10 ` Russell King - ARM Linux
0 siblings, 2 replies; 10+ messages in thread
From: Alexander Stein @ 2010-11-18 7:38 UTC (permalink / raw)
To: linux-arm-kernel
Soory for late answer,
On Saturday 13 November 2010, 11:47:41 Albin Tonnerre wrote:
> <linux@arm.linux.org.uk> wrote:
> > Is it really faster to copy an uncompressed image than it is to
> > decompress using LZMA with caches on?
>
> In my experience, using LZMA is painfully slow on older ARM CPUs.
>
> If you really need to boot quickly you might want to try LZO, which
> should give you results close to the uncompressed performance. It
> might still be slower though, especially if you're able to load your
> kernel image to memory fairly quickly
We only have experience with GZIP. Our compressed kernel is ~1,8MB and
uncompressed ~4MB.
On an AT91 ARM9 SoC the decompression takes about 1-2s of time. Caches should
be disabled, as far as I could see in decompression code.
Copying the uncompressed kernel from NOR to SD-RAM takes about 140ms. So if
you can afford the additional storage need, simply copying the uncompressed
kernel is much faster than copying the compressed kernel which decompresses
itself.
Best regards,
Alexander
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] ARM: add support for uncompressed uImage kernel
2010-11-18 7:38 ` Alexander Stein
@ 2010-11-18 8:15 ` Uwe Kleine-König
2010-11-18 9:10 ` Russell King - ARM Linux
1 sibling, 0 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2010-11-18 8:15 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Nov 18, 2010 at 08:38:26AM +0100, Alexander Stein wrote:
> Soory for late answer,
>
> On Saturday 13 November 2010, 11:47:41 Albin Tonnerre wrote:
> > <linux@arm.linux.org.uk> wrote:
> > > Is it really faster to copy an uncompressed image than it is to
> > > decompress using LZMA with caches on?
> >
> > In my experience, using LZMA is painfully slow on older ARM CPUs.
> >
> > If you really need to boot quickly you might want to try LZO, which
> > should give you results close to the uncompressed performance. It
> > might still be slower though, especially if you're able to load your
> > kernel image to memory fairly quickly
>
> We only have experience with GZIP. Our compressed kernel is ~1,8MB and
> uncompressed ~4MB.
> On an AT91 ARM9 SoC the decompression takes about 1-2s of time. Caches should
> be disabled, as far as I could see in decompression code.
Caches are enabled in line 248 of
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=arch/arm/boot/compressed/head.S;h=6825c34646d4e02f24b0eefe7ab4e012bca05208;hb=HEAD
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] ARM: add support for uncompressed uImage kernel
2010-11-18 7:38 ` Alexander Stein
2010-11-18 8:15 ` Uwe Kleine-König
@ 2010-11-18 9:10 ` Russell King - ARM Linux
2010-11-18 10:18 ` Alexander Stein
1 sibling, 1 reply; 10+ messages in thread
From: Russell King - ARM Linux @ 2010-11-18 9:10 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Nov 18, 2010 at 08:38:26AM +0100, Alexander Stein wrote:
> We only have experience with GZIP. Our compressed kernel is ~1,8MB and
> uncompressed ~4MB.
> On an AT91 ARM9 SoC the decompression takes about 1-2s of time. Caches should
> be disabled, as far as I could see in decompression code.
Are you sure? ARM9 is supposed to be ARMv4T, which is covered by this
entry in the proc_types table:
.word 0x00020000 @ ARMv4T
.word 0x000f0000
W(b) __armv4_mmu_cache_on
W(b) __armv4_mmu_cache_off
W(b) __armv4_mmu_cache_flush
So caches _should_ be enabled.
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH] ARM: add support for uncompressed uImage kernel
2010-11-18 9:10 ` Russell King - ARM Linux
@ 2010-11-18 10:18 ` Alexander Stein
0 siblings, 0 replies; 10+ messages in thread
From: Alexander Stein @ 2010-11-18 10:18 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On Thursday 18 November 2010, 10:10:46 Russell King - ARM Linux wrote:
> On Thu, Nov 18, 2010 at 08:38:26AM +0100, Alexander Stein wrote:
> > We only have experience with GZIP. Our compressed kernel is ~1,8MB and
> > uncompressed ~4MB.
> > On an AT91 ARM9 SoC the decompression takes about 1-2s of time. Caches
> > should be disabled, as far as I could see in decompression code.
>
> Are you sure? ARM9 is supposed to be ARMv4T, which is covered by this
> entry in the proc_types table:
>
> .word 0x00020000 @ ARMv4T
> .word 0x000f0000
> W(b) __armv4_mmu_cache_on
> W(b) __armv4_mmu_cache_off
> W(b) __armv4_mmu_cache_flush
>
> So caches _should_ be enabled.
I'm _not_ sure. That was a long time ago and I only did a short look into the
decompression/setup code.
After I noticed using the uncompressed kernel is much faster, I didn't
investigate further.
Best regards,
Alexander
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] ARM: add support for uncompressed uImage kernel
2010-11-09 13:50 [PATCH] ARM: add support for uncompressed uImage kernel Alexander Stein
2010-11-09 14:04 ` Russell King - ARM Linux
@ 2010-11-09 14:57 ` Uwe Kleine-König
1 sibling, 0 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2010-11-09 14:57 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 09, 2010 at 02:50:56PM +0100, Alexander Stein wrote:
> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Quite some time ago I suggested something similar. I'm sure you can
find the mail in the archives. The result of my patch was the
introduction of a few more Make-targets:
uImage -> uimage(Image)
uzImage -> uimage(zImage) (== today's uImage)
uImagegz -> uimage(gzip(Image))
Russell objected that though.
Today I don't use the kernel Makefile anymore to build uImages, but let
ptxdist do that for me.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-11-18 10:18 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-09 13:50 [PATCH] ARM: add support for uncompressed uImage kernel Alexander Stein
2010-11-09 14:04 ` Russell King - ARM Linux
2010-11-09 14:51 ` Uwe Kleine-König
2010-11-09 22:38 ` Sascha Hauer
2010-11-13 10:47 ` Albin Tonnerre
2010-11-18 7:38 ` Alexander Stein
2010-11-18 8:15 ` Uwe Kleine-König
2010-11-18 9:10 ` Russell King - ARM Linux
2010-11-18 10:18 ` Alexander Stein
2010-11-09 14:57 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).