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!)
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
--- /dev/null
+--- 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,
+ },
+ };
+
--- /dev/null
+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);
+
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 \
"
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
--- /dev/null
+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);
+
--- /dev/null
+--- 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;
+
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
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
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}"