linux-opendreambox-2.6.18: disable jffs2 summary support for dm800, dm500hd and dm800...
authorghost <andreas.monzner@multimedia-labs.de>
Tue, 22 Mar 2011 12:10:22 +0000 (13:10 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Tue, 22 Mar 2011 12:12:24 +0000 (13:12 +0100)
use full flash memory on dm8000 (256MB) with enabled jffs2 summary for faster mount time
reflash image is needed to use full flash size! as long no reflash was done we switch to legacy flash mapping
use 256M flash memory on dm7020hd
increased size of boot partition on dm8000 and dm7020hd to 7MB (new 2nd is needed!)

recipes/linux/linux-dm500hd-2.6.18/defconfig
recipes/linux/linux-dm7020hd-2.6.18/linux-2.6.18-256MB-nand-support.patch [new file with mode: 0644]
recipes/linux/linux-dm7020hd-2.6.18/linux-2.6.18-big-summary.patch [new file with mode: 0644]
recipes/linux/linux-dm7020hd_2.6.18.bb
recipes/linux/linux-dm800-2.6.18/defconfig
recipes/linux/linux-dm8000-2.6.18/linux-2.6.18-big-summary.patch [new file with mode: 0644]
recipes/linux/linux-dm8000-2.6.18/linux-2.6.18-use-full-flash.patch [new file with mode: 0644]
recipes/linux/linux-dm8000_2.6.18.bb
recipes/linux/linux-dm800se-2.6.18/defconfig
recipes/linux/linux-opendreambox-2.6.18.inc

index 90c2597..d256d4e 100644 (file)
@@ -1451,7 +1451,7 @@ CONFIG_RAMFS=y
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_FS_DEBUG=0
 CONFIG_JFFS2_FS_WRITEBUFFER=y
-CONFIG_JFFS2_SUMMARY=y
+# CONFIG_JFFS2_SUMMARY is not set
 # CONFIG_JFFS2_FS_XATTR is not set
 CONFIG_JFFS2_COMPRESSION_OPTIONS=y
 CONFIG_JFFS2_ZLIB=y
diff --git a/recipes/linux/linux-dm7020hd-2.6.18/linux-2.6.18-256MB-nand-support.patch b/recipes/linux/linux-dm7020hd-2.6.18/linux-2.6.18-256MB-nand-support.patch
new file mode 100644 (file)
index 0000000..e6d885c
--- /dev/null
@@ -0,0 +1,27 @@
+--- linux-2.6.18-old/drivers/mtd/brcmnand/bcm7xxx-nand.c       2011-02-14 16:36:11.397990373 +0100
++++ linux-2.6.18/drivers/mtd/brcmnand/bcm7xxx-nand.c   2011-03-14 13:24:34.955771000 +0100
+@@ -83,19 +83,19 @@
+       {
+               .name = "complete",
+               .offset = 0,
+-              .size = 64 * 1024 * 1024,
++              .size = 1024 * 1024 * 1024,
+       }, {
+               .name = "loader",
+               .offset = 0,
+-              .size = 256 * 1024,
++              .size = 1024 * 1024,
+       }, {
+               .name = "boot partition",
+-              .offset = 256 * 1024,
+-              .size = (4 * 1024 - 256) * 1024,
++              .offset = 1024 * 1024,
++              .size = (8 * 1024 - 1024) * 1024,
+       }, {
+               .name = "root partition",
+               .offset = 4 * 1024 * 1024,
+-              .size = 60 * 1024 * 1024,
++              .size = 248 * 1024 * 1024,
+       },
+ };
diff --git a/recipes/linux/linux-dm7020hd-2.6.18/linux-2.6.18-big-summary.patch b/recipes/linux/linux-dm7020hd-2.6.18/linux-2.6.18-big-summary.patch
new file mode 100644 (file)
index 0000000..d1522b3
--- /dev/null
@@ -0,0 +1,30 @@
+diff -Naur linux-2.6.18-org/fs/jffs2/summary.c linux-2.6.18/fs/jffs2/summary.c
+--- linux-2.6.18-org/fs/jffs2/summary.c        2011-03-15 16:32:15.374923000 +0100
++++ linux-2.6.18/fs/jffs2/summary.c    2011-03-15 16:33:05.246923008 +0100
+@@ -37,7 +37,7 @@
+       memset(c->summary, 0, sizeof(struct jffs2_summary));
+-      c->summary->sum_buf = kmalloc(sum_size, GFP_KERNEL);
++      c->summary->sum_buf = vmalloc(c->sector_size);
+       if (!c->summary->sum_buf) {
+               JFFS2_WARNING("Can't allocate buffer for writing out summary information!\n");
+@@ -56,7 +56,7 @@
+       jffs2_sum_disable_collecting(c->summary);
+-      kfree(c->summary->sum_buf);
++      vfree(c->summary->sum_buf);
+       c->summary->sum_buf = NULL;
+       kfree(c->summary);
+@@ -667,7 +667,7 @@
+       int ret;
+       size_t retlen;
+-      if (padsize + datasize > MAX_SUMMARY_SIZE) {
++      if (0 && padsize + datasize > MAX_SUMMARY_SIZE) {
+               /* It won't fit in the buffer. Abort summary for this jeb */
+               jffs2_sum_disable_collecting(c->summary);
index a03ab88..fc14a98 100644 (file)
@@ -4,4 +4,6 @@ PR="${PR_INC}.0"
 
 SRC_URI += "\
        file://linux-2.6.18-fix-serial.patch;patch=1 \
+       file://linux-2.6.18-256MB-nand-support.patch;patch=1 \
+       file://linux-2.6.18-big-summary.patch;patch=1 \
 "
index 937c94b..e981ed7 100644 (file)
@@ -1437,7 +1437,7 @@ CONFIG_RAMFS=y
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_FS_DEBUG=0
 CONFIG_JFFS2_FS_WRITEBUFFER=y
-CONFIG_JFFS2_SUMMARY=y
+# CONFIG_JFFS2_SUMMARY is not set
 # CONFIG_JFFS2_FS_XATTR is not set
 CONFIG_JFFS2_COMPRESSION_OPTIONS=y
 CONFIG_JFFS2_ZLIB=y
diff --git a/recipes/linux/linux-dm8000-2.6.18/linux-2.6.18-big-summary.patch b/recipes/linux/linux-dm8000-2.6.18/linux-2.6.18-big-summary.patch
new file mode 100644 (file)
index 0000000..d1522b3
--- /dev/null
@@ -0,0 +1,30 @@
+diff -Naur linux-2.6.18-org/fs/jffs2/summary.c linux-2.6.18/fs/jffs2/summary.c
+--- linux-2.6.18-org/fs/jffs2/summary.c        2011-03-15 16:32:15.374923000 +0100
++++ linux-2.6.18/fs/jffs2/summary.c    2011-03-15 16:33:05.246923008 +0100
+@@ -37,7 +37,7 @@
+       memset(c->summary, 0, sizeof(struct jffs2_summary));
+-      c->summary->sum_buf = kmalloc(sum_size, GFP_KERNEL);
++      c->summary->sum_buf = vmalloc(c->sector_size);
+       if (!c->summary->sum_buf) {
+               JFFS2_WARNING("Can't allocate buffer for writing out summary information!\n");
+@@ -56,7 +56,7 @@
+       jffs2_sum_disable_collecting(c->summary);
+-      kfree(c->summary->sum_buf);
++      vfree(c->summary->sum_buf);
+       c->summary->sum_buf = NULL;
+       kfree(c->summary);
+@@ -667,7 +667,7 @@
+       int ret;
+       size_t retlen;
+-      if (padsize + datasize > MAX_SUMMARY_SIZE) {
++      if (0 && padsize + datasize > MAX_SUMMARY_SIZE) {
+               /* It won't fit in the buffer. Abort summary for this jeb */
+               jffs2_sum_disable_collecting(c->summary);
diff --git a/recipes/linux/linux-dm8000-2.6.18/linux-2.6.18-use-full-flash.patch b/recipes/linux/linux-dm8000-2.6.18/linux-2.6.18-use-full-flash.patch
new file mode 100644 (file)
index 0000000..a3eba9c
--- /dev/null
@@ -0,0 +1,100 @@
+--- linux-2.6.18-org/arch/mips/kernel/setup.c  2011-03-21 15:00:29.000000000 +0100
++++ linux-2.6.18/arch/mips/kernel/setup.c      2011-03-22 11:01:22.249357772 +0100
+@@ -611,7 +611,6 @@
+ #define brcm_reserve_bootmem_node(firstUsableAddr)
+ #endif // #define CONFIG_MIPS_BRCM
+-
+ static inline void parse_cmdline_early(void)
+ {
+       char c = ' ', *to = command_line, *from = saved_command_line;
+@@ -818,6 +817,14 @@
+       printk("User-defined physical RAM map:\n");
+       brcm_print_memory_map();
++      {
++              const char *legacy_flash_mapping_str = prom_getenv("legacy_flash_mapping");
++              if (legacy_flash_mapping_str) {
++                      extern int use_legacy_flash_mapping;
++                      use_legacy_flash_mapping = simple_strtol(legacy_flash_mapping_str, NULL, 0);
++              }
++      }
++
+ }
+ static inline int parse_rd_cmdline(unsigned long* rd_start, unsigned long* rd_end)
+--- linux-2.6.18-org/drivers/mtd/nand/dm8000_nand.c    2011-03-22 11:08:12.321357609 +0100
++++ linux-2.6.18/drivers/mtd/nand/dm8000_nand.c        2011-03-22 11:07:25.185357627 +0100
+@@ -25,6 +25,9 @@
+ #include <linux/mtd/partitions.h>
+ #include <asm/io.h>
++int use_legacy_flash_mapping=0;
++EXPORT_SYMBOL(use_legacy_flash_mapping);
++
+ static struct mtd_info *dm8000_mtd;
+ /*
+  * Define partitions for flash device
+@@ -41,6 +44,26 @@
+       }, {
+               .name   = "boot partition",
+               .offset = 1024*1024,
++              .size   = 7*1024*1024
++      }, {
++              .name   = "root partition",
++              .offset = 8*1024*1024,
++              .size   = 248*1024*1024
++      }
++};
++
++static const struct mtd_partition partition_info_legacy[] = {
++      {
++              .name   = "complete",
++              .offset = 0,
++              .size   = 256*1024*1024
++      }, {
++              .name   = "loader",
++              .offset = 0,
++              .size   = 1024*1024
++      }, {
++              .name   = "boot partition",
++              .offset = 1024*1024,
+               .size   = 3*1024*1024
+       }, {
+               .name   = "root partition",
+@@ -48,19 +71,18 @@
+               .size   = 60*1024*1024
+       }, {
+               .name   = "home partition",
+-              .offset = 64*1024*1024,
++              .offset = 64*1024*1024,
+               .size   = 64*1024*1024
+       }, {
+               .name   = "unused partition",
+-              .offset = 128*1024*1024,
++              .offset = 128*1024*1024,
+               .size   = 120*1024*1024
+       }, {
+               .name   = "preset partition",
+-              .offset = 248*1024*1024,
++              .offset = 248*1024*1024,
+               .size   = 8*1024*1024
+       }
+ };
+-#define NUM_PARTITIONS 7
+ static int dm8000_nand_dev_ready(struct mtd_info *mtd);
+@@ -176,7 +198,11 @@
+       }
+       /* Register the partitions */
+-      ret = add_mtd_partitions(dm8000_mtd, partition_info, NUM_PARTITIONS);
++      if (use_legacy_flash_mapping)
++              ret = add_mtd_partitions(dm8000_mtd, partition_info_legacy, 7);
++      else
++              ret = add_mtd_partitions(dm8000_mtd, partition_info, 4);
++
+       if (ret < 0)
+               goto err_nand_release;
index 2428b6d..79ad995 100644 (file)
@@ -1,8 +1,22 @@
 require linux-opendreambox-2.6.18.inc
 
-PR="${PR_INC}.1"
+PR="${PR_INC}.0"
+
+RDEPENDS += "dreambox-secondstage (>=83)"
 
 SRC_URI += "\
        file://linux-2.6.18-disable-unneeded-uarts.patch;patch=1 \
        file://linux-2.6.18-dm8000-nand-smp-fix.patch;patch=1 \
+       file://linux-2.6.18-use-full-flash.patch;patch=1 \
+       file://linux-2.6.18-big-summary.patch;patch=1 \
 "
+
+pkg_preinst_kernel-image_dm8000 () {
+       if [ -d /proc/stb ] && `mount -o rw,remount /boot`; then
+               if [ ! -f /boot/secondstage.conf ] || [ `grep "legacy_flash_mapping" /boot/secondstage.conf | wc -l` -eq 0 ]; then
+                       echo "enable legacy flash mapping in secondstage.conf";
+                       echo "legacy_flash_mapping=1;" > /boot/secondstage.conf;
+               fi;
+       fi;
+       true;
+}
\ No newline at end of file
index bc94cc9..ff6cc03 100644 (file)
@@ -1451,7 +1451,7 @@ CONFIG_RAMFS=y
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_FS_DEBUG=0
 CONFIG_JFFS2_FS_WRITEBUFFER=y
-CONFIG_JFFS2_SUMMARY=y
+# CONFIG_JFFS2_SUMMARY is not set
 # CONFIG_JFFS2_FS_XATTR is not set
 CONFIG_JFFS2_COMPRESSION_OPTIONS=y
 CONFIG_JFFS2_ZLIB=y
index e45b4f0..d33d30e 100644 (file)
@@ -1,7 +1,7 @@
 require linux-opendreambox.inc
 
 SRCREV = "c59d7210272be29e3850aca3abbff76443f65d6f-fixed"
-PR_INC = "r10"
+PR_INC = "r11"
 
 RREPLACES_kernel = "kernel-2.6.18-7.1-${MACHINE}"
 RCONFLICTS_kernel = "kernel-2.6.18-7.1-${MACHINE}"