diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/core_apecs.c linux-2.4.20-WRTstp/arch/alpha/kernel/core_apecs.c
--- linux-2.4.20-WRT/arch/alpha/kernel/core_apecs.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/core_apecs.c	2001-03-02 11:12:07.000000000 -0800
@@ -168,6 +168,7 @@
 	mcheck_expected(0) = 0;
 	mb();
 
+#if 1
 	/*
 	 * david.rusling@reo.mts.dec.com.  This code is needed for the
 	 * EB64+ as it does not generate a machine check (why I don't
@@ -193,6 +194,7 @@
 		wrmces(0x7);			/* reset machine check */
 		value = 0xffffffff;
 	}
+#endif
 
 	/* If Type1 access, must reset HAE #2 so normal IO space ops work.  */
 	if (type1) {
@@ -236,6 +238,7 @@
 	mcheck_expected(0) = 0;
 	mb();
 
+#if 1
 	/*
 	 * david.rusling@reo.mts.dec.com.  This code is needed for the
 	 * EB64+ as it does not generate a machine check (why I don't
@@ -259,6 +262,7 @@
 		mb();
 		wrmces(0x7);			/* reset machine check */
 	}
+#endif
 
 	/* If Type1 access, must reset HAE #2 so normal IO space ops work.  */
 	if (type1) {
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/core_cia.c linux-2.4.20-WRTstp/arch/alpha/kernel/core_cia.c
--- linux-2.4.20-WRT/arch/alpha/kernel/core_cia.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/core_cia.c	2001-10-21 10:30:58.000000000 -0700
@@ -727,6 +727,7 @@
 		*(vip)CIA_IOC_PCI_W_DAC = alpha_mv.pci_dac_offset >> 32;
 	}
 
+	/* Prepare workaround for apparently broken tbia. */
 	cia_prepare_tbia_workaround();
 }
 
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/core_irongate.c linux-2.4.20-WRTstp/arch/alpha/kernel/core_irongate.c
--- linux-2.4.20-WRT/arch/alpha/kernel/core_irongate.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/core_irongate.c	2001-09-13 15:21:32.000000000 -0700
@@ -513,10 +513,10 @@
 	gart_bus_addr = (unsigned long)IRONGATE0->bar0 &
 			PCI_BASE_ADDRESS_MEM_MASK; 
 
-	if (!gart_bus_addr) 
+	if (!gart_bus_addr) /* FIXME - there must be a better way!!! */
 		return addr + IRONGATE_MEM;
 
-	gart_aper_size = IRONGATE_DEFAULT_AGP_APER_SIZE; 
+	gart_aper_size = IRONGATE_DEFAULT_AGP_APER_SIZE; /* FIXME */
 
 	/* 
 	 * Check for within the AGP aperture...
@@ -538,7 +538,7 @@
 	mmio_regs = (u32 *)(((unsigned long)IRONGATE0->bar1 &
 			PCI_BASE_ADDRESS_MEM_MASK) + IRONGATE_MEM);
 
-	gatt_pages = (u32 *)(phys_to_virt(mmio_regs[1])); 
+	gatt_pages = (u32 *)(phys_to_virt(mmio_regs[1])); /* FIXME */
 
 	/*
 	 * Adjust the limits (mappings must be page aligned)
@@ -551,6 +551,21 @@
 	last = addr + size - 1;
 	size = PAGE_ALIGN(last) - addr;
 
+#if 0
+	printk("irongate_ioremap(0x%lx, 0x%lx)\n", addr, size);
+	printk("irongate_ioremap:  gart_bus_addr  0x%lx\n", gart_bus_addr);
+	printk("irongate_ioremap:  gart_aper_size 0x%lx\n", gart_aper_size);
+	printk("irongate_ioremap:  mmio_regs      %p\n", mmio_regs);
+	printk("irongate_ioremap:  gatt_pages     %p\n", gatt_pages);
+	
+	for(baddr = addr; baddr <= last; baddr += PAGE_SIZE)
+	{
+		cur_gatt = phys_to_virt(GET_GATT(baddr) & ~1);
+		pte = cur_gatt[GET_GATT_OFF(baddr)] & ~1;
+		printk("irongate_ioremap:  cur_gatt %p pte 0x%x\n",
+		       cur_gatt, pte);
+	}
+#endif
 
 	/*
 	 * Map it
@@ -576,6 +591,10 @@
 	flush_tlb_all();
 
 	vaddr = (unsigned long)area->addr + (addr & ~PAGE_MASK);
+#if 0
+	printk("irongate_ioremap(0x%lx, 0x%lx) returning 0x%lx\n",
+	       addr, size, vaddr);
+#endif
 	return vaddr;
 }
 
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/core_mcpcia.c linux-2.4.20-WRTstp/arch/alpha/kernel/core_mcpcia.c
--- linux-2.4.20-WRT/arch/alpha/kernel/core_mcpcia.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/core_mcpcia.c	2001-10-12 15:35:53.000000000 -0700
@@ -636,6 +636,8 @@
 	switch (expected) {
 	case 0:
 	    {
+		/* FIXME: how do we figure out which hose the
+		   error was on?  */	
 		struct pci_controller *hose;
 		for (hose = hose_head; hose; hose = hose->next)
 			mcpcia_pci_clr_err(MCPCIA_HOSE2MID(hose->index));
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/core_polaris.c linux-2.4.20-WRTstp/arch/alpha/kernel/core_polaris.c
--- linux-2.4.20-WRT/arch/alpha/kernel/core_polaris.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/core_polaris.c	2001-03-02 11:12:07.000000000 -0800
@@ -184,6 +184,9 @@
 	 * for now assume that the firmware has done the right thing
 	 * already.
 	 */
+#if 0
+	printk("polaris_init_arch(): trusting firmware for setup\n");
+#endif
 
 	/*
 	 * Create our single hose.
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/core_t2.c linux-2.4.20-WRTstp/arch/alpha/kernel/core_t2.c
--- linux-2.4.20-WRT/arch/alpha/kernel/core_t2.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/core_t2.c	2001-03-02 11:12:07.000000000 -0800
@@ -136,6 +136,16 @@
 
 	DBG(("conf_read(addr=0x%lx, type1=%d)\n", addr, type1));
 
+#if 0
+	{
+	  unsigned long stat0;
+	  /* Reset status register to avoid losing errors.  */
+	  stat0 = *(vulp)T2_IOCSR;
+	  *(vulp)T2_IOCSR = stat0;
+	  mb();
+	  DBG(("conf_read: T2 IOCSR was 0x%x\n", stat0));
+	}
+#endif
 
 	/* If Type1 access, must set T2 CFG.  */
 	if (type1) {
@@ -186,6 +196,16 @@
 
 	__save_and_cli(flags);	/* avoid getting hit by machine check */
 
+#if 0
+	{
+	  unsigned long stat0;
+	  /* Reset status register to avoid losing errors.  */
+	  stat0 = *(vulp)T2_IOCSR;
+	  *(vulp)T2_IOCSR = stat0;
+	  mb();
+	  DBG(("conf_write: T2 ERR was 0x%x\n", stat0));
+	}
+#endif
 
 	/* If Type1 access, must set T2 CFG.  */
 	if (type1) {
@@ -312,8 +332,29 @@
 		mcheck_taken(i) = 0;
 	}
 
+#if 0
+	{
+	  /* Set up error reporting.  */
+	  unsigned long t2_err;
+
+	  t2_err = *(vulp)T2_IOCSR;
+	  t2_err |= (0x1 << 7);   /* master abort */
+	  *(vulp)T2_IOCSR = t2_err;
+	  mb();
+	}
+#endif
 
 	printk("t2_init: HBASE was 0x%lx\n", *(vulp)T2_HBASE);
+#if 0
+	printk("t2_init: WBASE1=0x%lx WMASK1=0x%lx TBASE1=0x%lx\n",
+	       *(vulp)T2_WBASE1,
+	       *(vulp)T2_WMASK1,
+	       *(vulp)T2_TBASE1);
+	printk("t2_init: WBASE2=0x%lx WMASK2=0x%lx TBASE2=0x%lx\n",
+	       *(vulp)T2_WBASE2,
+	       *(vulp)T2_WMASK2,
+	       *(vulp)T2_TBASE2);
+#endif
 
 	/*
 	 * Set up the PCI->physical memory translation windows.
@@ -335,6 +376,9 @@
 	*(vulp)T2_HAE_1 = 0; mb();
 	*(vulp)T2_HAE_2 = 0; mb();
 	*(vulp)T2_HAE_3 = 0; mb();
+#if 0
+	*(vulp)T2_HAE_4 = 0; mb(); /* do not touch this */
+#endif
 
 	/*
 	 * Create our single hose.
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/core_titan.c linux-2.4.20-WRTstp/arch/alpha/kernel/core_titan.c
--- linux-2.4.20-WRT/arch/alpha/kernel/core_titan.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/core_titan.c	2001-10-21 10:30:58.000000000 -0700
@@ -395,6 +395,23 @@
 void __init
 titan_init_arch(void)
 {
+#if 0
+	printk("%s: titan_init_arch()\n", FN);
+	printk("%s: CChip registers:\n", FN);
+	printk("%s: CSR_CSC 0x%lx\n", FN, TITAN_cchip->csc.csr);
+	printk("%s: CSR_MTR 0x%lx\n", FN, TITAN_cchip->mtr.csr);
+	printk("%s: CSR_MISC 0x%lx\n", FN, TITAN_cchip->misc.csr);
+	printk("%s: CSR_DIM0 0x%lx\n", FN, TITAN_cchip->dim0.csr);
+	printk("%s: CSR_DIM1 0x%lx\n", FN, TITAN_cchip->dim1.csr);
+	printk("%s: CSR_DIR0 0x%lx\n", FN, TITAN_cchip->dir0.csr);
+	printk("%s: CSR_DIR1 0x%lx\n", FN, TITAN_cchip->dir1.csr);
+	printk("%s: CSR_DRIR 0x%lx\n", FN, TITAN_cchip->drir.csr);
+
+	printk("%s: DChip registers:\n", FN);
+	printk("%s: CSR_DSC 0x%lx\n", FN, TITAN_dchip->dsc.csr);
+	printk("%s: CSR_STR 0x%lx\n", FN, TITAN_dchip->str.csr);
+	printk("%s: CSR_DREV 0x%lx\n", FN, TITAN_dchip->drev.csr);
+#endif
 
 	boot_cpuid = __hard_smp_processor_id();
 
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/core_tsunami.c linux-2.4.20-WRTstp/arch/alpha/kernel/core_tsunami.c
--- linux-2.4.20-WRT/arch/alpha/kernel/core_tsunami.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/core_tsunami.c	2001-10-21 10:30:58.000000000 -0700
@@ -398,6 +398,22 @@
 	       ? "succeeded" : "failed");
 #endif /* NXM_MACHINE_CHECKS_ON_TSUNAMI */
 
+#if 0
+	printk("%s: CChip registers:\n", FN);
+	printk("%s: CSR_CSC 0x%lx\n", FN, TSUNAMI_cchip->csc.csr);
+	printk("%s: CSR_MTR 0x%lx\n", FN, TSUNAMI_cchip.mtr.csr);
+	printk("%s: CSR_MISC 0x%lx\n", FN, TSUNAMI_cchip->misc.csr);
+	printk("%s: CSR_DIM0 0x%lx\n", FN, TSUNAMI_cchip->dim0.csr);
+	printk("%s: CSR_DIM1 0x%lx\n", FN, TSUNAMI_cchip->dim1.csr);
+	printk("%s: CSR_DIR0 0x%lx\n", FN, TSUNAMI_cchip->dir0.csr);
+	printk("%s: CSR_DIR1 0x%lx\n", FN, TSUNAMI_cchip->dir1.csr);
+	printk("%s: CSR_DRIR 0x%lx\n", FN, TSUNAMI_cchip->drir.csr);
+
+	printk("%s: DChip registers:\n");
+	printk("%s: CSR_DSC 0x%lx\n", FN, TSUNAMI_dchip->dsc.csr);
+	printk("%s: CSR_STR 0x%lx\n", FN, TSUNAMI_dchip->str.csr);
+	printk("%s: CSR_DREV 0x%lx\n", FN, TSUNAMI_dchip->drev.csr);
+#endif
 	/* With multiple PCI busses, we play with I/O as physical addrs.  */
 	ioport_resource.end = ~0UL;
 	iomem_resource.end = ~0UL;
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/core_wildfire.c linux-2.4.20-WRTstp/arch/alpha/kernel/core_wildfire.c
--- linux-2.4.20-WRT/arch/alpha/kernel/core_wildfire.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/core_wildfire.c	2001-03-02 11:12:07.000000000 -0800
@@ -191,6 +191,9 @@
 	int i;
 
 	temp = fast->qsd_whami.csr;
+#if 0
+	printk(KERN_ERR "fast QSD_WHAMI at base %p is 0x%lx\n", fast, temp);
+#endif
 
 	hard_qbb = (temp >> 8) & 7;
 	soft_qbb = (temp >> 4) & 7;
@@ -215,6 +218,9 @@
 	qsa = WILDFIRE_qsa(soft_qbb);
 
 	temp = qsa->qsa_qbb_id.csr;
+#if 0
+	printk(KERN_ERR "QSA_QBB_ID at base %p is 0x%lx\n", qsa, temp);
+#endif
 
 	if (temp & 0x40) /* Is there an HS? */
 		wildfire_hs_mask = 1;
@@ -224,6 +230,10 @@
 		temp = 0;
 		for (i = 0; i < 4; i++) {
 			temp |= gp->gpa_qbb_map[i].csr << (i * 8);
+#if 0
+			printk(KERN_ERR "GPA_QBB_MAP[%d] at base %p is 0x%lx\n",
+			       i, gp, temp);
+#endif
 		}
 
 		for (hard_qbb = 0; hard_qbb < WILDFIRE_MAX_QBB; hard_qbb++) {
@@ -242,20 +252,32 @@
 	    if (WILDFIRE_QBB_EXISTS(soft_qbb)) {
 	        qsd = WILDFIRE_qsd(soft_qbb);
 		temp = qsd->qsd_whami.csr;
+#if 0
+	printk(KERN_ERR "QSD_WHAMI at base %p is 0x%lx\n", qsd, temp);
+#endif
 		hard_qbb = (temp >> 8) & 7;
 		wildfire_hard_qbb_map[hard_qbb] = soft_qbb;
 		wildfire_soft_qbb_map[soft_qbb] = hard_qbb;
 
 		qsa = WILDFIRE_qsa(soft_qbb);
 		temp = qsa->qsa_qbb_pop[0].csr;
+#if 0
+	printk(KERN_ERR "QSA_QBB_POP_0 at base %p is 0x%lx\n", qsa, temp);
+#endif
 		wildfire_cpu_mask |= ((temp >> 0) & 0xf) << (soft_qbb << 2);
 		wildfire_mem_mask |= ((temp >> 4) & 0xf) << (soft_qbb << 2);
 
 		temp = qsa->qsa_qbb_pop[1].csr;
+#if 0
+	printk(KERN_ERR "QSA_QBB_POP_1 at base %p is 0x%lx\n", qsa, temp);
+#endif
 		wildfire_iop_mask |= (1 << soft_qbb);
 		wildfire_ior_mask |= ((temp >> 4) & 0xf) << (soft_qbb << 2);
 
 		temp = qsa->qsa_qbb_id.csr;
+#if 0
+	printk(KERN_ERR "QSA_QBB_ID at %p is 0x%lx\n", qsa, temp);
+#endif
 		if (temp & 0x20)
 		    wildfire_gp_mask |= (1 << soft_qbb);
 
@@ -310,6 +332,7 @@
 	mb();
 	mb();  /* magic */
 	draina();
+	/* FIXME: clear pci errors */
 	wrmces(0x7);
 	mb();
 
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/irq.c linux-2.4.20-WRTstp/arch/alpha/kernel/irq.c
--- linux-2.4.20-WRT/arch/alpha/kernel/irq.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/irq.c	2001-09-17 13:16:30.000000000 -0700
@@ -431,6 +431,7 @@
 	if (!handler)
 		return -EINVAL;
 
+#if 1
 	/*
 	 * Sanity-check: shared interrupts should REALLY pass in
 	 * a real dev-ID, otherwise we'll have trouble later trying
@@ -442,6 +443,7 @@
 		       "Bad boy: %s (at %p) called us without a dev_id!\n",
 		       devname, __builtin_return_address(0));
 	}
+#endif
 
 	action = (struct irqaction *)
 			kmalloc(sizeof(struct irqaction), GFP_KERNEL);
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/irq_smp.c linux-2.4.20-WRTstp/arch/alpha/kernel/irq_smp.c
--- linux-2.4.20-WRT/arch/alpha/kernel/irq_smp.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/irq_smp.c	2001-11-20 15:49:31.000000000 -0800
@@ -31,6 +31,10 @@
 static void
 show(char * str, void *where)
 {
+#if 0
+	int i;
+        unsigned long *stack;
+#endif
         int cpu = smp_processor_id();
 
         printk("\n%s, CPU %d: %p\n", str, cpu, where);
@@ -43,6 +47,16 @@
 	       spin_is_locked(&global_bh_lock) ? 1 : 0,
 	       local_bh_count(0),
 	       local_bh_count(1));
+#if 0
+        stack = (unsigned long *) &str;
+        for (i = 40; i ; i--) {
+		unsigned long x = *++stack;
+                if (x > (unsigned long) &init_task_union &&
+		    x < (unsigned long) &vsprintf) {
+			printk("<[%08lx]> ", x);
+                }
+        }
+#endif
 }
 
 static inline void
@@ -208,9 +222,29 @@
 void
 synchronize_irq(void)
 {
+#if 0
+	/* Joe's version.  */
+	int cpu = smp_processor_id();
+	int local_count;
+	int global_count;
+	int countdown = 1<<24;
+	void *where = __builtin_return_address(0);
+
+	mb();
+	do {
+		local_count = local_irq_count(cpu);
+		global_count = atomic_read(&global_irq_count);
+		if (DEBUG_SYNCHRONIZE_IRQ && (--countdown == 0)) {
+			printk("%d:%d/%d\n", cpu, local_count, global_count);
+			show("synchronize_irq", where);
+			break;
+		}
+	} while (global_count != local_count);
+#else
 	/* Jay's version.  */
 	if (irqs_running()) {
 		cli();
 		sti();
 	}
+#endif
 }
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/machvec_impl.h linux-2.4.20-WRTstp/arch/alpha/kernel/machvec_impl.h
--- linux-2.4.20-WRT/arch/alpha/kernel/machvec_impl.h	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/machvec_impl.h	2001-09-13 15:21:32.000000000 -0700
@@ -30,7 +30,7 @@
    seems like such a pain.  Define this to get things to compile.  */
 #define JENSEN_IACK_SC		1
 #define T2_IACK_SC		1
-#define WILDFIRE_IACK_SC	1 
+#define WILDFIRE_IACK_SC	1 /* FIXME */
 
 
 /*
@@ -142,6 +142,11 @@
 /* GCC actually has a syntax for defining aliases, but is under some
    delusion that you shouldn't be able to declare it extern somewhere
    else beforehand.  Fine.  We'll do it ourselves.  */
+#if 0
+#define ALIAS_MV(system) \
+  struct alpha_machine_vector alpha_mv __attribute__((alias(#system "_mv")));
+#else
 #define ALIAS_MV(system) \
   asm(".global alpha_mv\nalpha_mv = " #system "_mv");
+#endif
 #endif /* GENERIC */
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/osf_sys.c linux-2.4.20-WRTstp/arch/alpha/kernel/osf_sys.c
--- linux-2.4.20-WRT/arch/alpha/kernel/osf_sys.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/osf_sys.c	2005-11-08 06:23:46.000000000 -0800
@@ -73,6 +73,10 @@
 	mm = current->mm;
 	mm->end_code = bss_start + bss_len;
 	mm->brk = bss_start + bss_len;
+#if 0
+	printk("set_program_attributes(%lx %lx %lx %lx)\n",
+		text_start, text_len, bss_start, bss_len);
+#endif
 	unlock_kernel();
 	return 0;
 }
@@ -226,6 +230,11 @@
 	struct file *file = NULL;
 	unsigned long ret = -EBADF;
 
+#if 0
+	if (flags & (_MAP_HASSEMAPHORE | _MAP_INHERIT | _MAP_UNALIGNED))
+		printk("%s: unimplemented OSF mmap flags %04lx\n", 
+			current->comm, flags);
+#endif
 	if (!(flags & MAP_ANONYMOUS)) {
 		file = fget(fd);
 		if (!file)
@@ -685,6 +694,13 @@
 	return error;
 }
 
+/*
+ * The Linux kernel isn't good at returning values that look
+ * like negative longs (they are mistaken as error values).
+ * Until that is fixed, we need this little workaround for
+ * create_module() because it's one of the few system calls
+ * that return kernel addresses (which are negative).
+ */
 asmlinkage unsigned long alpha_create_module(char *module_name, unsigned long size,
 					  int a3, int a4, int a5, int a6,
 					     struct pt_regs regs)
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/pci.c linux-2.4.20-WRTstp/arch/alpha/kernel/pci.c
--- linux-2.4.20-WRT/arch/alpha/kernel/pci.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/pci.c	2005-11-08 06:24:34.000000000 -0800
@@ -287,6 +287,7 @@
 		printk(KERN_WARNING "PCI: dev %s type 64-bit\n", dev->name);
 	}
 
+	/* ??? FIXME -- record old value for shutdown.  */
 }
 
 void __init
@@ -294,6 +295,7 @@
 {
 	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
 
+	/* ??? FIXME -- record old value for shutdown.  */
 }
 
 /* Most Alphas have straight-forward swizzling needs.  */
@@ -328,6 +330,8 @@
 	ranges->io_end -= hose->io_space->start;
 	ranges->mem_start -= hose->mem_space->start;
 	ranges->mem_end -= hose->mem_space->start;
+/* FIXME: On older alphas we could use dense memory space
+	  to access prefetchable resources. */
 	ranges->prefetch_start -= hose->mem_space->start;
 	ranges->prefetch_end -= hose->mem_space->start;
 }
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/process.c linux-2.4.20-WRTstp/arch/alpha/kernel/process.c
--- linux-2.4.20-WRT/arch/alpha/kernel/process.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/process.c	2001-09-30 12:26:08.000000000 -0700
@@ -78,6 +78,8 @@
 	current->counter = -100;
 
 	while (1) {
+		/* FIXME -- EV6 and LCA45 know how to power down
+		   the CPU.  */
 
 		/* Although we are an idle CPU, we do not want to 
 		   get into the scheduler unnecessarily.  */
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/setup.c linux-2.4.20-WRTstp/arch/alpha/kernel/setup.c
--- linux-2.4.20-WRT/arch/alpha/kernel/setup.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/setup.c	2005-11-08 06:23:46.000000000 -0800
@@ -608,6 +608,11 @@
 	/* Default root filesystem to sda2.  */
 	ROOT_DEV = to_kdev_t(0x0802);
 
+ 	/*
+	 * Check ASN in HWRPB for validity, report if bad.
+	 * FIXME: how was this failing?  Should we trust it instead,
+	 * and copy the value into alpha_mv.max_asn?
+ 	 */
 
  	if (hwrpb->max_asn != MAX_ASN) {
 		printk("Max ASN from HWRPB is bad (0x%lx)\n", hwrpb->max_asn);
@@ -1139,8 +1144,11 @@
 			     unsigned long event,
 			     void *ptr)
 {
+#if 1
+	/* FIXME FIXME FIXME */
 	/* If we are using SRM and serial console, just hard halt here. */
 	if (alpha_using_srm && srmcons_output)
 		__halt();
+#endif
         return NOTIFY_DONE;
 }
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/signal.c linux-2.4.20-WRTstp/arch/alpha/kernel/signal.c
--- linux-2.4.20-WRT/arch/alpha/kernel/signal.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/signal.c	2005-11-08 06:23:46.000000000 -0800
@@ -150,6 +150,7 @@
 	struct k_sigaction new_ka, old_ka;
 	int ret;
 
+	/* XXX: Don't preclude handling different sized sigset_t's.  */
 	if (sigsetsize != sizeof(sigset_t))
 		return -EINVAL;
 
@@ -198,6 +199,7 @@
 {
 	sigset_t oldset, set;
 
+	/* XXX: Don't preclude handling different sized sigset_t's.  */
 	if (sigsetsize != sizeof(sigset_t))
 		return -EINVAL;
 	if (copy_from_user(&set, uset, sizeof(set)))
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/smc37c669.c linux-2.4.20-WRTstp/arch/alpha/kernel/smc37c669.c
--- linux-2.4.20-WRT/arch/alpha/kernel/smc37c669.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/smc37c669.c	2002-02-25 11:37:52.000000000 -0800
@@ -12,7 +12,11 @@
 #include <asm/io.h>
 #include <asm/segment.h>
 
+#if 0
+# define DBG_DEVS(args)         printk args
+#else
 # define DBG_DEVS(args)
+#endif
 
 #define KB              1024
 #define MB              (1024*KB)
@@ -929,6 +933,18 @@
  *
  *--
  */
+#if 0
+/* $INCLUDE_OPTIONS$ */
+#include    "cp$inc:platform_io.h"
+/* $INCLUDE_OPTIONS_END$ */
+#include    "cp$src:common.h"
+#include    "cp$inc:prototypes.h"
+#include    "cp$src:kernel_def.h"
+#include    "cp$src:msg_def.h"
+#include    "cp$src:smcc669_def.h"
+/* Platform-specific includes */
+#include    "cp$src:platform.h"
+#endif
 
 #ifndef TRUE
 #define TRUE 1
@@ -1051,6 +1067,14 @@
     unsigned int func 
 );
 
+#if 0
+static unsigned int SMC37c669_get_device_config( 
+    unsigned int func, 
+    int *port, 
+    int *irq, 
+    int *drq 
+);
+#endif
 
 static void SMC37c669_config_mode( 
     unsigned int enable 
@@ -1079,6 +1103,62 @@
     unsigned int drq 
 );
 
+#if 0
+/*
+** External Data Declarations
+*/
+
+extern struct LOCK spl_atomic;
+
+/*
+** External Function Prototype Declarations
+*/
+
+/* From kernel_alpha.mar */
+extern spinlock( 
+    struct LOCK *spl 
+);
+
+extern spinunlock( 
+    struct LOCK *spl 
+);
+
+/* From filesys.c */
+int allocinode(
+    char *name, 
+    int can_create, 
+    struct INODE **ipp
+);
+
+extern int null_procedure( void );
+
+int smcc669_init( void );
+int smcc669_open( struct FILE *fp, char *info, char *next, char *mode );
+int smcc669_read( struct FILE *fp, int size, int number, unsigned char *buf );
+int smcc669_write( struct FILE *fp, int size, int number, unsigned char *buf );
+int smcc669_close( struct FILE *fp );
+
+struct DDB smc_ddb = {
+	"smc",			/* how this routine wants to be called	*/
+	smcc669_read,		/* read routine				*/
+	smcc669_write,		/* write routine			*/
+	smcc669_open,		/* open routine				*/
+	smcc669_close,		/* close routine			*/
+	null_procedure,		/* name expansion routine		*/
+	null_procedure,		/* delete routine			*/
+	null_procedure,		/* create routine			*/
+	null_procedure,		/* setmode				*/
+	null_procedure,		/* validation routine			*/
+	0,			/* class specific use			*/
+	1,			/* allows information			*/
+	0,			/* must be stacked			*/
+	0,			/* is a flash update driver		*/
+	0,			/* is a block device			*/
+	0,			/* not seekable				*/
+	0,			/* is an Ethernet device		*/
+	0,			/* is a filesystem driver		*/
+};
+#endif
 
 #define spinlock(x)
 #define spinunlock(x)
@@ -1780,6 +1860,76 @@
 }
 
 
+#if 0
+/*
+**++
+**  FUNCTIONAL DESCRIPTION:
+**
+**      This function retrieves the configuration information of a 
+**	device function within the SMC37c699 Super I/O controller.
+**
+**  FORMAL PARAMETERS:
+**
+**      func:
+**          Which device function
+**       
+**      port:
+**          I/O port returned
+**	 
+**      irq:
+**          IRQ returned
+**	 
+**      drq:
+**          DMA channel returned
+**
+**  RETURN VALUE:
+**
+**      Returns TRUE if the device configuration was successfully
+**	retrieved, otherwise, FALSE.
+**
+**  SIDE EFFECTS:
+**
+**      The data pointed to by the port, irq, and drq parameters
+**	my be modified even if the configuration is not successfully
+**	retrieved.
+**
+**  DESIGN:
+**
+**      The device configuration is fetched from the local shadow
+**	copy.  Any unused parameters will be set to -1.  Any
+**	parameter which is not desired can specify the NULL
+**	pointer.
+**
+**--
+*/
+static unsigned int __init SMC37c669_get_device_config (
+    unsigned int func,
+    int *port,
+    int *irq,
+    int *drq )
+{
+    struct DEVICE_CONFIG *cp;
+    unsigned int ret_val = FALSE;
+/*
+** Check for a valid device configuration
+*/
+    if ( ( cp = SMC37c669_get_config( func ) ) != NULL ) {
+    	if ( drq != NULL ) {
+	    *drq = cp->drq;
+	    ret_val = TRUE;
+	}
+	if ( irq != NULL ) {
+	    *irq = cp->irq;
+	    ret_val = TRUE;
+	}
+	if ( port != NULL ) {
+	    *port = cp->port1;
+	    ret_val = TRUE;
+	}
+    }
+    return ret_val;
+}
+#endif
 
 
 /*
@@ -2249,6 +2399,111 @@
     return translated_drq;
 }
 
+#if 0
+int __init smcc669_init ( void )
+{
+    struct INODE *ip;
+
+    allocinode( smc_ddb.name, 1, &ip );
+    ip->dva = &smc_ddb;
+    ip->attr = ATTR$M_WRITE | ATTR$M_READ;
+    ip->len[0] = 0x30;
+    ip->misc = 0;
+    INODE_UNLOCK( ip );
+
+    return msg_success;
+}
+
+int __init smcc669_open( struct FILE *fp, char *info, char *next, char *mode )
+{
+    struct INODE *ip;
+/*
+** Allow multiple readers but only one writer.  ip->misc keeps track
+** of the number of writers
+*/
+    ip = fp->ip;
+    INODE_LOCK( ip );
+    if ( fp->mode & ATTR$M_WRITE ) {
+	if ( ip->misc ) {
+	    INODE_UNLOCK( ip );
+	    return msg_failure;	    /* too many writers */
+	}
+	ip->misc++;
+    }
+/*
+** Treat the information field as a byte offset
+*/
+    *fp->offset = xtoi( info );
+    INODE_UNLOCK( ip );
+
+    return msg_success;
+}
+
+int __init smcc669_close( struct FILE *fp )
+{
+    struct INODE *ip;
+
+    ip = fp->ip;
+    if ( fp->mode & ATTR$M_WRITE ) {
+	INODE_LOCK( ip );
+	ip->misc--;
+	INODE_UNLOCK( ip );
+    }
+    return msg_success;
+}
+
+int __init smcc669_read( struct FILE *fp, int size, int number, unsigned char *buf )
+{
+    int i;
+    int length;
+    int nbytes;
+    struct INODE *ip;
+
+/*
+** Always access a byte at a time
+*/
+    ip = fp->ip;
+    length = size * number;
+    nbytes = 0;
+
+    SMC37c669_config_mode( TRUE );
+    for ( i = 0; i < length; i++ ) {
+	if ( !inrange( *fp->offset, 0, ip->len[0] ) ) 
+	    break;
+	*buf++ = SMC37c669_read_config( *fp->offset );
+	*fp->offset += 1;
+	nbytes++;
+    }
+    SMC37c669_config_mode( FALSE );
+    return nbytes;
+}
+
+int __init smcc669_write( struct FILE *fp, int size, int number, unsigned char *buf )
+{
+    int i;
+    int length;
+    int nbytes;
+    struct INODE *ip;
+/*
+** Always access a byte at a time
+*/
+    ip = fp->ip;
+    length = size * number;
+    nbytes = 0;
+
+    SMC37c669_config_mode( TRUE );
+    for ( i = 0; i < length; i++ ) {
+	if ( !inrange( *fp->offset, 0, ip->len[0] ) ) 
+	    break;
+	SMC37c669_write_config( *fp->offset, *buf );
+	*fp->offset += 1;
+	buf++;
+	nbytes++;
+    }
+    SMC37c669_config_mode( FALSE );
+    return nbytes;
+}
+#endif
 
 void __init
 SMC37c669_dump_registers(void)
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/smp.c linux-2.4.20-WRTstp/arch/alpha/kernel/smp.c
--- linux-2.4.20-WRT/arch/alpha/kernel/smp.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/smp.c	2005-11-08 06:23:46.000000000 -0800
@@ -268,11 +268,19 @@
 
 	freq = hwrpb->cycle_freq ? : est_cycle_freq;
 
+#if 0
+	/* Magic estimation stolen from x86 port.  */
+	cacheflush_time = freq / 1024L * on_chip_cache / 5000L;
+
+        printk("Using heuristic of %d cycles.\n",
+               cacheflush_time);
+#else
 	/* Magic value to force potential preemption of other CPUs.  */
 	cacheflush_time = INT_MAX;
 
         printk("Using heuristic of %d cycles.\n",
                cacheflush_time);
+#endif
 }
 
 /*
@@ -420,6 +428,10 @@
 	hwpcb->flags = idle->thread.pal_flags;
 	hwpcb->res1 = hwpcb->res2 = 0;
 
+#if 0
+	DBGS(("KSP 0x%lx PTBR 0x%lx VPTBR 0x%lx UNIQUE 0x%lx\n",
+	      hwpcb->ksp, hwpcb->ptbr, hwrpb->vptb, hwpcb->unique));
+#endif
 	DBGS(("Starting secondary cpu %d: state 0x%lx pal_flags 0x%lx\n",
 	      cpuid, idle->state, idle->thread.pal_flags));
 
@@ -781,6 +793,10 @@
 	unsigned long *pending_ipis = &ipi_data[this_cpu].bits;
 	unsigned long ops;
 
+#if 0
+	DBGS(("handle_ipi: on CPU %d ops 0x%lx PC 0x%lx\n",
+	      this_cpu, *pending_ipis, regs->pc));
+#endif
 
 	mb();	/* Order interrupt and bit testing. */
 	while ((ops = xchg(pending_ipis, 0)) != 0) {
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/sys_dp264.c linux-2.4.20-WRTstp/arch/alpha/kernel/sys_dp264.c
--- linux-2.4.20-WRT/arch/alpha/kernel/sys_dp264.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/sys_dp264.c	2001-10-12 15:35:53.000000000 -0700
@@ -220,7 +220,32 @@
 static void
 dp264_device_interrupt(unsigned long vector, struct pt_regs * regs)
 {
+#if 1
 	printk("dp264_device_interrupt: NOT IMPLEMENTED YET!! \n");
+#else
+	unsigned long pld;
+	unsigned int i;
+
+	/* Read the interrupt summary register of TSUNAMI */
+	pld = TSUNAMI_cchip->dir0.csr;
+
+	/*
+	 * Now for every possible bit set, work through them and call
+	 * the appropriate interrupt handler.
+	 */
+	while (pld) {
+		i = ffz(~pld);
+		pld &= pld - 1; /* clear least bit set */
+		if (i == 55)
+			isa_device_interrupt(vector, regs);
+		else
+			handle_irq(16 + i, 16 + i, regs);
+#if 0
+		TSUNAMI_cchip->dir0.csr = 1UL << i; mb();
+		tmp = TSUNAMI_cchip->dir0.csr;
+#endif
+	}
+#endif
 }
 
 static void 
@@ -414,8 +439,13 @@
 		{    47,    47,    47,    47,    47}, /* IdSel 6 SCSI PCI1 */
 		{    -1,    -1,    -1,    -1,    -1}, /* IdSel 7 ISA Bridge */
 		{    -1,    -1,    -1,    -1,    -1}, /* IdSel 8 P2P PCI1 */
+#if 1
 		{    28,    28,    29,    30,    31}, /* IdSel 14 slot 4 PCI2*/
 		{    24,    24,    25,    26,    27}, /* IdSel 15 slot 5 PCI2*/
+#else
+		{    -1,    -1,    -1,    -1,    -1}, /* IdSel 9 unused */
+		{    -1,    -1,    -1,    -1,    -1}, /* IdSel 10 unused */
+#endif
 		{    40,    40,    41,    42,    43}, /* IdSel 11 slot 1 PCI0*/
 		{    36,    36,    37,    38,    39}, /* IdSel 12 slot 2 PCI0*/
 		{    32,    32,    33,    34,    35}, /* IdSel 13 slot 3 PCI0*/
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/sys_jensen.c linux-2.4.20-WRTstp/arch/alpha/kernel/sys_jensen.c
--- linux-2.4.20-WRT/arch/alpha/kernel/sys_jensen.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/sys_jensen.c	2001-09-13 15:21:32.000000000 -0700
@@ -175,6 +175,27 @@
 	    }
 	}
 
+#if 0
+        /* A useful bit of code to find out if an interrupt is going wild.  */
+        {
+          static unsigned int last_msg = 0, last_cc = 0;
+          static int last_irq = -1, count = 0;
+          unsigned int cc;
+
+          __asm __volatile("rpcc %0" : "=r"(cc));
+          ++count;
+#define JENSEN_CYCLES_PER_SEC	(150000000)
+          if (cc - last_msg > ((JENSEN_CYCLES_PER_SEC) * 3) ||
+	      irq != last_irq) {
+                printk(KERN_CRIT " irq %d count %d cc %u @ %lx\n",
+                       irq, count, cc-last_cc, regs->pc);
+                count = 0;
+                last_msg = cc;
+                last_irq = irq;
+          }
+          last_cc = cc;
+        }
+#endif
 
 	handle_irq(irq, regs);
 }
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/sys_miata.c linux-2.4.20-WRTstp/arch/alpha/kernel/sys_miata.c
--- linux-2.4.20-WRT/arch/alpha/kernel/sys_miata.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/sys_miata.c	2002-02-25 11:37:52.000000000 -0800
@@ -64,6 +64,11 @@
 	if (alpha_using_srm)
 		alpha_mv.device_interrupt = miata_srm_device_interrupt;
 
+#if 0
+	/* These break on MiataGL so we'll try not to do it at all.  */
+	*(vulp)PYXIS_INT_HILO = 0x000000B2UL; mb();	/* ISA/NMI HI */
+	*(vulp)PYXIS_RT_COUNT = 0UL; mb();		/* clear count */
+#endif
 
 	init_i8259a_irqs();
 
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/sys_nautilus.c linux-2.4.20-WRTstp/arch/alpha/kernel/sys_nautilus.c
--- linux-2.4.20-WRT/arch/alpha/kernel/sys_nautilus.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/sys_nautilus.c	2001-05-21 13:40:39.000000000 -0700
@@ -178,9 +178,15 @@
 
 /* Single bit ECC errors are categorized here.  */
 
+#if 0
+static const char *interr = "CPU internal error";
+static const char *slotb= "Slot-B error";
+static const char *membus= "Memory/EV6-bus error";
+#else
 static const char *interr = "";
 static const char *slotb = "";
 static const char *membus = "";
+#endif
 
 static void
 ev6_crd_interp(char *interp, struct el_common_EV6_mcheck * L)
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/sys_ruffian.c linux-2.4.20-WRTstp/arch/alpha/kernel/sys_ruffian.c
--- linux-2.4.20-WRT/arch/alpha/kernel/sys_ruffian.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/sys_ruffian.c	2001-10-12 15:35:53.000000000 -0700
@@ -84,6 +84,12 @@
 static void
 ruffian_kill_arch (int mode)
 {
+#if 0
+	/* This only causes re-entry to ARCSBIOS */
+	/* Perhaps this works for other PYXIS as well?  */
+	*(vuip) PYXIS_RESET = 0x0000dead;
+	mb();
+#endif
 }
 
 /*
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/sys_rx164.c linux-2.4.20-WRTstp/arch/alpha/kernel/sys_rx164.c
--- linux-2.4.20-WRT/arch/alpha/kernel/sys_rx164.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/sys_rx164.c	2000-10-27 10:55:01.000000000 -0700
@@ -163,6 +163,17 @@
 static int __init
 rx164_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 {
+#if 0
+	static char irq_tab_pass1[6][5] __initdata = {
+	  /*INT   INTA  INTB  INTC   INTD */
+	  { 16+3, 16+3, 16+8, 16+13, 16+18},      /* IdSel 5,  slot 2 */
+	  { 16+5, 16+5, 16+10, 16+15, 16+20},     /* IdSel 6,  slot 0 */
+	  { 16+4, 16+4, 16+9, 16+14, 16+19},      /* IdSel 7,  slot 1 */
+	  { -1,     -1,    -1,    -1,   -1},      /* IdSel 8, PCI/ISA bridge */
+	  { 16+2, 16+2, 16+7, 16+12, 16+17},      /* IdSel 9,  slot 3 */
+	  { 16+1, 16+1, 16+6, 16+11, 16+16},      /* IdSel 10, slot 4 */
+	};
+#else
 	static char irq_tab[6][5] __initdata = {
 	  /*INT   INTA  INTB  INTC   INTD */
 	  { 16+0, 16+0, 16+6, 16+11, 16+16},      /* IdSel 5,  slot 0 */
@@ -172,6 +183,7 @@
 	  { 16+3, 16+3, 16+9, 16+14, 16+19},      /* IdSel 9,  slot 3 */
 	  { 16+4, 16+4, 16+10, 16+15, 16+5},      /* IdSel 10, PCI-PCI */
 	};
+#endif
 	const long min_idsel = 5, max_idsel = 10, irqs_per_slot = 5;
 
 	/* JRP - Need to figure out how to distinguish pass1 from pass2,
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/sys_sio.c linux-2.4.20-WRTstp/arch/alpha/kernel/sys_sio.c
--- linux-2.4.20-WRT/arch/alpha/kernel/sys_sio.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/sys_sio.c	2001-06-20 11:10:27.000000000 -0700
@@ -232,15 +232,16 @@
 	/* Do not set *ANY* level triggers for AlphaBook1. */
 	sio_fixup_irq_levels(0);
 
-	outb(0x0f, 0x3ce); orig = inb(0x3cf);   
-	outb(0x0f, 0x3ce); outb(0x05, 0x3cf);   
-	outb(0x0b, 0x3ce); config = inb(0x3cf); 
+	/* Make sure that register PR1 indicates 1Mb mem */
+	outb(0x0f, 0x3ce); orig = inb(0x3cf);   /* read PR5  */
+	outb(0x0f, 0x3ce); outb(0x05, 0x3cf);   /* unlock PR0-4 */
+	outb(0x0b, 0x3ce); config = inb(0x3cf); /* read PR1 */
 	if ((config & 0xc0) != 0xc0) {
 		printk("AlphaBook1 VGA init: setting 1Mb memory\n");
 		config |= 0xc0;
-		outb(0x0b, 0x3ce); outb(config, 0x3cf); 
+		outb(0x0b, 0x3ce); outb(config, 0x3cf); /* write PR1 */
 	}
-	outb(0x0f, 0x3ce); outb(orig, 0x3cf); 
+	outb(0x0f, 0x3ce); outb(orig, 0x3cf); /* (re)lock PR0-4 */
 }
 
 
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/sys_wildfire.c linux-2.4.20-WRTstp/arch/alpha/kernel/sys_wildfire.c
--- linux-2.4.20-WRT/arch/alpha/kernel/sys_wildfire.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/sys_wildfire.c	2001-03-02 11:12:07.000000000 -0800
@@ -64,6 +64,32 @@
 static void __init
 wildfire_init_irq_hw(void)
 {
+#if 0
+	register wildfire_pca * pca = WILDFIRE_pca(0, 0);
+	volatile unsigned long * enable0, * enable1, * enable2, *enable3;
+	volatile unsigned long * target0, * target1, * target2, *target3;
+
+	enable0 = (unsigned long *) &pca->pca_int[0].enable;
+	enable1 = (unsigned long *) &pca->pca_int[1].enable;
+	enable2 = (unsigned long *) &pca->pca_int[2].enable;
+	enable3 = (unsigned long *) &pca->pca_int[3].enable;
+
+	target0 = (unsigned long *) &pca->pca_int[0].target;
+	target1 = (unsigned long *) &pca->pca_int[1].target;
+	target2 = (unsigned long *) &pca->pca_int[2].target;
+	target3 = (unsigned long *) &pca->pca_int[3].target;
+
+	*enable0 = *enable1 = *enable2 = *enable3 = 0;
+
+	*target0 = (1UL<<8) | WILDFIRE_QBB(0);
+	*target1 = *target2 = *target3 = 0;
+
+	mb();
+
+	*enable0; *enable1; *enable2; *enable3;
+	*target0; *target1; *target2; *target3;
+
+#else
 	int i;
 
 	doing_init_irq_hw = 1;
@@ -73,6 +99,7 @@
 		wildfire_update_irq_hw(i);
 
 	doing_init_irq_hw = 0;
+#endif
 }
 
 static void
@@ -121,6 +148,10 @@
 static void
 wildfire_end_irq(unsigned int irq)
 { 
+#if 0
+	if (!irq_desc[irq].action)
+		printk("got irq %d\n", irq);
+#endif
 	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
 		wildfire_enable_irq(irq);
 }
@@ -151,7 +182,17 @@
 	/* Only need the following for first PCI bus per PCA. */
 	io_bias = WILDFIRE_IO(qbbno, pcano<<1) - WILDFIRE_IO_BIAS;
 
-
+#if 0
+	outb(0, DMA1_RESET_REG + io_bias);
+	outb(0, DMA2_RESET_REG + io_bias);
+	outb(DMA_MODE_CASCADE, DMA2_MODE_REG + io_bias);
+	outb(0, DMA2_MASK_REG + io_bias);
+#endif
+
+#if 0
+	/* ??? Not sure how to do this, yet... */
+	init_i8259a_irqs(); /* ??? */
+#endif
 
 	for (i = 0; i < 16; ++i) {
 		if (i == 2)
@@ -175,8 +216,10 @@
 {
 	int qbbno, pcano;
 
+#if 1
 	wildfire_init_irq_hw();
 	init_i8259a_irqs();
+#endif
 
 	for (qbbno = 0; qbbno < WILDFIRE_MAX_QBB; qbbno++) {
 	  if (WILDFIRE_QBB_EXISTS(qbbno)) {
diff -ruN linux-2.4.20-WRT/arch/alpha/kernel/traps.c linux-2.4.20-WRTstp/arch/alpha/kernel/traps.c
--- linux-2.4.20-WRT/arch/alpha/kernel/traps.c	2003-07-04 01:10:59.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/kernel/traps.c	2005-11-08 06:24:34.000000000 -0800
@@ -80,8 +80,17 @@
 	printk("t11= %016lx  pv = %016lx  at = %016lx\n",
 	       regs->r25, regs->r27, regs->r28);
 	printk("gp = %016lx  sp = %p\n", regs->gp, regs+1);
+#if 0
+__halt();
+#endif
 }
 
+#if 0
+static char * ireg_name[] = {"v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6",
+			   "t7", "s0", "s1", "s2", "s3", "s4", "s5", "s6",
+			   "a0", "a1", "a2", "a3", "a4", "a5", "t8", "t9",
+			   "t10", "t11", "ra", "pv", "at", "gp", "sp", "zero"};
+#endif
 
 static void
 dik_show_code(unsigned int *pc)
@@ -214,6 +223,10 @@
 		}
 	}
 
+#if 0
+	printk("%s: arithmetic trap at %016lx: %02lx %016lx\n",
+		current->comm, regs.pc, summary, write_mask);
+#endif
 	die_if_kernel("Arithmetic fault", &regs, 0, 0);
 	send_sig(SIGFPE, current, 1);
 }
@@ -985,6 +998,9 @@
 {
 	/* We only get here for OSF system calls, minus #112;
 	   the rest go to sys_ni_syscall.  */
+#if 0
+	printk("<sc %ld(%lx,%lx,%lx)>", regs.r0, a0, a1, a2);
+#endif
 	return -ENOSYS;
 }
 
diff -ruN linux-2.4.20-WRT/arch/alpha/lib/io.c linux-2.4.20-WRTstp/arch/alpha/lib/io.c
--- linux-2.4.20-WRT/arch/alpha/lib/io.c	2003-07-04 01:11:00.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/lib/io.c	2001-11-09 13:45:35.000000000 -0800
@@ -463,6 +463,7 @@
 {
 	/* Optimize co-aligned transfers.  Everything else gets handled
 	   a byte at a time. */
+	/* FIXME -- align FROM.  */
 
 	if (count >= 8 && (to & 7) == ((long)from & 7)) {
 		count -= 8;
@@ -579,6 +580,8 @@
 		if (! __is_ioaddr((unsigned long) d))
 			memcpy_fromio(d, s, count);
 		else {
+			/* FIXME: Should handle unaligned ops and
+			   operation widening.  */
 			count /= 2;
 			while (count--) {
 				u16 tmp = __raw_readw((unsigned long)(s++));
diff -ruN linux-2.4.20-WRT/arch/alpha/mm/fault.c linux-2.4.20-WRTstp/arch/alpha/mm/fault.c
--- linux-2.4.20-WRT/arch/alpha/mm/fault.c	2003-07-04 01:11:00.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/mm/fault.c	2005-11-08 06:24:34.000000000 -0800
@@ -181,6 +181,10 @@
 	if ((fixup = search_exception_table(regs->pc, regs->gp)) != 0) {
 		unsigned long newpc;
 		newpc = fixup_exception(dpf_reg, fixup, regs->pc);
+#if 0
+		printk("%s: Exception at [<%lx>] (%lx) handled successfully\n",
+		       current->comm, regs->pc, newpc);
+#endif
 		regs->pc = newpc;
 		return;
 	}
diff -ruN linux-2.4.20-WRT/arch/alpha/mm/numa.c linux-2.4.20-WRTstp/arch/alpha/mm/numa.c
--- linux-2.4.20-WRT/arch/alpha/mm/numa.c	2003-07-04 01:11:00.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/alpha/mm/numa.c	2005-11-08 06:23:46.000000000 -0800
@@ -390,6 +390,9 @@
 	       reservedpages << (PAGE_SHIFT-10),
 	       datasize >> 10,
 	       initsize >> 10);
+#if 0
+	mem_stress();
+#endif
 }
 
 void
diff -ruN linux-2.4.20-WRT/arch/arm/kernel/arch.c linux-2.4.20-WRTstp/arch/arm/kernel/arch.c
--- linux-2.4.20-WRT/arch/arm/kernel/arch.c	2003-07-04 01:11:01.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/kernel/arch.c	2001-08-12 11:13:59.000000000 -0700
@@ -38,6 +38,12 @@
 	default:
 		break;
 	}
+#if 0
+	if (vram_size) {
+		desc->video_start = 0x02000000;
+		desc->video_end   = 0x02000000 + vram_size;
+	}
+#endif
 	return 0;
 }
 
diff -ruN linux-2.4.20-WRT/arch/arm/kernel/dma-footbridge.c linux-2.4.20-WRTstp/arch/arm/kernel/dma-footbridge.c
--- linux-2.4.20-WRT/arch/arm/kernel/dma-footbridge.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/kernel/dma-footbridge.c	2000-09-18 15:15:24.000000000 -0700
@@ -20,9 +20,34 @@
 #include <asm/mach/dma.h>
 #include <asm/hardware/dec21285.h>
 
+#if 0
+static int fb_dma_request(dmach_t channel, dma_t *dma)
+{
+	return -EINVAL;
+}
+
+static void fb_dma_enable(dmach_t channel, dma_t *dma)
+{
+}
+
+static void fb_dma_disable(dmach_t channel, dma_t *dma)
+{
+}
+
+static struct dma_ops fb_dma_ops = {
+	type:		"fb",
+	request:	fb_dma_request,
+	enable:		fb_dma_enable,
+	disable:	fb_dma_disable,
+};
+#endif
 
 void __init arch_dma_init(dma_t *dma)
 {
+#if 0
+	dma[_DC21285_DMA(0)].d_ops = &fb_dma_ops;
+	dma[_DC21285_DMA(1)].d_ops = &fb_dma_ops;
+#endif
 #ifdef CONFIG_ISA_DMA
 	if (footbridge_cfn_mode())
 		isa_init_dma(dma + _ISA_DMA(0));
diff -ruN linux-2.4.20-WRT/arch/arm/kernel/dma-rpc.c linux-2.4.20-WRTstp/arch/arm/kernel/dma-rpc.c
--- linux-2.4.20-WRT/arch/arm/kernel/dma-rpc.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/kernel/dma-rpc.c	2001-02-09 11:29:44.000000000 -0800
@@ -26,6 +26,18 @@
 #include <asm/mach/dma.h>
 #include <asm/hardware/iomd.h>
 
+#if 0
+typedef enum {
+	dma_size_8	= 1,
+	dma_size_16	= 2,
+	dma_size_32	= 4,
+	dma_size_128	= 16
+} dma_size_t;
+
+typedef struct {
+	dma_size_t	transfersize;
+} dma_t;
+#endif
 
 #define TRANSFER_SIZE	2
 
diff -ruN linux-2.4.20-WRT/arch/arm/kernel/ecard.c linux-2.4.20-WRTstp/arch/arm/kernel/ecard.c
--- linux-2.4.20-WRT/arch/arm/kernel/ecard.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/kernel/ecard.c	2001-08-12 11:13:59.000000000 -0700
@@ -243,6 +243,17 @@
  */
 static void ecard_init_pgtables(struct mm_struct *mm)
 {
+	/* We want to set up the page tables for the following mapping:
+	 *  Virtual	Physical
+	 *  0x03000000	0x03000000
+	 *  0x03010000	unmapped
+	 *  0x03210000	0x03210000
+	 *  0x03400000	unmapped
+	 *  0x08000000	0x08000000
+	 *  0x10000000	unmapped
+	 *
+	 * FIXME: we don't follow this 100% yet.
+	 */
 	pgd_t *src_pgd, *dst_pgd;
 	unsigned int dst_addr = IO_START;
 
@@ -323,6 +334,12 @@
 	}
 }
 
+/*
+ * Wake the expansion card daemon to action our request.
+ *
+ * FIXME: The test here is not sufficient to detect if the
+ * kcardd is running.
+ */
 static void
 ecard_call(struct ecard_request *req)
 {
diff -ruN linux-2.4.20-WRT/arch/arm/kernel/entry-armo.S linux-2.4.20-WRTstp/arch/arm/kernel/entry-armo.S
--- linux-2.4.20-WRT/arch/arm/kernel/entry-armo.S	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/kernel/entry-armo.S	2001-08-12 11:13:59.000000000 -0700
@@ -99,6 +99,16 @@
  * For entry-common.S
  */
 
+#if 0
+/*
+ * Uncomment these if you wish to get more debugging into about data aborts.
+ */
+#define FAULT_CODE_LDRSTRPOST	0x80
+#define FAULT_CODE_LDRSTRPRE	0x40
+#define FAULT_CODE_LDRSTRREG	0x20
+#define FAULT_CODE_LDMSTM	0x10
+#define FAULT_CODE_LDCSTC	0x08
+#endif
 #define FAULT_CODE_PREFETCH	0x04
 #define FAULT_CODE_WRITE	0x02
 #define FAULT_CODE_FORCECOW	0x01
diff -ruN linux-2.4.20-WRT/arch/arm/kernel/entry-armv.S linux-2.4.20-WRTstp/arch/arm/kernel/entry-armv.S
--- linux-2.4.20-WRT/arch/arm/kernel/entry-armv.S	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/kernel/entry-armv.S	2005-11-08 06:23:46.000000000 -0800
@@ -434,6 +434,7 @@
 		.endm
 
 		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
+/* FIXME: should not be using soo many LDRs here */
 		ldr	\irqnr, =IO_ADDRESS(INTEGRATOR_IC_BASE)
 		ldr	\irqstat, [\irqnr, #IRQ_STATUS]		@ get masked status
 		ldr	\irqnr, =IO_ADDRESS(INTEGRATOR_HDR_BASE)
@@ -524,7 +525,7 @@
 		.macro	irq_prio_table
 		.endm
 	
-#elif defined(CONFIG_ARCH_CAMELOT)
+#elif defined (CONFIG_ARCH_CAMELOT)
 #include <asm/arch/platform.h>
 #undef IRQ_MODE /* same name defined in asm/proc/ptrace.h */
 #include <asm/arch/int_ctrl00.h>
diff -ruN linux-2.4.20-WRT/arch/arm/kernel/entry-common.S linux-2.4.20-WRTstp/arch/arm/kernel/entry-common.S
--- linux-2.4.20-WRT/arch/arm/kernel/entry-common.S	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/kernel/entry-common.S	2002-02-25 11:37:52.000000000 -0800
@@ -14,7 +14,7 @@
  * We rely on the fact that R0 is at the bottom of the stack (due to
  * slow/fast restore user regs).
  */
-#if S_R0
+#if S_R0 != 0
 #error "Please fix"
 #endif
 
diff -ruN linux-2.4.20-WRT/arch/arm/kernel/head-armv.S linux-2.4.20-WRTstp/arch/arm/kernel/head-armv.S
--- linux-2.4.20-WRT/arch/arm/kernel/head-armv.S	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/kernel/head-armv.S	2001-10-11 09:04:57.000000000 -0700
@@ -120,6 +120,9 @@
 __entry:
 #endif
 #if defined(CONFIG_ARCH_L7200)
+/*
+ * FIXME - No bootloader, so manually set 'r1' with our architecture number.
+ */
 		mov	r1, #MACH_TYPE_L7200
 #endif
 
diff -ruN linux-2.4.20-WRT/arch/arm/kernel/plx90x0.c linux-2.4.20-WRTstp/arch/arm/kernel/plx90x0.c
--- linux-2.4.20-WRT/arch/arm/kernel/plx90x0.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/kernel/plx90x0.c	2001-07-04 15:43:05.000000000 -0700
@@ -133,6 +133,13 @@
 	/* Have a sniff around and see which PLX device is present. */
 	unsigned long id = __raw_readl(base + 0xf0);
 	
+#if 0
+	/* This check was a good idea, but can fail.  The PLX9060 puts no
+	   default value in these registers unless NB# is asserted (which it
+	   isn't on these cards).  */
+	if ((id & 0xffff) != PCI_VENDOR_ID_PLX)
+		return;		/* Nothing found */
+#endif
 
 	/* Found one - now work out what it is. */
 	switch (id >> 16) {
diff -ruN linux-2.4.20-WRT/arch/arm/kernel/signal.c linux-2.4.20-WRTstp/arch/arm/kernel/signal.c
--- linux-2.4.20-WRT/arch/arm/kernel/signal.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/kernel/signal.c	2005-11-08 06:23:46.000000000 -0800
@@ -115,6 +115,7 @@
 {
 	sigset_t saveset, newset;
 
+	/* XXX: Don't preclude handling different sized sigset_t's. */
 	if (sigsetsize != sizeof(sigset_t))
 		return -EINVAL;
 
diff -ruN linux-2.4.20-WRT/arch/arm/lib/csumpartialcopyuser.S linux-2.4.20-WRTstp/arch/arm/lib/csumpartialcopyuser.S
--- linux-2.4.20-WRT/arch/arm/lib/csumpartialcopyuser.S	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/lib/csumpartialcopyuser.S	2001-05-16 15:25:16.000000000 -0700
@@ -159,6 +159,12 @@
 
 #include "csumpartialcopygeneric.S"
 
+/*
+ * FIXME: minor buglet here
+ * We don't return the checksum for the data present in the buffer.  To do
+ * so properly, we would have to add in whatever registers were loaded before
+ * the fault, which, with the current asm above is not predictable.
+ */
 #if defined(CONFIG_CPU_32)
 		.section .fixup,"ax"
 #endif
diff -ruN linux-2.4.20-WRT/arch/arm/lib/longlong.h linux-2.4.20-WRTstp/arch/arm/lib/longlong.h
--- linux-2.4.20-WRT/arch/arm/lib/longlong.h	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/lib/longlong.h	2001-10-11 09:04:57.000000000 -0700
@@ -73,7 +73,7 @@
    If any of these macros are left undefined for a particular CPU,
    C macros are used.  */
 
-#if defined(__arm__)
+#if defined (__arm__)
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
   __asm__ ("adds	%1, %4, %5
 	adc	%0, %2, %3"						\
diff -ruN linux-2.4.20-WRT/arch/arm/mach-clps711x/mm.c linux-2.4.20-WRTstp/arch/arm/mach-clps711x/mm.c
--- linux-2.4.20-WRT/arch/arm/mach-clps711x/mm.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mach-clps711x/mm.c	2005-11-08 06:23:46.000000000 -0800
@@ -31,6 +31,30 @@
 #include <asm/mach/map.h>
 #include <asm/hardware/clps7111.h>
 
+#if 0 //def CONFIG_DISCONTIGMEM
+  
+/*
+ * The assumption of maximum 4 discontiguous memory banks is present
+ * in several places in the ARM kernel, including the parameter block
+ * (this affects boot loaders, too).  Banks do not necessarily
+ * correspond 1:1 with NUMA nodes, although they usually will,
+ * especially if they are widely discontiguous.
+ *
+ *  - note that the parameter block is depreciated for new implementations
+ *  - also note that discontig_node_data is actually used
+ *    -- rmk 
+ */
+
+static bootmem_data_t node_bootmem_data[4];
+
+pg_data_t clps711x_node_data[4] = {
+        { bdata: &node_bootmem_data[0] },
+        { bdata: &node_bootmem_data[1] },
+        { bdata: &node_bootmem_data[2] },
+        { bdata: &node_bootmem_data[3] },
+};
+
+#endif
 
 /*
  * This maps the generic CLPS711x registers
diff -ruN linux-2.4.20-WRT/arch/arm/mach-integrator/cpu.c linux-2.4.20-WRTstp/arch/arm/mach-integrator/cpu.c
--- linux-2.4.20-WRT/arch/arm/mach-integrator/cpu.c	2003-10-14 01:07:14.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mach-integrator/cpu.c	2005-11-08 06:24:34.000000000 -0800
@@ -3,7 +3,7 @@
  *
  *  Copyright (C) 2001 Deep Blue Solutions Ltd.
  *
- *  $Id: cpu.c,v 1.1.1.4 2003/10/14 08:07:14 sparq Exp $
+ *  $Id: cpu.c,v 1.2 2001/09/22 12:11:17 rmk Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff -ruN linux-2.4.20-WRT/arch/arm/mach-integrator/pci_v3.c linux-2.4.20-WRTstp/arch/arm/mach-integrator/pci_v3.c
--- linux-2.4.20-WRT/arch/arm/mach-integrator/pci_v3.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mach-integrator/pci_v3.c	2005-11-08 06:23:46.000000000 -0800
@@ -451,6 +451,15 @@
 {
 	unsigned long pc = instruction_pointer(regs);
 	unsigned long instr = *(unsigned long *)pc;
+#if 0
+	char buf[128];
+
+	sprintf(buf, "V3 fault: address=0x%08lx, pc=0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x ISTAT=%02x\n",
+		addr, pc, instr, __raw_readl(SC_LBFADDR), __raw_readl(SC_LBFCODE) & 255,
+		v3_readb(V3_LB_ISTAT));
+	printk(KERN_DEBUG "%s", buf);
+	printascii(buf);
+#endif
 
 	v3_writeb(V3_LB_ISTAT, 0);
 	__raw_writel(3, SC_PCI);
@@ -617,4 +626,10 @@
 	v3_writeb(V3_LB_ISTAT, ~0x40);
 	v3_writeb(V3_LB_IMASK, 0x68);
 
+#if 0
+	ret = request_irq(IRQ_LBUSTIMEOUT, lb_timeout, 0, "bus timeout", NULL);
+	if (ret)
+		printk(KERN_ERR "PCI: unable to grab local bus timeout ".
+		       "interrupt: %d\n", ret);
+#endif
 }
diff -ruN linux-2.4.20-WRT/arch/arm/mach-mx1ads/arch.c linux-2.4.20-WRTstp/arch/arm/mach-mx1ads/arch.c
--- linux-2.4.20-WRT/arch/arm/mach-mx1ads/arch.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mach-mx1ads/arch.c	2005-11-08 06:23:46.000000000 -0800
@@ -54,3 +54,6 @@
 	INITIRQ(mx1ads_init_irq)
 MACHINE_END
 
+#if 0
+
+#endif
diff -ruN linux-2.4.20-WRT/arch/arm/mach-mx1ads/cpu.c linux-2.4.20-WRTstp/arch/arm/mach-mx1ads/cpu.c
--- linux-2.4.20-WRT/arch/arm/mach-mx1ads/cpu.c	2003-10-14 01:07:15.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mach-mx1ads/cpu.c	2005-11-08 06:23:46.000000000 -0800
@@ -3,7 +3,7 @@
  *
  *  Copyright (C) 2001 Deep Blue Solutions Ltd.
  *
- *  $Id: cpu.c,v 1.1.1.4 2003/10/14 08:07:15 sparq Exp $
+ *  $Id: cpu.c,v 1.2 2001/09/22 12:11:17 rmk Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -12,6 +12,10 @@
  * CPU support functions
  */
 
+/*  FIXME-
+ *  Add support for clock change on the fly.  (Power)
+ *
+ */
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
diff -ruN linux-2.4.20-WRT/arch/arm/mach-mx1ads/irq.c linux-2.4.20-WRTstp/arch/arm/mach-mx1ads/irq.c
--- linux-2.4.20-WRT/arch/arm/mach-mx1ads/irq.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mach-mx1ads/irq.c	2005-11-08 06:23:46.000000000 -0800
@@ -26,6 +26,15 @@
 
 #include <asm/mach/irq.h>
 
+/*
+ *
+ * We simply use the ENABLE DISABLE registers inside of the MX1
+ * to turn on/off specific interrupts.  FIXME- We should
+ * also add support for the accelerated interrupt controller
+ * by putting offets to irq jump code in the appropriate
+ * places.
+ *
+ */
 
 #define INTENNUM_OFF              0x8
 #define INTDISNUM_OFF             0xC
diff -ruN linux-2.4.20-WRT/arch/arm/mach-mx1ads/time.c linux-2.4.20-WRTstp/arch/arm/mach-mx1ads/time.c
--- linux-2.4.20-WRT/arch/arm/mach-mx1ads/time.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mach-mx1ads/time.c	2005-11-08 06:23:46.000000000 -0800
@@ -18,6 +18,15 @@
 
 extern int (*set_rtc)(void);
 
+/* FIXME-
+ * When we have an external RTC part,
+ * put the mapping in for that part.
+ *
+ * The internal RTC within the MX1 is not sufficient
+ * for tracking time other than time of day, or
+ * date over very short periods of time.
+ *
+ */
 
 static int mx1ads_set_rtc(void)
 {
diff -ruN linux-2.4.20-WRT/arch/arm/mach-sa1100/cpu-sa1110.c linux-2.4.20-WRTstp/arch/arm/mach-sa1100/cpu-sa1110.c
--- linux-2.4.20-WRT/arch/arm/mach-sa1100/cpu-sa1110.c	2003-10-14 01:07:15.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mach-sa1100/cpu-sa1110.c	2005-11-08 06:23:46.000000000 -0800
@@ -3,7 +3,7 @@
  *
  *  Copyright (C) 2001 Russell King
  *
- *  $Id: cpu-sa1110.c,v 1.1.1.4 2003/10/14 08:07:15 sparq Exp $
+ *  $Id: cpu-sa1110.c,v 1.6 2001/10/22 11:53:47 rmk Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -165,6 +165,14 @@
 	(void) MDREFR;
 }
 
+/*
+ * Update the refresh period.  We do this such that we always refresh
+ * the SDRAMs within their permissible period.  The refresh period is
+ * always a multiple of the memory clock (fixed at cpu_clock / 2).
+ *
+ * FIXME: we don't currently take account of burst accesses here,
+ * but neither do Intels DM nor Angel.
+ */
 static void
 sdram_update_refresh(u_int cpu_khz, struct sdram_params *sdram)
 {
@@ -194,6 +202,22 @@
 	ppcr = sa11x0_freq_to_ppcr(khz);
 	sdram_calculate_timing(&sd, khz, sdram);
 
+#if 0
+	/*
+	 * These values are wrong according to the SA1110 documentation
+	 * and errata, but they seem to work.  Need to get a storage
+	 * scope on to the SDRAM signals to work out why.
+	 */
+	if (khz < 147500) {
+		sd.mdrefr |= MDREFR_K1DB2;
+		sd.mdcas[0] = 0xaaaaaa7f;
+	} else {
+		sd.mdrefr &= ~MDREFR_K1DB2;
+		sd.mdcas[0] = 0xaaaaaa9f;
+	}
+	sd.mdcas[1] = 0xaaaaaaaa;
+	sd.mdcas[2] = 0xaaaaaaaa;
+#endif
 	/*
 	 * The clock could be going away for some time.  Set the SDRAMs
 	 * to refresh rapidly (every 64 memory clock cycles).  To get
diff -ruN linux-2.4.20-WRT/arch/arm/mach-sa1100/dma-sa1111.c linux-2.4.20-WRTstp/arch/arm/mach-sa1100/dma-sa1111.c
--- linux-2.4.20-WRT/arch/arm/mach-sa1100/dma-sa1111.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mach-sa1100/dma-sa1111.c	2005-11-08 06:23:46.000000000 -0800
@@ -241,6 +241,7 @@
 }
 
 
+/* FIXME:  need to complete the three following functions */
 
 int sa1111_dma_get_current(dmach_t channel, void **buf_id, dma_addr_t *addr)
 {
diff -ruN linux-2.4.20-WRT/arch/arm/mach-sa1100/leds-system3.c linux-2.4.20-WRTstp/arch/arm/mach-sa1100/leds-system3.c
--- linux-2.4.20-WRT/arch/arm/mach-sa1100/leds-system3.c	2003-10-14 01:07:15.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mach-sa1100/leds-system3.c	2005-11-08 06:23:46.000000000 -0800
@@ -5,19 +5,13 @@
  *
  * Original (leds-footbridge.c) by Russell King
  *
- * $Id: leds-system3.c,v 1.1.1.4 2003/10/14 08:07:15 sparq Exp $
+ * $Id: leds-system3.c,v 1.1.6.1 2001/12/04 15:19:26 seletz Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  *
  * $Log: leds-system3.c,v $
- * Revision 1.1.1.4  2003/10/14 08:07:15  sparq
- * Broadcom Release 3.51.8.0 for BCM4712.
- *
- * Revision 1.1.1.1  2003/02/03 22:37:19  mhuang
- * LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  * Revision 1.1.6.1  2001/12/04 15:19:26  seletz
  * - merged from linux_2_4_13_ac5_rmk2
  *
diff -ruN linux-2.4.20-WRT/arch/arm/mach-sa1100/neponset.c linux-2.4.20-WRTstp/arch/arm/mach-sa1100/neponset.c
--- linux-2.4.20-WRT/arch/arm/mach-sa1100/neponset.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mach-sa1100/neponset.c	2005-11-08 06:23:46.000000000 -0800
@@ -110,6 +110,7 @@
 	 * Neponset has SA1111 connected to CS4.  We know that after
 	 * reset the chip will be configured for variable latency IO.
 	 */
+	/* FIXME: setup MSC2 */
 
 	/*
 	 * Probe for a SA1111.
diff -ruN linux-2.4.20-WRT/arch/arm/mach-sa1100/simpad.c linux-2.4.20-WRTstp/arch/arm/mach-sa1100/simpad.c
--- linux-2.4.20-WRT/arch/arm/mach-sa1100/simpad.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mach-sa1100/simpad.c	2005-11-08 06:23:46.000000000 -0800
@@ -44,7 +44,7 @@
 fixup_simpad(struct machine_desc *desc, struct param_struct *params,
 		   char **cmdline, struct meminfo *mi)
 {
-#ifdef CONFIG_SA1100_SIMPAD_DRAM_64MB     /* DRAM */
+#ifdef CONFIG_SA1100_SIMPAD_DRAM_64MB /* DRAM */
 	SET_BANK( 0, 0xc0000000, 64*1024*1024 );
 #else
 	SET_BANK( 0, 0xc0000000, 32*1024*1024 );
diff -ruN linux-2.4.20-WRT/arch/arm/mach-sa1100/system3.c linux-2.4.20-WRTstp/arch/arm/mach-sa1100/system3.c
--- linux-2.4.20-WRT/arch/arm/mach-sa1100/system3.c	2003-10-14 01:07:15.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mach-sa1100/system3.c	2005-11-08 06:23:46.000000000 -0800
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 2001 Stefan Eletzhofer <stefan.eletzhofer@eletztrick.de>
  *
- * $Id: system3.c,v 1.1.1.4 2003/10/14 08:07:15 sparq Exp $
+ * $Id: system3.c,v 1.1.6.1 2001/12/04 17:28:06 seletz Exp $
  *
  * This file contains all PT Sytsem 3 tweaks. Based on original work from
  * Nicolas Pitre's assabet fixes
@@ -13,12 +13,6 @@
  * published by the Free Software Foundation.
  *
  * $Log: system3.c,v $
- * Revision 1.1.1.4  2003/10/14 08:07:15  sparq
- * Broadcom Release 3.51.8.0 for BCM4712.
- *
- * Revision 1.1.1.1  2003/02/03 22:37:19  mhuang
- * LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  * Revision 1.1.6.1  2001/12/04 17:28:06  seletz
  * - merged from previous branch
  *
@@ -164,6 +158,11 @@
 		if( irr & PT_IRQ_LAN )
 			do_IRQ(IRQ_SYSTEM3_SMC9196, regs);
 
+#if 0
+		/* Highspeed Serial Bus not yet used */
+		if( irr & PT_IRQ_USAR )
+			do_IRQ(PT_USAR_IRQ, regs);
+#endif
 
 		if( irr & PT_IRQ_SA1111 )
 			sa1111_IRQ_demux(irq, dev_id, regs);
@@ -185,6 +184,12 @@
 	irq_desc[irq].valid	= 1;
 	irq_desc[irq].probe_ok	= 1;
 
+#if 0
+	/* Highspeed Serial Bus not yet used */
+	irq = PT_USAR_IRQ;
+	irq_desc[irq].valid	= 1;
+	irq_desc[irq].probe_ok	= 1;
+#endif
 
 	/* IRQ by CPLD */
 	set_GPIO_IRQ_edge( GPIO_GPIO(25), GPIO_RISING_EDGE );
@@ -237,6 +242,13 @@
 	/* TODO: switch on/off uart in powersave mode */
 }
 
+/*
+ * Note! this can be called from IRQ context.
+ * FIXME: Handle PT Digital Board CTRL regs irq-safe.
+ *
+ * NB: system3 uses COM_RTS and COM_DTR for both UART1 (com port)
+ * and UART3 (radio module).  We only handle them for UART1 here.
+ */
 static void system3_set_mctrl(struct uart_port *port, u_int mctrl)
 {
 	if (port->mapbase == _Ser1UTCR0) {
@@ -335,7 +347,7 @@
 
 	system3_init_irq();
 
-#if defined(CONFIG_CPU_FREQ)
+#if defined( CONFIG_CPU_FREQ )
 	ret = cpufreq_register_notifier(&system3_clkchg_block);
 	if ( ret != 0 ) {
 		printk( KERN_WARNING"PT Digital Board: could not register clock scale callback\n" );
diff -ruN linux-2.4.20-WRT/arch/arm/mm/consistent.c linux-2.4.20-WRTstp/arch/arm/mm/consistent.c
--- linux-2.4.20-WRT/arch/arm/mm/consistent.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mm/consistent.c	2001-06-27 14:12:04.000000000 -0700
@@ -57,6 +57,14 @@
 	if (!ret)
 		goto no_remap;
 
+#if 0 /* ioremap_does_flush_cache_all */
+	/*
+	 * we need to ensure that there are no cachelines in use, or
+	 * worse dirty in this area.  Really, we don't need to do
+	 * this since __ioremap does a flush_cache_all() anyway. --rmk
+	 */
+	invalidate_dcache_range(virt, virt + size);
+#endif
 
 	/*
 	 * free wasted pages.  We skip the first page since we know
diff -ruN linux-2.4.20-WRT/arch/arm/mm/fault-armo.c linux-2.4.20-WRTstp/arch/arm/mm/fault-armo.c
--- linux-2.4.20-WRT/arch/arm/mm/fault-armo.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mm/fault-armo.c	2001-02-08 16:32:44.000000000 -0800
@@ -55,6 +55,12 @@
 asmlinkage int
 do_PrefetchAbort(unsigned long addr, struct pt_regs *regs)
 {
+#if 0
+	if (the memc mapping for this page exists) {
+		printk ("Page in, but got abort (undefined instruction?)\n");
+		return 0;
+	}
+#endif
 	do_page_fault(addr, FAULT_CODE_PREFETCH, regs);
 	return 1;
 }
diff -ruN linux-2.4.20-WRT/arch/arm/mm/fault-common.c linux-2.4.20-WRTstp/arch/arm/mm/fault-common.c
--- linux-2.4.20-WRT/arch/arm/mm/fault-common.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mm/fault-common.c	2005-11-08 06:24:34.000000000 -0800
@@ -351,6 +351,10 @@
 	if (pgd_none(*pgd_k))
 		goto bad_area;
 
+#if 0	/* note that we are two-level */
+	if (!pgd_present(*pgd))
+		set_pgd(pgd, *pgd_k);
+#endif
 
 	pmd_k = pmd_offset(pgd_k, addr);
 	pmd   = pmd_offset(pgd, addr);
diff -ruN linux-2.4.20-WRT/arch/arm/mm/init.c linux-2.4.20-WRTstp/arch/arm/mm/init.c
--- linux-2.4.20-WRT/arch/arm/mm/init.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mm/init.c	2001-10-11 09:04:57.000000000 -0700
@@ -167,6 +167,12 @@
 #define PFN_RANGE(s,e)	PFN_SIZE(PAGE_ALIGN((unsigned long)(e)) - \
 				(((unsigned long)(s)) & PAGE_MASK))
 
+/*
+ * FIXME: We really want to avoid allocating the bootmap bitmap
+ * over the top of the initrd.  Hopefully, this is located towards
+ * the start of a bank, so if we allocate the bootmap bitmap at
+ * the end, we won't clash.
+ */
 static unsigned int __init
 find_bootmap_pfn(int node, struct meminfo *mi, unsigned int bootmap_pages)
 {
diff -ruN linux-2.4.20-WRT/arch/arm/mm/mm-armv.c linux-2.4.20-WRTstp/arch/arm/mm/mm-armv.c
--- linux-2.4.20-WRT/arch/arm/mm/mm-armv.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/mm/mm-armv.c	2005-11-08 06:23:46.000000000 -0800
@@ -113,6 +113,9 @@
 	memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR,
 		       (PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t));
 
+	/*
+	 * FIXME: this should not be necessary
+	 */
 	clean_cache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t));
 
 	return new_pgd;
@@ -421,6 +424,11 @@
 	unsigned long bank_start, prev_bank_end = 0;
 	unsigned int i;
 
+	/*
+	 * [FIXME] This relies on each bank being in address order.  This
+	 * may not be the case, especially if the user has provided the
+	 * information on the command line.
+	 */
 	for (i = 0; i < mi->nr_banks; i++) {
 		if (mi->bank[i].size == 0 || mi->bank[i].node != node)
 			continue;
diff -ruN linux-2.4.20-WRT/arch/arm/nwfpe/ARM-gcc.h linux-2.4.20-WRTstp/arch/arm/nwfpe/ARM-gcc.h
--- linux-2.4.20-WRT/arch/arm/nwfpe/ARM-gcc.h	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/nwfpe/ARM-gcc.h	2005-11-08 06:23:46.000000000 -0800
@@ -105,5 +105,16 @@
 #define float64_le			___float64_le
 #define float64_lt			___float64_lt
 
+#if 0
+#define float64_add			__adddf3
+#define float64_sub			__subdf3
+#define float64_mul			__muldf3
+#define float64_div			__divdf3
+#define int32_to_float64		__floatsidf
+#define float64_to_int32_round_to_zero	__fixdfsi
+#define float64_to_uint32_round_to_zero	__fixunsdfsi
+#define float64_to_float32		__truncdfsf2
+#define float32_to_float64		__extendsfdf2
+#endif
 
 #endif
diff -ruN linux-2.4.20-WRT/arch/arm/nwfpe/double_cpdo.c linux-2.4.20-WRTstp/arch/arm/nwfpe/double_cpdo.c
--- linux-2.4.20-WRT/arch/arm/nwfpe/double_cpdo.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/nwfpe/double_cpdo.c	2005-11-08 06:23:46.000000000 -0800
@@ -122,11 +122,25 @@
          fpa11->fpreg[Fd].fDouble = float64_div(rFm,rFn);
       break;
 
+#if 0
+      case POW_CODE:
+         fpa11->fpreg[Fd].fDouble = float64_pow(rFn,rFm);
+      break;
+
+      case RPW_CODE:
+         fpa11->fpreg[Fd].fDouble = float64_pow(rFm,rFn);
+      break;
+#endif
 
       case RMF_CODE:
          fpa11->fpreg[Fd].fDouble = float64_rem(rFn,rFm);
       break;
 
+#if 0
+      case POL_CODE:
+         fpa11->fpreg[Fd].fDouble = float64_pol(rFn,rFm);
+      break;
+#endif
 
       /* monadic opcodes */
       case MVF_CODE:
@@ -158,6 +172,43 @@
          fpa11->fpreg[Fd].fDouble = float64_sqrt(rFm);
       break;
 
+#if 0
+      case LOG_CODE:
+         fpa11->fpreg[Fd].fDouble = float64_log(rFm);
+      break;
+
+      case LGN_CODE:
+         fpa11->fpreg[Fd].fDouble = float64_ln(rFm);
+      break;
+
+      case EXP_CODE:
+         fpa11->fpreg[Fd].fDouble = float64_exp(rFm);
+      break;
+
+      case SIN_CODE:
+         fpa11->fpreg[Fd].fDouble = float64_sin(rFm);
+      break;
+
+      case COS_CODE:
+         fpa11->fpreg[Fd].fDouble = float64_cos(rFm);
+      break;
+
+      case TAN_CODE:
+         fpa11->fpreg[Fd].fDouble = float64_tan(rFm);
+      break;
+
+      case ASN_CODE:
+         fpa11->fpreg[Fd].fDouble = float64_arcsin(rFm);
+      break;
+
+      case ACS_CODE:
+         fpa11->fpreg[Fd].fDouble = float64_arccos(rFm);
+      break;
+
+      case ATN_CODE:
+         fpa11->fpreg[Fd].fDouble = float64_arctan(rFm);
+      break;
+#endif
 
       case NRM_CODE:
       break;
@@ -172,3 +223,66 @@
    return nRc;
 }
 
+#if 0
+float64 float64_exp(float64 rFm)
+{
+  return rFm;
+//series
+}
+
+float64 float64_ln(float64 rFm)
+{
+  return rFm;
+//series
+}
+
+float64 float64_sin(float64 rFm)
+{
+  return rFm;
+//series
+}
+
+float64 float64_cos(float64 rFm)
+{
+   return rFm;
+   //series
+}
+
+#if 0
+float64 float64_arcsin(float64 rFm)
+{
+//series
+}
+
+float64 float64_arctan(float64 rFm)
+{
+  //series
+}
+#endif
+
+float64 float64_log(float64 rFm)
+{
+  return float64_div(float64_ln(rFm),getDoubleConstant(7));
+}
+
+float64 float64_tan(float64 rFm)
+{
+  return float64_div(float64_sin(rFm),float64_cos(rFm));
+}
+
+float64 float64_arccos(float64 rFm)
+{
+return rFm;
+   //return float64_sub(halfPi,float64_arcsin(rFm));
+}
+
+float64 float64_pow(float64 rFn,float64 rFm)
+{
+  return float64_exp(float64_mul(rFm,float64_ln(rFn))); 
+}
+
+float64 float64_pol(float64 rFn,float64 rFm)
+{
+  return float64_arctan(float64_div(rFn,rFm)); 
+}
+#endif
diff -ruN linux-2.4.20-WRT/arch/arm/nwfpe/extended_cpdo.c linux-2.4.20-WRTstp/arch/arm/nwfpe/extended_cpdo.c
--- linux-2.4.20-WRT/arch/arm/nwfpe/extended_cpdo.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/nwfpe/extended_cpdo.c	2005-11-08 06:23:46.000000000 -0800
@@ -120,11 +120,25 @@
          fpa11->fpreg[Fd].fExtended = floatx80_div(rFm,rFn);
       break;
 
+#if 0
+      case POW_CODE:
+         fpa11->fpreg[Fd].fExtended = floatx80_pow(rFn,rFm);
+      break;
+
+      case RPW_CODE:
+         fpa11->fpreg[Fd].fExtended = floatx80_pow(rFm,rFn);
+      break;
+#endif
 
       case RMF_CODE:
          fpa11->fpreg[Fd].fExtended = floatx80_rem(rFn,rFm);
       break;
 
+#if 0
+      case POL_CODE:
+         fpa11->fpreg[Fd].fExtended = floatx80_pol(rFn,rFm);
+      break;
+#endif
 
       /* monadic opcodes */
       case MVF_CODE:
@@ -150,6 +164,43 @@
          fpa11->fpreg[Fd].fExtended = floatx80_sqrt(rFm);
       break;
 
+#if 0
+      case LOG_CODE:
+         fpa11->fpreg[Fd].fExtended = floatx80_log(rFm);
+      break;
+
+      case LGN_CODE:
+         fpa11->fpreg[Fd].fExtended = floatx80_ln(rFm);
+      break;
+
+      case EXP_CODE:
+         fpa11->fpreg[Fd].fExtended = floatx80_exp(rFm);
+      break;
+
+      case SIN_CODE:
+         fpa11->fpreg[Fd].fExtended = floatx80_sin(rFm);
+      break;
+
+      case COS_CODE:
+         fpa11->fpreg[Fd].fExtended = floatx80_cos(rFm);
+      break;
+
+      case TAN_CODE:
+         fpa11->fpreg[Fd].fExtended = floatx80_tan(rFm);
+      break;
+
+      case ASN_CODE:
+         fpa11->fpreg[Fd].fExtended = floatx80_arcsin(rFm);
+      break;
+
+      case ACS_CODE:
+         fpa11->fpreg[Fd].fExtended = floatx80_arccos(rFm);
+      break;
+
+      case ATN_CODE:
+         fpa11->fpreg[Fd].fExtended = floatx80_arctan(rFm);
+      break;
+#endif
 
       case NRM_CODE:
       break;
@@ -164,3 +215,59 @@
    return nRc;
 }
 
+#if 0
+floatx80 floatx80_exp(floatx80 Fm)
+{
+//series
+}
+
+floatx80 floatx80_ln(floatx80 Fm)
+{
+//series
+}
+
+floatx80 floatx80_sin(floatx80 rFm)
+{
+//series
+}
+
+floatx80 floatx80_cos(floatx80 rFm)
+{
+//series
+}
+
+floatx80 floatx80_arcsin(floatx80 rFm)
+{
+//series
+}
+
+floatx80 floatx80_arctan(floatx80 rFm)
+{
+  //series
+}
+
+floatx80 floatx80_log(floatx80 rFm)
+{
+  return floatx80_div(floatx80_ln(rFm),getExtendedConstant(7));
+}
+
+floatx80 floatx80_tan(floatx80 rFm)
+{
+  return floatx80_div(floatx80_sin(rFm),floatx80_cos(rFm));
+}
+
+floatx80 floatx80_arccos(floatx80 rFm)
+{
+   //return floatx80_sub(halfPi,floatx80_arcsin(rFm));
+}
+
+floatx80 floatx80_pow(floatx80 rFn,floatx80 rFm)
+{
+  return floatx80_exp(floatx80_mul(rFm,floatx80_ln(rFn))); 
+}
+
+floatx80 floatx80_pol(floatx80 rFn,floatx80 rFm)
+{
+  return floatx80_arctan(floatx80_div(rFn,rFm)); 
+}
+#endif
diff -ruN linux-2.4.20-WRT/arch/arm/nwfpe/fpa11.c linux-2.4.20-WRTstp/arch/arm/nwfpe/fpa11.c
--- linux-2.4.20-WRT/arch/arm/nwfpe/fpa11.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/nwfpe/fpa11.c	2005-11-08 06:23:46.000000000 -0800
@@ -174,4 +174,42 @@
   return(nRc);
 }
 
+#if 0
+unsigned int EmulateAll1(unsigned int opcode)
+{
+  switch ((opcode >> 24) & 0xf)
+  {
+     case 0xc:
+     case 0xd:
+       if ((opcode >> 20) & 0x1)
+       {
+          switch ((opcode >> 8) & 0xf)
+          {
+             case 0x1: return PerformLDF(opcode); break;
+             case 0x2: return PerformLFM(opcode); break;
+             default: return 0;
+          }
+       }
+       else
+       {
+          switch ((opcode >> 8) & 0xf)
+          {
+             case 0x1: return PerformSTF(opcode); break;
+             case 0x2: return PerformSFM(opcode); break;
+             default: return 0;
+          }
+      }
+     break;
+     
+     case 0xe: 
+       if (opcode & 0x10)
+         return EmulateCPDO(opcode);
+       else
+         return EmulateCPRT(opcode);
+     break;
+  
+     default: return 0;
+  }
+}
+#endif
 
diff -ruN linux-2.4.20-WRT/arch/arm/nwfpe/fpa11_cpdt.c linux-2.4.20-WRTstp/arch/arm/nwfpe/fpa11_cpdt.c
--- linux-2.4.20-WRT/arch/arm/nwfpe/fpa11_cpdt.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/nwfpe/fpa11_cpdt.c	2005-11-08 06:23:46.000000000 -0800
@@ -325,6 +325,7 @@
    return 1;
 }
 
+#if 1
 unsigned int EmulateCPDT(const unsigned int opcode)
 {
   unsigned int nRc = 0;
@@ -354,3 +355,4 @@
   
   return nRc;
 }
+#endif
diff -ruN linux-2.4.20-WRT/arch/arm/nwfpe/fpmodule.c linux-2.4.20-WRTstp/arch/arm/nwfpe/fpmodule.c
--- linux-2.4.20-WRT/arch/arm/nwfpe/fpmodule.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/nwfpe/fpmodule.c	2005-11-08 06:23:46.000000000 -0800
@@ -27,11 +27,13 @@
 #include <linux/version.h>
 #include <linux/config.h>
 
+/* XXX */
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/init.h>
+/* XXX */
 
 #include "softfloat.h"
 #include "fpopcode.h"
diff -ruN linux-2.4.20-WRT/arch/arm/nwfpe/single_cpdo.c linux-2.4.20-WRTstp/arch/arm/nwfpe/single_cpdo.c
--- linux-2.4.20-WRT/arch/arm/nwfpe/single_cpdo.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/nwfpe/single_cpdo.c	2005-11-08 06:23:46.000000000 -0800
@@ -102,11 +102,25 @@
          fpa11->fpreg[Fd].fSingle = float32_div(rFm,rFn);
       break;
 
+#if 0
+      case POW_CODE:
+         fpa11->fpreg[Fd].fSingle = float32_pow(rFn,rFm);
+      break;
+
+      case RPW_CODE:
+         fpa11->fpreg[Fd].fSingle = float32_pow(rFm,rFn);
+      break;
+#endif
 
       case RMF_CODE:
          fpa11->fpreg[Fd].fSingle = float32_rem(rFn,rFm);
       break;
 
+#if 0
+      case POL_CODE:
+         fpa11->fpreg[Fd].fSingle = float32_pol(rFn,rFm);
+      break;
+#endif
 
       /* monadic opcodes */
       case MVF_CODE:
@@ -132,6 +146,43 @@
          fpa11->fpreg[Fd].fSingle = float32_sqrt(rFm);
       break;
 
+#if 0
+      case LOG_CODE:
+         fpa11->fpreg[Fd].fSingle = float32_log(rFm);
+      break;
+
+      case LGN_CODE:
+         fpa11->fpreg[Fd].fSingle = float32_ln(rFm);
+      break;
+
+      case EXP_CODE:
+         fpa11->fpreg[Fd].fSingle = float32_exp(rFm);
+      break;
+
+      case SIN_CODE:
+         fpa11->fpreg[Fd].fSingle = float32_sin(rFm);
+      break;
+
+      case COS_CODE:
+         fpa11->fpreg[Fd].fSingle = float32_cos(rFm);
+      break;
+
+      case TAN_CODE:
+         fpa11->fpreg[Fd].fSingle = float32_tan(rFm);
+      break;
+
+      case ASN_CODE:
+         fpa11->fpreg[Fd].fSingle = float32_arcsin(rFm);
+      break;
+
+      case ACS_CODE:
+         fpa11->fpreg[Fd].fSingle = float32_arccos(rFm);
+      break;
+
+      case ATN_CODE:
+         fpa11->fpreg[Fd].fSingle = float32_arctan(rFm);
+      break;
+#endif
 
       case NRM_CODE:
       break;
@@ -146,3 +197,59 @@
    return nRc;
 }
 
+#if 0
+float32 float32_exp(float32 Fm)
+{
+//series
+}
+
+float32 float32_ln(float32 Fm)
+{
+//series
+}
+
+float32 float32_sin(float32 rFm)
+{
+//series
+}
+
+float32 float32_cos(float32 rFm)
+{
+//series
+}
+
+float32 float32_arcsin(float32 rFm)
+{
+//series
+}
+
+float32 float32_arctan(float32 rFm)
+{
+  //series
+}
+
+float32 float32_arccos(float32 rFm)
+{
+   //return float32_sub(halfPi,float32_arcsin(rFm));
+}
+
+float32 float32_log(float32 rFm)
+{
+  return float32_div(float32_ln(rFm),getSingleConstant(7));
+}
+
+float32 float32_tan(float32 rFm)
+{
+  return float32_div(float32_sin(rFm),float32_cos(rFm));
+}
+
+float32 float32_pow(float32 rFn,float32 rFm)
+{
+  return float32_exp(float32_mul(rFm,float32_ln(rFn))); 
+}
+
+float32 float32_pol(float32 rFn,float32 rFm)
+{
+  return float32_arctan(float32_div(rFn,rFm)); 
+}
+#endif
diff -ruN linux-2.4.20-WRT/arch/arm/nwfpe/softfloat.c linux-2.4.20-WRTstp/arch/arm/nwfpe/softfloat.c
--- linux-2.4.20-WRT/arch/arm/nwfpe/softfloat.c	2003-07-04 01:11:02.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/arm/nwfpe/softfloat.c	2005-11-08 06:23:46.000000000 -0800
@@ -182,7 +182,19 @@
 */
 INLINE float32 packFloat32( flag zSign, int16 zExp, bits32 zSig )
 {
+#if 0
+   float32 f;
+   __asm__("@ packFloat32;
+   	    mov %0, %1, asl #31;
+   	    orr %0, %2, asl #23;
+   	    orr %0, %3"
+   	    : /* no outputs */
+   	    : "g" (f), "g" (zSign), "g" (zExp), "g" (zSig)
+   	    : "cc");
+   return f;
+#else
     return ( ( (bits32) zSign )<<31 ) + ( ( (bits32) zExp )<<23 ) + zSig;
+#endif 
 }
 
 /*
diff -ruN linux-2.4.20-WRT/arch/cris/boot/compressed/misc.c linux-2.4.20-WRTstp/arch/cris/boot/compressed/misc.c
--- linux-2.4.20-WRT/arch/cris/boot/compressed/misc.c	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/boot/compressed/misc.c	2001-05-01 16:04:56.000000000 -0700
@@ -1,7 +1,7 @@
 /*
  * misc.c
  *
- * $Id: misc.c,v 1.1.1.4 2003/10/14 08:07:16 sparq Exp $
+ * $Id: misc.c,v 1.6 2001/04/09 10:00:21 starvik Exp $
  * 
  * This is a collection of several routines from gzip-1.0.3 
  * adapted for Linux.
diff -ruN linux-2.4.20-WRT/arch/cris/boot/compressed/README linux-2.4.20-WRTstp/arch/cris/boot/compressed/README
--- linux-2.4.20-WRT/arch/cris/boot/compressed/README	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/boot/compressed/README	2001-02-08 16:32:44.000000000 -0800
@@ -1,6 +1,6 @@
 Creation of the self-extracting compressed kernel image (vmlinuz)
 -----------------------------------------------------------------
-$Id: README,v 1.1.1.4 2003/10/14 08:07:16 sparq Exp $
+$Id: README,v 1.1 2000/11/22 17:20:46 bjornw Exp $
 
 This can be slightly confusing because it's a process with many steps.
 
diff -ruN linux-2.4.20-WRT/arch/cris/boot/rescue/head.S linux-2.4.20-WRTstp/arch/cris/boot/rescue/head.S
--- linux-2.4.20-WRT/arch/cris/boot/rescue/head.S	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/boot/rescue/head.S	2002-02-25 11:37:52.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: head.S,v 1.1.1.4 2003/10/14 08:07:16 sparq Exp $
+/* $Id: head.S,v 1.10 2001/11/08 15:10:16 starvik Exp $
  * 
  * Rescue code, made to reside at the beginning of the
  * flash-memory. when it starts, it checks a partition
diff -ruN linux-2.4.20-WRT/arch/cris/boot/rescue/kimagerescue.S linux-2.4.20-WRTstp/arch/cris/boot/rescue/kimagerescue.S
--- linux-2.4.20-WRT/arch/cris/boot/rescue/kimagerescue.S	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/boot/rescue/kimagerescue.S	2001-10-08 11:43:54.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: kimagerescue.S,v 1.1.1.4 2003/10/14 08:07:16 sparq Exp $
+/* $Id: kimagerescue.S,v 1.5 2001/10/03 17:15:15 bjornw Exp $
  * 
  * Rescue code to be prepended on a kimage and copied to the
  * rescue serial port.
diff -ruN linux-2.4.20-WRT/arch/cris/boot/rescue/testrescue.S linux-2.4.20-WRTstp/arch/cris/boot/rescue/testrescue.S
--- linux-2.4.20-WRT/arch/cris/boot/rescue/testrescue.S	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/boot/rescue/testrescue.S	2001-10-08 11:43:54.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: testrescue.S,v 1.1.1.4 2003/10/14 08:07:16 sparq Exp $
+/* $Id: testrescue.S,v 1.3 2001/10/03 17:15:15 bjornw Exp $
  *
  * Simple testcode to download by the rescue block.
  * Just lits some LEDs to show it was downloaded correctly.
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/axisflashmap.c linux-2.4.20-WRTstp/arch/cris/drivers/axisflashmap.c
--- linux-2.4.20-WRT/arch/cris/drivers/axisflashmap.c	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/axisflashmap.c	2005-11-08 06:23:46.000000000 -0800
@@ -11,12 +11,6 @@
  * partition split defined below.
  *
  * $Log: axisflashmap.c,v $
- * Revision 1.1.1.2  2003/10/14 08:07:16  sparq
- * Broadcom Release 3.51.8.0 for BCM4712.
- *
- * Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
- * LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  * Revision 1.23  2002/05/13 12:12:28  johana
  * Allow compile without CONFIG_MTD_MTDRAM but warn at compiletime and
  * be informative at runtime.
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/ds1302.c linux-2.4.20-WRTstp/arch/cris/drivers/ds1302.c
--- linux-2.4.20-WRT/arch/cris/drivers/ds1302.c	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/ds1302.c	2005-11-08 06:24:34.000000000 -0800
@@ -7,12 +7,6 @@
 *! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init, get_rtc_status
 *!
 *! $Log: ds1302.c,v $
-*! Revision 1.1.1.4  2003/10/14 08:07:16  sparq
-*! Broadcom Release 3.51.8.0 for BCM4712.
-*!
-*! Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
-*! LINUX_2_4 branch snapshot from linux-mips.org CVS
-*!
 *! Revision 1.13  2002/05/29 15:16:08  johana
 *! Removed unused variables.
 *!
@@ -94,7 +88,7 @@
 *!
 *! (C) Copyright 1999, 2000, 2001  Axis Communications AB, LUND, SWEDEN
 *!
-*! $Id: ds1302.c,v 1.1.1.4 2003/10/14 08:07:16 sparq Exp $
+*! $Id: ds1302.c,v 1.13 2002/05/29 15:16:08 johana Exp $
 *!
 *!***************************************************************************/
 
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/eeprom.c linux-2.4.20-WRTstp/arch/cris/drivers/eeprom.c
--- linux-2.4.20-WRT/arch/cris/drivers/eeprom.c	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/eeprom.c	2001-07-26 15:10:06.000000000 -0700
@@ -20,12 +20,6 @@
 *!                                  in the spin-lock.
 *!
 *!  $Log: eeprom.c,v $
-*!  Revision 1.1.1.2  2003/10/14 08:07:16  sparq
-*!  Broadcom Release 3.51.8.0 for BCM4712.
-*!
-*!  Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
-*!  LINUX_2_4 branch snapshot from linux-mips.org CVS
-*!
 *!  Revision 1.8  2001/06/15 13:24:29  jonashg
 *!  * Added verification of pointers from userspace in read and write.
 *!  * Made busy counter volatile.
@@ -243,6 +237,16 @@
         {
           D(printk("0 loc1: (%i) '%4.4s' loc2 (%i) '%4.4s'\n", 
                    LOC1, loc1, LOC2, loc2));
+#if 0
+          if (memcmp(loc1, loc2, 4) != 0 )
+          {
+            /* It's 16k */
+            printk(KERN_INFO "%s: 16k detected in step 1\n", eeprom_name);
+            eeprom.size = EEPROM_16KB;     
+            success = 1;
+          }
+          else
+#endif
           {
             /* Do step 2 check */
             /* Invert value */
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/ethernet.c linux-2.4.20-WRTstp/arch/cris/drivers/ethernet.c
--- linux-2.4.20-WRT/arch/cris/drivers/ethernet.c	2003-07-04 01:11:03.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/ethernet.c	2005-11-08 06:23:46.000000000 -0800
@@ -1,4 +1,137 @@
-
+/* $Id: ethernet.c,v 1.30 2002/05/07 18:50:08 johana Exp $
+ *
+ * e100net.c: A network driver for the ETRAX 100LX network controller.
+ *
+ * Copyright (c) 1998-2002 Axis Communications AB.
+ *
+ * The outline of this driver comes from skeleton.c.
+ *
+ * $Log: ethernet.c,v $
+ * Revision 1.30  2002/05/07 18:50:08  johana
+ * Correct spelling in comments.
+ *
+ * Revision 1.29  2002/05/06 05:38:49  starvik
+ * Performance improvements:
+ *    Large packets are not copied (breakpoint set to 256 bytes)
+ *    The cache bug workaround is delayed until half of the receive list
+ *      has been used
+ *    Added transmit list
+ *    Transmit interrupts are only enabled when transmit queue is full
+ *
+ * Revision 1.28.2.1  2002/04/30 08:15:51  starvik
+ * Performance improvements:
+ *   Large packets are not copied (breakpoint set to 256 bytes)
+ *   The cache bug workaround is delayed until half of the receive list
+ *     has been used.
+ *   Added transmit list
+ *   Transmit interrupts are only enabled when transmit queue is full
+ *
+ * Revision 1.28  2002/04/22 11:47:21  johana
+ * Fix according to 2.4.19-pre7. time_after/time_before and
+ * missing end of comment.
+ * The patch has a typo for ethernet.c in e100_clear_network_leds(),
+ *  that is fixed here.
+ *
+ * Revision 1.27  2002/04/12 11:55:11  bjornw
+ * Added TODO
+ *
+ * Revision 1.26  2002/03/15 17:11:02  bjornw
+ * Use prepare_rx_descriptor after the CPU has touched the receiving descs
+ *
+ * Revision 1.25  2002/03/08 13:07:53  bjornw
+ * Unnecessary spinlock removed
+ *
+ * Revision 1.24  2002/02/20 12:57:43  fredriks
+ * Replaced MIN() with min().
+ *
+ * Revision 1.23  2002/02/20 10:58:14  fredriks
+ * Strip the Ethernet checksum (4 bytes) before forwarding a frame to upper layers.
+ *
+ * Revision 1.22  2002/01/30 07:48:22  matsfg
+ * Initiate R_NETWORK_TR_CTRL
+ *
+ * Revision 1.21  2001/11/23 11:54:49  starvik
+ * Added IFF_PROMISC and IFF_ALLMULTI handling in set_multicast_list
+ * Removed compiler warnings
+ *
+ * Revision 1.20  2001/11/12 19:26:00  pkj
+ * * Corrected e100_negotiate() to not assign half to current_duplex when
+ *   it was supposed to compare them...
+ * * Cleaned up failure handling in e100_open().
+ * * Fixed compiler warnings.
+ *
+ * Revision 1.19  2001/11/09 07:43:09  starvik
+ * Added full duplex support
+ * Added ioctl to set speed and duplex
+ * Clear LED timer only runs when LED is lit
+ *
+ * Revision 1.18  2001/10/03 14:40:43  jonashg
+ * Update rx_bytes counter.
+ *
+ * Revision 1.17  2001/06/11 12:43:46  olof
+ * Modified defines for network LED behavior
+ *
+ * Revision 1.16  2001/05/30 06:12:46  markusl
+ * TxDesc.next should not be set to NULL
+ *
+ * Revision 1.15  2001/05/29 10:27:04  markusl
+ * Updated after review remarks:
+ * +Use IO_EXTRACT
+ * +Handle underrun
+ *
+ * Revision 1.14  2001/05/29 09:20:14  jonashg
+ * Use driver name on printk output so one can tell which driver that complains.
+ *
+ * Revision 1.13  2001/05/09 12:35:59  johana
+ * Use DMA_NBR and IRQ_NBR defines from dma.h and irq.h
+ *
+ * Revision 1.12  2001/04/05 11:43:11  tobiasa
+ * Check dev before panic.
+ *
+ * Revision 1.11  2001/04/04 11:21:05  markusl
+ * Updated according to review remarks
+ *
+ * Revision 1.10  2001/03/26 16:03:06  bjornw
+ * Needs linux/config.h
+ *
+ * Revision 1.9  2001/03/19 14:47:48  pkj
+ * * Make sure there is always a pause after the network LEDs are
+ *   changed so they will not look constantly lit during heavy traffic.
+ * * Always use HZ when setting times relative to jiffies.
+ * * Use LED_NETWORK_SET() when setting the network LEDs.
+ *
+ * Revision 1.8  2001/02/27 13:52:48  bjornw
+ * malloc.h -> slab.h
+ *
+ * Revision 1.7  2001/02/23 13:46:38  bjornw
+ * Spellling check
+ *
+ * Revision 1.6  2001/01/26 15:21:04  starvik
+ * Don't disable interrupts while reading MDIO registers (MDIO is slow)
+ * Corrected promiscuous mode
+ * Improved deallocation of IRQs ("ifconfig eth0 down" now works)
+ *
+ * Revision 1.5  2000/11/29 17:22:22  bjornw
+ * Get rid of the udword types legacy stuff
+ *
+ * Revision 1.4  2000/11/22 16:36:09  bjornw
+ * Please marketing by using the correct case when spelling Etrax.
+ *
+ * Revision 1.3  2000/11/21 16:43:04  bjornw
+ * Minor short->int change
+ *
+ * Revision 1.2  2000/11/08 14:27:57  bjornw
+ * 2.4 port
+ *
+ * Revision 1.1  2000/11/06 13:56:00  bjornw
+ * Verbatim copy of the 1.24 version of e100net.c from elinux
+ *
+ * Revision 1.24  2000/10/04 15:55:23  bjornw
+ * * Use virt_to_phys etc. for DMA addresses
+ * * Removed bogus CHECKSUM_UNNECESSARY
+ *
+ *
+ */
 
 #include <linux/config.h>
 
@@ -446,10 +579,18 @@
 	*R_NETWORK_SA_1 = dev->dev_addr[4] | (dev->dev_addr[5] << 8);
 	*R_NETWORK_SA_2 = 0;
 
+#if 0
+	/* use promiscuous mode for testing */
+	*R_NETWORK_GA_0 = 0xffffffff;
+	*R_NETWORK_GA_1 = 0xffffffff;
+
+	*R_NETWORK_REC_CONFIG = 0xd; /* broadcast rec, individ. rec, ma0 enabled */
+#else
 	SETS(network_rec_config_shadow, R_NETWORK_REC_CONFIG, broadcast, receive);
 	SETS(network_rec_config_shadow, R_NETWORK_REC_CONFIG, ma0, enable);
 	SETF(network_rec_config_shadow, R_NETWORK_REC_CONFIG, duplex, full_duplex);
 	*R_NETWORK_REC_CONFIG = network_rec_config_shadow;
+#endif
 
 	*R_NETWORK_GEN_CONFIG =
 		IO_STATE(R_NETWORK_GEN_CONFIG, phy,    mii_clk) |
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/examples/kiobuftest.c linux-2.4.20-WRTstp/arch/cris/drivers/examples/kiobuftest.c
--- linux-2.4.20-WRT/arch/cris/drivers/examples/kiobuftest.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/examples/kiobuftest.c	2001-04-06 10:42:55.000000000 -0700
@@ -10,12 +10,6 @@
  * Author:  Bjorn Wesen
  *
  * $Log: kiobuftest.c,v $
- * Revision 1.1.1.2  2003/10/14 08:07:17  sparq
- * Broadcom Release 3.51.8.0 for BCM4712.
- *
- * Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
- * LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  * Revision 1.2  2001/02/27 13:52:50  bjornw
  * malloc.h -> slab.h
  *
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/gpio.c linux-2.4.20-WRTstp/arch/cris/drivers/gpio.c
--- linux-2.4.20-WRT/arch/cris/drivers/gpio.c	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/gpio.c	2005-11-08 06:24:34.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: gpio.c,v 1.1.1.4 2003/10/14 08:07:16 sparq Exp $
+/* $Id: gpio.c,v 1.17 2002/06/17 15:53:01 johana Exp $
  *
  * Etrax general port I/O device
  *
@@ -9,12 +9,6 @@
  *             Johan Adolfsson  (read/set directions, write, port G)
  *
  * $Log: gpio.c,v $
- * Revision 1.1.1.4  2003/10/14 08:07:16  sparq
- * Broadcom Release 3.51.8.0 for BCM4712.
- *
- * Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
- * LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  * Revision 1.17  2002/06/17 15:53:01  johana
  * Added IO_READ_INBITS, IO_READ_OUTBITS, IO_SETGET_INPUT and IO_SETGET_OUTPUT
  * that take a pointer as argument and thus can handle 32 bit ports (G)
@@ -108,6 +102,9 @@
 
 static char gpio_name[] = "etrax gpio";
 
+#if 0
+static wait_queue_head_t *gpio_wq;
+#endif
 
 static int gpio_ioctl(struct inode *inode, struct file *file,
 		      unsigned int cmd, unsigned long arg);
@@ -204,6 +201,14 @@
 	  struct poll_table_struct *wait)
 {
 	/* TODO poll on alarms! */
+#if 0
+	if (!ANYTHING_WANTED) {
+		D(printk("gpio_select sleeping task\n"));
+		select_wait(&gpio_wq, table);
+		return 0;
+	}
+	D(printk("gpio_select ready\n"));
+#endif
 	return 1;
 }
 
@@ -522,7 +527,7 @@
 		SOFT_SHUTDOWN();
 		break;
 	case IO_GET_PWR_BT:
-#if defined(CONFIG_ETRAX_SOFT_SHUTDOWN)
+#if defined (CONFIG_ETRAX_SOFT_SHUTDOWN)
 		return (*R_PORT_G_DATA & ( 1 << CONFIG_ETRAX_POWERBUTTON_BIT));
 #else
 		return 0;
@@ -727,7 +732,7 @@
 {
 	extern void init_ioremap(void);
 	int res;
-#if defined(CONFIG_ETRAX_CSP0_LEDS)
+#if defined (CONFIG_ETRAX_CSP0_LEDS)
 	int i;
 #endif
 
@@ -740,14 +745,14 @@
 	}
 
 	/* Clear all leds */
-#if defined(CONFIG_ETRAX_CSP0_LEDS) ||  defined(CONFIG_ETRAX_PA_LEDS) || defined(CONFIG_ETRAX_PB_LEDS) 
+#if defined (CONFIG_ETRAX_CSP0_LEDS) ||  defined (CONFIG_ETRAX_PA_LEDS) || defined (CONFIG_ETRAX_PB_LEDS) 
 	init_ioremap();
 	LED_NETWORK_SET(0);
 	LED_ACTIVE_SET(0);
 	LED_DISK_READ(0);
 	LED_DISK_WRITE(0);
 
-#if defined(CONFIG_ETRAX_CSP0_LEDS)
+#if defined (CONFIG_ETRAX_CSP0_LEDS)
 	for (i = 0; i < 32; i++) {
 		LED_BIT_SET(i);
 	}
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/i2c.c linux-2.4.20-WRTstp/arch/cris/drivers/i2c.c
--- linux-2.4.20-WRT/arch/cris/drivers/i2c.c	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/i2c.c	2005-11-08 06:24:34.000000000 -0800
@@ -12,12 +12,6 @@
 *!                                 don't use PB_I2C if DS1302 uses same bits,
 *!                                 use PB.
 *! $Log: i2c.c,v $
-*! Revision 1.1.1.4  2003/10/14 08:07:16  sparq
-*! Broadcom Release 3.51.8.0 for BCM4712.
-*!
-*! Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
-*! LINUX_2_4 branch snapshot from linux-mips.org CVS
-*!
 *! Revision 1.8  2002/08/13 06:31:53  starvik
 *! Made SDA and SCL line configurable
 *! Modified i2c_inbyte to work with PCF8563
@@ -53,7 +47,7 @@
 *! (C) Copyright 1999-2002 Axis Communications AB, LUND, SWEDEN
 *!
 *!***************************************************************************/
-/* $Id: i2c.c,v 1.1.1.4 2003/10/14 08:07:16 sparq Exp $ */
+/* $Id: i2c.c,v 1.8 2002/08/13 06:31:53 starvik Exp $ */
 /****************** INCLUDE FILES SECTION ***********************************/
 
 #include <linux/module.h>
@@ -93,6 +87,13 @@
 #define I2C_DATA_HIGH 1
 #define I2C_DATA_LOW 0
 
+#if 0
+/* TODO: fix this so the CONFIG_ETRAX_I2C_USES... is set in Config.in instead */
+#if defined(CONFIG_DS1302) && (CONFIG_DS1302_SDABIT==0) && \
+           (CONFIG_DS1302_SCLBIT == 1)
+#define CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C
+#endif
+#endif
 
 #ifdef CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C
 /* Use PB and not PB_I2C */
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/i2c.h linux-2.4.20-WRTstp/arch/cris/drivers/i2c.h
--- linux-2.4.20-WRT/arch/cris/drivers/i2c.h	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/i2c.h	2001-05-19 17:43:05.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: i2c.h,v 1.1.1.4 2003/10/14 08:07:16 sparq Exp $ */
+/* $Id: i2c.h,v 1.3 2001/03/19 12:43:01 markusl Exp $ */
 
 /* High level I2C actions */
 int i2c_writereg(unsigned char theSlave, unsigned char theReg, unsigned char theValue);
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/ide.c linux-2.4.20-WRTstp/arch/cris/drivers/ide.c
--- linux-2.4.20-WRT/arch/cris/drivers/ide.c	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/ide.c	2005-11-08 06:23:46.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: ide.c,v 1.1.1.4 2003/10/14 08:07:16 sparq Exp $
+/* $Id: ide.c,v 1.24 2002/04/22 11:47:21 johana Exp $
  *
  * Etrax specific IDE functions, like init and PIO-mode setting etc.
  * Almost the entire ide.c is used for the rest of the Etrax ATA driver.
@@ -8,12 +8,6 @@
  *             Mikael Starvik     (pio setup stuff)
  *
  * $Log: ide.c,v $
- * Revision 1.1.1.4  2003/10/14 08:07:16  sparq
- * Broadcom Release 3.51.8.0 for BCM4712.
- *
- * Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
- * LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  * Revision 1.24  2002/04/22 11:47:21  johana
  * Fix according to 2.4.19-pre7. time_after/time_before and
  * missing end of comment.
@@ -518,6 +512,38 @@
 	WAIT_DMA(ATA_RX_DMA_NBR);
 	LED_DISK_READ(0);
 
+#if 0
+        /* old polled transfer code
+	 * this should be moved into a new function that can do polled
+	 * transfers if DMA is not available
+	 */
+        
+        /* initiate a multi word read */
+        
+        *R_ATA_TRANSFER_CNT = wcount << 1;
+        
+        *R_ATA_CTRL_DATA = data_reg |
+                IO_STATE(R_ATA_CTRL_DATA, rw,       read) |
+                IO_STATE(R_ATA_CTRL_DATA, src_dst,  register) |
+                IO_STATE(R_ATA_CTRL_DATA, handsh,   pio) |
+                IO_STATE(R_ATA_CTRL_DATA, multi,    on) |
+                IO_STATE(R_ATA_CTRL_DATA, dma_size, word);
+        
+        /* svinto has a latency until the busy bit actually is set */
+        
+        nop(); nop();
+        nop(); nop();
+        nop(); nop();
+        nop(); nop();
+        nop(); nop();
+        
+        /* unit should be busy during multi transfer */
+        while((status = *R_ATA_STATUS_DATA) & IO_MASK(R_ATA_STATUS_DATA, busy)) {
+                while(!(status & IO_MASK(R_ATA_STATUS_DATA, dav)))
+                        status = *R_ATA_STATUS_DATA;
+                *ptr++ = (unsigned short)(status & 0xffff);
+        }
+#endif
 }
 
 static void 
@@ -565,6 +591,42 @@
 	WAIT_DMA(ATA_TX_DMA_NBR);
 	LED_DISK_WRITE(0);
 
+#if 0
+        /* old polled write code - see comment in input_bytes */
+
+	/* wait for busy flag */
+        while(*R_ATA_STATUS_DATA & IO_MASK(R_ATA_STATUS_DATA, busy)); 
+
+        /* initiate a multi word write */
+
+        *R_ATA_TRANSFER_CNT = bytecount >> 1;
+
+        ctrl = data_reg |
+                IO_STATE(R_ATA_CTRL_DATA, rw,       write) |
+                IO_STATE(R_ATA_CTRL_DATA, src_dst,  register) |
+                IO_STATE(R_ATA_CTRL_DATA, handsh,   pio) |
+                IO_STATE(R_ATA_CTRL_DATA, multi,    on) |
+                IO_STATE(R_ATA_CTRL_DATA, dma_size, word);
+        
+        LED_DISK_WRITE(1);
+        
+        /* Etrax will set busy = 1 until the multi pio transfer has finished
+         * and tr_rdy = 1 after each succesful word transfer. 
+         * When the last byte has been transferred Etrax will first set tr_tdy = 1 
+         * and then busy = 0 (not in the same cycle). If we read busy before it
+         * has been set to 0 we will think that we should transfer more bytes 
+         * and then tr_rdy would be 0 forever. This is solved by checking busy
+         * in the inner loop.
+         */
+        
+        do {
+                *R_ATA_CTRL_DATA = ctrl | *ptr++;
+                while(!(*R_ATA_STATUS_DATA & IO_MASK(R_ATA_STATUS_DATA, tr_rdy)) &&
+                      (*R_ATA_STATUS_DATA & IO_MASK(R_ATA_STATUS_DATA, busy)));
+        } while(*R_ATA_STATUS_DATA & IO_MASK(R_ATA_STATUS_DATA, busy));
+
+        LED_DISK_WRITE(0);
+#endif  
 
 }
 
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/lpslave/bintocarr.pl linux-2.4.20-WRTstp/arch/cris/drivers/lpslave/bintocarr.pl
--- linux-2.4.20-WRT/arch/cris/drivers/lpslave/bintocarr.pl	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/lpslave/bintocarr.pl	2001-10-08 11:43:54.000000000 -0700
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# $Id: bintocarr.pl,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+# $Id: bintocarr.pl,v 1.4 2001/08/08 08:18:13 bjarne Exp $
 # Copy of mkjulbin.pl made by Olof
 # convert a binary stdin to a C-file containing a char array of the input
 # first argument is the symbol name
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/lpslave/e100lpslavenet.c linux-2.4.20-WRTstp/arch/cris/drivers/lpslave/e100lpslavenet.c
--- linux-2.4.20-WRT/arch/cris/drivers/lpslave/e100lpslavenet.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/lpslave/e100lpslavenet.c	2005-11-08 06:23:46.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: e100lpslavenet.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: e100lpslavenet.c,v 1.5 2002/04/22 11:47:24 johana Exp $
  *
  * e100lpslavenet.c: A network driver for the ETRAX 100LX slave controller.
  *
@@ -7,12 +7,6 @@
  * The outline of this driver comes from skeleton.c.
  *
  * $Log: e100lpslavenet.c,v $
- * Revision 1.1.1.4  2003/10/14 08:07:17  sparq
- * Broadcom Release 3.51.8.0 for BCM4712.
- *
- * Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
- * LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  * Revision 1.5  2002/04/22 11:47:24  johana
  * Fix according to 2.4.19-pre7. time_after/time_before and
  * missing end of comment.
@@ -457,6 +451,35 @@
 		return -EAGAIN;
 	}
 
+#if 0
+        /* We are not allocating DMA since DMA4 is reserved for 'cascading'
+         * and will always fail with the current dma.c
+         */
+        
+	/*
+	 * Always allocate the DMA channels after the IRQ,
+	 * and clean up on failure.
+	 */
+
+	if(request_dma(PAR0_RX_DMA_NBR, cardname)) {
+          printk("Failed to allocate PAR0_RX_DMA_NBR\n");
+		goto grace_exit;
+	}
+
+	if(request_dma(PAR1_TX_DMA_NBR, cardname)) {
+          printk("Failed to allocate PAR1_TX_DMA_NBR\n");
+	grace_exit:
+		/* this will cause some 'trying to free free irq' but what the heck... */
+
+		free_dma(PAR1_TX_DMA_NBR);
+                free_dma(PAR0_RX_DMA_NBR);
+                free_irq(PAR0_ECP_IRQ_NBR, (void *)dev);
+                free_irq(DMA4_TX_IRQ_NBR, (void *)dev);
+		free_irq(DMA3_RX_IRQ_NBR, (void *)dev);
+		
+		return -EAGAIN;
+	}
+#endif
         
 #ifdef ETHDEBUG
         printk("Par port IRQ and DMA allocated\n");
@@ -882,6 +905,9 @@
 	/* Configure the tx dma descriptor. Desc 0 is already configured.*/
 
         TxDescList[1].sw_len = length;
+	/* bug workaround - etrax100 needs d_wait on the descriptor _before_
+	 * a descriptor containing an ECP command
+	 */
 	TxDescList[1].ctrl = d_wait;
 	TxDescList[1].buf = virt_to_phys(buf);
 	TxDescList[1].next = virt_to_phys(&TxDescList[2]);
@@ -939,6 +965,15 @@
 
 	*R_DMA_CH4_CLR_INTR = IO_STATE(R_DMA_CH4_CLR_INTR, clr_descr, do);
 
+#if 0
+        /* manual transfer of boot code - requires dma turned off */
+        for (i=0; i<ETRAX_PAR_BOOT_LENGTH; i++)
+        {
+          printk("  sending byte: %u value: %x\n",i,code[i]);
+          while (((*R_PAR1_STATUS)&0x02) == 0); /* Wait while tr_rdy is busy*/
+          *R_PAR1_CTRL_DATA = code[i];
+        }
+#endif
 
 #ifdef ETHDEBUG
 	printk("  done\n");
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/lpslave/e100lpslave.S linux-2.4.20-WRTstp/arch/cris/drivers/lpslave/e100lpslave.S
--- linux-2.4.20-WRT/arch/cris/drivers/lpslave/e100lpslave.S	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/lpslave/e100lpslave.S	2001-07-26 15:10:06.000000000 -0700
@@ -1,4 +1,4 @@
-	;; $Id: e100lpslave.S,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+	;; $Id: e100lpslave.S,v 1.3 2001/06/21 16:55:26 olof Exp $
 	;;
 	;; Etrax100 slave network<->parport forwarder
 	;;
@@ -9,6 +9,9 @@
 	;;
 
 #include <linux/config.h>
+#if 0
+#define ASSEMBLER_MACROS_ONLY
+#endif
 #include <asm/sv_addr_ag.h>
 
 #define BUFSIZE 0x600
@@ -248,6 +251,15 @@
 	;; restart DMAs
 
 	jsr	startdmaFNTP
+#if 0
+#ifdef CONFIG_ETRAX_ETHERNET_LPSLAVE_HAS_LEDS
+	;; Light the LED signaling an incoming networkpacket
+	movu.b	0xFB, r0
+	move.b	r0, [R_PORT_PA_DATA]
+	move.d	0x00010000, r0
+	move.d	r0,[LEDCount]
+#endif
+#endif
 
 noswap2:
 #ifdef CONFIG_ETRAX_ETHERNET_LPSLAVE_HAS_LEDS
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/parport.c linux-2.4.20-WRTstp/arch/cris/drivers/parport.c
--- linux-2.4.20-WRT/arch/cris/drivers/parport.c	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/parport.c	2005-11-08 06:23:46.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: parport.c,v 1.1.1.4 2003/10/14 08:07:16 sparq Exp $
+/* $Id: parport.c,v 1.9 2002/05/15 12:30:24 starvik Exp $
  * 
  * Elinux parallel port driver
  * NOTE!
@@ -530,6 +530,7 @@
 
                 info->port = p;
                 p->private_data = info;
+                /* Axis FIXME: Set mode flags. */
                 /* p->modes = PARPORT_MODE_TRISTATE | PARPORT_MODE_SAFEININT; */
 
 	        if(request_irq(info->int_irq, parport_etrax_interrupt,
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/pcf8563.c linux-2.4.20-WRTstp/arch/cris/drivers/pcf8563.c
--- linux-2.4.20-WRT/arch/cris/drivers/pcf8563.c	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/pcf8563.c	2005-11-08 06:24:34.000000000 -0800
@@ -15,7 +15,7 @@
  *
  * Author: Tobias Anderberg <tobiasa@axis.com>.
  *
- * $Id: pcf8563.c,v 1.1.1.4 2003/10/14 08:07:16 sparq Exp $
+ * $Id: pcf8563.c,v 1.1 2002/08/12 13:46:02 starvik Exp $
  */
 
 #include <linux/config.h>
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/serial.c linux-2.4.20-WRTstp/arch/cris/drivers/serial.c
--- linux-2.4.20-WRT/arch/cris/drivers/serial.c	2003-10-14 01:07:16.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/serial.c	2005-11-08 06:24:34.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: serial.c,v 1.1.1.4 2003/10/14 08:07:16 sparq Exp $
+/* $Id: serial.c,v 1.37 2002/08/13 13:02:37 bjornw Exp $
  *
  * Serial port driver for the ETRAX 100LX chip
  *
@@ -7,12 +7,6 @@
  *      Many, many authors. Based once upon a time on serial.c for 16x50.
  *
  * $Log: serial.c,v $
- * Revision 1.1.1.4  2003/10/14 08:07:16  sparq
- * Broadcom Release 3.51.8.0 for BCM4712.
- *
- * Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
- * LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  * Revision 1.37  2002/08/13 13:02:37  bjornw
  * Removed some warnings because of unused code
  *
@@ -327,7 +321,7 @@
  *
  */
 
-static char *serial_version = "$Revision: 1.1.1.4 $";
+static char *serial_version = "$Revision: 1.37 $";
 
 #include <linux/config.h>
 #include <linux/version.h>
@@ -380,7 +374,7 @@
  * All of the compatibilty code so we can compile serial.c against
  * older kernels is hidden in serial_compat.h
  */
-#if defined(LOCAL_HEADERS) || (LINUX_VERSION_CODE < 0x020317)     /* 2.3.23 */
+#if defined(LOCAL_HEADERS) || (LINUX_VERSION_CODE < 0x020317) /* 2.3.23 */
 #include "serial_compat.h"
 #endif
 
@@ -867,6 +861,11 @@
 		restore_flags(flags);
 	}
 	
+#if 0
+	REG_SHADOW_SET(e100_modem_pins[info->line].port,
+		       *e100_modem_pins[info->line].shadow,
+		       e100_modem_pins[info->line].dtr_bit, !set);
+#endif
 #ifdef SERIAL_DEBUG_IO
 	printk("ser%i shadow after 0x%02X get: %i\n", 
 	       info->line, *e100_modem_pins[info->line].shadow, 
@@ -1083,6 +1082,10 @@
  * ------------------------------------------------------------
  */
 
+/* FIXME - when are these used and what is the purpose ? 
+ * In rs_stop we probably just can block the transmit DMA ready irq
+ * and in rs_start we re-enable it (and then the old one will come).
+ */
 
 static void 
 rs_stop(struct tty_struct *tty)
@@ -1241,6 +1244,10 @@
 static void 
 start_transmit(struct e100_serial *info)
 {
+#if 0
+	if (info->line == SERIAL_DEBUG_LINE)
+		printk("x\n");
+#endif
 
 	info->tr_descr.sw_len = 0;
 	info->tr_descr.hw_len = 0;
@@ -1575,6 +1582,8 @@
 			transmit_chars(info);
 		}
 		
+		/* FIXME: here we should really check for a change in the
+		   status lines and if so call status_handle(info) */
 	}
 }
 
@@ -1612,6 +1621,8 @@
 			receive_chars(info);
 		}
 		
+		/* FIXME: here we should really check for a change in the
+		   status lines and if so call status_handle(info) */
 	}
 }
 
@@ -2784,6 +2795,16 @@
 {
 	unsigned int result;
 	/* Polarity isn't verified */
+#if 0 /*def SERIAL_DEBUG_IO  */
+
+	printk("get_modem_info: RTS: %i DTR: %i CD: %i RI: %i DSR: %i CTS: %i\n",
+	       E100_RTS_GET(info),
+	       E100_DTR_GET(info),
+	       E100_CD_GET(info),
+	       E100_RI_GET(info),
+	       E100_DSR_GET(info),
+	       E100_CTS_GET(info));
+#endif
 	result =  
 		(!E100_RTS_GET(info) ? TIOCM_RTS : 0)
 		| (!E100_DTR_GET(info) ? TIOCM_DTR : 0)
@@ -2863,7 +2884,7 @@
 /*
  * This routine sends a break character out the serial port.
  */
-#if (LINUX_VERSION_CODE < 131394)     /* Linux 2.1.66 */
+#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */
 static void 
 send_break(struct e100_serial * info, int duration)
 {
@@ -2925,10 +2946,10 @@
 	 unsigned int cmd, unsigned long arg)
 {
 	struct e100_serial * info = (struct e100_serial *)tty->driver_data;
-#if (LINUX_VERSION_CODE < 131394)     /* Linux 2.1.66 */
+#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */
 	int error;
 #endif
-#if (LINUX_VERSION_CODE < 131394)     /* Linux 2.1.66 */
+#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */
 	int retval;
 #endif
 	
@@ -2940,7 +2961,7 @@
 	}
 	
 	switch (cmd) {
-#if (LINUX_VERSION_CODE < 131394)     /* Linux 2.1.66 */
+#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */
 	        case TCSBRK:	/* SVID version: non-zero arg --> no break */
 			retval = tty_check_change(tty);
 			if (retval)
@@ -3622,7 +3643,7 @@
 	serial_driver.stop = rs_stop;
 	serial_driver.start = rs_start;
 	serial_driver.hangup = rs_hangup;
-#if (LINUX_VERSION_CODE >= 131394)     /* Linux 2.1.66 */
+#if (LINUX_VERSION_CODE >= 131394) /* Linux 2.1.66 */
 	serial_driver.break_ctl = rs_break;
 #endif
 #if (LINUX_VERSION_CODE >= 131343)
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/usb-host.c linux-2.4.20-WRTstp/arch/cris/drivers/usb-host.c
--- linux-2.4.20-WRT/arch/cris/drivers/usb-host.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/usb-host.c	2005-11-08 06:24:34.000000000 -0800
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2001 Axis Communications AB.
  *
- * $Id: usb-host.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+ * $Id: usb-host.c,v 1.13 2001/11/13 12:06:17 pkj Exp $
  *
  */
 
@@ -34,7 +34,7 @@
 #define ETRAX_USB_RX_IRQ USB_DMA_RX_IRQ_NBR
 #define ETRAX_USB_TX_IRQ USB_DMA_TX_IRQ_NBR
 
-static const char *usb_hcd_version = "$Revision: 1.1.1.4 $";
+static const char *usb_hcd_version = "$Revision: 1.13 $";
 
 #undef KERN_DEBUG
 #define KERN_DEBUG ""
@@ -563,7 +563,11 @@
 
 	/* This is safe since there cannot be any other URB's for this epid */
 	URB_List[epid] = urb;
+#if 0
+	first_ep = (USB_EP_Desc_t *)phys_to_virt(*R_DMA_CH8_SUB2_EP);
+#else
 	first_ep = &TxIntrEPList[0];
+#endif
 
 	/* Round of the interval to 2^n, it is obvious that this code favours
 	   smaller numbers, but that is actually a good thing */
@@ -992,7 +996,11 @@
 		sb_desc_1->command = IO_FIELD(USB_SB_command, rem, 0) |
 			IO_STATE(USB_SB_command, tt, out) |
 
+#if 0
+			IO_STATE(USB_SB_command, full, no) |
+#else
 			IO_STATE(USB_SB_command, full, yes) |
+#endif
 
 			IO_STATE(USB_SB_command, eot, yes) |
 			IO_STATE(USB_SB_command, eol, yes);
@@ -1136,10 +1144,12 @@
 					 usb_maxpacket(URB_List[epid]->dev, URB_List[epid]->pipe,
 						       usb_pipeout(URB_List[epid]->pipe)));
 	}
+#if 1
 	else {
 		/* This means that this EP is now free, deconfigure it */
 		etrax_usb_free_epid(epid);
 	}
+#endif
 	
 	/* Remember to free the SB's */
 	hc_priv = (etrax_urb_priv_t *)old_urb->hcpriv;
@@ -1681,10 +1691,12 @@
 					 usb_maxpacket(URB_List[epid]->dev, URB_List[epid]->pipe,
 						       usb_pipeout(URB_List[epid]->pipe)));
 	}
+#if 1
 	else {
 		/* This means that this EP is now free, deconfigure it */
 		etrax_usb_free_epid(epid);
 	}
+#endif
 	
 	/* Remember to free the SB's */
 	hc_priv = (etrax_urb_priv_t *)old_urb->hcpriv;
@@ -1945,6 +1957,14 @@
 	reg->r_usb_irq_mask_read    = *R_USB_IRQ_MASK_READ;
 	reg->r_usb_status           = *R_USB_STATUS;
 
+#if 0
+	if (reg->r_usb_status & IO_MASK(R_USB_STATUS, perror)) {
+		panic("r_usb_status said perror\n");
+	}
+	if (reg->r_usb_status & IO_MASK(R_USB_STATUS, ourun)) {
+		panic("r_usb_status said ourun !!!\n");
+	}
+#endif
 	
 	reg->r_usb_epid_attn        = *R_USB_EPID_ATTN;
 
@@ -2356,6 +2376,22 @@
 		DBFEXIT;
 		return -1;
 	}	
+#if 0  /* Moved to head.S */
+	*R_GEN_CONFIG = genconfig_shadow =
+		(genconfig_shadow & ~(IO_MASK(R_GEN_CONFIG, usb1) |
+				      IO_MASK(R_GEN_CONFIG, usb2) |
+				      IO_MASK(R_GEN_CONFIG, dma8) |
+				      IO_MASK(R_GEN_CONFIG, dma9))) |
+		IO_STATE(R_GEN_CONFIG, dma8, usb) |
+		IO_STATE(R_GEN_CONFIG, dma9, usb)
+#ifdef CONFIG_ETRAX_USB_HOST_PORT1
+		| IO_STATE(R_GEN_CONFIG, usb1, select)
+#endif
+#ifdef CONFIG_ETRAX_USB_HOST_PORT2
+		| IO_STATE(R_GEN_CONFIG, usb2, select)
+#endif
+	;
+#endif
 	
 	usb_register_bus(hc->bus);
 
@@ -2410,8 +2446,10 @@
 		IO_STATE(R_USB_COMMAND, port_cmd, reset);
 	
 	nop(); while (*R_USB_COMMAND & IO_MASK(R_USB_COMMAND, busy));
+#if 1
 	/* Initate PSTART to all unallocatable bit times */
 	*R_USB_FM_PSTART = IO_FIELD(R_USB_FM_PSTART, value, 10000);
+#endif
 
 #ifdef CONFIG_ETRAX_USB_HOST_PORT1
 	*R_USB_PORT1_DISABLE = IO_STATE(R_USB_PORT1_DISABLE, disable, no);
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/usb-host.h linux-2.4.20-WRTstp/arch/cris/drivers/usb-host.h
--- linux-2.4.20-WRT/arch/cris/drivers/usb-host.h	2003-07-04 01:11:03.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/usb-host.h	2001-08-15 01:22:15.000000000 -0700
@@ -75,6 +75,9 @@
 	__u32 r_usb_rh_port_status_2;
 	__u32 r_usb_irq_mask_read;
 	struct tq_struct usb_bh;
+#if 0
+	__u32 r_usb_ept_data[32];
+#endif
 };
 
 struct in_chunk
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/virtex.c linux-2.4.20-WRTstp/arch/cris/drivers/virtex.c
--- linux-2.4.20-WRT/arch/cris/drivers/virtex.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/virtex.c	2005-11-08 06:24:34.000000000 -0800
@@ -31,12 +31,6 @@
 *!  
 *! Jul 19 2002  Stefan Lundberg    Initial version.
 *! $Log: virtex.c,v $
-*! Revision 1.1.1.4  2003/10/14 08:07:17  sparq
-*! Broadcom Release 3.51.8.0 for BCM4712.
-*!
-*! Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
-*! LINUX_2_4 branch snapshot from linux-mips.org CVS
-*!
 *! Revision 1.1  2002/06/25 09:58:58  stefanl
 *! New FPGA driver for Platoon
 *!
@@ -46,7 +40,7 @@
 *! (C) Copyright 2002 Axis Communications AB, LUND, SWEDEN
 *!
 *!***************************************************************************/
-/* $Id: virtex.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $ */
+/* $Id: virtex.c,v 1.1 2002/06/25 09:58:58 stefanl Exp $ */
 /****************** INCLUDE FILES SECTION ***********************************/
 
 #include <linux/module.h>
diff -ruN linux-2.4.20-WRT/arch/cris/drivers/virtex.h linux-2.4.20-WRTstp/arch/cris/drivers/virtex.h
--- linux-2.4.20-WRT/arch/cris/drivers/virtex.h	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/drivers/virtex.h	2005-11-08 06:24:34.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: virtex.h,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $ */
+/* $Id: virtex.h,v 1.1 2002/06/25 09:58:58 stefanl Exp $ */
 
 int virtex_writereg(unsigned short theReg, unsigned short theValue);
 unsigned short virtex_readreg(unsigned short theReg);
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/debugport.c linux-2.4.20-WRTstp/arch/cris/kernel/debugport.c
--- linux-2.4.20-WRT/arch/cris/kernel/debugport.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/debugport.c	2005-11-08 06:23:46.000000000 -0800
@@ -12,12 +12,6 @@
  *    init_etrax_debug()
  *
  * $Log: debugport.c,v $
- * Revision 1.1.1.2  2003/10/14 08:07:17  sparq
- * Broadcom Release 3.51.8.0 for BCM4712.
- *
- * Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
- * LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  * Revision 1.7  2002/04/23 15:35:50  bjornw
  * Cleaned up sercons struct and removed the waitkey ptr (2.4.19-pre)
  *
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/entry.S linux-2.4.20-WRTstp/arch/cris/kernel/entry.S
--- linux-2.4.20-WRT/arch/cris/kernel/entry.S	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/entry.S	2005-11-08 06:23:46.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: entry.S,v 1.39 2002/04/24 00:46:45 bjornw Exp $
  *
  *  linux/arch/cris/entry.S
  *
@@ -7,12 +7,6 @@
  *  Authors:	Bjorn Wesen (bjornw@axis.com)
  *
  *  $Log: entry.S,v $
- *  Revision 1.1.1.4  2003/10/14 08:07:17  sparq
- *  Broadcom Release 3.51.8.0 for BCM4712.
- *
- *  Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
- *  LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  *  Revision 1.39  2002/04/24 00:46:45  bjornw
  *  Added sys_tkill
  *
@@ -507,9 +501,31 @@
 	nop
 		
 	;; special handlers for breakpoint and NMI
+#if 0			
+hwbreakpoint:
+	push	$dccr
+	di
+	push	$r10
+	push	$r11
+	push	$r12
+	push	$r13
+	clearf	b
+	move	$brp,$r11
+	move.d	[hw_bp_msg],$r10
+	jsr	printk
+	setf	b
+	pop	$r13
+	pop	$r12
+	pop	$r11
+	pop	$r10
+	pop	$dccr
+	retb
+	nop
+#else
 hwbreakpoint:
 	push	$dccr
 	di
+#if 1
 	push	$r10
 	push	$r11
 	move.d	[hw_bp_trig_ptr],$r10
@@ -522,9 +538,11 @@
 	move.d	$r10,[hw_bp_trig_ptr]
 1:	pop	$r11
 	pop	$r10
+#endif
 	pop	$dccr
 	retb
 	nop
+#endif
 	
 IRQ1_interrupt:
 
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/fasttimer.c linux-2.4.20-WRTstp/arch/cris/kernel/fasttimer.c
--- linux-2.4.20-WRT/arch/cris/kernel/fasttimer.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/fasttimer.c	2005-11-08 06:24:34.000000000 -0800
@@ -1,16 +1,10 @@
-/* $Id: fasttimer.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: fasttimer.c,v 1.4 2002/05/28 17:47:59 johana Exp $
  * linux/arch/cris/kernel/fasttimer.c
  *
  * Fast timers for ETRAX100/ETRAX100LX
  * This may be useful in other OS than Linux so use 2 space indentation...
  *
  * $Log: fasttimer.c,v $
- * Revision 1.1.1.4  2003/10/14 08:07:17  sparq
- * Broadcom Release 3.51.8.0 for BCM4712.
- *
- * Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
- * LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  * Revision 1.4  2002/05/28 17:47:59  johana
  * Added del_fast_timer()
  *
@@ -232,6 +226,7 @@
   /* t = 1/freq = 1/19200 = 53us
    * T=div*t,  div = T/t = delay_us*freq/1000000
    */
+#if 1 /* Adaptive timer settings */
   while (delay_us < upper_limit && freq_index < MAX_USABLE_TIMER_FREQ)
   {
     freq_index++;
@@ -241,6 +236,9 @@
   {
     freq_index--;
   }
+#else
+  freq_index = 6;
+#endif
   div = delay_us * timer_freq_100[freq_index]/10000;
   if (div < 2)
   {
@@ -673,12 +671,14 @@
     {
       int cur = (fast_timers_started - i - 1) % NUM_TIMER_STATS;
 
+#if 1 //ndef FAST_TIMER_LOG
       used += sprintf(bigbuf + used, "div: %i freq: %i delay: %i"
                       "\n",
                       timer_div_settings[cur],
                       timer_freq_settings[cur],
                       timer_delay_settings[cur]
                       );
+#endif
 #ifdef FAST_TIMER_LOG
       t = &timer_started_log[cur];
       used += sprintf(bigbuf + used, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
@@ -939,9 +939,19 @@
   /* For some reason, request_irq() hangs when called froom time_init() */
   if (!fast_timer_is_init)
   {
+#if 0 && defined(FAST_TIMER_TEST)
+    int i;
+#endif
 
     printk("fast_timer_init()\n");
 
+#if 0 && defined(FAST_TIMER_TEST)
+    for (i = 0; i <= TIMER0_DIV; i++)
+    {
+      /* We must be careful not to get overflow... */
+      printk("%3i %6u\n", i, timer0_value_us[i]);
+    }
+#endif
 #ifdef CONFIG_PROC_FS
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
    if ((fasttimer_proc_entry = create_proc_entry( "fasttimer", 0, 0 )))
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/head.S linux-2.4.20-WRTstp/arch/cris/kernel/head.S
--- linux-2.4.20-WRT/arch/cris/kernel/head.S	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/head.S	2005-11-08 06:23:46.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: head.S,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: head.S,v 1.44 2002/02/05 15:39:57 bjornw Exp $
  * 
  * Head of the kernel - alter with care
  *
@@ -7,12 +7,6 @@
  * Authors:	Bjorn Wesen (bjornw@axis.com)
  * 
  * $Log: head.S,v $
- * Revision 1.1.1.4  2003/10/14 08:07:17  sparq
- * Broadcom Release 3.51.8.0 for BCM4712.
- *
- * Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
- * LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  * Revision 1.44  2002/02/05 15:39:57  bjornw
  * Oops.. non-CRAMFS_MAGIC should jump over the copying, not into it...
  *
@@ -492,6 +486,18 @@
 	move.d	$r0,[R_ATA_CTRL_DATA]
 	move.d	$r0,[R_ATA_TRANSFER_CNT]
 	move.d	$r0,[R_ATA_CONFIG]
+#if 0
+	move.d	R_PORT_G_DATA, $r1
+	move.d	$r0, [$r1]; assert ATA bus-reset
+	nop
+	nop
+	nop
+	nop
+	nop
+	nop
+	move.d	0x08000000,$r0
+	move.d	$r0,[$r1]
+#endif
 #endif
 
 #ifdef CONFIG_JULIETTE
@@ -614,6 +620,21 @@
 #ifndef CONFIG_SVINTO_SIM
 	move.d	$r0,[R_GEN_CONFIG]
 
+#if 0
+	moveq	4,$r0
+	move.b	$r0,[R_DMA_CH6_CMD]	; reset (ser0 dma out)
+	move.b	$r0,[R_DMA_CH7_CMD]	; reset (ser0 dma in)
+1:	move.b	[R_DMA_CH6_CMD],$r0	; wait for reset cycle to finish
+	and.b	7,$r0
+	cmp.b	4,$r0
+	beq	1b
+	nop
+1:	move.b	[R_DMA_CH7_CMD],$r0	; wait for reset cycle to finish
+	and.b	7,$r0
+	cmp.b	4,$r0
+	beq	1b
+	nop
+#endif
 	
 	moveq	IO_STATE (R_DMA_CH8_CMD, cmd, reset),$r0
 	move.b	$r0,[R_DMA_CH8_CMD]	; reset (ser1 dma out)
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/irq.c linux-2.4.20-WRTstp/arch/cris/kernel/irq.c
--- linux-2.4.20-WRT/arch/cris/kernel/irq.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/irq.c	2002-02-25 11:37:52.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: irq.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: irq.c,v 1.18 2001/11/21 13:40:18 bjornw Exp $
  *
  *	linux/arch/cris/kernel/irq.c
  *
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/kgdb.c linux-2.4.20-WRTstp/arch/cris/kernel/kgdb.c
--- linux-2.4.20-WRT/arch/cris/kernel/kgdb.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/kgdb.c	2005-11-08 06:24:34.000000000 -0800
@@ -18,12 +18,6 @@
 *! Jul 21 1999  Bjorn Wesen     eLinux port
 *!
 *! $Log: kgdb.c,v $
-*! Revision 1.1.1.4  2003/10/14 08:07:17  sparq
-*! Broadcom Release 3.51.8.0 for BCM4712.
-*!
-*! Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
-*! LINUX_2_4 branch snapshot from linux-mips.org CVS
-*!
 *! Revision 1.7  2002/07/12 09:14:56  bjornw
 *! Corrected typo
 *!
@@ -64,7 +58,7 @@
 *!
 *!---------------------------------------------------------------------------
 *!
-*! $Id: kgdb.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+*! $Id: kgdb.c,v 1.7 2002/07/12 09:14:56 bjornw Exp $
 *!
 *! (C) Copyright 1999, Axis Communications AB, LUND, SWEDEN
 *!
@@ -464,6 +458,7 @@
    part of the code in order to avoid horrible addressing modes. */
 static registers reg;
 
+/* FIXME: Should this be used? Delete otherwise. */
 /* Contains the assumed consistency state of the register image. Uses the
    enum error_type for state information. */
 static int consistency_status = SUCCESS;
@@ -763,6 +758,7 @@
 	int ch;
         
         if (mem == NULL) {
+                /* Bogus read from m0. FIXME: What constitutes a valid address? */
                 for (i = 0; i < count; i++) {
                         *buf++ = '0';
                         *buf++ = '0';
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/Makefile linux-2.4.20-WRTstp/arch/cris/kernel/Makefile
--- linux-2.4.20-WRT/arch/cris/kernel/Makefile	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/Makefile	2005-11-08 06:24:34.000000000 -0800
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+# $Id: Makefile,v 1.10 2002/05/27 15:41:40 johana Exp $
 #
 # Makefile for the linux kernel.
 #
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/process.c linux-2.4.20-WRTstp/arch/cris/kernel/process.c
--- linux-2.4.20-WRT/arch/cris/kernel/process.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/process.c	2002-02-25 11:37:52.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: process.c,v 1.22 2001/11/13 09:40:43 orjanf Exp $
  * 
  *  linux/arch/cris/kernel/process.c
  *
@@ -8,12 +8,6 @@
  *  Authors:   Bjorn Wesen (bjornw@axis.com)
  *
  *  $Log: process.c,v $
- *  Revision 1.1.1.4  2003/10/14 08:07:17  sparq
- *  Broadcom Release 3.51.8.0 for BCM4712.
- *
- *  Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
- *  LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  *  Revision 1.22  2001/11/13 09:40:43  orjanf
  *  Added dump_fpu (needed for core dumps).
  *
@@ -257,6 +251,27 @@
  */
 void dump_thread(struct pt_regs * regs, struct user * dump)
 {
+#if 0
+	int i;
+
+	/* changed the size calculations - should hopefully work better. lbt */
+	dump->magic = CMAGIC;
+	dump->start_code = 0;
+	dump->start_stack = regs->esp & ~(PAGE_SIZE - 1);
+	dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
+	dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1))) >> PAGE_SHIFT;
+	dump->u_dsize -= dump->u_tsize;
+	dump->u_ssize = 0;
+	for (i = 0; i < 8; i++)
+		dump->u_debugreg[i] = current->debugreg[i];  
+
+	if (dump->start_stack < TASK_SIZE)
+		dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT;
+
+	dump->regs = *regs;
+
+	dump->u_fpvalid = dump_fpu (regs, &dump->i387);
+#endif 
 }
 
 /* Fill in the fpu structure for a core dump. */
@@ -338,6 +353,29 @@
 
 unsigned long get_wchan(struct task_struct *p)
 {
+#if 0
+	/* YURGH. TODO. */
+
+        unsigned long ebp, esp, eip;
+        unsigned long stack_page;
+        int count = 0;
+        if (!p || p == current || p->state == TASK_RUNNING)
+                return 0;
+        stack_page = (unsigned long)p;
+        esp = p->thread.esp;
+        if (!stack_page || esp < stack_page || esp > 8188+stack_page)
+                return 0;
+        /* include/asm-i386/system.h:switch_to() pushes ebp last. */
+        ebp = *(unsigned long *) esp;
+        do {
+                if (ebp < stack_page || ebp > 8184+stack_page)
+                        return 0;
+                eip = *(unsigned long *) (ebp+4);
+                if (eip < first_sched || eip >= last_sched)
+                        return eip;
+                ebp = *(unsigned long *) ebp;
+        } while (count++ < 16);
+#endif
         return 0;
 }
 #undef last_sched
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/ptrace.c linux-2.4.20-WRTstp/arch/cris/kernel/ptrace.c
--- linux-2.4.20-WRT/arch/cris/kernel/ptrace.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/ptrace.c	2002-02-25 11:37:52.000000000 -0800
@@ -8,12 +8,6 @@
  * Authors:   Bjorn Wesen
  *
  * $Log: ptrace.c,v $
- * Revision 1.1.1.2  2003/10/14 08:07:17  sparq
- * Broadcom Release 3.51.8.0 for BCM4712.
- *
- * Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
- * LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  * Revision 1.8  2001/11/12 18:26:21  pkj
  * Fixed compiler warnings.
  *
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/setup.c linux-2.4.20-WRTstp/arch/cris/kernel/setup.c
--- linux-2.4.20-WRT/arch/cris/kernel/setup.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/setup.c	2005-11-08 06:24:34.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: setup.c,v 1.26 2002/06/04 07:57:56 jonashg Exp $
  *
  *  linux/arch/cris/kernel/setup.c
  *
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/shadows.c linux-2.4.20-WRTstp/arch/cris/kernel/shadows.c
--- linux-2.4.20-WRT/arch/cris/kernel/shadows.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/shadows.c	2001-05-01 16:04:56.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: shadows.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: shadows.c,v 1.2 2001/03/15 14:25:16 bjornw Exp $
  * 
  * Various shadow registers. Defines for these are in include/asm-etrax100/io.h
  */
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/signal.c linux-2.4.20-WRTstp/arch/cris/kernel/signal.c
--- linux-2.4.20-WRT/arch/cris/kernel/signal.c	2003-07-04 01:11:03.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/signal.c	2005-11-08 06:23:46.000000000 -0800
@@ -122,6 +122,7 @@
 {
 	sigset_t saveset, newset;
 
+	/* XXX: Don't preclude handling different sized sigset_t's.  */
 	if (sigsetsize != sizeof(sigset_t))
 		return -EINVAL;
 
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/sys_cris.c linux-2.4.20-WRTstp/arch/cris/kernel/sys_cris.c
--- linux-2.4.20-WRT/arch/cris/kernel/sys_cris.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/sys_cris.c	2001-07-26 15:10:06.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: sys_cris.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: sys_cris.c,v 1.10 2001/06/27 21:16:15 hp Exp $
  *
  * linux/arch/cris/kernel/sys_cris.c
  *
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/time.c linux-2.4.20-WRTstp/arch/cris/kernel/time.c
--- linux-2.4.20-WRT/arch/cris/kernel/time.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/time.c	2005-11-08 06:23:46.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: time.c,v 1.14 2002/03/05 13:31:03 johana Exp $
  *
  *  linux/arch/cris/kernel/time.c
  *
@@ -105,6 +105,18 @@
 void cris_test_timers(void)
 {
 	int i;
+#if 0
+	for (i = 0; i < NS_TEST_SIZE; i++)
+	{
+		ns_test[i] = *R_TIMER0_DATA | (*R_TIM_PRESC_STATUS<<16);
+	}
+	for (i = 1; i < NS_TEST_SIZE; i++)
+	{
+		printk("%4i. %lu %lu %09lu ns \n",
+		       i, ns_test[i]&0x0FFFF, (ns_test[i]>>16), 
+	get_ns_in_jiffie_from_data(ns_test[i]&0x0FFFF, ns_test[i]>>16));
+	}
+#else
 	for (i = 0; i < NS_TEST_SIZE; i++)
 	{
 		ns_test[i] = get_ns_in_jiffie();
@@ -115,6 +127,7 @@
 		printk("%4i. %09lu ns diff %li ns\n",
 		       i, ns_test[i], ns_test[i]- ns_test[i-1]);
 	}
+#endif
 }
 
 #endif
@@ -395,6 +408,23 @@
 	}
 }
 
+#if 0
+/* some old debug code for testing the microsecond timing of packets */
+static unsigned int lastjiff;
+
+void print_timestamp(const char *s)
+{
+	unsigned long flags;
+	unsigned int newjiff;
+
+	save_flags(flags);
+	cli();
+	newjiff = (myjiff << 16) | (unsigned short)(-*R_TIMER01_DATA); 
+	printk("%s: %x (%x)\n", s, newjiff, newjiff - lastjiff);
+	lastjiff = newjiff;
+	restore_flags(flags);
+}
+#endif
 
 /* grab the time from the RTC chip */
 
diff -ruN linux-2.4.20-WRT/arch/cris/kernel/traps.c linux-2.4.20-WRTstp/arch/cris/kernel/traps.c
--- linux-2.4.20-WRT/arch/cris/kernel/traps.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/kernel/traps.c	2005-11-08 06:24:34.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: traps.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: traps.c,v 1.17 2001/12/07 17:02:34 bjornw Exp $
  *
  *  linux/arch/cris/traps.c
  *
@@ -129,6 +129,20 @@
 	show_trace(sp);
 }
 
+#if 0
+/* displays a short stack trace */
+
+int 
+show_stack()
+{
+	unsigned long *sp = (unsigned long *)rdusp();
+	int i;
+	printk("Stack dump [0x%08lx]:\n", (unsigned long)sp);
+	for(i = 0; i < 16; i++)
+		printk("sp + %d: 0x%08lx\n", i*4, sp[i]);
+	return 0;
+}
+#endif
 
 void 
 show_registers(struct pt_regs * regs)
diff -ruN linux-2.4.20-WRT/arch/cris/lib/checksumcopy.S linux-2.4.20-WRTstp/arch/cris/lib/checksumcopy.S
--- linux-2.4.20-WRT/arch/cris/lib/checksumcopy.S	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/lib/checksumcopy.S	2001-10-08 11:43:54.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: checksumcopy.S,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: checksumcopy.S,v 1.7 2001/10/01 14:47:35 bjornw Exp $
  * A fast checksum+copy routine using movem
  * Copyright (c) 1998, 2001 Axis Communications AB
  *
diff -ruN linux-2.4.20-WRT/arch/cris/lib/checksum.S linux-2.4.20-WRTstp/arch/cris/lib/checksum.S
--- linux-2.4.20-WRT/arch/cris/lib/checksum.S	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/lib/checksum.S	2001-10-08 11:43:54.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: checksum.S,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: checksum.S,v 1.6 2001/10/01 14:47:35 bjornw Exp $
  * A fast checksum routine using movem
  * Copyright (c) 1998-2001 Axis Communications AB
  *
diff -ruN linux-2.4.20-WRT/arch/cris/lib/dmacopy.c linux-2.4.20-WRTstp/arch/cris/lib/dmacopy.c
--- linux-2.4.20-WRT/arch/cris/lib/dmacopy.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/lib/dmacopy.c	2001-02-08 16:32:44.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: dmacopy.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $ 
+/* $Id: dmacopy.c,v 1.1 2000/07/10 16:25:21 bjornw Exp $ 
  *
  * memcpy for large blocks, using memory-memory DMA channels 6 and 7 in Etrax
  */
@@ -16,6 +16,12 @@
 	
 	D(printk("dma_memcpy %d bytes... ", pn));
 
+#if 0
+	*R_GEN_CONFIG = genconfig_shadow = 
+		(genconfig_shadow & ~0x3c0000) |
+		IO_STATE(R_GEN_CONFIG, dma6, intdma7) |
+		IO_STATE(R_GEN_CONFIG, dma7, intdma6);
+#endif
 	indma.sw_len = outdma.sw_len = pn;
 	indma.ctrl = d_eol | d_eop;
 	outdma.ctrl = d_eol;
diff -ruN linux-2.4.20-WRT/arch/cris/lib/dram_init.S linux-2.4.20-WRTstp/arch/cris/lib/dram_init.S
--- linux-2.4.20-WRT/arch/cris/lib/dram_init.S	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/lib/dram_init.S	2005-11-08 06:24:34.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: dram_init.S,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: dram_init.S,v 1.12 2002/08/09 11:37:37 orjanf Exp $
  * 
  * DRAM/SDRAM initialization - alter with care
  * This file is intended to be included from other assembler files
@@ -11,12 +11,6 @@
  * Authors:  Mikael Starvik (starvik@axis.com)	
  * 
  * $Log: dram_init.S,v $
- * Revision 1.1.1.4  2003/10/14 08:07:17  sparq
- * Broadcom Release 3.51.8.0 for BCM4712.
- *
- * Revision 1.1.1.1  2003/02/03 22:37:20  mhuang
- * LINUX_2_4 branch snapshot from linux-mips.org CVS
- *
  * Revision 1.12  2002/08/09 11:37:37  orjanf
  * Added double initialization work-around for Samsung SDRAMs.
  *
diff -ruN linux-2.4.20-WRT/arch/cris/lib/hw_settings.S linux-2.4.20-WRTstp/arch/cris/lib/hw_settings.S
--- linux-2.4.20-WRT/arch/cris/lib/hw_settings.S	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/lib/hw_settings.S	2005-11-08 06:24:34.000000000 -0800
@@ -1,5 +1,5 @@
 /*
- * $Id: hw_settings.S,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+ * $Id: hw_settings.S,v 1.4 2002/07/04 16:58:56 pkj Exp $
  * 
  * This table is used by some tools to extract hardware parameters.
  * The table should be included in the kernel and the decompressor.
diff -ruN linux-2.4.20-WRT/arch/cris/lib/old_checksum.c linux-2.4.20-WRTstp/arch/cris/lib/old_checksum.c
--- linux-2.4.20-WRT/arch/cris/lib/old_checksum.c	2003-10-14 01:07:17.000000000 -0700
+++ linux-2.4.20-WRTstp/arch/cris/lib/old_checksum.c	2001-02-08 16:32:44.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: old_checksum.c,v 1.1.1.4 2003/10/14 08:07:17 sparq Exp $
+/* $Id: old_checksum.c,v 1.1 2000/07/10 16:25:21 bjornw Exp $
  *
  * INET		An implementation of the TCP/IP protocol suite for the LINUX
  *		operating system.  INET is implemented using the  BSD Socket
@@ -24,6 +24,10 @@
 
 #ifdef PROFILE_CHECKSUM
 /* these are just for profiling the checksum code with an oscillioscope.. uh */
+#if 0
+#define BITOFF *((unsigned char *)0xb0000030) = 0xff
+#define BITON *((unsigned char *)0xb0000030) = 0x0
+#endif
 #include <asm/io.h>
 #define CBITON LED_ACTIVE_SET(1)
 #define CBITOFF LED_ACTIVE_SET(0)
@@ -50,6 +54,11 @@
    */
   const unsigned char *endMarker = buff + len;
   const unsigned char *marker = endMarker - (len % 16);
+#if 0
+  if((int)buff & 0x3)
+    printk("unaligned buff %p\n", buff);
+  __delay(900); /* extra delay of 90 us to test performance hit */
+#endif
   BITON;
   while (buff < marker) {
     sum += *((unsigned short *)buff)++;
@@ -72,3 +81,47 @@
   return(sum);
 }
 
+#if 0
+
+/*
+ * copy while checksumming, otherwise like csu