Index: arch/parisc/kernel/ccio-dma.c
===================================================================
RCS file: /var/cvs/linux/arch/parisc/kernel/ccio-dma.c,v
retrieving revision 1.55
diff -u -p -r1.55 ccio-dma.c
--- arch/parisc/kernel/ccio-dma.c	3 Aug 2002 08:18:20 -0000	1.55
+++ arch/parisc/kernel/ccio-dma.c	7 Sep 2002 00:42:44 -0000
@@ -1461,10 +1461,28 @@ static void __init ccio_init_resources(s
 static void expand_ioc_area(struct ioc *ioc, unsigned long size,
 		unsigned long min, unsigned long max, unsigned long align)
 {
-#ifdef NASTY_HACK_FOR_K_CLASS
-	__raw_writel(0xfffff600, (unsigned long)&(ioc->ioc_hpa->io_io_high));
-	ioc->mmio_region[0].end = 0xf5ffffff;
-#endif
+	int i;
+
+	for (i = 0; i < 2; i++) {
+		unsigned long addr;
+		signed int val;
+		struct resource *parent = ioc->mmio_region + i;
+
+		if (parent->sibling->start - parent->end < size)
+			continue;
+
+		parent->end += size;
+
+		if (i == 0) {
+			addr = (unsigned long) &ioc->ioc_hpa->io_io_high;
+		} else {
+			addr = (unsigned long) &ioc->ioc_hpa->io_io_high_hv;
+		}
+
+		val = parent->end + 1;
+		val >>= 16; /* sign extends */
+		__raw_writel(val, addr);
+	}
 }
 
 static struct resource *ccio_get_resource(struct ioc* ioc,
@@ -1490,17 +1508,22 @@ int ccio_allocate_resource(const struct 
 		void *alignf_data)
 {
 	struct ioc *ioc = ccio_get_iommu(dev);
-	struct resource *parent = ccio_get_resource(ioc, dev);
-	if (!parent)
-		return -EBUSY;
 
-	if (!allocate_resource(parent, res, size, min, max, align, alignf,
-			alignf_data))
+	if (!allocate_resource(ioc->mmio_region, res, size, min, max, align, alignf,
+			       alignf_data))
+		return 0;
+
+	if (!allocate_resource(ioc->mmio_region + 1, res, size, min, max, align, alignf,
+			       alignf_data))
 		return 0;
 
 	expand_ioc_area(ioc, size, min, max, align);
-	return allocate_resource(parent, res, size, min, max, align, alignf,
-			alignf_data);
+	if (!allocate_resource(ioc->mmio_region, res, size, min, max, align, alignf,
+			       alignf_data))
+		return 0;
+
+	return allocate_resource(ioc->mmio_region + 1, res, size, min, max, align, alignf,
+				 alignf_data);
 }
 
 int ccio_request_resource(const struct parisc_device *dev,
Index: drivers/char/mux.c
===================================================================
RCS file: /var/cvs/linux/drivers/char/mux.c,v
retrieving revision 1.2
diff -u -p -r1.2 mux.c
--- drivers/char/mux.c	26 Aug 2002 03:27:10 -0000	1.2
+++ drivers/char/mux.c	7 Sep 2002 00:42:45 -0000
@@ -532,6 +532,11 @@ mux_open(struct tty_struct *tty, struct 
 static int __init 
 mux_probe(struct parisc_device *dev)
 {
+	if(hpa) {
+		printk("KERN_INFO "Serial MUX driver already registered, skipping additonal MUXes for now.\n");
+		return 1;
+	}
+
 	init_timer(&mux_drv_timer);
 	mux_drv_timer.function = mux_drv_poll;
 	mod_timer(&mux_drv_timer, jiffies + MUX_POLL_DELAY);
@@ -591,8 +596,7 @@ mux_probe(struct parisc_device *dev)
 }
 
 static struct parisc_device_id mux_tbl[] = {
-	{ HPHW_A_DIRECT, HVERSION_REV_ANY_ID, 0x015, 0x0000D }, /* Eole CAP/MUX */
-	{ HPHW_A_DIRECT, HVERSION_REV_ANY_ID, 0x044, 0x0000D }, /* Sahp Baat Kiuh AP/MUX */
+	{ HPHW_A_DIRECT, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0000D },
 	{ 0, }
 };
 
Index: drivers/net/tulip/eeprom.c
===================================================================
RCS file: /var/cvs/linux/drivers/net/tulip/eeprom.c,v
retrieving revision 1.14
diff -u -p -r1.14 eeprom.c
--- drivers/net/tulip/eeprom.c	29 Aug 2002 21:02:18 -0000	1.14
+++ drivers/net/tulip/eeprom.c	7 Sep 2002 00:42:46 -0000
@@ -75,6 +75,61 @@ static const char *block_name[] __devini
 };
 
 
+/**
+ * tulip_build_fake_mediatable - Build a fake mediatable entry.
+ * @tp: Ptr to the tulip private data.
+ *
+ * Some cards like the 3x5 HSC cards (J3514A) do not have a standard 
+ * srom and can not be handled under the fixup routine.  These cards
+ * still need a valid mediatable entry for correct csr12 setup and 
+ * mii handling.
+ * 
+ * Since this is currently a parisc-linux specific function, the
+ * #ifdef __hppa__ should completely optimize this function away for
+ * non-parisc hardware.
+ */
+static void __devinit tulip_build_fake_mediatable(struct tulip_private *tp)
+{
+#ifdef __hppa__
+	unsigned char *ee_data = tp->eeprom;
+
+	if (ee_data[0] == 0x3c && ee_data[1] == 0x10 && 
+		(ee_data[2] == 0x63 || ee_data[2] == 0x61) && ee_data[3] == 0x10) {
+
+		static unsigned char leafdata[] =
+			{ 0x01,       /* phy number */
+			  0x02,       /* gpr setup sequence length */
+			  0x02, 0x00, /* gpr setup sequence */
+			  0x02,       /* phy reset sequence length */
+			  0x01, 0x00, /* phy reset sequence */
+			  0x00, 0x78, /* media capabilities */
+			  0x00, 0xe0, /* nway advertisment */
+			  0x00, 0x05, /* fdx bit map */
+			  0x00, 0x06  /* ttm bit map */
+			};
+
+		tp->mtable = (struct mediatable *)
+			kmalloc(sizeof(struct mediatable) + sizeof(struct medialeaf), GFP_KERNEL);
+
+		if (tp->mtable == NULL)
+			return; /* Horrible, impossible failure. */
+
+		tp->mtable->defaultmedia = 0x800;
+		tp->mtable->leafcount = 1;
+		tp->mtable->csr12dir = 0x3f; /* inputs on bit7 for hsc-pci, bit6 for pci-fx */
+		tp->mtable->has_nonmii = 0;
+		tp->mtable->has_reset = 0;
+		tp->mtable->has_mii = 1;
+		tp->mtable->csr15dir = tp->mtable->csr15val = 0;
+		tp->mtable->mleaf[0].type = 1;
+		tp->mtable->mleaf[0].media = 11;
+		tp->mtable->mleaf[0].leafdata = &leafdata[0];
+		tp->flags |= HAS_PHY_IRQ;
+		tp->csr12_shadow = -1;
+	}
+#endif 
+}
+
 void __devinit tulip_parse_eeprom(struct net_device *dev)
 {
 	/* The last media info list parsed, for multiport boards.  */
@@ -136,50 +191,7 @@ void __devinit tulip_parse_eeprom(struct
 subsequent_board:
 
 	if (ee_data[27] == 0) {		/* No valid media table. */
-#ifdef __hppa__
-		/*
-		 * HSC-PCI cards don't have a standard srom,
-		 * but we need to setup a fake mediatable
-		 * for a correct csr12 setup and mii handling
-		 */
-		if (ee_data[0] == 0x3c && ee_data[1] == 0x10   && /* sub vendor id */
-		    (ee_data[2] == 0x63 || ee_data[2] == 0x61) && /* sub device id */
-		     ee_data[3] == 0x10) { 
-
-			static unsigned char leafdata[] =
-			        { 0x01,       /* phy number */
-				  0x02,       /* gpr setup sequence length */
-				  0x02, 0x00, /* gpr setup sequence */
-				  0x02,       /* phy reset sequence length */
-				  0x01, 0x00, /* phy reset sequence */
-				  0x00, 0x78, /* media capabilities */
-				  0x00, 0xe0, /* nway advertisment */
-				  0x00, 0x05, /* fdx bit map */
-				  0x00, 0x06  /* ttm bit map */
-				};
-			struct mediatable *mtable;
-			
-			mtable = (struct mediatable *)
-				kmalloc(sizeof(struct mediatable) + sizeof(struct medialeaf),
-					GFP_KERNEL);
-			if (mtable == NULL)
-				return;				/* Horrible, impossible failure. */
-			
-			tp->mtable = mtable;
-			mtable->defaultmedia = 0x800;
-			mtable->leafcount = 1;
-			mtable->csr12dir = 0x3f; /* inputs on bit7 for hsc-pci, bit6 for pci-fx */
-			mtable->has_nonmii = 0;
-			mtable->has_reset = 0;
-			mtable->has_mii = 1;
-			mtable->csr15dir = mtable->csr15val = 0;
-			mtable->mleaf[0].type = 1;
-			mtable->mleaf[0].media = 11;
-			mtable->mleaf[0].leafdata = &leafdata[0];
-		        tp->flags |= HAS_PHY_IRQ;
-			tp->csr12_shadow = -1;
-		}
-#endif		
+		tulip_build_fake_mediatable(tp);
 	} else if (tp->chip_id == DC21041) {
 		unsigned char *p = (void *)ee_data + ee_data[27 + controller_index*3];
 		int media = get_u16(p);
Index: drivers/net/tulip/interrupt.c
===================================================================
RCS file: /var/cvs/linux/drivers/net/tulip/interrupt.c,v
retrieving revision 1.13
diff -u -p -r1.13 interrupt.c
--- drivers/net/tulip/interrupt.c	25 Feb 2002 23:12:32 -0000	1.13
+++ drivers/net/tulip/interrupt.c	7 Sep 2002 00:42:46 -0000
@@ -291,25 +291,25 @@ throttle:
 #endif
 }
 
-#ifdef __hppa__
-static inline void phy_interrupt (struct net_device *dev, struct tulip_private *tp, long ioaddr)
+static inline void phy_interrupt (struct net_device *dev)
 {
-	int csr12;
-	
-	csr12 = inl(ioaddr + CSR12) & 0xff;
+#ifdef __hppa__
+	int csr12 = inl(dev->base_addr + CSR12) & 0xff;
+	struct tulip_private *tp = (struct tulip_private *)dev->priv;
+
 	if (csr12 != tp->csr12_shadow) {
 		/* ack interrupt */
-		outl(csr12 | 0x02, ioaddr + CSR12);
+		outl(csr12 | 0x02, dev->base_addr + CSR12);
 		tp->csr12_shadow = csr12;
 		/* do link change stuff */
 		spin_lock(&tp->lock);
 		tulip_check_duplex(dev);
 		spin_unlock(&tp->lock);
 		/* clear irq ack bit */
-		outl(csr12 & ~0x02, ioaddr + CSR12);
+		outl(csr12 & ~0x02, dev->base_addr + CSR12);
 	}
-}
 #endif
+}
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
@@ -332,11 +332,8 @@ void tulip_interrupt(int irq, void *dev_
 	/* Let's see whether the interrupt really is for us */
 	csr5 = inl(ioaddr + CSR5);
 
-    
-#ifdef __hppa__
         if (tp->flags & HAS_PHY_IRQ)
-	        phy_interrupt (dev, tp, ioaddr);
-#endif
+	        phy_interrupt (dev);
     
 	if ((csr5 & (NormalIntr|AbnormalIntr)) == 0)
 		return;
Index: drivers/net/tulip/media.c
===================================================================
RCS file: /var/cvs/linux/drivers/net/tulip/media.c,v
retrieving revision 1.12
diff -u -p -r1.12 media.c
--- drivers/net/tulip/media.c	4 Aug 2002 22:58:40 -0000	1.12
+++ drivers/net/tulip/media.c	7 Sep 2002 00:42:46 -0000
@@ -285,6 +285,16 @@ void tulip_select_media(struct net_devic
 					outl(init_sequence[i], ioaddr + CSR12);
 			}
 
+			/* FIXME: this is WRONG! ggg says we need to poll bit 15 
+			 * of Basic Mode Control register (address 00h) until it 
+			 * is zero again.
+			 * the right sequence in that code should be:
+			 *   1) send reset_sequence[]
+			 *   2) poll bit 15 until it's zero again
+			 *   3) udelay(500)
+ 			 *   4) send init_sequence[]
+			 * this based on the DP83840A Phy spec.
+			 */
 			inl(ioaddr + CSR6);	/* flush posted writes */
 			udelay(500);
 
Index: drivers/net/tulip/tulip.h
===================================================================
RCS file: /var/cvs/linux/drivers/net/tulip/tulip.h,v
retrieving revision 1.9
diff -u -p -r1.9 tulip.h
--- drivers/net/tulip/tulip.h	13 Dec 2001 22:37:14 -0000	1.9
+++ drivers/net/tulip/tulip.h	7 Sep 2002 00:42:46 -0000
@@ -388,12 +388,8 @@ struct tulip_private {
 	int susp_rx;
 	unsigned long nir;
 	unsigned long base_addr;
-#ifdef __hppa__
 	int csr12_shadow;
-	int pad1;
-#else	
-	int pad0, pad1;		/* Used for 8-byte alignment */
-#endif	
+	int pad0;		/* Used for 8-byte alignment */
 };
 
 
Index: drivers/net/tulip/tulip_core.c
===================================================================
RCS file: /var/cvs/linux/drivers/net/tulip/tulip_core.c,v
retrieving revision 1.24
diff -u -p -r1.24 tulip_core.c
--- drivers/net/tulip/tulip_core.c	29 Aug 2002 21:02:18 -0000	1.24
+++ drivers/net/tulip/tulip_core.c	7 Sep 2002 00:42:47 -0000
@@ -1579,17 +1579,18 @@ static int __devinit tulip_init_one (str
                }
 #endif
 #ifdef __hppa__
-		/* Check to see if we have a broken srom */
+		/* 3x5 HSC (J3514A) has a broken srom */
 		if(ee_data[0] == 0x61 && ee_data[1] == 0x10) {
-			/* subsys_vendor and subsys_id are swapped */
+			/* pci_vendor_id and subsystem_id are swapped */
 			ee_data[0] = ee_data[2];
 			ee_data[1] = ee_data[3];
 			ee_data[2] = 0x61;
 			ee_data[3] = 0x10;
 
-			/* HSC-PCI boards need to be byte-swaped and shifted
-			**   up 1 word. 
-			*/
+			/* srom need to be byte-swaped and shifted up 1 word.  
+			 * This shift needs to happen at the end of the MAC
+			 * first because of the 2 byte overlap.
+			 */
 			for(i = 4; i >= 0; i -= 2) {
 				ee_data[17 + i + 3] = ee_data[17 + i];
 				ee_data[16 + i + 5] = ee_data[16 + i];
