
#
# Patch managed by http://www.holgerschurig.de/patcher.html
#

--- linux2/fs/jffs2/build.c~rp-mtd-sharpsl-extra-r0.patch
+++ linux2/fs/jffs2/build.c
@@ -297,7 +297,14 @@
 
 	c->free_size = c->flash_size;
 	c->nr_blocks = c->flash_size / c->sector_size;
+#if defined(CONFIG_MACH_HUSKY) || defined(CONFIG_ARCH_PXA_TOSA)
+	printk("Trying to alloc_coherent...#%u,#%u\n", c->flash_size,c->sector_size);
+	c->blocks = dma_alloc_coherent(NULL,
+				     sizeof(struct jffs2_eraseblock) * c->nr_blocks,
+				     &c->blocks_phys,GFP_KERNEL);
+#else
 	c->blocks = kmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks, GFP_KERNEL);
+#endif
 	if (!c->blocks)
 		return -ENOMEM;
 	for (i=0; i<c->nr_blocks; i++) {
@@ -336,7 +343,13 @@
 		D1(printk(KERN_DEBUG "build_fs failed\n"));
 		jffs2_free_ino_caches(c);
 		jffs2_free_raw_node_refs(c);
+#if defined(CONFIG_MACH_HUSKY) || defined(CONFIG_ARCH_PXA_TOSA)
+		dma_free_coherent(NULL,
+				 sizeof(struct jffs2_eraseblock) * c->nr_blocks,
+				  c->blocks,c->blocks_phys );
+#else
 		kfree(c->blocks);
+#endif
 		return -EIO;
 	}
 
--- linux2/fs/jffs2/fs.c~rp-mtd-sharpsl-extra-r0.patch
+++ linux2/fs/jffs2/fs.c
@@ -463,10 +463,10 @@
 	 */
 	c->sector_size = c->mtd->erasesize; 
 	blocks = c->flash_size / c->sector_size;
-	while ((blocks * sizeof (struct jffs2_eraseblock)) > (128 * 1024)) {
-		blocks >>= 1;
-		c->sector_size <<= 1;
-	}	
+//	while ((blocks * sizeof (struct jffs2_eraseblock)) > (128 * 1024)) {
+//		blocks >>= 1;
+//		c->sector_size <<= 1;
+//	}	
 	
 	/*
 	 * Size alignment check
@@ -533,7 +533,13 @@
  out_nodes:
 	jffs2_free_ino_caches(c);
 	jffs2_free_raw_node_refs(c);
+#if defined(CONFIG_MACH_HUSKY) || defined(CONFIG_ARCH_PXA_TOSA)
+	dma_free_coherent(NULL,
+			 sizeof(struct jffs2_eraseblock) * c->nr_blocks,
+			  c->blocks,c->blocks_phys );
+#else
 	kfree(c->blocks);
+#endif
  out_inohash:
 	kfree(c->inocache_list);
  out_wbuf:
--- linux2/fs/jffs2/super.c~rp-mtd-sharpsl-extra-r0.patch
+++ linux2/fs/jffs2/super.c
@@ -266,7 +266,13 @@
 	up(&c->alloc_sem);
 	jffs2_free_ino_caches(c);
 	jffs2_free_raw_node_refs(c);
+#if defined(CONFIG_MACH_HUSKY) || defined(CONFIG_ARCH_PXA_TOSA)
+	dma_free_coherent(NULL,
+			 sizeof(struct jffs2_eraseblock) * c->nr_blocks,
+			  c->blocks,c->blocks_phys );
+#else
 	kfree(c->blocks);
+#endif	
 	jffs2_flash_cleanup(c);
 	kfree(c->inocache_list);
 	if (c->mtd->sync)
--- linux2/include/linux/jffs2_fs_sb.h~rp-mtd-sharpsl-extra-r0.patch
+++ linux2/include/linux/jffs2_fs_sb.h
@@ -68,6 +68,10 @@
 						 * from the offset (blocks[ofs / sector_size]) */
 	struct jffs2_eraseblock *nextblock;	/* The block we're currently filling */
 
+#if defined(CONFIG_MACH_HUSKY) || defined(CONFIG_ARCH_PXA_TOSA)
+	dma_addr_t	blocks_phys;
+#endif
+
 	struct jffs2_eraseblock *gcblock;	/* The block we're currently garbage-collecting */
 
 	struct list_head clean_list;		/* Blocks 100% full of clean data */
--- linux2/fs/jffs2/compr.h~rp-mtd-sharpsl-extra-r0.patch
+++ linux2/fs/jffs2/compr.h
@@ -36,6 +36,7 @@
 
 #define JFFS2_RUBINMIPS_DISABLED /* RUBINs will be used only */
 #define JFFS2_DYNRUBIN_DISABLED  /*        for decompression */
+#define JFFS2_RTIME_DISABLED
 
 #define JFFS2_COMPR_MODE_NONE       0
 #define JFFS2_COMPR_MODE_PRIORITY   1

