53c700 SCSI driver (for NCRD700 MCA and HPPA lasi)
PATCH 1/1 53c700 SCSI driver (for NCRD700 MCA and HPPA lasi)
Hi Alan,
A while ago (14 May) you asked Richard Hirst and I to come to agreement over our two drivers for the 53c700 chip. We've now agreed that I'll maintain both the NCR Dual 700 microchannel SCSI card and the PARISC LASI SCSI interface which Richard was previously writing. We've spent most of the last 3+ months getting the internals of the core driver to work on the PARISC.
The driver works well on the Dual 700 (I now trust it to be the root filesys driver for my voyager system), but it is still rather dangerous on the PARISC since we believe there are still lurking memory coherency issues. Linuxcare is shipping me some HP equipment which will hopefully allow me to knock the remaining kinks out of the lasi driver.
The changes in this patch are
- Apply the patches suggested by Rasmus Andersen, Keith Owens and others.
- Add the lasi700 driver for PARISC.
- Make the 53c700 core memory mapped as well as io mapped.
- Make the driver endian neutral (to drive the chip little endian on a BE arch).
- Add memory coherency instructions.
Any comments will be gratefully received (especially any about missing/needed memory coherency instructions).
James Bottomley
Index: linux/2.4/MAINTAINERS
2.4/MAINTAINERS renamed from 2.4/MAINTAINERS:1.1.1.23 +6 -0
@@ -843,6 +843,12 @@ L: [email protected] S: Maintained +LASI 53c700 driver for PARISC +P: James E.J. Bottomley +M: [email protected] +L: [email protected] +S: Maintained + LINUX FOR IBM pSERIES (RS/6000) P: Paul Mackerras M: [email protected]
Index: linux/2.4/drivers/scsi/53c700.c
2.4/drivers/scsi/53c700.c renamed from 2.4/drivers/scsi/53c700.c:1.1.1.2 +231 -134
767 lines not on this page · raw message
Index: linux/2.4/drivers/scsi/53c700.h
2.4/drivers/scsi/53c700.h renamed from 2.4/drivers/scsi/53c700.h:1.1.1.1 +155 -12
247 lines not on this page · raw message
Index: linux/2.4/drivers/scsi/Config.in
2.4/drivers/scsi/Config.in renamed from 2.4/drivers/scsi/Config.in:1.1.1.17 +1 -0
@@ -116,6 +116,7 @@ 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 +dep_tristate 'HP LASI SCSI support for 53c700' CONFIG_SCSI_LASI700 $CONFIG_SCSI $CONFIG_PARISC dep_tristate 'NCR53c7,8xx SCSI support' CONFIG_SCSI_NCR53C7xx $CONFIG_SCSI $CONFIG_PCI if [ "$CONFIG_SCSI_NCR53C7xx" != "n" ]; then bool ' always negotiate synchronous transfers' CONFIG_SCSI_NCR53C7xx_sync
Index: linux/2.4/drivers/scsi/Makefile
2.4/drivers/scsi/Makefile renamed from 2.4/drivers/scsi/Makefile:1.1.1.16 +10 -3
@@ -31,7 +31,7 @@ endif endif -export-objs := scsi_syms.o 53c700.o +export-objs := scsi_syms.o 53c700.o 53c700-mem.o CFLAGS_aha152x.o = -DAHA152X_STAT -DAUTOCONF CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS
@@ -125,6 +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 ifeq ($(CONFIG_ARCH_ACORN),y) mod-subdirs += ../acorn/scsi
@@ -200,13 +201,19 @@ 53c700_d.h: 53c700.scr script_asm.pl $(PERL) -s script_asm.pl -ncr7x0_family < 53c700.scr + rm -f scriptu.h mv script.h 53c700_d.h - mv scriptu.h 53c700_u.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 $< >> $@ + cpqfc.o: cpqfcTSinit.o cpqfcTScontrol.o cpqfcTSi2c.o cpqfcTSworker.o \ cpqfcTStrigger.o $(LD) -r -o cpqfc.o cpqfcTSinit.o cpqfcTScontrol.o \ cpqfcTSi2c.o cpqfcTSworker.o cpqfcTStrigger.o -
Index: linux/2.4/drivers/scsi/NCR_D700.c
2.4/drivers/scsi/NCR_D700.c renamed from 2.4/drivers/scsi/NCR_D700.c:1.1.1.1 +8 -6
@@ -126,16 +126,13 @@#define STATIC static#endif -#ifdef MODULE -char *NCR_D700 ;/* command line from insmod */ MODULE_AUTHOR ("James Bottomley" );MODULE_DESCRIPTION ("NCR Dual700 SCSI Driver" ); +MODULE_LICENSE ("GPL" );MODULE_PARM (NCR_D700 ,"s" ); -#endif -static __u8 __initdata id_array[2 *(MCA_MAX_SLOT_NR +1 )] = { [0 ...2 *(MCA_MAX_SLOT_NR +1 )-1 ] =7 };
@@ -274,7 +271,11 @@continue ; }memset (hostdata,0 ,sizeof (struct NCR_700_Host_Parameters )); -request_region (region,64 ,"NCR_D700" ); +if (request_region (region,64 ,"NCR_D700" ) ==NULL ) { +printk (KERN_ERR "NCR D700: Failed to reserve IO region 0x%x\n" , region); +kfree (hostdata); +continue ; + }/* Fill in the three required pieces of hostdata */ hostdata->base = region;
@@ -283,6 +284,7 @@/* and register the chip */ if ((host =NCR_700_detect (tpnt, hostdata)) ==NULL ) {kfree (hostdata); +release_region (host->base,64 );continue ; } host->irq = irq;
@@ -292,8 +294,8 @@ i, host->this_id);if (request_irq (irq, NCR_700_intr,SA_SHIRQ ,"NCR_D700" , host)) {printk (KERN_ERR "NCR D700, channel %d: irq problem, detatching\n" , i); +scsi_unregister (host);NCR_700_release (host); -release_region (host->base,64 );continue ; } found++;
Index: linux/2.4/drivers/scsi/lasi700.c
2.4/drivers/scsi/lasi700.c new file +188 -0
188 lines not on this page · raw message
Index: linux/2.4/drivers/scsi/lasi700.h
2.4/drivers/scsi/lasi700.h new file +57 -0
57 lines not on this page · raw message