patch-2.3.41 linux/drivers/scsi/amiga7xx.c

Next file: linux/drivers/scsi/blz1230.c
Previous file: linux/drivers/scsi/aic7xxx/aic7xxx.seq
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.40/linux/drivers/scsi/amiga7xx.c linux/drivers/scsi/amiga7xx.c
@@ -38,107 +38,105 @@
 int __init amiga7xx_detect(Scsi_Host_Template *tpnt)
 {
     static unsigned char called = 0;
-    unsigned int key;
     int num = 0, clock;
     long long options;
-    const struct ConfigDev *cd;
+    struct zorro_dev *z = NULL;
+    unsigned long address;
 
     if (called || !MACH_IS_AMIGA)
 	return 0;
 
     tpnt->proc_name = "Amiga7xx";
 
-#ifdef CONFIG_BLZ603EPLUS_SCSI
-    if ((key = zorro_find(ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS, 0, 0)))
-    {
-	cd = zorro_get_board(key);
-
-	options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;
-
-	clock = 50000000;	/* 50MHz SCSI Clock */
-
-	ncr53c7xx_init(tpnt, 0, 710, (u32)ZTWO_VADDR(0xf40000),	0,
-		       IRQ_AMIGA_PORTS, DMA_NONE, options, clock);
-
-	zorro_config_board(key, 0);
-	num++;
+#ifdef CONFIG_A4000T_SCSI
+    if (AMIGAHW_PRESENT(A4000_SCSI)) {
+	address = 0xdd0040;
+	if (request_mem_region(address, 0x1000, "ncr53c710")) { 
+	    address = ZTWO_VADDR(address);
+	    options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 |
+		      OPTION_INTFLY | OPTION_SYNCHRONOUS |
+		      OPTION_ALWAYS_SYNCHRONOUS | OPTION_DISCONNECT;
+	    clock = 50000000;	/* 50MHz SCSI Clock */
+	    ncr53c7xx_init(tpnt, 0, 710, address, 0, IRQ_AMIGA_PORTS, DMA_NONE,
+			   options, clock);
+	    num++;
+	}
     }
 #endif
 
-#ifdef CONFIG_WARPENGINE_SCSI
-    if ((key = zorro_find(ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx, 0, 0)))
-    {
-	unsigned long address;
-	cd = zorro_get_board(key);
-	address = (unsigned long)ioremap((unsigned long)cd->cd_BoardAddr,
-						cd->cd_BoardSize);
-
-	options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;
-
-	clock = 50000000;	/* 50MHz SCSI Clock */
-
-	ncr53c7xx_init(tpnt, 0, 710, (u32)(unsigned char *)(address + 0x40000),
-		       0, IRQ_AMIGA_PORTS, DMA_NONE, options, clock);
-
-	zorro_config_board(key, 0);
-	num++;
-    }
+    while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
+	unsigned long address = z->resource.start;
+	unsigned long size = z->resource.end-z->resource.start+1;
+	switch (z->id) {
+#ifdef CONFIG_BLZ603EPLUS_SCSI
+	    case ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS:
+		address = 0xf40000;
+		if (request_mem_region(address, 0x1000, "ncr53c710")) {
+		    strcpy(z->name,
+			   "Blizzard 603e+ Accelerator and SCSI Host Adapter");
+		    address = ZTWO_VADDR(address);
+		    options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 |
+			      OPTION_INTFLY | OPTION_SYNCHRONOUS | 
+			      OPTION_ALWAYS_SYNCHRONOUS | OPTION_DISCONNECT;
+		    clock = 50000000;	/* 50MHz SCSI Clock */
+		    ncr53c7xx_init(tpnt, 0, 710, address, 0, IRQ_AMIGA_PORTS,
+				   DMA_NONE, options, clock);
+		    num++;
+		}
+		break;
 #endif
 
-#ifdef CONFIG_A4000T_SCSI
-    if (AMIGAHW_PRESENT(A4000_SCSI))
-    { 
-    	options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;
-
-	clock = 50000000;	/* 50MHz SCSI Clock */
-
-    	ncr53c7xx_init(tpnt, 0, 710, (u32)ZTWO_VADDR(0xDD0040), 0,
-		       IRQ_AMIGA_PORTS, DMA_NONE, options, clock);
-    	num++;
-    }
+#ifdef CONFIG_WARPENGINE_SCSI
+    	    case ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx:
+		if (request_mem_region(address+0x40000, 0x1000, "ncr53c710")) {
+		    strcpy(z->name, "Warp Engine 40xx Accelerator, SCSI Host "
+		    		    "Adapter and RAM Expansion");
+		    address = (unsigned long)ioremap(address, size);
+		    options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 |
+			      OPTION_INTFLY | OPTION_SYNCHRONOUS |
+			      OPTION_ALWAYS_SYNCHRONOUS | OPTION_DISCONNECT;
+		    clock = 50000000;	/* 50MHz SCSI Clock */
+		    ncr53c7xx_init(tpnt, 0, 710, address+0x40000, 0,
+				   IRQ_AMIGA_PORTS, DMA_NONE, options, clock);
+		    num++;
+		}
+		break;
 #endif
 
 #ifdef CONFIG_A4091_SCSI
-    while ( (key = zorro_find(ZORRO_PROD_CBM_A4091_1, 0, 0)) ||
-	    (key = zorro_find(ZORRO_PROD_CBM_A4091_2, 0, 0)) )
-    {
-	unsigned long address;
-	cd = zorro_get_board(key);
-	address = (unsigned long)ioremap((unsigned long)cd->cd_BoardAddr,
-						cd->cd_BoardSize);
-
-    	options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;
-
-	clock = 50000000;	/* 50MHz SCSI Clock */
-
-    	ncr53c7xx_init(tpnt, 0, 710, (u32)(unsigned char *)(address+0x800000),
-			0, IRQ_AMIGA_PORTS, DMA_NONE, options, clock);
-
-	zorro_config_board(key, 0);
-	num++;
-    }
+	    case ZORRO_PROD_CBM_A4091_1:
+	    case ZORRO_PROD_CBM_A4091_2:
+		if (request_mem_region(address+0x800000, 0x1000, "ncr53c710")) {
+		    strcpy(z->name, "A4091 SCSI Host Adapter");
+		    address = (unsigned long)ioremap(address, size);
+		    options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 |
+			      OPTION_INTFLY | OPTION_SYNCHRONOUS |
+			      OPTION_ALWAYS_SYNCHRONOUS | OPTION_DISCONNECT;
+		    clock = 50000000;	/* 50MHz SCSI Clock */
+		    ncr53c7xx_init(tpnt, 0, 710, address+0x800000, 0,
+				   IRQ_AMIGA_PORTS, DMA_NONE, options, clock);
+		    num++;
+		}
+		break;
 #endif
 
 #ifdef CONFIG_GVP_TURBO_SCSI
-    if((key = zorro_find(ZORRO_PROD_GVP_GFORCE_040_060, 0, 0)))
-    {
-	    cd = zorro_get_board(key);
-	    address = ZTWO_VADDR((unsigned long)cd->cd_BoardAddr);
-
-	    options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 |
-		      OPTION_INTFLY | OPTION_SYNCHRONOUS |
-		      OPTION_ALWAYS_SYNCHRONOUS | OPTION_DISCONNECT;
-
-	    clock = 50000000;	/* 50MHz SCSI Clock */
-
-	    ncr53c7xx_init(tpnt, 0, 710,
-			   (u32)(unsigned char *)(address + 0x40000),
-			   0, IRQ_AMIGA_PORTS, DMA_NONE, options, clock);
-
-	    zorro_config_board(key, 0);
-	    num++;
-    }
+    	    case ZORRO_PROD_GVP_GFORCE_040_060:
+		if (request_mem_region(address+0x40000, 0x1000, "ncr53c710")) {
+		    strcpy(z->name, "GForce 040/060 Accelerator and SCSI Host "
+		    		    "Adapter");
+		    address = ZTWO_VADDR(address);
+		    options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 |
+			      OPTION_INTFLY | OPTION_SYNCHRONOUS |
+			      OPTION_ALWAYS_SYNCHRONOUS | OPTION_DISCONNECT;
+		    clock = 50000000;	/* 50MHz SCSI Clock */
+		    ncr53c7xx_init(tpnt, 0, 710, address+0x40000, 0,
+				   IRQ_AMIGA_PORTS, DMA_NONE, options, clock);
+		    num++;
+		}
 #endif
+	}
+    }
 
     called = 1;
     return num;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)