diff -Nrup linux-2.6.0-test4-uc0/Makefile linux-2.6.x/Makefile
--- linux-2.6.0-test4-uc0/Makefile	2003-08-23 03:44:05.000000000 +0200
+++ linux-2.6.x/Makefile	2003-08-23 05:18:16.000000000 +0200
@@ -393,6 +393,7 @@ define cmd_vmlinux__
 	$(drivers-y) \
 	$(net-y) \
 	--end-group \
+	-M -Map $@.map \
 	$(filter .tmp_kallsyms%,$^) \
 	-o $@
 endef
diff -Nrup linux-2.6.0-test4-uc0/arch/m68knommu/Kconfig linux-2.6.x/arch/m68knommu/Kconfig
--- linux-2.6.0-test4-uc0/arch/m68knommu/Kconfig	2003-08-23 03:43:36.000000000 +0200
+++ linux-2.6.x/arch/m68knommu/Kconfig	2003-08-23 05:18:16.000000000 +0200
@@ -288,6 +288,29 @@ config M5282C3
 	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 -Nrup linux-2.6.0-test4-uc0/arch/m68knommu/Makefile linux-2.6.x/arch/m68knommu/Makefile
--- linux-2.6.0-test4-uc0/arch/m68knommu/Makefile	2003-08-23 01:57:57.000000000 +0200
+++ linux-2.6.x/arch/m68knommu/Makefile	2003-08-23 05:18:16.000000000 +0200
@@ -28,6 +28,7 @@ board-$(CONFIG_UCQUICC)		:= uCquicc
 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
diff -Nrup linux-2.6.0-test4-uc0/arch/m68knommu/kernel/vmlinux.lds.S linux-2.6.x/arch/m68knommu/kernel/vmlinux.lds.S
--- linux-2.6.0-test4-uc0/arch/m68knommu/kernel/vmlinux.lds.S	2003-08-23 01:54:36.000000000 +0200
+++ linux-2.6.x/arch/m68knommu/kernel/vmlinux.lds.S	2003-08-23 05:18:16.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 -Nrup linux-2.6.0-test4-uc0/drivers/mtd/chips/Kconfig linux-2.6.x/drivers/mtd/chips/Kconfig
--- linux-2.6.0-test4-uc0/drivers/mtd/chips/Kconfig	2003-08-23 01:53:45.000000000 +0200
+++ linux-2.6.x/drivers/mtd/chips/Kconfig	2003-08-23 05:18:16.000000000 +0200
@@ -168,6 +168,17 @@ config MTD_CFI_STAA
 	  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 -Nrup linux-2.6.0-test4-uc0/drivers/mtd/chips/cfi_cmdset_0002.c linux-2.6.x/drivers/mtd/chips/cfi_cmdset_0002.c
--- linux-2.6.0-test4-uc0/drivers/mtd/chips/cfi_cmdset_0002.c	2003-08-23 01:54:58.000000000 +0200
+++ linux-2.6.x/drivers/mtd/chips/cfi_cmdset_0002.c	2003-08-23 05:18:16.000000000 +0200
@@ -1035,8 +1035,12 @@ static inline int do_erase_oneblock(stru
 	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 -Nrup linux-2.6.0-test4-uc0/drivers/mtd/maps/Kconfig linux-2.6.x/drivers/mtd/maps/Kconfig
--- linux-2.6.0-test4-uc0/drivers/mtd/maps/Kconfig	2003-08-23 02:01:44.000000000 +0200
+++ linux-2.6.x/drivers/mtd/maps/Kconfig	2003-08-23 05:18:16.000000000 +0200
@@ -419,6 +419,15 @@ config MTD_FORTUNET
 	  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 -Nrup linux-2.6.0-test4-uc0/drivers/mtd/maps/Makefile linux-2.6.x/drivers/mtd/maps/Makefile
--- linux-2.6.0-test4-uc0/drivers/mtd/maps/Makefile	2003-08-23 01:50:21.000000000 +0200
+++ linux-2.6.x/drivers/mtd/maps/Makefile	2003-08-23 05:18:16.000000000 +0200
@@ -50,6 +50,7 @@ obj-$(CONFIG_MTD_FORTUNET)	+= fortunet.o
 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 -Nrup linux-2.6.0-test4-uc0/drivers/mtd/maps/m5272c3_jffs2.c linux-2.6.x/drivers/mtd/maps/m5272c3_jffs2.c
--- linux-2.6.0-test4-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-23 05:18:16.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 -Nrup linux-2.6.0-test4-uc0/drivers/mtd/maps/physmap.c linux-2.6.x/drivers/mtd/maps/physmap.c
--- linux-2.6.0-test4-uc0/drivers/mtd/maps/physmap.c	2003-08-23 01:57:13.000000000 +0200
+++ linux-2.6.x/drivers/mtd/maps/physmap.c	2003-08-23 05:18:16.000000000 +0200
@@ -23,7 +23,7 @@ static struct mtd_info *mymtd;
 
 
 struct map_info physmap_map = {
-	.name = "Physically mapped flash",
+	.name = "physmap",
 	.size = WINDOW_SIZE,
 	.buswidth = BUSWIDTH,
 	.phys = WINDOW_ADDR,
diff -Nrup linux-2.6.0-test4-uc0/drivers/net/fec.c linux-2.6.x/drivers/net/fec.c
--- linux-2.6.0-test4-uc0/drivers/net/fec.c	2003-08-23 03:43:37.000000000 +0200
+++ linux-2.6.x/drivers/net/fec.c	2003-09-21 13:41:49.000000000 +0200
@@ -742,7 +742,7 @@ static void mii_do_cmd(struct net_device
 	}
 }
 
-static void mii_parse_sr(uint mii_reg, struct net_device *dev)
+void mii_parse_sr(uint mii_reg, struct net_device *dev)
 {
 	struct fec_enet_private *fep = dev->priv;
 	volatile uint *s = &(fep->phy_status);
@@ -757,7 +757,7 @@ static void mii_parse_sr(uint mii_reg, s
 		*s |= PHY_STAT_ANC;
 }
 
-static void mii_parse_cr(uint mii_reg, struct net_device *dev)
+void mii_parse_cr(uint mii_reg, struct net_device *dev)
 {
 	struct fec_enet_private *fep = dev->priv;
 	volatile uint *s = &(fep->phy_status);
@@ -770,7 +770,7 @@ static void mii_parse_cr(uint mii_reg, s
 		*s |= PHY_CONF_LOOP;
 }
 
-static void mii_parse_anar(uint mii_reg, struct net_device *dev)
+void mii_parse_anar(uint mii_reg, struct net_device *dev)
 {
 	struct fec_enet_private *fep = dev->priv;
 	volatile uint *s = &(fep->phy_status);
@@ -796,7 +796,7 @@ static void mii_parse_anar(uint mii_reg,
 #define MII_LXT970_CONFIG    19  /* Configuration Register    */
 #define MII_LXT970_CSR       20  /* Chip Status Register      */
 
-static void mii_parse_lxt970_csr(uint mii_reg, struct net_device *dev)
+void mii_parse_lxt970_csr(uint mii_reg, struct net_device *dev)
 {
 	struct fec_enet_private *fep = dev->priv;
 	volatile uint *s = &(fep->phy_status);
@@ -863,7 +863,7 @@ static phy_info_t phy_info_lxt970 = {
  * weird, so 2.5 MHz ought to be enough for anyone...
  */
 
-static void mii_parse_lxt971_sr2(uint mii_reg, struct net_device *dev)
+void mii_parse_lxt971_sr2(uint mii_reg, struct net_device *dev)
 {
 	struct fec_enet_private *fep = dev->priv;
 	volatile uint *s = &(fep->phy_status);
@@ -941,7 +941,7 @@ static phy_info_t phy_info_lxt971 = {
 #define MII_QS6612_IMR       30  /* Interrupt Mask Register    */
 #define MII_QS6612_PCR       31  /* 100BaseTx PHY Control Reg. */
 
-static void mii_parse_qs6612_pcr(uint mii_reg, struct net_device *dev)
+void mii_parse_qs6612_pcr(uint mii_reg, struct net_device *dev)
 {
 	struct fec_enet_private *fep = dev->priv;
 	volatile uint *s = &(fep->phy_status);
@@ -1005,7 +1005,7 @@ static phy_info_t phy_info_qs6612 = {
 #define MII_AM79C874_DC        23  /* Disconnect Counter             */
 #define MII_AM79C874_REC       24  /* Recieve Error Counter          */
 
-static void mii_parse_am79c874_dr(uint mii_reg, struct net_device *dev)
+void mii_parse_am79c874_dr(uint mii_reg, struct net_device *dev)
 {
 	struct fec_enet_private *fep = dev->priv;
 	volatile uint *s = &(fep->phy_status);
diff -Nrup linux-2.6.0-test4-uc0/fs/Kconfig linux-2.6.x/fs/Kconfig
--- linux-2.6.0-test4-uc0/fs/Kconfig	2003-08-23 01:56:58.000000000 +0200
+++ linux-2.6.x/fs/Kconfig	2003-08-23 05:18:17.000000000 +0200
@@ -1095,6 +1095,17 @@ config JFFS2_FS_NAND
 	  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"
 	select ZLIB_INFLATE
diff -Nrup linux-2.6.0-test4-uc0/fs/jffs2/nodelist.h linux-2.6.x/fs/jffs2/nodelist.h
--- linux-2.6.0-test4-uc0/fs/jffs2/nodelist.h	2003-08-23 02:03:19.000000000 +0200
+++ linux-2.6.x/fs/jffs2/nodelist.h	2003-08-23 05:18:17.000000000 +0200
@@ -240,6 +240,20 @@ struct jffs2_eraseblock
 #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 @@ struct jffs2_eraseblock
 #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 -Nrup linux-2.6.0-test4-uc0/include/asm-m68knommu/system.h linux-2.6.x/include/asm-m68knommu/system.h
--- linux-2.6.0-test4-uc0/include/asm-m68knommu/system.h	2003-08-23 01:57:13.000000000 +0200
+++ linux-2.6.x/include/asm-m68knommu/system.h	2003-08-23 05:18:17.000000000 +0200
@@ -232,7 +232,9 @@ cmpxchg(volatile int *p, int old, int ne
 #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 @@ cmpxchg(volatile int *p, int old, int ne
         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 -Nrup linux-2.6.0-test4-uc0/net/xfrm/Kconfig linux-2.6.x/net/xfrm/Kconfig
--- linux-2.6.0-test4-uc0/net/xfrm/Kconfig	2003-08-23 01:56:13.000000000 +0200
+++ linux-2.6.x/net/xfrm/Kconfig	2003-08-23 05:25:32.000000000 +0200
@@ -2,7 +2,7 @@
 # XFRM configuration
 #
 config XFRM
-       bool
+       bool "Kick me"
        depends on NET
 
 config XFRM_USER
