Skip to contentSkip to conversation

53c700 driver completion (against 2.4.10-pre13)

PATCH New James Bottomley 1 participant 1 message Sep 22, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 53c700 driver completion (against 2.4.10-pre13)

This patch should complete the essential functionality of the 53c700 chip driver (mainly for parisc). I've tested it on a 53c700 (parisc 715/50) a 53c700-66 (NCR D700 microchannel) and on a lasi 710 (parisc 712/60). I've done some fairly extensive corruption testing on the parisc architecture looking for memory coherency problems and none has shown up so far. I've also cleaned up the driver so it seems to compile OK with the 64 bit parisc compiler and made it use the pci mapping functions necessary for the 64 bit architecture.

James Bottomley

Index: Documentation/Configure.help
===================================================================
RCS file: /home/jejb/CVSROOT/linux/2.4/Documentation/Configure.help,v retrieving revision 1.1.1.25

Configure.help +17 -0
diff -u -r1.1.1.25 Configure.help
@@ -5991,6 +5991,23 @@
   port or memory mapped. You should know what you have. The most
   common card, Trantor T130B, uses port mapped mode.
 
+NCR Dual 700 MCA SCSI support
+CONFIG_SCSI_NCR_D700
+  This is a driver for the MicroChannel Dual 700 card produced by
+  NCR and commonly used in 345x/35xx/4100 class machines.  It always
+  tries to negotiate sync and uses tag command queueing.
+
+  Unless you have an NCR manufactured machine, the chances are that
+  you do not have this SCSI card, so say N.
+
+HP LASI SCSI support for 53c700
+CONFIG_SCSI_LASI700
+  This is a driver for the lasi baseboard in some parisc machines
+  which is based on the 53c700 chip.  Will also support LASI subsystems
+  based on the 710 chip using 700 emulation mode.
+
+  Unless you know you have a 53c700 or 53c710 based lasi, say N here
+
 NCR53c7,8xx SCSI support
 CONFIG_SCSI_NCR53C7xx
   This is a driver for the 53c7 and 8xx NCR family of SCSI

Index: drivers/scsi/53c700.c
===================================================================
RCS file: /home/jejb/CVSROOT/linux/2.4/drivers/scsi/53c700.c,v retrieving revision 1.1.1.3

scsi/53c700.c +359 -151

948 lines not on this page · raw message

Index: drivers/scsi/53c700.h
===================================================================
RCS file: /home/jejb/CVSROOT/linux/2.4/drivers/scsi/53c700.h,v retrieving revision 1.1.1.2

scsi/53c700.h +49 -25

218 lines not on this page · raw message

Index: drivers/scsi/53c700.scr
===================================================================
RCS file: /home/jejb/CVSROOT/linux/2.4/drivers/scsi/53c700.scr,v retrieving revision 1.1.1.1

scsi/53c700.scr +9 -2
diff -u -r1.1.1.1 53c700.scr
@@ -81,6 +81,7 @@
 ABSOLUTE	DISCONNECT_AFTER_CMD = 0x380
 ABSOLUTE	SDTR_MSG_AFTER_CMD = 0x360
 ABSOLUTE	WDTR_MSG_AFTER_CMD = 0x3A0
+ABSOLUTE	MSG_IN_AFTER_STATUS = 0x440
 ABSOLUTE	DISCONNECT_AFTER_DATA = 0x580
 ABSOLUTE	MSG_IN_AFTER_DATA_IN = 0x550
 ABSOLUTE	MSG_IN_AFTER_DATA_OUT = 0x650
@@ -116,7 +117,8 @@
 
 ;
 ; SCSI Messages we interpret in the script
-; 
+;
+ABSOLUTE	COMMAND_COMPLETE_MSG	= 0x00
 ABSOLUTE	EXTENDED_MSG		= 0x01
 ABSOLUTE	SDTR_MSG		= 0x01
 ABSOLUTE	SAVE_DATA_PTRS_MSG	= 0x02
@@ -393,7 +395,12 @@
 Finish:
 	MOVE	1, StatusAddress, WHEN STATUS
 	INT	NOT_MSG_IN_AFTER_STATUS, WHEN NOT MSG_IN
-	CALL	ReceiveMessage
+	MOVE	1, ReceiveMsgAddress, WHEN MSG_IN
+	JUMP	FinishCommandComplete, IF COMMAND_COMPLETE_MSG
+	CALL	ProcessReceiveMessage
+	INT	MSG_IN_AFTER_STATUS
+	ENTRY	FinishCommandComplete
+FinishCommandComplete:
 	CLEAR	ACK
 	WAIT	DISCONNECT
 	ENTRY	Finish1

Index: drivers/scsi/Config.in
===================================================================
RCS file: /home/jejb/CVSROOT/linux/2.4/drivers/scsi/Config.in,v retrieving revision 1.1.1.18

scsi/Config.in +11 -2
diff -u -r1.1.1.18 Config.in
@@ -115,9 +115,18 @@
    fi
 fi
 dep_tristate 'NCR53c406a SCSI support' CONFIG_SCSI_NCR53C406A $CONFIG_SCSI
-dep_tristate 'NCR Dual 700 MCA SCSI support' CONFIG_SCSI_NCR_D700 $CONFIG_SCSI $CONFIG_MCA
+if [ "$CONFIG_MCA" = "y" ]; then
+   dep_tristate 'NCR Dual 700 MCA SCSI support' CONFIG_SCSI_NCR_D700 $CONFIG_SCSI
+   if [ "$CONFIG_SCSI_NCR_D700" != "n" ]; then
+      define_bool CONFIG_53C700_IO_MAPPED y
+   fi
+fi
 if [ "$CONFIG_PARISC" = "y" ]; then
-   dep_tristate 'HP LASI SCSI support for 53c700' CONFIG_SCSI_LASI70 $CONFIG_SCSI
+   dep_tristate 'HP LASI SCSI support for 53c700' CONFIG_SCSI_LASI700 $CONFIG_SCSI
+   if [ "$CONFIG_SCSI_LASI700" != "n" ]; then
+      define_bool CONFIG_53C700_MEM_MAPPED y
+      define_bool CONFIG_53C700_LE_ON_BE y
+   fi
 fi
 dep_tristate 'NCR53c7,8xx SCSI support'  CONFIG_SCSI_NCR53C7xx $CONFIG_SCSI $CONFIG_PCI
 if [ "$CONFIG_SCSI_NCR53C7xx" != "n" ]; then

Index: drivers/scsi/Makefile
===================================================================
RCS file: /home/jejb/CVSROOT/linux/2.4/drivers/scsi/Makefile,v retrieving revision 1.1.1.18

scsi/Makefile +2 -9
diff -u -r1.1.1.18 Makefile
@@ -31,7 +31,7 @@
   endif
 endif
 
-export-objs	:= scsi_syms.o 53c700.o 53c700-mem.o
+export-objs	:= scsi_syms.o 53c700.o
 
 CFLAGS_aha152x.o =   -DAHA152X_STAT -DAUTOCONF
 CFLAGS_gdth.o    = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS
@@ -125,7 +125,7 @@
 obj-$(CONFIG_SCSI_DEBUG)	+= scsi_debug.o
 obj-$(CONFIG_SCSI_FCAL)		+= fcal.o
 obj-$(CONFIG_SCSI_CPQFCTS)	+= cpqfc.o
-obj-$(CONFIG_SCSI_LASI700)	+= lasi700.o 53c700-mem.o
+obj-$(CONFIG_SCSI_LASI700)	+= lasi700.o 53c700.o
 
 ifeq ($(CONFIG_ARCH_ACORN),y)
 mod-subdirs	+= ../acorn/scsi
@@ -209,10 +209,3 @@
 	mv script.h 53c700_d.h
 
 53c700.o: 53c700_d.h
-
-53c700-mem.o: 53c700_d.h
-
-53c700-mem.c: 53c700.c
-	echo "/* WARNING: GENERATED FILE (from $<), DO NOT MODIFY */" > $@
-	echo "#define MEM_MAPPED" >> $@
-	cat $< >> $@

Index: drivers/scsi/lasi700.c
===================================================================
RCS file: /home/jejb/CVSROOT/linux/2.4/drivers/scsi/lasi700.c,v retrieving revision 1.1.1.1

scsi/lasi700.c +24 -7
diff -u -r1.1.1.1 lasi700.c
@@ -109,6 +109,7 @@
 static int __initdata host_count = 0;
 static struct parisc_device_id lasi700_scsi_tbl[] = {
 	LASI700_ID_TABLE,
+	LASI710_ID_TABLE,
 	{ 0 }
 };
 
@@ -136,32 +137,48 @@
 {
 	unsigned long base = dev->hpa + LASI_SCSI_CORE_OFFSET;
 	int irq = busdevice_alloc_irq(dev);
+	char *driver_name;
 	struct Scsi_Host *host;
 	struct NCR_700_Host_Parameters *hostdata =
 		kmalloc(sizeof(struct NCR_700_Host_Parameters),
 			GFP_KERNEL);
+	if(dev->id.sversion == LASI_700_SVERSION) {
+		driver_name = "lasi700";
+	} else {
+		driver_name = "lasi710";
+	}
 	if(hostdata == NULL) {
-		printk(KERN_ERR "lasi700: Failed to allocate host data\n");
+		printk(KERN_ERR "%s: Failed to allocate host data\n",
+		       driver_name);
 		return 1;
 	}
 	memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters));
-	if(request_mem_region(base, 64, "lasi700") == NULL) {
-		printk(KERN_ERR "lasi700: Failed to claim memory region\n");
+	if(request_mem_region(base, 64, driver_name) == NULL) {
+		printk(KERN_ERR "%s: Failed to claim memory region\n",
+		       driver_name);
 		kfree(hostdata);
 		return 1;
 	}
 	hostdata->base = base;
 	hostdata->differential = 0;
-	hostdata->clock = LASI700_CLOCK;
-	hostdata->force_le_on_be = 1;
+	if(dev->id.sversion == LASI_700_SVERSION) {
+		hostdata->clock = LASI700_CLOCK;
+		hostdata->force_le_on_be = 1;
+	} else {
+		hostdata->clock = LASI710_CLOCK;
+		hostdata->force_le_on_be = 0;
+		hostdata->chip710 = 1;
+		hostdata->dmode_extra = DMODE_FC2;
+	}
 	if((host = NCR_700_detect(host_tpnt, hostdata)) == NULL) {
 		kfree(hostdata);
 		release_mem_region(host->base, 64);
 		return 1;
 	}
 	host->irq = irq;
-	if(request_irq(irq, NCR_700_intr, SA_SHIRQ, "lasi700", host)) {
-		printk(KERN_ERR "lasi700: irq problem, detatching\n");
+	if(request_irq(irq, NCR_700_intr, SA_SHIRQ, driver_name, host)) {
+		printk(KERN_ERR "%s: irq problem, detatching\n",
+		       driver_name);
 		scsi_unregister(host);
 		NCR_700_release(host);
 		return 1;

Index: drivers/scsi/lasi700.h
===================================================================
RCS file: /home/jejb/CVSROOT/linux/2.4/drivers/scsi/lasi700.h,v retrieving revision 1.1.1.1

scsi/lasi700.h +12 -1
diff -u -r1.1.1.1 lasi700.h
@@ -38,9 +38,19 @@
 	this_id:	7,			\
 }
 
+#define LASI_710_SVERSION	0x082
+#define LASI_700_SVERSION	0x071
+
 #define LASI700_ID_TABLE {			\
+	hw_type:	HPHW_FIO,		\
+	sversion:	LASI_700_SVERSION,	\
+	hversion:	HVERSION_ANY_ID,	\
+	hversion_rev:	HVERSION_REV_ANY_ID,	\
+}
+
+#define LASI710_ID_TABLE {			\
 	hw_type:	HPHW_FIO,		\
-	sversion:	0x071,			\
+	sversion:	LASI_710_SVERSION,	\
 	hversion:	HVERSION_ANY_ID,	\
 	hversion_rev:	HVERSION_REV_ANY_ID,	\
 }
@@ -52,6 +62,7 @@
 }
 
 #define LASI700_CLOCK	25
+#define LASI710_CLOCK	40
 #define LASI_SCSI_CORE_OFFSET 0x100
 
 #endif