Re: New MMC maintainer needed

2009-07-29 Thread Ian Molton

Andrew Morton wrote:


I expect that Dave Miller can set up linux-...@vger.kernel.org in a
jiffy.  A MAINTAINERS patch should be made if this is done.


I've sent him an email, will let you all know what happens.
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/5 v2] Add support for LZO-compressed kernels

2009-07-29 Thread Albin Tonnerre
This is the first part of the lzo patch
The lzo compressor is worse than gzip at compression, but faster at
extraction. Here are some figures for an ARM board I'm working on:

Uncompressed size: 3.24Mo
gzip  1.61Mo 0.72s
lzo   1.75Mo 0.48s

So for a compression ratio that is still relatively close to gzip, it's
much faster to extract, at least in that case.

This version applies to kernel 2.6.31-rc3

This part contains:
 - Makefile routine to support lzo compression
 - Fixes to the existing lzo compressor so that it can be used in
   compressed kernels
 - wrapper around the existing lzo1x_decompress, as it only extracts one
   block at a time, while we need to extract a whole file here
 - config dialog for kernel compression

Signed-off-by: Albin Tonnerre albin.tonne...@free-electrons.com
---
Changelog since v1:

lib/decompress_unlzo.c
 - Rename lzo_decompress to unlzo to match the prototype in decompress/unlzo.h
 - Use LZO_BLOCK_SIZE instead of BLOCK_SIZE to avoid confusion
 - Add support for using the posp, fill and flush arguments
 - Reorder includes so that linux/types.h is included before
   linux/lzo.h. This prevents issue when not used as bootstrap code, as
   lzo.h needs things like size_t
 - When we are not using unlzo as part of kernel bootstrap code, we need
   linux/slab.h for memory allocation functions.
 - ... and we also need a call to set_error_fn so that the provided error
   function is used correctly

 include/linux/decompress/unlzo.h |   10 ++
 init/Kconfig |   18 +++-
 lib/decompress_unlzo.c   |  206 ++
 lib/lzo/lzo1x_decompress.c   |9 +-
 scripts/Makefile.lib |5 +
 5 files changed, 241 insertions(+), 7 deletions(-)
 create mode 100644 include/linux/decompress/unlzo.h
 create mode 100644 lib/decompress_unlzo.c

diff --git a/include/linux/decompress/unlzo.h b/include/linux/decompress/unlzo.h
new file mode 100644
index 000..d1925ea
--- /dev/null
+++ b/include/linux/decompress/unlzo.h
@@ -0,0 +1,10 @@
+#ifndef DECOMPRESS_UNLZO_H
+#define DECOMPRESS_UNLZO_H
+
+int unlzo(unsigned char *inbuf, int len,
+  int(*fill)(void*, unsigned int),
+  int(*flush)(void*, unsigned int),
+  unsigned char *output,
+  int *pos,
+  void(*error)(char *x));
+#endif
diff --git a/init/Kconfig b/init/Kconfig
index cb2c092..ada6182 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -115,10 +115,13 @@ config HAVE_KERNEL_BZIP2
 config HAVE_KERNEL_LZMA
bool
 
+config HAVE_KERNEL_LZO
+   bool
+
 choice
prompt Kernel compression mode
default KERNEL_GZIP
-   depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA
+   depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || 
HAVE_KERNEL_LZO
help
  The linux kernel is a kind of self-extracting executable.
  Several compression algorithms are available, which differ
@@ -141,9 +144,8 @@ config KERNEL_GZIP
bool Gzip
depends on HAVE_KERNEL_GZIP
help
- The old and tried gzip compression. Its compression ratio is
- the poorest among the 3 choices; however its speed (both
- compression and decompression) is the fastest.
+ The old and tried gzip compression. It provides a good balance
+ between compression ration and decompression speed.
 
 config KERNEL_BZIP2
bool Bzip2
@@ -164,6 +166,14 @@ config KERNEL_LZMA
  two. Compression is slowest.  The kernel size is about 33%
  smaller with LZMA in comparison to gzip.
 
+config KERNEL_LZO
+   bool LZO
+   depends on HAVE_KERNEL_LZO
+   help
+ Its compression ratio is the poorest among the 4. The kernel
+ size is about about 10% bigger than gzip; however its speed
+ (both compression and decompression) is the fastest.
+
 endchoice
 
 config SWAP
diff --git a/lib/decompress_unlzo.c b/lib/decompress_unlzo.c
new file mode 100644
index 000..a18417a
--- /dev/null
+++ b/lib/decompress_unlzo.c
@@ -0,0 +1,206 @@
+/*
+ * LZO decompressor for the Linux kernel. Code borrowed from the lzo
+ * implementation by Markus Franz Xaver Johannes Oberhumer.
+ *
+ * Linux kernel adaptation:
+ * Copyright (C) 2009
+ * Albin Tonnerre, Free Electrons albin.tonne...@free-electrons.com
+ *
+ * Original code:
+ * Copyright (C) 1996-2005 Markus Franz Xaver Johannes Oberhumer
+ * All Rights Reserved.
+ *
+ * lzop and the LZO library are free software; you can redistribute them
+ * and/or modify them under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ 

[PATCH] Add LZO compression support for initramfs and old-style initrd

2009-07-29 Thread Albin Tonnerre
Signed-off-by: Albin Tonnerre albin.tonne...@free-electrons.com
---
 lib/Kconfig  |4 
 lib/Makefile |1 +
 lib/decompress.c |5 +
 usr/Kconfig  |   25 -
 4 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/lib/Kconfig b/lib/Kconfig
index bb1326d..8639349 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -117,6 +117,10 @@ config DECOMPRESS_BZIP2
 config DECOMPRESS_LZMA
tristate
 
+config DECOMPRESS_LZO
+   select LZO_DECOMPRESS
+   tristate
+
 #
 # Generic allocator support is selected if needed
 #
diff --git a/lib/Makefile b/lib/Makefile
index b6d1857..cd3d37b 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -69,6 +69,7 @@ obj-$(CONFIG_LZO_DECOMPRESS) += lzo/
 lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o
 lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o
 lib-$(CONFIG_DECOMPRESS_LZMA) += decompress_unlzma.o
+lib-$(CONFIG_DECOMPRESS_LZO) += decompress_unlzo.o
 
 obj-$(CONFIG_TEXTSEARCH) += textsearch.o
 obj-$(CONFIG_TEXTSEARCH_KMP) += ts_kmp.o
diff --git a/lib/decompress.c b/lib/decompress.c
index d2842f5..a760681 100644
--- a/lib/decompress.c
+++ b/lib/decompress.c
@@ -9,6 +9,7 @@
 #include linux/decompress/bunzip2.h
 #include linux/decompress/unlzma.h
 #include linux/decompress/inflate.h
+#include linux/decompress/unlzo.h
 
 #include linux/types.h
 #include linux/string.h
@@ -22,6 +23,9 @@
 #ifndef CONFIG_DECOMPRESS_LZMA
 # define unlzma NULL
 #endif
+#ifndef CONFIG_DECOMPRESS_LZO
+# define unlzo NULL
+#endif
 
 static const struct compress_format {
unsigned char magic[2];
@@ -32,6 +36,7 @@ static const struct compress_format {
{ {037, 0236}, gzip, gunzip },
{ {0x42, 0x5a}, bzip2, bunzip2 },
{ {0x5d, 0x00}, lzma, unlzma },
+   { {0x89, 0x4c}, lzo, unlzo },
{ {0, 0}, NULL, NULL }
 };
 
diff --git a/usr/Kconfig b/usr/Kconfig
index 1c3039f..04a826e 100644
--- a/usr/Kconfig
+++ b/usr/Kconfig
@@ -72,6 +72,15 @@ config RD_LZMA
  Support loading of a LZMA encoded initial ramdisk or cpio buffer
  If unsure, say N.
 
+config RD_LZO
+   bool Support initial ramdisks compressed using LZO if EMBEDDED
+   default !EMBEDDED
+   depends on BLK_DEV_INITRD
+   select DECOMPRESS_LZO
+   help
+ Support loading of a LZO encoded initial ramdisk or cpio buffer
+ If unsure, say N.
+
 choice
prompt Built-in initramfs compression mode if INITRAMFS_SOURCE!=
help
@@ -108,16 +117,15 @@ config INITRAMFS_COMPRESSION_GZIP
bool Gzip
depends on RD_GZIP
help
- The old and tried gzip compression. Its compression ratio is
- the poorest among the 3 choices; however its speed (both
- compression and decompression) is the fastest.
+ The old and tried gzip compression. It provides a good balance
+ between compression ration and decompression speed.
 
 config INITRAMFS_COMPRESSION_BZIP2
bool Bzip2
depends on RD_BZIP2
help
  Its compression ratio and speed is intermediate.
- Decompression speed is slowest among the three.  The initramfs
+ Decompression speed is slowest among the four.  The initramfs
  size is about 10% smaller with bzip2, in comparison to gzip.
  Bzip2 uses a large amount of memory. For modern kernels you
  will need at least 8MB RAM or more for booting.
@@ -128,7 +136,14 @@ config INITRAMFS_COMPRESSION_LZMA
help
  The most recent compression algorithm.
  Its ratio is best, decompression speed is between the other
- two. Compression is slowest.  The initramfs size is about 33%
+ three. Compression is slowest. The initramfs size is about 33%
  smaller with LZMA in comparison to gzip.
 
+config INITRAMFS_COMPRESSION_LZO
+   bool LZO
+   depends on RD_LZO
+   help
+ Its compression ratio is the poorest among the four. The kernel
+ size is about about 10% bigger than gzip; however its speed
+
 endchoice
-- 
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] Add support for LZO-compressed kernels on x86

2009-07-29 Thread H. Peter Anvin
On 07/22/2009 07:01 AM, Albin Tonnerre wrote:
 This is the third and last part of the patch, which contains the
 necessary changes to the x86 Kconfig and boot/compressed to allow the
 use of this new compression method
 
 Signed-off-by: Albin Tonnerre albin.tonne...@free-electrons.com

Acked-by: H. Peter Anvin h...@zytor.com

Since the patchset otherwise isn't really x86-related it probably makes
more sense to pass this through the kbuild tree, or perhaps via akpm,
rather than -tip?

-hpa
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] Add support for LZO-compressed kernels on x86

2009-07-29 Thread Sam Ravnborg
On Wed, Jul 29, 2009 at 01:00:36PM -0700, H. Peter Anvin wrote:
 On 07/22/2009 07:01 AM, Albin Tonnerre wrote:
  This is the third and last part of the patch, which contains the
  necessary changes to the x86 Kconfig and boot/compressed to allow the
  use of this new compression method
  
  Signed-off-by: Albin Tonnerre albin.tonne...@free-electrons.com
 
 Acked-by: H. Peter Anvin h...@zytor.com
 
 Since the patchset otherwise isn't really x86-related it probably makes
 more sense to pass this through the kbuild tree, or perhaps via akpm,
 rather than -tip?

I can take it via kbuild if I get a fewsh patch-set with proper
ack's added.
I've long lost the original patch-set.

Sam
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: New MMC maintainer needed

2009-07-29 Thread Segher Boessenkool

I use the public specs from sdcard.org for more or less everything. I
also have a MMC 4 spec, which was generously donated to me by Nokia.
Unfortunately I am not allowed to pass that on. I can look things up
for people if they have specific questions though.


The MMC Association has merged with JEDEC, so now everyone can download
the specs, e.g. http://www.jedec.org/download/search/JESD84-A44.pdf .


Segher

--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html