Index: drivers/scsi//ncr53c8xx.c
===================================================================
RCS file: /var/cvs/linux/drivers/scsi/ncr53c8xx.c,v
retrieving revision 1.23
diff -u -r1.23 ncr53c8xx.c
--- drivers/scsi//ncr53c8xx.c	2002/06/18 21:49:05	1.23
+++ drivers/scsi//ncr53c8xx.c	2002/06/23 13:01:20
@@ -82,7 +82,7 @@
 **	    Etc...
 **
 **	Supported NCR/SYMBIOS chips:
-**		53C720		(Wide,   Fast SCSI-2, HP Zalon)
+**		53C720		(Wide,   Fast SCSI-2, HP Zalon/Outfield)
 **		53C810		(8 bits, Fast SCSI-2, no rom BIOS) 
 **		53C815		(8 bits, Fast SCSI-2, on board rom BIOS)
 **		53C820		(Wide,   Fast SCSI-2, no rom BIOS)
@@ -194,10 +194,15 @@
 #endif
 
 #if defined(CONFIG_SCSI_ZALON) || defined(CONFIG_SCSI_ZALON_MODULE)
-#define ENABLE_SCSI_ZALON
+#define ENABLE_SCSI_HP720
 #include "zalon7xx.h"
 #endif
 
+#define DMA_CACHE_WBACK(mem, size) dma_cache_wback(mem,size)
+#define DMA_CACHE_INV(mem, size) dma_cache_inv(mem,size)
+#define DMA_CACHE_WBACK_INV(mem, size) dma_cache_wback_inv(mem,size)
+#define DO_BIG_FLUSH(np)	do_big_flush(np);
+
 #include "ncr53c8xx.h"
 
 /*
@@ -232,7 +237,7 @@
 **==========================================================
 */
  
-#define SCSI_NCR_CCB_DONE_SUPPORT
+#undef SCSI_NCR_CCB_DONE_SUPPORT
 #ifdef  SCSI_NCR_CCB_DONE_SUPPORT
 
 #define MAX_DONE 24
@@ -1173,6 +1178,7 @@
 	u_char		msgout[8];	/* Buffer for MESSAGE OUT 	*/
 	u_char		msgin [8];	/* Buffer for MESSAGE IN	*/
 	u_int32		lastmsg;	/* Last SCSI message sent	*/
+	u_int32		ncr_cache;	/* Used for cache test at init.	*/
 	u_char		scratch;	/* Scratch for SCSI receive	*/
 
 	/*----------------------------------------------------------------
@@ -1183,7 +1189,6 @@
 	u_char		scsi_mode;	/* Current SCSI BUS mode	*/
 	u_char		order;		/* Tag order to use		*/
 	u_char		verbose;	/* Verbosity for this controller*/
-	int		ncr_cache;	/* Used for cache test at init.	*/
 	u_long		p_ncb;		/* BUS address of this NCB	*/
 
 	/*----------------------------------------------------------------
@@ -1247,7 +1252,7 @@
 **	return from the subroutine.
 */
 
-#ifdef ENABLE_SCSI_ZALON
+#ifdef ENABLE_SCSI_HP720
 #define PREFETCH_FLUSH_CNT	2
 #define	PREFETCH_FLUSH		SCR_CALL, PADDRH (wait_dma),
 #else
@@ -1372,6 +1377,7 @@
 **==========================================================
 */
 
+static	void	do_big_flush	(ncb_p np);
 static	void	ncr_alloc_ccb	(ncb_p np, u_char tn, u_char ln);
 static	void	ncr_complete	(ncb_p np, ccb_p cp);
 static	void	ncr_exception	(ncb_p np);
@@ -2929,6 +2935,37 @@
 }/*--------------------------------------------------------*/
 };
 
+static void do_big_flush(ncb_p np)
+{
+	ccb_p cp, next_cp;
+	int t, l;
+
+#ifdef SCSI_NCR_CCB_DONE_SUPPORT
+#error SCSI_NCR_CCB_DONE_SUPPORT not supported by do_big_flush()
+#else
+	cp = np->ccb;
+	while (cp) {
+		next_cp = cp->link_ccb;
+		DMA_CACHE_WBACK_INV((u_long)cp, sizeof(*cp));
+		cp = next_cp;
+	}
+#if 1
+	/* Need to flush tag info in lcb; this looks awful, but
+	 * in practice there is porbably only one valid lcb per
+	 * disk.
+	 */
+	for (t = 0; t < 16; t++) {
+		for (l = 0; l < 8; l++) {
+			lcb_p lp = np->target[t].lp[l];
+			if (lp)
+				DMA_CACHE_WBACK_INV((u_long)lp, sizeof(*lp));
+		}
+	}
+#endif
+#endif
+	DMA_CACHE_WBACK_INV((u_long)np, sizeof(*np));
+}
+
 /*==========================================================
 **
 **
@@ -3157,6 +3194,7 @@
 			*dst++ = cpu_to_scr(*src++);
 
 	};
+	DMA_CACHE_WBACK_INV((u_long)(dst - len/4), len);
 }
 
 /*==========================================================
@@ -3238,7 +3276,8 @@
  *	ctest4 for others.
  */
 #define burst_code(dmode, ctest0, ctest4, ctest5) \
-	(np->device_id == PSEUDO_ZALON_720_ID) ? \
+	(np->device_id == PSEUDO_ZALON_720_ID || \
+	 np->device_id == PSEUDO_OUTFIELD_720_ID) ? \
 	(ctest0) & 0x80? 0 : (((dmode) & 0xc0) >> 6) + 1 : \
 	(ctest4) & 0x80? 0 : (((dmode) & 0xc0) >> 6) + ((ctest5) & 0x04) + 1
 
@@ -3247,7 +3286,8 @@
  */
 static inline void ncr_init_burst(ncb_p np, u_char bc)
 {
-	u_char *be = (np->device_id == PSEUDO_ZALON_720_ID) ?
+	u_char *be = (np->device_id == PSEUDO_ZALON_720_ID ||
+			np->device_id == PSEUDO_OUTFIELD_720_ID) ?
 		&np->rv_ctest0 : &np->rv_ctest4;
 
 	*be		&= ~0x80;
@@ -3460,6 +3500,8 @@
 		np->rv_dcntl	|= EA;		/* Enable ACK */
 	if (np->features & FE_EHP)
 		np->rv_ctest0	|= EHP;		/* Even host parity */
+	if (np->features & FE_EPG)
+		np->rv_scntl0	|= EPG;		/* Enable parity generation */
 
 	/*
 	**	Select some other
@@ -3660,7 +3702,7 @@
 	ncr_nvram *nvram = device->nvram;
 	int i;
 
-#ifndef ENABLE_SCSI_ZALON
+#ifndef ENABLE_SCSI_HP720
 	printk(KERN_INFO "ncr53c%s-%d: rev 0x%x on pci bus %d device %d function %d "
 #ifdef __sparc__
 		"irq %s\n",
@@ -3772,7 +3814,7 @@
 	**	Try to map the controller chip into iospace.
 	*/
 
-#ifndef ENABLE_SCSI_ZALON
+#ifndef ENABLE_SCSI_HP720
 	request_region(device->slot.io_port, 128, "ncr53c8xx");
 #endif
 	np->base_io = device->slot.io_port;
@@ -4005,7 +4047,7 @@
 #ifdef DEBUG_NCR53C8XX
 		printk(KERN_DEBUG "%s: releasing IO region %x[%d]\n", ncr_name(np), np->base_io, 128);
 #endif
-#ifndef ENABLE_SCSI_ZALON
+#ifndef ENABLE_SCSI_HP720
 		release_region(np->base_io, 128);
 #endif
 	}
@@ -4713,6 +4755,8 @@
 	**	2 max at a time is enough to flush the CCB wait queue.
 	*/
 	cp->auto_sense = 0;
+	DMA_CACHE_WBACK_INV((u_long)cp, sizeof(*cp));
+	DMA_CACHE_WBACK_INV((u_long)np, sizeof(*np));
 	if (lp)
 		ncr_start_next_ccb(np, lp, 2);
 	else
@@ -4753,6 +4797,7 @@
 		xpt_insque_tail(qp, &lp->busy_ccbq);
 		lp->jump_ccb[cp->tag == NO_TAG ? 0 : cp->tag] =
 			cpu_to_scr(CCB_PHYS (cp, restart));
+		DMA_CACHE_WBACK_INV((u_long)&(lp->jump_ccb[cp->tag == NO_TAG ? 0 : cp->tag]), 4);
 		ncr_put_start_queue(np, cp);
 	}
 }
@@ -4769,8 +4814,10 @@
 	if (qidx >= MAX_START + MAX_START) qidx = 1;
 
 	np->scripth->tryloop [qidx] = cpu_to_scr(NCB_SCRIPT_PHYS (np, idle));
+	DMA_CACHE_WBACK_INV((u_long)&(np->scripth->tryloop [qidx]), 4);
 	MEMORY_BARRIER();
 	np->scripth->tryloop [np->squeueput] = cpu_to_scr(CCB_PHYS (cp, start));
+	DMA_CACHE_WBACK_INV((u_long)&(np->scripth->tryloop [np->squeueput]), 4);
 
 	np->squeueput = qidx;
 	++np->queuedccbs;
@@ -4828,7 +4875,8 @@
 	**	properly set IRQ mode, prior to resetting the bus.
 	*/
 	OUTB (nc_stest3, TE);
-	if (np->device_id != PSEUDO_ZALON_720_ID)
+	if (np->device_id != PSEUDO_ZALON_720_ID &&
+			np->device_id != PSEUDO_OUTFIELD_720_ID)
 		OUTB (nc_dcntl, (np->rv_dcntl & IRQM));
 	OUTB (nc_scntl1, CRST);
 	UDELAY (200);
@@ -5113,7 +5161,7 @@
 #ifdef DEBUG_NCR53C8XX
 	printk("%s: releasing IO region %x[%d]\n", ncr_name(np), np->base_io, 128);
 #endif
-#ifndef ENABLE_SCSI_ZALON
+#ifndef ENABLE_SCSI_HP720
 	release_region(np->base_io, 128);
 #endif
 
@@ -5188,6 +5236,8 @@
 	if (!cp || cp->magic != CCB_MAGIC || !cp->cmd)
 		return;
 
+	DMA_CACHE_INV((u_long)&cp->scsi_status, sizeof(cp->scsi_status));
+	DMA_CACHE_INV((u_long)&cp->host_status, sizeof(cp->host_status));
 	/*
 	**	Print minimal debug information.
 	*/
@@ -5504,17 +5554,22 @@
 		if (j >= MAX_DONE)
 			j = 0;
 
+		DMA_CACHE_INV((u_long)&(np->ccb_done[j]), sizeof(cp));
 		cp = np->ccb_done[j];
 		if (!CCB_DONE_VALID(cp))
 			break;
 
 		np->ccb_done[j] = (ccb_p) CCB_DONE_EMPTY;
+		DMA_CACHE_WBACK_INV((u_long)&(np->ccb_done[j]), sizeof(cp));
 		np->scripth->done_queue[5*j + 4] =
 				cpu_to_scr(NCB_SCRIPT_PHYS (np, done_plug));
+		DMA_CACHE_WBACK_INV((u_long)&(np->scripth->done_queue[5*j + 4]), 4);
 		MEMORY_BARRIER();
 		np->scripth->done_queue[5*i + 4] =
 				cpu_to_scr(NCB_SCRIPT_PHYS (np, done_end));
+		DMA_CACHE_WBACK_INV((u_long)&(np->scripth->done_queue[5*j + 4]), 4);
 
+		DMA_CACHE_INV((u_long)&cp->host_status, 4);
 		if (cp->host_status & HS_DONEMASK)
 			ncr_complete (np, cp);
 		else if (cp->host_status & HS_SKIPMASK)
@@ -5526,6 +5581,7 @@
 #else
 	cp = np->ccb;
 	while (cp) {
+		DMA_CACHE_INV((u_long)&cp->host_status, 4);
 		if (cp->host_status & HS_DONEMASK)
 			ncr_complete (np, cp);
 		else if (cp->host_status & HS_SKIPMASK)
@@ -5570,6 +5626,8 @@
 		OUTB (nc_ctest0, EHP);
 	if (np->features & FE_MUX)
 		OUTB (nc_ctest4, MUX);
+	if (np->features & FE_EPG)
+		OUTB (nc_scntl0, EPG);
 }
 
 
@@ -7410,6 +7468,8 @@
 		np->msgin [0] = M_NOOP;
 		np->msgout[0] = M_NOOP;
 		cp->nego_status = 0;
+		DMA_CACHE_WBACK_INV((u_long)cp, sizeof(*cp));
+		DMA_CACHE_WBACK_INV((u_long)np, sizeof(*np));
 		break;
 
 	case SIR_NEGO_SYNC:
@@ -7429,6 +7489,7 @@
 		*/
 
 		chg = 0;
+		DMA_CACHE_INV((u_long)np->msgin, sizeof(np->msgin));
 		per = np->msgin[3];
 		ofs = np->msgin[4];
 		if (ofs==0) per=255;
@@ -7518,6 +7579,7 @@
 		np->msgout[2] = M_X_SYNC_REQ;
 		np->msgout[3] = per;
 		np->msgout[4] = ofs;
+		DMA_CACHE_WBACK_INV((u_long)np->msgout, sizeof(np->msgout));
 
 		cp->nego_status = NS_SYNC;
 
@@ -7533,6 +7595,7 @@
 			return;
 		}
 		np->msgin [0] = M_NOOP;
+		DMA_CACHE_WBACK_INV((u_long)np->msgin, sizeof(np->msgin));
 
 		break;
 
@@ -7552,6 +7615,7 @@
 		*/
 
 		chg  = 0;
+		DMA_CACHE_INV((u_long)np->msgin, sizeof(np->msgin));
 		wide = np->msgin[3];
 
 		/*
@@ -7614,8 +7678,10 @@
 		np->msgout[1] = 2;
 		np->msgout[2] = M_X_WIDE_REQ;
 		np->msgout[3] = wide;
+		DMA_CACHE_WBACK_INV((u_long)np->msgout, sizeof(np->msgout));
 
 		np->msgin [0] = M_NOOP;
+		DMA_CACHE_WBACK_INV((u_long)np->msgin, sizeof(np->msgin));
 
 		cp->nego_status = NS_WIDE;
 
@@ -8381,6 +8447,7 @@
 	**	Set memory and register.
 	*/
 	np->ncr_cache = cpu_to_scr(host_wr);
+	DMA_CACHE_WBACK_INV((u_long)&np->ncr_cache, 4);
 	OUTL (nc_temp, ncr_wr);
 	/*
 	**	Start script (exchange values)
@@ -9384,6 +9451,7 @@
 
 static u_short	ncr_chip_ids[]   __initdata = {
 	PSEUDO_ZALON_720_ID,
+	PSEUDO_OUTFIELD_720_ID,
 	PCI_DEVICE_ID_NCR_53C810,
 	PCI_DEVICE_ID_NCR_53C815,
 	PCI_DEVICE_ID_NCR_53C820,
@@ -9398,14 +9466,15 @@
 	PCI_DEVICE_ID_NCR_53C1510D
 };
 
-#ifdef ENABLE_SCSI_ZALON
+#ifdef ENABLE_SCSI_HP720
 /*
 **	Attach a 53c720 interfaced via Zalon chip on HP boxes.  
 */
 
 int
-zalon_attach(Scsi_Host_Template *tpnt, unsigned long io_port, 
-	     struct parisc_device *dev, int irq, int unit)
+zalon_attach(Scsi_Host_Template *tpnt, unsigned long io_port,
+		struct parisc_device *dev, int irq,
+		int unit, int outfield)
 {
 	u_short device_id;
 	u_char revision;
@@ -9429,7 +9498,7 @@
 
 	memset(&device, 0, sizeof(ncr_device));
 	chip = 0;
-	device_id = PSEUDO_ZALON_720_ID;
+	device_id = outfield ? PSEUDO_OUTFIELD_720_ID : PSEUDO_ZALON_720_ID;
 	revision = 0;
 	for (i = 0; i < sizeof(ncr_chip_table)/sizeof(ncr_chip_table[0]); i++) {
 		if (device_id != ncr_chip_table[i].device_id)
@@ -9452,12 +9521,20 @@
 	driver_setup.diff_support = 2;
 
 	/*
-	**    The following three are needed before any other access.
+	**    The following are needed before any other accesses.
 	*/
 
-	writeb(0x20, io_port + 0x38); /* DCNTL_REG,  EA  */
-	writeb(0x04, io_port + 0x1b); /* CTEST0_REG, EHP */
-	writeb(0x80, io_port + 0x22); /* CTEST4_REG, MUX */
+	if (outfield) {
+		writeb(0x40, io_port + 0x17); /* ISTAT_REG,  RST */
+		udelay(100);
+		writeb(0x00, io_port + 0x17); /* !ISTAT_REG, RST */
+		writeb(0x20, io_port + 0x38); /* DCNTL_REG,  EA  */
+	}
+	else {	/* zalon */
+		writeb(0x20, io_port + 0x38); /* DCNTL_REG,  EA  */
+		writeb(0x04, io_port + 0x1b); /* CTEST0_REG, EHP */
+		writeb(0x80, io_port + 0x22); /* CTEST4_REG, MUX */
+	}
 
  	/*
 	**    Initialise ncr_device structure with items required by ncr_attach.
@@ -9530,7 +9607,7 @@
 static
 #endif
 #if LINUX_VERSION_CODE >= LinuxVersionCode(2,4,0) || defined(MODULE)
-#ifdef ENABLE_SCSI_ZALON
+#ifdef ENABLE_SCSI_HP720
 Scsi_Host_Template driver_template = SCSI_ZALON;
 #else
 Scsi_Host_Template driver_template = NCR53C8XX;
Index: drivers/scsi//sym53c8xx_comm.h
===================================================================
RCS file: /var/cvs/linux/drivers/scsi/sym53c8xx_comm.h,v
retrieving revision 1.14
diff -u -r1.14 sym53c8xx_comm.h
--- drivers/scsi//sym53c8xx_comm.h	2002/01/03 22:37:18	1.14
+++ drivers/scsi//sym53c8xx_comm.h	2002/06/23 13:01:21
@@ -793,10 +793,19 @@
 	vbp = __m_calloc(&mp0, sizeof(*vbp), "VTOB");
 	if (vbp) {
 		dma_addr_t daddr;
+#ifdef SYM53C8XX_USE_CONSISTENT
 		vp = (m_addr_t) pci_alloc_consistent(mp->bush,
 						PAGE_SIZE<<MEMO_PAGE_ORDER,
 						&daddr);
+#else
+		/* XXX GFP_KERNEL ok here? */
+		vp = (m_addr_t)__get_free_pages(GFP_ATOMIC, MEMO_PAGE_ORDER);
 		if (vp) {
+			daddr = pci_map_single(mp->bush, (void *)vp,
+				PAGE_SIZE<<MEMO_PAGE_ORDER, PCI_DMA_BIDIRECTIONAL);
+		}
+#endif
+		if (vp) {
 			int hc = VTOB_HASH_CODE(vp);
 			vbp->vaddr = vp;
 			vbp->baddr = daddr;
@@ -822,8 +831,14 @@
 	if (*vbpp) {
 		vbp = *vbpp;
 		*vbpp = (*vbpp)->next;
+#ifdef SYM53C8XX_USE_CONSISTENT
 		pci_free_consistent(mp->bush, PAGE_SIZE<<MEMO_PAGE_ORDER,
 				    (void *)vbp->vaddr, (dma_addr_t)vbp->baddr);
+#else
+		pci_unmap_single(mp->bush, (dma_addr_t)vbp->baddr,
+				PAGE_SIZE<<MEMO_PAGE_ORDER, PCI_DMA_BIDIRECTIONAL);
+		free_pages((unsigned long)m, MEMO_PAGE_ORDER);
+#endif
 		__m_free(&mp0, vbp, sizeof(*vbp), "VTOB");
 		--mp->nump;
 	}
Index: drivers/scsi//sym53c8xx_defs.h
===================================================================
RCS file: /var/cvs/linux/drivers/scsi/sym53c8xx_defs.h,v
retrieving revision 1.17
diff -u -r1.17 sym53c8xx_defs.h
--- drivers/scsi//sym53c8xx_defs.h	2002/06/18 21:49:05	1.17
+++ drivers/scsi//sym53c8xx_defs.h	2002/06/23 13:01:23
@@ -78,7 +78,7 @@
 /*
  *	No more an option, enabled by default.
  */
-#ifndef ENABLE_SCSI_ZALON
+#ifndef ENABLE_SCSI_HP720
 #ifndef CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT
 #define CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT
 #endif
@@ -184,7 +184,7 @@
 #elif defined(__sparc__)
 #undef SCSI_NCR_IOMAPPED
 #elif defined(__hppa__)
-#if defined(ENABLE_SCSI_ZALON)
+#if defined(ENABLE_SCSI_HP720)
 #undef SCSI_NCR_IOMAPPED
 #endif
 #endif
@@ -602,7 +602,7 @@
 
 #else
 
-#ifdef ENABLE_SCSI_ZALON
+#ifdef ENABLE_SCSI_HP720
 /* Only 8 or 32 bit transfers allowed */
 #define INW_OFF(o)		(readb((char *)np->reg + ncr_offw(o)) << 8 | readb((char *)np->reg + ncr_offw(o) + 1))
 #else
@@ -610,7 +610,7 @@
 #endif
 #define INL_OFF(o)		readl_raw((char *)np->reg + (o))
 
-#ifdef ENABLE_SCSI_ZALON
+#ifdef ENABLE_SCSI_HP720
 /* Only 8 or 32 bit transfers allowed */
 #define OUTW_OFF(o, val)	do { writeb((char)((val) >> 8), (char *)np->reg + ncr_offw(o)); writeb((char)(val), (char *)np->reg + ncr_offw(o) + 1); } while (0)
 #else
@@ -648,12 +648,14 @@
  */
 #define OUTL_DSP(v)				\
 	do {					\
+		DO_BIG_FLUSH(np);		\
 		MEMORY_BARRIER();		\
 		OUTL (nc_dsp, (v));		\
 	} while (0)
 
 #define OUTONB_STD()				\
 	do {					\
+		DO_BIG_FLUSH(np);		\
 		MEMORY_BARRIER();		\
 		OUTONB (nc_dcntl, (STD|NOCOM));	\
 	} while (0)
@@ -667,6 +669,10 @@
 #define PSEUDO_ZALON_720_ID 0x5a00
 #endif
 
+#ifndef PSEUDO_OUTFIELD_720_ID
+#define PSEUDO_OUTFIELD_720_ID 0x5a01
+#endif
+
 #ifndef PCI_DEVICE_ID_NCR_53C810
 #define PCI_DEVICE_ID_NCR_53C810 1
 #endif
@@ -773,6 +779,7 @@
 #define FE_EHP		(1<<27)   /* 720: Even host parity */
 #define FE_MUX		(1<<28)   /* 720: Multiplexed bus */
 #define FE_EA		(1<<29)   /* 720: Enable Ack */
+#define FE_EPG		(1<<30)   /* 720: Enable Parity Generation */
 
 #define FE_CACHE_SET	(FE_ERL|FE_CLSE|FE_WRIE|FE_ERMP)
 #define FE_SCSI_SET	(FE_WIDE|FE_ULTRA|FE_ULTRA2|FE_DBLR|FE_QUAD|F_CLK80)
@@ -797,6 +804,9 @@
  {PSEUDO_ZALON_720_ID, 0x0f, "720",  3,  8, 4,				\
  FE_WIDE|FE_DIFF|FE_EHP|FE_MUX|FE_EA}					\
  ,									\
+ {PSEUDO_OUTFIELD_720_ID, 0x0f, "720",  4,  8, 4,			\
+ FE_WIDE|FE_DIFF|FE_EA|FE_EPG}						\
+ ,									\
  {PCI_DEVICE_ID_NCR_53C810, 0x0f, "810",  4,  8, 4,			\
  FE_ERL}								\
  ,									\
@@ -870,6 +880,7 @@
 #define SCSI_NCR_CHIP_IDS		\
 {					\
 	PSEUDO_ZALON_720_ID,		\
+	PSEUDO_OUTFIELD_720_ID,		\
 	PCI_DEVICE_ID_NCR_53C810,	\
 	PCI_DEVICE_ID_NCR_53C815,	\
 	PCI_DEVICE_ID_NCR_53C820,	\
@@ -1124,6 +1135,7 @@
 
 struct ncr_reg {
 /*00*/  u_char    nc_scntl0;    /* full arb., ena parity, par->ATN  */
+	#define   EPG     0x04  /* 720: enable parity generation    */
 
 /*01*/  u_char    nc_scntl1;    /* no reset                         */
         #define   ISCON   0x10  /* connected to scsi		    */
Index: drivers/scsi//zalon7xx.c
===================================================================
RCS file: /var/cvs/linux/drivers/scsi/zalon7xx.c,v
retrieving revision 1.14
diff -u -r1.14 zalon7xx.c
--- drivers/scsi//zalon7xx.c	2002/06/18 21:49:05	1.14
+++ drivers/scsi//zalon7xx.c	2002/06/23 13:01:23
@@ -45,7 +45,8 @@
 			unsigned long base_addr,
 			struct parisc_device *dev,
 			int irq_vector,
-			int unit
+			int unit,
+			int outfield
 			);
 
 
@@ -86,36 +87,52 @@
 	struct gsc_irq gsc_irq;
 	u32 zalon_vers;
 	int irq;
-	unsigned long zalon = dev->hpa;
+	int zalon = (dev->id.sversion == 0x0089);
 
-	__raw_writel(CMD_RESET, zalon + IO_MODULE_IO_COMMAND);
-	while (!(__raw_readl(zalon + IO_MODULE_IO_STATUS) & IOSTATUS_RY))
-		;
-	__raw_writel(IOIIDATA_MINT5EN | IOIIDATA_PACKEN | IOIIDATA_PREFETCHEN,
-		zalon + IO_MODULE_II_CDATA);
-
-	/* XXX: Save the Zalon version for bug workarounds? */
-	zalon_vers = __raw_readl(dev->hpa + IO_MODULE_II_CDATA) & 0x07000000;
-	zalon_vers >>= 24;
-
 	/* Setup the interrupts first.
 	** Later on request_irq() will register the handler.
 	*/
-        irq = gsc_alloc_irq(&gsc_irq);
+	irq = gsc_alloc_irq(&gsc_irq);
 
-	printk("%s: Zalon vers field is 0x%x, IRQ %d\n", __FUNCTION__,
-		zalon_vers, irq);
+	if (zalon) {
+		__raw_writel(CMD_RESET, dev->hpa + IO_MODULE_IO_COMMAND);
+		while (!(__raw_readl(dev->hpa + IO_MODULE_IO_STATUS) & IOSTATUS_RY))
+			;
+		__raw_writel(IOIIDATA_MINT5EN | IOIIDATA_PACKEN | IOIIDATA_PREFETCHEN,
+			dev->hpa + IO_MODULE_II_CDATA);
+
+		/* XXX: Save the Zalon version for bug workarounds? */
+		zalon_vers = __raw_readl(dev->hpa + IO_MODULE_II_CDATA) & 0x07000000;
+		zalon_vers >>= 24;
+
+		printk("%s: Zalon vers field is 0x%x, IRQ %d\n", __FUNCTION__,
+			zalon_vers, irq);
+		if ( zalon_vers == 0)
+			printk(KERN_WARNING "%s: Zalon 1.1 or earlier\n", __FUNCTION__);
 
-	__raw_writel(gsc_irq.txn_addr | gsc_irq.txn_data, dev->hpa + IO_MODULE_EIM);
+	}
+	else {
+#if 0
+		/*
+		** This is code from scsi_c700.c.
+		** Maybe I'm getting away with not doing it because it's done by IODC.
+		*/
+		if (NCR_OUTFIELD(isc))
+		{
+		    /* Set burst limit for cutoff chip (735 & 755) ONLY. */
+		    *((char *)0xf0830004) = 0x02;
+		    /* Do we need "*((char *)0xf0830000) = 0x00;" too??? */
+		}
+#endif
+	}
 
-	if ( zalon_vers == 0)
-		printk(KERN_WARNING "%s: Zalon 1.1 or earlier\n", __FUNCTION__);
+	__raw_writel(gsc_irq.txn_addr | gsc_irq.txn_data, dev->hpa + IO_MODULE_EIM);
 
 	/*
 	**  zalon_attach: returns -1 on failure, 0 on success
 	*/
 	hosts_used = zalon_attach(hosts_tptr, dev->hpa + GSC_SCSI_ZALON_OFFSET,
-			dev, irq, zalon_id);
+			dev, irq, zalon_id, !zalon /* outfield */);
 
 	if (hosts_used == 0)
 		zalon_id++;
@@ -124,15 +141,17 @@
 	return (hosts_used == 0);
 }
 
+
 static struct parisc_device_id zalon_tbl[] = {
 	{ HPHW_A_DMA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00089 }, 
+	{ HPHW_FIO,   HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0007c }, 
 	{ 0, }
 };
 
 MODULE_DEVICE_TABLE(parisc, zalon_tbl);
 
 static struct parisc_driver zalon_driver = {
-	name:		"GSC SCSI (Zalon)",
+	name:		"720 SCSI (Zalon/Outfield)",
 	id_table:	zalon_tbl,
 	probe:		zalon_scsi_callback,
 };
@@ -145,6 +164,8 @@
 
 	/* claim all zalon cards. */
 	register_parisc_driver(&zalon_driver);
+	if (!zalon_id)
+		unregister_parisc_driver(&zalon_driver);
 
 	/* Check if any callbacks actually found/claimed anything. */
 	return (hosts_used != 0);
Index: drivers/scsi//zalon7xx.h
===================================================================
RCS file: /var/cvs/linux/drivers/scsi/zalon7xx.h,v
retrieving revision 1.4
diff -u -r1.4 zalon7xx.h
--- drivers/scsi//zalon7xx.h	2002/06/18 21:49:05	1.4
+++ drivers/scsi//zalon7xx.h	2002/06/23 13:01:23
@@ -39,7 +39,8 @@
 			use_clustering: DISABLE_CLUSTERING} 
 
 
-#define GSC_SCSI_ZALON_OFFSET 0x800
+#define GSC_SCSI_ZALON_OFFSET	0x800
+#define SCSI_OUTFIELD_OFFSET	0x100
 
 #define IO_MODULE_EIM		(1*4)
 #define IO_MODULE_DC_ADATA	(2*4)
