diff -Nru linux-2.6.0-test2-uc0/Makefile linux-2.6.x/Makefile
--- linux-2.6.0-test2-uc0/Makefile	2003-08-06 03:51:49.000000000 +0200
+++ linux-2.6.x/Makefile	2003-08-09 22:02:30.000000000 +0200
@@ -345,6 +345,7 @@
 	$(drivers-y) \
 	$(net-y) \
 	--end-group \
+	-M -Map $@.map \
 	$(filter .tmp_kallsyms%,$^) \
 	-o $@
 endef
diff -Nru linux-2.6.0-test2-uc0/arch/m68knommu/Kconfig linux-2.6.x/arch/m68knommu/Kconfig
--- linux-2.6.0-test2-uc0/arch/m68knommu/Kconfig	2003-08-06 03:51:48.000000000 +0200
+++ linux-2.6.x/arch/m68knommu/Kconfig	2003-08-06 04:39:31.000000000 +0200
@@ -288,6 +288,29 @@
 	help
 	  Support for the Motorola M5282C3 board.
 
+config DEVELER_AMR
+	bool "ISC/Develer AMR board support"
+	depends on M5272
+	help
+	  Support for the ISC/Develer AMR board.
+
+config DEVELER_CDB4
+	bool "AEP/Develer CDB4 board support"
+	depends on M5272
+	help
+	  Support for the AEP/Develer CDB4 board.
+
+config DEVELER_SEAC
+	bool "SEAC/Develer SC board support"
+	depends on M5272
+	help
+	  Support for the SEAC/Develer SC board.
+
+config DEVELER
+	bool
+	default y
+	depends on (DEVELER_AMR || DEVELER_CDB4 || DEVELER_SEAC)
+
 config ARN5307
 	bool "Arnewsh 5307 board support"
 	depends on M5307
diff -Nru linux-2.6.0-test2-uc0/arch/m68knommu/Makefile linux-2.6.x/arch/m68knommu/Makefile
--- linux-2.6.0-test2-uc0/arch/m68knommu/Makefile	2003-07-27 19:05:20.000000000 +0200
+++ linux-2.6.x/arch/m68knommu/Makefile	2003-08-08 16:01:51.000000000 +0200
@@ -28,6 +28,7 @@
 board-$(CONFIG_DRAGEN2)		:= de2
 board-$(CONFIG_ARNEWSH)		:= ARNEWSH
 board-$(CONFIG_MOTOROLA)	:= MOTOROLA
+board-$(CONFIG_DEVELER)		:= MOTOROLA
 board-$(CONFIG_ELITE)		:= eLITE
 board-$(CONFIG_eLIA)		:= eLIA
 board-$(CONFIG_NETtel)		:= NETtel
@@ -81,7 +82,7 @@
 
 CFLAGS += $(cflags-y)
 CFLAGS += -fno-builtin
-CFLAGS += -O2 -g
+CFLAGS += -Os -g
 CFLAGS += -D__linux__
 CFLAGS += -DUTS_SYSNAME=\"uClinux\"
 
diff -Nru linux-2.6.0-test2-uc0/arch/m68knommu/vmlinux.lds.S linux-2.6.x/arch/m68knommu/vmlinux.lds.S
--- linux-2.6.0-test2-uc0/arch/m68knommu/vmlinux.lds.S	2003-07-27 19:01:10.000000000 +0200
+++ linux-2.6.x/arch/m68knommu/vmlinux.lds.S	2003-08-06 04:39:31.000000000 +0200
@@ -128,6 +128,15 @@
 #endif
 
 /*
+ *	Develer boards are similar to M5272C3, but we can grab some
+ *	more RAM because we're using colilo instead of dBUG.
+ */
+#if defined(CONFIG_DEVELER)
+#define	RAM_START	0x400
+#define	RAM_LENGTH	0x3ffc00
+#endif
+
+/*
  *	These flash boot boards use all of ram for operation. Again the
  *	actual memory size is not important here, assume at least 4MiB.
  *	They currently have no support for running in flash.
diff -Nru linux-2.6.0-test2-uc0/drivers/mtd/chips/Kconfig linux-2.6.x/drivers/mtd/chips/Kconfig
--- linux-2.6.0-test2-uc0/drivers/mtd/chips/Kconfig	2003-07-27 18:59:39.000000000 +0200
+++ linux-2.6.x/drivers/mtd/chips/Kconfig	2003-08-06 04:39:31.000000000 +0200
@@ -168,6 +168,17 @@
 	  sets which a CFI-compliant chip may claim to implement. This code
 	  provides support for one of those command sets.
 
+config MTD_CFI_BLOCKERASE
+	bool "Use BLOCK ERASE command"
+	depends on MTD_CFI_AMDSTD
+	default n
+	help
+	  Some flash chips such as the SST S71145, have two different erase
+	  commands, one for sectors (4KB) and one for blocks (64KB). Using
+	  larger erase units might be faster and reduce memory usage of JFFS2
+	  for such chips. Note that the chip mapping must be adjusted to
+	  reflect this change.
+
 config MTD_RAM
 	tristate "Support for RAM chips in bus mapping"
 	depends on MTD
diff -Nru linux-2.6.0-test2-uc0/drivers/mtd/chips/cfi_cmdset_0002.c linux-2.6.x/drivers/mtd/chips/cfi_cmdset_0002.c
--- linux-2.6.0-test2-uc0/drivers/mtd/chips/cfi_cmdset_0002.c	2003-07-27 19:01:15.000000000 +0200
+++ linux-2.6.x/drivers/mtd/chips/cfi_cmdset_0002.c	2003-08-06 04:39:31.000000000 +0200
@@ -1035,8 +1035,12 @@
 	cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
 	cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
 
-	cfi_write(map, CMD(0x30), adr);
-	
+#if defined(CONFIG_MTD_CFI_BLOCKERASE)
+	cfi_write(map, CMD(0x50), adr);
+#else
+ 	cfi_write(map, CMD(0x30), adr);
+#endif
+
 	timeo = jiffies + (HZ*20);
 
 	/* Wait for the end of programing/erasure by using the toggle method.
diff -Nru linux-2.6.0-test2-uc0/drivers/mtd/chips/jedec_probe.c linux-2.6.x/drivers/mtd/chips/jedec_probe.c
--- linux-2.6.0-test2-uc0/drivers/mtd/chips/jedec_probe.c	2003-07-27 19:11:46.000000000 +0200
+++ linux-2.6.x/drivers/mtd/chips/jedec_probe.c	2003-08-06 04:39:31.000000000 +0200
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
+#include <linux/init.h>
 #include <asm/io.h>
 #include <asm/byteorder.h>
 #include <linux/errno.h>
@@ -1114,6 +1115,25 @@
 		}
 	}, {
 		.mfr_id		= MANUFACTURER_SST,
+		.dev_id		= SST39LF160,
+		.name		= "SST SST39LF/VF160",
+		.DevSize	= SIZE_2MiB,
+		.CmdSet		= P_ID_AMD_STD,
+#if CONFIG_MTD_CFI_BLOCKERASE 
+		.NumEraseRegions= 1,
+		.regions = {
+			ERASEINFO(0x10000,32)
+		}
+#else
+		/* Split flash in two regions to work around 256 blocks limit */
+		.NumEraseRegions= 2,
+		.regions = {
+			ERASEINFO(0x01000,256),
+			ERASEINFO(0x01000,256)
+		} 
+#endif
+	}, {
+		.mfr_id		= MANUFACTURER_SST,
 		.dev_id		= SST49LF030A,
 		.name		= "SST 49LF030A",
  		.uaddr		= {
diff -Nru linux-2.6.0-test2-uc0/drivers/mtd/maps/Kconfig linux-2.6.x/drivers/mtd/maps/Kconfig
--- linux-2.6.0-test2-uc0/drivers/mtd/maps/Kconfig	2003-07-27 19:10:52.000000000 +0200
+++ linux-2.6.x/drivers/mtd/maps/Kconfig	2003-08-06 04:39:31.000000000 +0200
@@ -419,6 +419,15 @@
 	  This enables access to the Flash on the FortuNet board.  If you
 	  have such a board, say 'Y'.
 
+config MTD_M5272C3_JFFS2
+	tristate "CFI Flash device on Motorola M5272C3 for JFFS2 usage"
+	depends on M5272 && MTD_CFI
+	help
+	  This enables MTD access to CFI and JEDEC compatible flash devices
+	  on board designs derived from the Motorola M5272C3. The partition
+	  map is suitable for using a JFFS2 root filesystem and a bootloader
+	  such as CoLilo.
+
 config MTD_AUTCPU12
 	tristate "NV-RAM mapping AUTCPU12 board"
 	depends on ARM && ARCH_AUTCPU12
diff -Nru linux-2.6.0-test2-uc0/drivers/mtd/maps/Makefile linux-2.6.x/drivers/mtd/maps/Makefile
--- linux-2.6.0-test2-uc0/drivers/mtd/maps/Makefile	2003-07-27 18:55:53.000000000 +0200
+++ linux-2.6.x/drivers/mtd/maps/Makefile	2003-08-06 04:39:31.000000000 +0200
@@ -50,6 +50,7 @@
 obj-$(CONFIG_MTD_REDWOOD)	+= redwood.o
 obj-$(CONFIG_MTD_UCLINUX)	+= uclinux.o
 obj-$(CONFIG_MTD_NETtel)	+= nettel.o
+obj-$(CONFIG_MTD_M5272C3_JFFS2)	+= m5272c3_jffs2.o
 obj-$(CONFIG_MTD_SCB2_FLASH)	+= scb2_flash.o
 obj-$(CONFIG_MTD_EBONY)		+= ebony.o
 obj-$(CONFIG_MTD_BEECH)		+= beech-mtd.o
diff -Nru linux-2.6.0-test2-uc0/drivers/mtd/maps/m5272c3_jffs2.c linux-2.6.x/drivers/mtd/maps/m5272c3_jffs2.c
--- linux-2.6.0-test2-uc0/drivers/mtd/maps/m5272c3_jffs2.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.x/drivers/mtd/maps/m5272c3_jffs2.c	2003-08-06 04:39:31.000000000 +0200
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2003 Bernardo Innocenti <bernie@develer.com>
+ *
+ * Based on physmap.c by David Woodhouse <dwmw2@infradead.org>
+ * Based on m5272c3.c
+ *
+ * MTD partition map for M5272C3 and similar boards.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/major.h>
+#include <linux/root_dev.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/partitions.h>
+
+
+#define WINDOW_ADDR 0xffe00000
+#define WINDOW_SIZE 0x200000
+#define BUSWIDTH 2
+
+static struct mtd_info *mymtd;
+
+static struct map_info m5272c3_jffs2_map = {
+	.name = "M5272C3 flash device",
+	.size = WINDOW_SIZE,
+	.buswidth = BUSWIDTH,
+	.phys = WINDOW_ADDR
+};
+
+/*
+ * MTD 'PARTITIONING' STUFF 
+ */
+static struct mtd_partition m5272c3_jffs2_partitions[] = {
+	{
+		.name	= "boot (32K)",
+		.size	= 0x8000,
+		.offset	= 0
+	}, {
+		.name	= "kernel (480K)",
+		.size	= 0x78000,
+		.offset	= MTDPART_OFS_APPEND /* 0x8000 */
+	}, {
+		.name	= "rootfs (1536K)",
+		.size	= MTDPART_SIZ_FULL, /* 0x180000 */
+		.offset	= MTDPART_OFS_APPEND /* 0x80000 */
+	}
+};
+
+#define	NUM_PARTITIONS	(sizeof(m5272c3_jffs2_partitions) / sizeof(m5272c3_jffs2_partitions[0]))
+
+
+int __init init_m5272c3_jffs2(void)
+{
+	printk(KERN_NOTICE "m5272c3[mtd] flash device: %x at %x\n", WINDOW_SIZE, WINDOW_ADDR);
+	m5272c3_jffs2_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
+
+	if (!m5272c3_jffs2_map.virt) {
+		printk("Failed to ioremap\n");
+		return -EIO;
+	}
+
+	simple_map_init(&m5272c3_jffs2_map);
+
+	if (!(mymtd = do_map_probe("cfi_probe", &m5272c3_jffs2_map)))
+		mymtd = do_map_probe("jedec_probe", &m5272c3_jffs2_map);
+
+	if (mymtd) {
+		mymtd->owner = THIS_MODULE;
+
+		printk(KERN_NOTICE 
+		       "Using physmap partition definition\n");
+		add_mtd_partitions(mymtd, m5272c3_jffs2_partitions, NUM_PARTITIONS);
+
+		printk("m5272c3[mtd]: set '%s' to be root filesystem\n",
+		     	m5272c3_jffs2_partitions[2].name);
+		ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, 2);
+
+		return 0;
+	}
+
+	iounmap((void *)m5272c3_jffs2_map.virt);
+	return -ENXIO;
+}
+
+static void __exit cleanup_m5272c3_jffs2(void)
+{
+	if (mymtd) {
+		del_mtd_partitions(mymtd);
+		map_destroy(mymtd);
+	}
+	if (m5272c3_jffs2_map.virt) {
+		iounmap((void *)m5272c3_jffs2_map.virt);
+		m5272c3_jffs2_map.virt = 0;
+	}
+}
+
+module_init(init_m5272c3_jffs2);
+module_exit(cleanup_m5272c3_jffs2);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Bernardo Innocenti <bernie@develer>");
+MODULE_DESCRIPTION("Develer MTD map driver");
+
diff -Nru linux-2.6.0-test2-uc0/drivers/mtd/maps/physmap.c linux-2.6.x/drivers/mtd/maps/physmap.c
--- linux-2.6.0-test2-uc0/drivers/mtd/maps/physmap.c	2003-07-27 19:04:02.000000000 +0200
+++ linux-2.6.x/drivers/mtd/maps/physmap.c	2003-08-06 04:39:31.000000000 +0200
@@ -23,7 +23,7 @@
 
 
 struct map_info physmap_map = {
-	.name = "Physically mapped flash",
+	.name = "physmap",
 	.size = WINDOW_SIZE,
 	.buswidth = BUSWIDTH,
 	.phys = WINDOW_ADDR,
diff -Nru linux-2.6.0-test2-uc0/fs/Kconfig linux-2.6.x/fs/Kconfig
--- linux-2.6.0-test2-uc0/fs/Kconfig	2003-07-27 19:03:14.000000000 +0200
+++ linux-2.6.x/fs/Kconfig	2003-08-06 04:39:31.000000000 +0200
@@ -1094,6 +1094,17 @@
 	  Say 'N' unless you have NAND flash and you are willing to test and
 	  develop JFFS2 support for it.
 
+config JFFS2_FS_GC_TWEAKS
+	bool "Tweak JFFS2 garbage collector for Am29PL160 flash (EXPERIMENTAL)"
+	depends on JFFS2_FS && EXPERIMENTAL
+	default n
+	help
+	  The Am29PL160 flash device used some embedded boards such as Motorola's
+	  M5272C3 EVM is a 2MB device with just 7 big blocks of 256KB.
+
+	  By enabling this option, the GC parameters will be dangerously tweaked
+	  to allow writing to a device with very few blocks.
+
 config CRAMFS
 	tristate "Compressed ROM file system support"
 	help
diff -Nru linux-2.6.0-test2-uc0/fs/jffs2/nodelist.h linux-2.6.x/fs/jffs2/nodelist.h
--- linux-2.6.0-test2-uc0/fs/jffs2/nodelist.h	2003-07-27 19:12:40.000000000 +0200
+++ linux-2.6.x/fs/jffs2/nodelist.h	2003-08-06 04:39:31.000000000 +0200
@@ -240,6 +240,20 @@
 #define ALLOC_DELETION	1	/* Deletion node. Best to allow it */
 #define ALLOC_GC	2	/* Space requested for GC. Give it or die */
 
+
+/* Settings for Am29PL160 flash device, with big 256k blocks */
+#ifdef CONFIG_JFFS2_FS_GC_TWEAKS
+
+#define JFFS2_RESERVED_BLOCKS_BASE 1						/* Number of free blocks there must be before we... */
+#define JFFS2_RESERVED_BLOCKS_WRITE (JFFS2_RESERVED_BLOCKS_BASE + 1)		/* ... allow a normal filesystem write */
+#define JFFS2_RESERVED_BLOCKS_DELETION (JFFS2_RESERVED_BLOCKS_BASE)		/* ... allow a normal filesystem deletion */
+#define JFFS2_RESERVED_BLOCKS_GCTRIGGER (JFFS2_RESERVED_BLOCKS_BASE + 1)	/* ... wake up the GC thread */
+#define JFFS2_RESERVED_BLOCKS_GCBAD (JFFS2_RESERVED_BLOCKS_BASE)                /* ... pick a block from the bad_list to GC */
+#define JFFS2_RESERVED_BLOCKS_GCMERGE (JFFS2_RESERVED_BLOCKS_BASE)	        /* ... merge pages when garbage collecting */
+
+#else /* !CONFIG_JFFS2_FS_GC_TWEAKS */
+
+/* Sane settings */
 #define JFFS2_RESERVED_BLOCKS_BASE 3						/* Number of free blocks there must be before we... */
 #define JFFS2_RESERVED_BLOCKS_WRITE (JFFS2_RESERVED_BLOCKS_BASE + 2)		/* ... allow a normal filesystem write */
 #define JFFS2_RESERVED_BLOCKS_DELETION (JFFS2_RESERVED_BLOCKS_BASE)		/* ... allow a normal filesystem deletion */
@@ -247,6 +261,8 @@
 #define JFFS2_RESERVED_BLOCKS_GCBAD (JFFS2_RESERVED_BLOCKS_BASE + 1)		/* ... pick a block from the bad_list to GC */
 #define JFFS2_RESERVED_BLOCKS_GCMERGE (JFFS2_RESERVED_BLOCKS_BASE)		/* ... merge pages when garbage collecting */
 
+#endif /* !CONFIG_JFFS2_FS_GC_TWEAKS */
+
 
 /* How much dirty space before it goes on the very_dirty_list */
 #define VERYDIRTY(c, size) ((size) >= ((c)->sector_size / 2))
diff -Nru linux-2.6.0-test2-uc0/include/asm-arm/div64.h linux-2.6.x/include/asm-arm/div64.h
--- linux-2.6.0-test2-uc0/include/asm-arm/div64.h	2003-07-27 19:01:24.000000000 +0200
+++ linux-2.6.x/include/asm-arm/div64.h	2003-08-06 04:39:31.000000000 +0200
@@ -1,18 +1,32 @@
 #ifndef __ASM_ARM_DIV64
 #define __ASM_ARM_DIV64
 
+#include <linux/types.h>
+
 /* We're not 64-bit, but... */
 #define do_div(n,base)						\
 ({								\
-	register int __res asm("r2") = base;			\
-	register unsigned long long __n asm("r0") = n;		\
+	register int __res asm("r2") = (base);			\
+	register unsigned long long __n asm("r0") = (n);	\
 	asm("bl do_div64"					\
 		: "=r" (__n), "=r" (__res)			\
 		: "0" (__n), "1" (__res)			\
 		: "r3", "ip", "lr", "cc");			\
-	n = __n;						\
+	(n) = __n;						\
 	__res;							\
 })
 
+/*
+ * See <asm-generic/div64.h> for specifications.
+ *
+ * FIXME: performance could be improved by writing specific asm
+ */
+extern inline uint32_t
+div_long_long_rem(uint64_t n, uint32_t base, uint32_t *rem)
+{
+	*rem = do_div(n, base);
+	return n;
+}
+
 #endif
 
diff -Nru linux-2.6.0-test2-uc0/include/asm-generic/div64.h linux-2.6.x/include/asm-generic/div64.h
--- linux-2.6.0-test2-uc0/include/asm-generic/div64.h	2003-07-27 19:08:25.000000000 +0200
+++ linux-2.6.x/include/asm-generic/div64.h	2003-08-06 04:39:31.000000000 +0200
@@ -4,6 +4,7 @@
  * Copyright (C) 2003 Bernardo Innocenti <bernie@develer.com>
  * Based on former asm-ppc/div64.h and asm-m68knommu/div64.h
  *
+ *
  * The semantics of do_div() are:
  *
  * uint32_t do_div(uint64_t *n, uint32_t base)
@@ -15,6 +16,17 @@
  *
  * NOTE: macro parameter n is evaluated multiple times,
  *       beware of side effects!
+ *
+ *
+ * Semantics for div_long_long_rem():
+ *
+ * uint32_t div_long_long_rem(uint64_t n, uint32_t base, uint32_t *rem)
+ * {
+ * 	*rem = n % base;
+ * 	return n / base;
+ * }
+ *
+ * NOTE: this will do an exception if result overflows.
  */
 
 #include <linux/types.h>
@@ -30,6 +42,13 @@
 	__rem;							\
  })
 
+extern inline uint32_t
+div_long_long_rem(uint64_t n, uint32_t base, uint32_t *rem)
+{
+	*rem = n % base;
+	return n / base;
+}
+
 #elif BITS_PER_LONG == 32
 
 extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
@@ -49,6 +68,18 @@
 	__rem;						\
  })
 
+extern inline uint32_t
+div_long_long_rem(uint64_t n, uint32_t base, uint32_t *rem)
+{
+	if (likely((n >> 32) == 0)) {
+		*rem = ((uint32_t)n) % base;
+		return ((uint32_t)n) / base;
+	} else {
+		*rem = __div64_32(&n, base);
+		return n;
+	}
+}
+
 #else /* BITS_PER_LONG == ?? */
 
 # error do_div() does not yet support the C64
@@ -56,3 +87,4 @@
 #endif /* BITS_PER_LONG */
 
 #endif /* _ASM_GENERIC_DIV64_H */
+
diff -Nru linux-2.6.0-test2-uc0/include/asm-i386/div64.h linux-2.6.x/include/asm-i386/div64.h
--- linux-2.6.0-test2-uc0/include/asm-i386/div64.h	2003-07-27 18:55:58.000000000 +0200
+++ linux-2.6.x/include/asm-i386/div64.h	2003-08-06 04:39:31.000000000 +0200
@@ -1,6 +1,12 @@
 #ifndef __I386_DIV64
 #define __I386_DIV64
 
+#include <linux/types.h>
+
+/* See asm-generic/div64.h for semantics of
+ * do_div() and div_long_long_rem()
+ */
+
 #define do_div(n,base) ({ \
 	unsigned long __upper, __low, __high, __mod; \
 	asm("":"=a" (__low), "=d" (__high):"A" (n)); \
@@ -14,22 +20,14 @@
 	__mod; \
 })
 
-/*
- * (long)X = ((long long)divs) / (long)div
- * (long)rem = ((long long)divs) % (long)div
- *
- * Warning, this will do an exception if X overflows.
- */
-#define div_long_long_rem(a,b,c) div_ll_X_l_rem(a,b,c)
-
-extern inline long
-div_ll_X_l_rem(long long divs, long div, long *rem)
+extern inline uint32_t
+div_long_long_rem(uint64_t divs, uint32_t div, uint32_t *rem)
 {
-	long dum2;
-      __asm__("divl %2":"=a"(dum2), "=d"(*rem)
-      :	"rm"(div), "A"(divs));
-
-	return dum2;
+	uint32_t result;
+	__asm__("divl %2":"=a"(result), "=d"(*rem)
+		: "rm"(div), "A"(divs));
 
+	return result;
 }
+
 #endif
diff -Nru linux-2.6.0-test2-uc0/include/asm-m68k/div64.h linux-2.6.x/include/asm-m68k/div64.h
--- linux-2.6.0-test2-uc0/include/asm-m68k/div64.h	2003-07-27 19:09:17.000000000 +0200
+++ linux-2.6.x/include/asm-m68k/div64.h	2003-08-06 04:39:31.000000000 +0200
@@ -1,6 +1,8 @@
 #ifndef _M68K_DIV64_H
 #define _M68K_DIV64_H
 
+#include <linux/types.h>
+
 /* n = n / base; return rem; */
 
 #define do_div(n, base) ({					\
@@ -23,4 +25,16 @@
 	__rem;							\
 })
 
+/*
+ * See <asm-generic/div64.h> for specifications.
+ *
+ * FIXME: performance could be improved by writing specific asm
+ */
+extern inline uint32_t
+div_long_long_rem(uint64_t n, uint32_t base, uint32_t *rem)
+{
+	*rem = do_div(n, base);
+	return n;
+}
+
 #endif /* _M68K_DIV64_H */
diff -Nru linux-2.6.0-test2-uc0/include/asm-m68knommu/system.h linux-2.6.x/include/asm-m68knommu/system.h
--- linux-2.6.0-test2-uc0/include/asm-m68knommu/system.h	2003-07-27 19:04:03.000000000 +0200
+++ linux-2.6.x/include/asm-m68knommu/system.h	2003-08-06 04:39:31.000000000 +0200
@@ -232,7 +232,9 @@
 #endif
 
 #ifdef CONFIG_COLDFIRE
-#if defined(CONFIG_M5272) && defined(CONFIG_NETtel)
+#if defined(CONFIG_M5272)
+
+#if defined(CONFIG_NETtel)
 /*
  *	Need to account for broken early mask of 5272 silicon. So don't
  *	jump through the original start address. Jump strait into the
@@ -244,6 +246,15 @@
         jmp 0xf0000400;			\
         ");				\
 })
+#elif defined(CONFIG_DEVELER_AMR) || defined(CONFIG_DEVELER_CDB4) || defined(CONFIG_DEVELER_SEAC)
+#define HARD_RESET_NOW() ({			\
+	asm(					\
+		"movew #0x2700, %sr\n\t"	\
+		"jmp 0xffe00400\n"		\
+	);					\
+})
+#endif /* CONFIG_NETtel || CONFIG_DEVELER */
+
 #elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA)
 #define HARD_RESET_NOW() ({		\
         asm("				\
diff -Nru linux-2.6.0-test2-uc0/include/asm-mips/div64.h linux-2.6.x/include/asm-mips/div64.h
--- linux-2.6.0-test2-uc0/include/asm-mips/div64.h	2003-07-27 19:05:48.000000000 +0200
+++ linux-2.6.x/include/asm-mips/div64.h	2003-08-06 04:39:31.000000000 +0200
@@ -8,6 +8,8 @@
 #ifndef _ASM_DIV64_H
 #define _ASM_DIV64_H
 
+#include <linux/types.h>
+
 /*
  * No traps on overflows for any of these...
  */
@@ -73,4 +75,16 @@
 	(n) = __quot; \
 	__mod; })
 
+/*
+ * See <asm-generic/div64.h> for specifications.
+ *
+ * FIXME: performance could be improved by writing specific asm
+ */
+extern inline uint32_t
+div_long_long_rem(uint64_t n, uint32_t base, uint32_t *rem)
+{
+	*rem = do_div(n, base);
+	return n;
+}
+
 #endif /* _ASM_DIV64_H */
diff -Nru linux-2.6.0-test2-uc0/include/asm-s390/div64.h linux-2.6.x/include/asm-s390/div64.h
--- linux-2.6.0-test2-uc0/include/asm-s390/div64.h	2003-07-27 19:04:16.000000000 +0200
+++ linux-2.6.x/include/asm-s390/div64.h	2003-08-06 04:39:31.000000000 +0200
@@ -3,6 +3,8 @@
 
 #ifndef __s390x__
 
+#include <linux/types.h>
+
 /* for do_div "base" needs to be smaller than 2^31-1 */
 #define do_div(n, base) ({                                      \
 	unsigned long long __n = (n);				\
@@ -42,6 +44,18 @@
         __r;                                                    \
 })
 
+/*
+ * See <asm-generic/div64.h> for specifications.
+ *
+ * FIXME: performance could be improved by writing specific asm
+ */
+extern inline uint32_t
+div_long_long_rem(uint64_t n, uint32_t base, uint32_t *rem)
+{
+	*rem = do_div(n, base);
+	return n;
+}
+
 #else /* __s390x__ */
 #include <asm-generic/div64.h>
 #endif /* __s390x__ */
diff -Nru linux-2.6.0-test2-uc0/include/linux/sysctl.h linux-2.6.x/include/linux/sysctl.h
--- linux-2.6.0-test2-uc0/include/linux/sysctl.h	2003-07-27 19:03:04.000000000 +0200
+++ linux-2.6.x/include/linux/sysctl.h	2003-08-06 04:39:31.000000000 +0200
@@ -21,6 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/list.h>
+#include <linux/compiler.h>
 
 struct file;
 
diff -Nru linux-2.6.0-test2-uc0/include/linux/time.h linux-2.6.x/include/linux/time.h
--- linux-2.6.0-test2-uc0/include/linux/time.h	2003-07-27 19:04:06.000000000 +0200
+++ linux-2.6.x/include/linux/time.h	2003-08-06 04:39:31.000000000 +0200
@@ -28,14 +28,6 @@
 #include <linux/seqlock.h>
 #include <linux/timex.h>
 #include <asm/div64.h>
-#ifndef div_long_long_rem
-
-#define div_long_long_rem(dividend,divisor,remainder) ({ \
-		       u64 result = dividend;		\
-		       *remainder = do_div(result,divisor); \
-		       result; })
-
-#endif
 
 /*
  * Have the 32 bit jiffies value wrap 5 minutes after boot
@@ -122,7 +114,7 @@
 	 * one divide.
 	 */
 	u64 nsec = (u64)jiffies * TICK_NSEC; 
-	value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_nsec);
+	value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, (uint32_t *)&value->tv_nsec);
 }
 
 /* Same for "timeval" */
@@ -150,7 +142,7 @@
 	 * one divide.
 	 */
 	u64 nsec = (u64)jiffies * TICK_NSEC; 
-	value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec);
+	value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, (uint32_t *)&value->tv_usec);
 	value->tv_usec /= NSEC_PER_USEC;
 }
 
diff -Nru linux-2.6.0-test2-uc0/kernel/posix-timers.c linux-2.6.x/kernel/posix-timers.c
--- linux-2.6.0-test2-uc0/kernel/posix-timers.c	2003-07-27 19:02:10.000000000 +0200
+++ linux-2.6.x/kernel/posix-timers.c	2003-08-06 04:39:31.000000000 +0200
@@ -23,16 +23,8 @@
 #include <linux/idr.h>
 #include <linux/posix-timers.h>
 #include <linux/wait.h>
-
-#ifndef div_long_long_rem
 #include <asm/div64.h>
 
-#define div_long_long_rem(dividend,divisor,remainder) ({ \
-		       u64 result = dividend;		\
-		       *remainder = do_div(result,divisor); \
-		       result; })
-
-#endif
 #define CLOCK_REALTIME_RES TICK_NSEC  // In nano seconds.
 
 static inline u64  mpy_l_X_l_ll(unsigned long mpy1,unsigned long mpy2)
@@ -1226,7 +1218,7 @@
 		left *= TICK_NSEC;
 		tsave->tv_sec = div_long_long_rem(left, 
 						  NSEC_PER_SEC, 
-						  &tsave->tv_nsec);
+						  (uint32_t *)&tsave->tv_nsec);
 		restart_block->fn = clock_nanosleep_restart;
 		restart_block->arg0 = which_clock;
 		restart_block->arg1 = (unsigned long)tsave;
diff -Nru linux-2.6.0-test2-uc0/mm/slab.c linux-2.6.x/mm/slab.c
--- linux-2.6.0-test2-uc0/mm/slab.c	2003-08-06 03:51:49.000000000 +0200
+++ linux-2.6.x/mm/slab.c	2003-08-14 23:40:08.000000000 +0200
@@ -107,6 +107,9 @@
  * FORCED_DEBUG	- 1 enables SLAB_RED_ZONE and SLAB_POISON (if possible)
  */
 
+//bernie
+#define CONFIG_DEBUG_SLAB
+
 #ifdef CONFIG_DEBUG_SLAB
 #define	DEBUG		1
 #define	STATS		1
