diff -Nru linux-2.5.75-uc0/Makefile linux-2.5.x/Makefile
--- linux-2.5.75-uc0/Makefile	2003-07-12 20:25:18.000000000 +0200
+++ linux-2.5.x/Makefile	2003-08-04 03:47:39.000000000 +0200
@@ -345,6 +345,7 @@
 	$(drivers-y) \
 	$(net-y) \
 	--end-group \
+	-M -Map $@.map \
 	$(filter .tmp_kallsyms%,$^) \
 	-o $@
 endef
diff -Nru linux-2.5.75-uc0/arch/m68knommu/Kconfig linux-2.5.x/arch/m68knommu/Kconfig
--- linux-2.5.75-uc0/arch/m68knommu/Kconfig	2003-07-10 22:12:20.000000000 +0200
+++ linux-2.5.x/arch/m68knommu/Kconfig	2003-07-23 19:58:48.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
@@ -490,10 +513,6 @@
 
 menu "Executable file formats"
 
-config KCORE_AOUT
-	bool
-	default y
-
 config KCORE_ELF
 	bool
 	default y
@@ -608,6 +627,14 @@
 	help
 	  Enable debuging symbols on kernel build.
 
+config FRAME_POINTER
+	bool "Compile the kernel with frame pointers"
+	help
+	  If you say Y here the resulting kernel image will be slightly larger
+	  and slower, but it will give very useful debugging information.
+	  If you don't debug the kernel, you can say N, but we may not be able
+	  to solve problems without frame pointers.
+
 config MAGIC_SYSRQ
 	bool "Magic SysRq key"
 	help
diff -Nru linux-2.5.75-uc0/arch/m68knommu/Makefile linux-2.5.x/arch/m68knommu/Makefile
--- linux-2.5.75-uc0/arch/m68knommu/Makefile	2003-07-10 22:12:21.000000000 +0200
+++ linux-2.5.x/arch/m68knommu/Makefile	2003-07-23 23:46:30.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
diff -Nru linux-2.5.75-uc0/arch/m68knommu/vmlinux.lds.S linux-2.5.x/arch/m68knommu/vmlinux.lds.S
--- linux-2.5.75-uc0/arch/m68knommu/vmlinux.lds.S	2003-07-10 22:08:24.000000000 +0200
+++ linux-2.5.x/arch/m68knommu/vmlinux.lds.S	2003-07-13 16:44: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 -Nru linux-2.5.75-uc0/drivers/block/Kconfig.iosched linux-2.5.x/drivers/block/Kconfig.iosched
--- linux-2.5.75-uc0/drivers/block/Kconfig.iosched	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.5.x/drivers/block/Kconfig.iosched	2003-07-26 14:37:27.000000000 +0200
@@ -0,0 +1,8 @@
+config IOSCHED_AS
+	bool "Anticipatory I/O scheduler" if EMBEDDED
+	default y
+
+config IOSCHED_DEADLINE
+	bool "Deadline I/O scheduler" if EMBEDDED
+	default y
+
diff -Nru linux-2.5.75-uc0/drivers/block/Makefile linux-2.5.x/drivers/block/Makefile
--- linux-2.5.75-uc0/drivers/block/Makefile	2003-07-10 22:13:04.000000000 +0200
+++ linux-2.5.x/drivers/block/Makefile	2003-07-26 14:37:27.000000000 +0200
@@ -13,9 +13,10 @@
 # kblockd threads
 #
 
-obj-y	:= elevator.o ll_rw_blk.o ioctl.o genhd.o scsi_ioctl.o \
-	deadline-iosched.o as-iosched.o
+obj-y	:= elevator.o ll_rw_blk.o ioctl.o genhd.o scsi_ioctl.o
 
+obj-$(CONFIG_IOSCHED_AS)	+= as-iosched.o
+obj-$(CONFIG_IOSCHED_DEADLINE)	+= deadline-iosched.o
 obj-$(CONFIG_MAC_FLOPPY)	+= swim3.o
 obj-$(CONFIG_BLK_DEV_FD)	+= floppy.o
 obj-$(CONFIG_BLK_DEV_FD98)	+= floppy98.o
diff -Nru linux-2.5.75-uc0/drivers/block/as-iosched.c linux-2.5.x/drivers/block/as-iosched.c
--- linux-2.5.75-uc0/drivers/block/as-iosched.c	2003-07-10 22:04:00.000000000 +0200
+++ linux-2.5.x/drivers/block/as-iosched.c	2003-07-26 14:37:27.000000000 +0200
@@ -837,7 +837,7 @@
 		aic->seek_total += 256*seek_dist;
 		if (aic->seek_samples) {
 			aic->seek_mean = aic->seek_total + 128;
-			do_div(aic->seek_mean, aic->seek_samples);
+			sector_div(aic->seek_mean, aic->seek_samples);
 		}
 		aic->seek_samples = (aic->seek_samples>>1)
 					+ (aic->seek_samples>>2);
@@ -1832,6 +1832,7 @@
 	.elevator_exit_fn =		as_exit,
 
 	.elevator_ktype =		&as_ktype,
+	.elevator_name =		"anticipatory scheduling",
 };
 
 EXPORT_SYMBOL(iosched_as);
diff -Nru linux-2.5.75-uc0/drivers/block/deadline-iosched.c linux-2.5.x/drivers/block/deadline-iosched.c
--- linux-2.5.75-uc0/drivers/block/deadline-iosched.c	2003-07-10 22:13:01.000000000 +0200
+++ linux-2.5.x/drivers/block/deadline-iosched.c	2003-07-26 14:37:27.000000000 +0200
@@ -941,6 +941,7 @@
 	.elevator_exit_fn =		deadline_exit,
 
 	.elevator_ktype =		&deadline_ktype,
+	.elevator_name =		"deadline",
 };
 
 EXPORT_SYMBOL(iosched_deadline);
diff -Nru linux-2.5.75-uc0/drivers/block/elevator.c linux-2.5.x/drivers/block/elevator.c
--- linux-2.5.75-uc0/drivers/block/elevator.c	2003-07-10 22:12:58.000000000 +0200
+++ linux-2.5.x/drivers/block/elevator.c	2003-07-26 14:37:27.000000000 +0200
@@ -409,6 +409,7 @@
 	.elevator_merge_req_fn		= elevator_noop_merge_requests,
 	.elevator_next_req_fn		= elevator_noop_next_request,
 	.elevator_add_req_fn		= elevator_noop_add_request,
+	.elevator_name			= "noop",
 };
 
 module_init(elevator_global_init);
diff -Nru linux-2.5.75-uc0/drivers/block/ll_rw_blk.c linux-2.5.x/drivers/block/ll_rw_blk.c
--- linux-2.5.75-uc0/drivers/block/ll_rw_blk.c	2003-07-10 22:04:59.000000000 +0200
+++ linux-2.5.x/drivers/block/ll_rw_blk.c	2003-07-26 14:37:27.000000000 +0200
@@ -1205,17 +1205,31 @@
 
 static int __make_request(request_queue_t *, struct bio *);
 
-static elevator_t *chosen_elevator = &iosched_as;
+static elevator_t *chosen_elevator =
+#if defined(CONFIG_IOSCHED_AS)
+	&iosched_as;
+#elif defined(CONFIG_IOSCHED_DEADLINE)
+	&iosched_deadline;
+#else
+	&elevator_noop;
+#endif
 
+#if defined(CONFIG_IOSCHED_AS) || defined(CONFIG_IOSCHED_DEADLINE)
 static int __init elevator_setup(char *str)
 {
+#ifdef CONFIG_IOSCHED_DEADLINE
 	if (!strcmp(str, "deadline"))
 		chosen_elevator = &iosched_deadline;
+#endif
+#ifdef CONFIG_IOSCHED_AS
 	if (!strcmp(str, "as"))
 		chosen_elevator = &iosched_as;
+#endif
 	return 1;
 }
+
 __setup("elevator=", elevator_setup);
+#endif /* CONFIG_IOSCHED_AS || CONFIG_IOSCHED_DEADLINE */
 
 /**
  * blk_init_queue  - prepare a request queue for use with a block device
@@ -1255,10 +1269,7 @@
 
 	if (!printed) {
 		printed = 1;
-		if (chosen_elevator == &iosched_deadline)
-			printk("deadline elevator\n");
-		else if (chosen_elevator == &iosched_as)
-			printk("anticipatory scheduling elevator\n");
+		printk("Using %s elevator\n", chosen_elevator->elevator_name);
 	}
 
 	if ((ret = elevator_init(q, chosen_elevator))) {
diff -Nru linux-2.5.75-uc0/drivers/mtd/chips/Kconfig linux-2.5.x/drivers/mtd/chips/Kconfig
--- linux-2.5.75-uc0/drivers/mtd/chips/Kconfig	2003-07-10 22:06:55.000000000 +0200
+++ linux-2.5.x/drivers/mtd/chips/Kconfig	2003-07-13 16:44:16.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.5.75-uc0/drivers/mtd/chips/cfi_cmdset_0002.c linux-2.5.x/drivers/mtd/chips/cfi_cmdset_0002.c
--- linux-2.5.75-uc0/drivers/mtd/chips/cfi_cmdset_0002.c	2003-07-10 22:08:49.000000000 +0200
+++ linux-2.5.x/drivers/mtd/chips/cfi_cmdset_0002.c	2003-07-13 16:44:16.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.5.75-uc0/drivers/mtd/chips/jedec_probe.c linux-2.5.x/drivers/mtd/chips/jedec_probe.c
--- linux-2.5.75-uc0/drivers/mtd/chips/jedec_probe.c	2003-07-10 22:15:35.000000000 +0200
+++ linux-2.5.x/drivers/mtd/chips/jedec_probe.c	2003-07-13 16:44:16.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.5.75-uc0/drivers/mtd/maps/Kconfig linux-2.5.x/drivers/mtd/maps/Kconfig
--- linux-2.5.75-uc0/drivers/mtd/maps/Kconfig	2003-07-10 22:15:00.000000000 +0200
+++ linux-2.5.x/drivers/mtd/maps/Kconfig	2003-07-13 16:44:16.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.5.75-uc0/drivers/mtd/maps/Makefile linux-2.5.x/drivers/mtd/maps/Makefile
--- linux-2.5.75-uc0/drivers/mtd/maps/Makefile	2003-07-10 22:03:34.000000000 +0200
+++ linux-2.5.x/drivers/mtd/maps/Makefile	2003-07-13 16:44:16.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.5.75-uc0/drivers/mtd/maps/m5272c3_jffs2.c linux-2.5.x/drivers/mtd/maps/m5272c3_jffs2.c
--- linux-2.5.75-uc0/drivers/mtd/maps/m5272c3_jffs2.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.5.x/drivers/mtd/maps/m5272c3_jffs2.c	2003-07-28 03:34:59.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.5.75-uc0/drivers/mtd/maps/physmap.c linux-2.5.x/drivers/mtd/maps/physmap.c
--- linux-2.5.75-uc0/drivers/mtd/maps/physmap.c	2003-07-10 22:11:35.000000000 +0200
+++ linux-2.5.x/drivers/mtd/maps/physmap.c	2003-07-13 16:44:16.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.5.75-uc0/drivers/serial/mcfserial.c linux-2.5.x/drivers/serial/mcfserial.c
--- linux-2.5.75-uc0/drivers/serial/mcfserial.c	2003-07-12 20:25:18.000000000 +0200
+++ linux-2.5.x/drivers/serial/mcfserial.c	2003-07-15 20:22:28.000000000 +0200
@@ -143,6 +143,7 @@
  *	Forware declarations...
  */
 static void	mcfrs_change_speed(struct mcf_serial *info);
+static void	mcfrs_wait_until_sent(struct tty_struct *tty, int timeout);
 
 
 static inline int serial_paranoia_check(struct mcf_serial *info,
@@ -608,6 +609,9 @@
 	unsigned long		flags;
 	unsigned char		mr1, mr2;
 	int			i;
+#ifdef	CONFIG_M5272
+	unsigned int		fraction;
+#endif
 
 	if (!info->tty || !info->tty->termios)
 		return;
@@ -631,7 +635,20 @@
 		mcfrs_setsignals(info, 0, -1);
 		return;
 	}
+
+	/* compute the baudrate clock */
+#ifdef	CONFIG_M5272
+	/*
+	 * For the MCF5272, also compute the baudrate fraction.
+	 */
+	baudclk = (MCF_BUSCLK / mcfrs_baud_table[i]) / 32;
+	fraction = MCF_BUSCLK - (baudclk * 32 * mcfrs_baud_table[i]);
+	fraction *= 16;
+	fraction /= (32 * mcfrs_baud_table[i]);
+#else
 	baudclk = ((MCF_BUSCLK / mcfrs_baud_table[i]) + 16) / 32;
+#endif
+
 	info->baud = mcfrs_baud_table[i];
 
 	mr1 = MCFUART_MR1_RXIRQRDY | MCFUART_MR1_RXERRCHAR;
@@ -695,6 +712,9 @@
 	uartp[MCFUART_UMR] = mr2;
 	uartp[MCFUART_UBG1] = (baudclk & 0xff00) >> 8;	/* set msb byte */
 	uartp[MCFUART_UBG2] = (baudclk & 0xff);		/* set lsb byte */
+#ifdef	CONFIG_M5272
+	uartp[MCFUART_UFPD] = (fraction & 0xf);		/* set fraction */
+#endif
 	uartp[MCFUART_UCSR] = MCFUART_UCSR_RXCLKTIMER | MCFUART_UCSR_TXCLKTIMER;
 	uartp[MCFUART_UCR] = MCFUART_UCR_RXENABLE | MCFUART_UCR_TXENABLE;
 	mcfrs_setsignals(info, 1, -1);
@@ -1246,6 +1266,76 @@
 }
 
 /*
+ * mcfrs_wait_until_sent() --- wait until the transmitter is empty
+ */
+static void
+mcfrs_wait_until_sent(struct tty_struct *tty, int timeout)
+{
+#ifdef	CONFIG_M5272
+#define	MCF5272_FIFO_SIZE	25		/* fifo size + shift reg */
+
+	struct mcf_serial * info = (struct mcf_serial *)tty->driver_data;
+	volatile unsigned char *uartp;
+	unsigned long orig_jiffies, fifo_time, char_time, fifo_cnt;
+	
+	if (serial_paranoia_check(info, tty->name, "mcfrs_wait_until_sent"))
+		return;
+	
+	orig_jiffies = jiffies;
+
+	/*
+	 * Set the check interval to be 1/5 of the approximate time
+	 * to send the entire fifo, and make it at least 1.  The check
+	 * interval should also be less than the timeout.
+	 *
+	 * Note: we have to use pretty tight timings here to satisfy
+	 * the NIST-PCTS.
+	 */
+	fifo_time = (MCF5272_FIFO_SIZE * HZ * 10) / info->baud;
+	char_time = fifo_time / 5;
+	if (char_time == 0)
+		char_time = 1;
+	if (timeout && timeout < char_time)
+		char_time = timeout;
+
+	/*
+	 * Clamp the timeout period at 2 * the time to empty the
+	 * fifo.  Just to be safe, set the minimum at .5 seconds.
+	 */
+	fifo_time *= 2;
+	if (fifo_time < (HZ/2))
+		fifo_time = HZ/2;
+	if (!timeout || timeout > fifo_time)
+		timeout = fifo_time;
+
+	/*
+	 * Account for the number of bytes in the UART
+	 * transmitter FIFO plus any byte being shifted out.
+	 */
+	uartp = (volatile unsigned char *) info->addr;
+	for (;;) {
+		fifo_cnt = (uartp[MCFUART_UTF] & MCFUART_UTF_TXB);
+		if ((uartp[MCFUART_USR] & (MCFUART_USR_TXREADY|
+				MCFUART_USR_TXEMPTY)) ==
+			MCFUART_USR_TXREADY)
+			fifo_cnt++;
+		if (fifo_cnt == 0)
+			break;
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(char_time);
+		if (signal_pending(current))
+			break;
+		if (timeout && time_after(jiffies, orig_jiffies + timeout))
+			break;
+	}
+#else
+	/*
+	 * For the other coldfire models, assume all data has been sent
+	 */
+#endif
+}
+
+/*
  * mcfrs_hangup() --- called by tty_hangup() when a hangup is signaled.
  */
 void mcfrs_hangup(struct tty_struct *tty)
@@ -1570,6 +1660,7 @@
 	.start = mcfrs_start,
 	.hangup = mcfrs_hangup,
 	.read_proc = mcfrs_readproc,
+	.wait_until_sent = mcfrs_wait_until_sent,
 };
 
 /* mcfrs_init inits the driver */
@@ -1596,7 +1687,9 @@
 	show_serial_version();
 
 	/* Initialize the tty_driver structure */
+	mcfrs_serial_driver->owner = THIS_MODULE;
 	mcfrs_serial_driver->name = "ttyS";
+	mcfrs_serial_driver->devfs_name = "ttys/";
 	mcfrs_serial_driver->driver_name = "serial";
 	mcfrs_serial_driver->major = TTY_MAJOR;
 	mcfrs_serial_driver->minor_start = 64;
diff -Nru linux-2.5.75-uc0/fs/Kconfig linux-2.5.x/fs/Kconfig
--- linux-2.5.75-uc0/fs/Kconfig	2003-07-10 22:10:54.000000000 +0200
+++ linux-2.5.x/fs/Kconfig	2003-07-13 16:44:16.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.5.75-uc0/fs/jffs2/nodelist.h linux-2.5.x/fs/jffs2/nodelist.h
--- linux-2.5.75-uc0/fs/jffs2/nodelist.h	2003-07-10 22:15:44.000000000 +0200
+++ linux-2.5.x/fs/jffs2/nodelist.h	2003-07-13 16:44:16.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.5.75-uc0/include/asm-arm/div64.h linux-2.5.x/include/asm-arm/div64.h
--- linux-2.5.75-uc0/include/asm-arm/div64.h	2003-07-10 22:08:54.000000000 +0200
+++ linux-2.5.x/include/asm-arm/div64.h	2003-07-15 06:41:10.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.5.75-uc0/include/asm-generic/div64.h linux-2.5.x/include/asm-generic/div64.h
--- linux-2.5.75-uc0/include/asm-generic/div64.h	2003-07-12 20:25:18.000000000 +0200
+++ linux-2.5.x/include/asm-generic/div64.h	2003-07-15 06:41:58.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,13 +42,24 @@
 	__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);
 
+/* The unnecessary pointer compare is there
+ * to check for type safety (n must be 64bit)
+ */
 # define do_div(n,base) ({				\
 	uint32_t __base = (base);			\
 	uint32_t __rem;					\
+	(void)(((typeof((n)) *)0) == ((uint64_t *)0));	\
 	if (likely(((n) >> 32) == 0)) {			\
 		__rem = (uint32_t)(n) % __base;		\
 		(n) = (uint32_t)(n) / __base;		\
@@ -45,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
@@ -52,3 +87,4 @@
 #endif /* BITS_PER_LONG */
 
 #endif /* _ASM_GENERIC_DIV64_H */
+
diff -Nru linux-2.5.75-uc0/include/asm-i386/div64.h linux-2.5.x/include/asm-i386/div64.h
--- linux-2.5.75-uc0/include/asm-i386/div64.h	2003-07-10 22:04:02.000000000 +0200
+++ linux-2.5.x/include/asm-i386/div64.h	2003-07-15 06:41:10.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.5.75-uc0/include/asm-m68k/div64.h linux-2.5.x/include/asm-m68k/div64.h
--- linux-2.5.75-uc0/include/asm-m68k/div64.h	2003-07-10 22:14:19.000000000 +0200
+++ linux-2.5.x/include/asm-m68k/div64.h	2003-07-15 06:41:10.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.5.75-uc0/include/asm-m68knommu/system.h linux-2.5.x/include/asm-m68knommu/system.h
--- linux-2.5.75-uc0/include/asm-m68knommu/system.h	2003-07-10 22:11:35.000000000 +0200
+++ linux-2.5.x/include/asm-m68knommu/system.h	2003-07-13 16:44:16.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.5.75-uc0/include/asm-mips/div64.h linux-2.5.x/include/asm-mips/div64.h
--- linux-2.5.75-uc0/include/asm-mips/div64.h	2003-07-10 22:12:22.000000000 +0200
+++ linux-2.5.x/include/asm-mips/div64.h	2003-07-15 06:41:10.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.5.75-uc0/include/asm-s390/div64.h linux-2.5.x/include/asm-s390/div64.h
--- linux-2.5.75-uc0/include/asm-s390/div64.h	2003-07-10 22:12:09.000000000 +0200
+++ linux-2.5.x/include/asm-s390/div64.h	2003-07-15 06:41:10.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.5.75-uc0/include/linux/elevator.h linux-2.5.x/include/linux/elevator.h
--- linux-2.5.75-uc0/include/linux/elevator.h	2003-07-10 22:04:37.000000000 +0200
+++ linux-2.5.x/include/linux/elevator.h	2003-07-26 14:37:27.000000000 +0200
@@ -52,6 +52,7 @@
 
 	struct kobject kobj;
 	struct kobj_type *elevator_ktype;
+	const char *elevator_name;
 };
 
 /*
diff -Nru linux-2.5.75-uc0/include/linux/sysctl.h linux-2.5.x/include/linux/sysctl.h
--- linux-2.5.75-uc0/include/linux/sysctl.h	2003-07-10 22:10:50.000000000 +0200
+++ linux-2.5.x/include/linux/sysctl.h	2003-07-19 19:19:03.000000000 +0200
@@ -27,6 +27,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/list.h>
+#include <linux/compiler.h>
 
 struct file;
 
diff -Nru linux-2.5.75-uc0/include/linux/time.h linux-2.5.x/include/linux/time.h
--- linux-2.5.75-uc0/include/linux/time.h	2003-07-10 22:11:36.000000000 +0200
+++ linux-2.5.x/include/linux/time.h	2003-07-15 06:41:10.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.5.75-uc0/init/Kconfig linux-2.5.x/init/Kconfig
--- linux-2.5.75-uc0/init/Kconfig	2003-07-10 22:13:05.000000000 +0200
+++ linux-2.5.x/init/Kconfig	2003-08-04 05:42:42.000000000 +0200
@@ -133,6 +133,8 @@
 	  Disabling this option will cause the kernel to be built without
 	  support for epoll family of system calls.
 
+source "drivers/block/Kconfig.iosched"
+
 endmenu		# General setup
 
 
diff -Nru linux-2.5.75-uc0/kernel/posix-timers.c linux-2.5.x/kernel/posix-timers.c
--- linux-2.5.75-uc0/kernel/posix-timers.c	2003-07-10 22:09:38.000000000 +0200
+++ linux-2.5.x/kernel/posix-timers.c	2003-07-15 06:41:10.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.5.75-uc0/lib/vsprintf.c linux-2.5.x/lib/vsprintf.c
--- linux-2.5.75-uc0/lib/vsprintf.c	2003-07-10 22:14:14.000000000 +0200
+++ linux-2.5.x/lib/vsprintf.c	2003-07-13 16:44:16.000000000 +0200
@@ -127,7 +127,7 @@
 #define SPECIAL	32		/* 0x */
 #define LARGE	64		/* use 'ABCDEF' instead of 'abcdef' */
 
-static char * number(char * buf, char * end, long long num, int base, int size, int precision, int type)
+static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precision, int type)
 {
 	char c,sign,tmp[66];
 	const char *digits;
diff -Nru linux-2.5.75-uc0/mm/vmscan.c linux-2.5.x/mm/vmscan.c
--- linux-2.5.75-uc0/mm/vmscan.c	2003-07-10 22:05:27.000000000 +0200
+++ linux-2.5.x/mm/vmscan.c	2003-07-23 07:35:17.000000000 +0200
@@ -147,7 +147,7 @@
 
 	pages = nr_used_zone_pages();
 	list_for_each_entry(shrinker, &shrinker_list, list) {
-		long long delta;
+		uint64_t delta;
 
 		delta = scanned * shrinker->seeks;
 		delta *= (*shrinker->shrinker)(0, gfp_mask);
