patch-2.1.16 linux/drivers/sbus/dvma.c

Next file: linux/drivers/sbus/sbus.c
Previous file: linux/drivers/sbus/char/weitek.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.15/linux/drivers/sbus/dvma.c linux/drivers/sbus/dvma.c
@@ -5,12 +5,12 @@
 
 #include <linux/kernel.h>
 #include <linux/malloc.h>
+#include <linux/init.h>
 
 #include <asm/oplib.h>
 #include <asm/contregs.h>
 #include <asm/sysen.h>
 #include <asm/delay.h>
-#include <asm/idprom.h>
 #include <asm/machines.h>
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -34,8 +34,8 @@
 
 
 /* Probe this SBus DMA module(s) */
-unsigned long
-dvma_init(struct linux_sbus *sbus, unsigned long memory_start)
+__initfunc(unsigned long
+dvma_init(struct linux_sbus *sbus, unsigned long memory_start))
 {
 	struct linux_sbus_device *this_dev;
 	struct Linux_SBus_DMA *dma;
@@ -43,9 +43,13 @@
 	static int num_dma=0;
 
 	for_each_sbusdev(this_dev, sbus) {
-		if(strcmp(this_dev->prom_name, "dma") &&
-		   strcmp(this_dev->prom_name, "ledma") &&
-		   strcmp(this_dev->prom_name, "espdma"))
+		int hme = 0;
+
+		if(!strcmp(this_dev->prom_name, "SUNW,fas")) {
+			hme = 1;
+		} else if(strcmp(this_dev->prom_name, "dma") &&
+			  strcmp(this_dev->prom_name, "ledma") &&
+			  strcmp(this_dev->prom_name, "espdma"))
 			continue;
 
 		/* Found one... */
@@ -71,7 +75,10 @@
 		/* The constant PAGE_SIZE that is passed to sparc_alloc_io makes the
 		 * routine only alloc 1 page, that was what the original code did
 		 */
-		prom_apply_sbus_ranges(dma->SBus_dev->reg_addrs, 0x1);
+		if(hme) /* On HME cards, dvma lives with esp, 2 reg sets. */
+			prom_apply_sbus_ranges(sbus, dma->SBus_dev->reg_addrs, 0x2);
+		else    /* All others have only 1 reg set. */
+			prom_apply_sbus_ranges(sbus, dma->SBus_dev->reg_addrs, 0x1);
 		dma->regs = (struct sparc_dma_registers *)
 			sparc_alloc_io (dma->SBus_dev->reg_addrs[0].phys_addr, 0,
 					PAGE_SIZE, "dma",
@@ -96,6 +103,10 @@
 		case DMA_VERS2:
 			dma->revision=dvmarev2;
 			printk("Revision 2 ");
+			break;
+		case DMA_VERHME:
+			dma->revision=dvmahme;
+			printk("HME DVMA gate array ");
 			break;
 		case DMA_VERSPLUS:
 			dma->revision=dvmarevplus;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov