Commit bf8022f7 authored by James Bottomley's avatar James Bottomley

Eliminate really old ncr53c8xx driver

- Remove direct configuration of this driver
- Only remaining use is in the parisc zalon driver
- Split the driver up to make it more use to 720 based drivers
- Update zalon to new module/SCSI methods
parent 62b1ea27
......@@ -953,27 +953,6 @@ config SCSI_ZALON
used on the add-in Bluefish, Barracuda & Shrike SCSI cards.
Say Y here if you have one of these machines or cards.
config SCSI_NCR53C8XX
tristate "NCR53C8XX SCSI support"
depends on PCI && SCSI_SYM53C8XX_2!=y && SCSI_ZALON!=y && SCSI
---help---
This is the BSD ncr driver adapted to Linux for the NCR53C8XX family
of PCI-SCSI controllers. This driver supports parity checking,
tagged command queuing and fast synchronous data transfers up to 80
MB/s with wide FAST-40 LVD devices and controllers.
Recent versions of the 53C8XX chips are better supported by the
option "SYM53C8XX SCSI support", below.
Note: there is yet another driver for the 53c8xx family of
controllers ("NCR53c7,8xx SCSI support" above). If you want to use
them both, you need to say M to both and build them as modules, but
only one may be active at a time. If you have a 53c8xx board, you
probably do not want to use the "NCR53c7,8xx SCSI support".
Please read <file:Documentation/scsi/ncr53c8xx.txt> for more
information.
config SCSI_SYM53C8XX
tristate "SYM53C8XX SCSI support"
depends on PCI && SCSI_SYM53C8XX_2!=y && SCSI
......@@ -1002,8 +981,8 @@ config SCSI_SYM53C8XX
information.
config SCSI_NCR53C8XX_DEFAULT_TAGS
int "default tagged command queue depth"
depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX || SCSI_ZALON)
int " default tagged command queue depth"
depends on (SCSI_SYM53C8XX || SCSI_ZALON || SCSI_NCR_Q720)
default "8"
---help---
"Tagged command queuing" is a feature of SCSI-2 which improves
......@@ -1028,8 +1007,8 @@ config SCSI_NCR53C8XX_DEFAULT_TAGS
There is no safe option other than using good SCSI devices.
config SCSI_NCR53C8XX_MAX_TAGS
int "maximum number of queued commands"
depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX || SCSI_ZALON)
int " maximum number of queued commands"
depends on (SCSI_SYM53C8XX || SCSI_ZALON || SCSI_NCR_Q720)
default "32"
---help---
This option allows you to specify the maximum number of commands
......@@ -1045,8 +1024,8 @@ config SCSI_NCR53C8XX_MAX_TAGS
There is no safe option and the default answer is recommended.
config SCSI_NCR53C8XX_SYNC
int "synchronous transfers frequency in MHz"
depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX || SCSI_ZALON)
int " synchronous transfers frequency in MHz"
depends on (SCSI_SYM53C8XX || SCSI_ZALON || SCSI_NCR_Q720)
default "20"
---help---
The SCSI Parallel Interface-2 Standard defines 5 classes of transfer
......@@ -1079,8 +1058,8 @@ config SCSI_NCR53C8XX_SYNC
terminations and SCSI conformant devices.
config SCSI_NCR53C8XX_PROFILE
bool "enable profiling"
depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX || SCSI_ZALON)
bool " enable profiling"
depends on (SCSI_SYM53C8XX || SCSI_ZALON || SCSI_NCR_Q720)
help
This option allows you to enable profiling information gathering.
These statistics are not very accurate due to the low frequency
......@@ -1090,8 +1069,8 @@ config SCSI_NCR53C8XX_PROFILE
The normal answer therefore is N.
config SCSI_NCR53C8XX_IOMAPPED
bool "use normal IO"
depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX) && !SCSI_ZALON
bool " use normal IO"
depends on SCSI_SYM53C8XX && !(SCSI_ZALON || SCSI_NCR_Q720)
help
If you say Y here, the driver will use normal IO, as opposed to
memory mapped IO. Memory mapped IO has less latency than normal IO
......@@ -1103,8 +1082,8 @@ config SCSI_NCR53C8XX_IOMAPPED
related problems.
config SCSI_NCR53C8XX_PQS_PDS
bool "include support for the NCR PQS/PDS SCSI card"
depends on (SCSI_NCR53C8XX || SCSI_SYM53C8XX) && SCSI_SYM53C8XX
bool " include support for the NCR PQS/PDS SCSI card"
depends on SCSI_SYM53C8XX
help
Say Y here if you have a special SCSI adapter produced by NCR
corporation called a PCI Quad SCSI or PCI Dual SCSI. You do not need
......@@ -1115,8 +1094,8 @@ config SCSI_NCR53C8XX_PQS_PDS
The common answer here is N, but answering Y is safe.
config SCSI_NCR53C8XX_NO_DISCONNECT
bool "not allow targets to disconnect"
depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX || SCSI_ZALON) && SCSI_NCR53C8XX_DEFAULT_TAGS=0
bool " not allow targets to disconnect"
depends on (SCSI_SYM53C8XX || SCSI_ZALON || SCSI_NCR_Q720) && SCSI_NCR53C8XX_DEFAULT_TAGS=0
help
This option is only provided for safety if you suspect some SCSI
device of yours to not support properly the target-disconnect
......@@ -1125,8 +1104,8 @@ config SCSI_NCR53C8XX_NO_DISCONNECT
than 1 device on a SCSI bus. The normal answer therefore is N.
config SCSI_NCR53C8XX_SYMBIOS_COMPAT
bool "assume boards are SYMBIOS compatible (EXPERIMENTAL)"
depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX || SCSI_ZALON) && EXPERIMENTAL
bool " assume boards are SYMBIOS compatible (EXPERIMENTAL)"
depends on (SCSI_SYM53C8XX || SCSI_ZALON || SCSI_NCR_Q720 ) && EXPERIMENTAL
---help---
This option allows you to enable some features depending on GPIO
wiring. These General Purpose Input/Output pins can be used for
......
......@@ -81,7 +81,6 @@ obj-$(CONFIG_SCSI_DMX3191D) += dmx3191d.o
obj-$(CONFIG_SCSI_DTC3280) += dtc.o
obj-$(CONFIG_SCSI_SYM53C8XX_2) += sym53c8xx_2/
obj-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o
obj-$(CONFIG_SCSI_NCR53C8XX) += ncr53c8xx.o
obj-$(CONFIG_SCSI_ZALON) += zalon7xx.o
obj-$(CONFIG_SCSI_EATA_PIO) += eata_pio.o
obj-$(CONFIG_SCSI_7000FASST) += wd7000.o
......@@ -133,6 +132,12 @@ sd_mod-objs := sd.o
sr_mod-objs := sr.o sr_ioctl.o sr_vendor.o
initio-objs := ini9100u.o i91uscsi.o
a100u2w-objs := inia100.o i60uscsi.o
ncr53c8xx-flags-$(CONFIG_SCSI_ZALON) \
:= -DCONFIG_NCR53C8XX_PREFETCH \
-DCONFIG_SCSI_NCR53C8XX_NO_WORD_TRANSFERS \
-DCONFIG_SCSI_NCR53C8XX_NO_NVRAM \
-DSCSI_NCR_BIG_ENDIAN -DSIMULATED_INTFLY
CFLAGS_ncr53c8xx.o := $(ncr53c8xx-flags-y) $(ncr53c8xx-flags-m)
zalon7xx-objs := zalon.o ncr53c8xx.o
cpqfc-objs := cpqfcTSinit.o cpqfcTScontrol.o cpqfcTSi2c.o \
cpqfcTSworker.o cpqfcTStrigger.o
......
This diff is collapsed.
......@@ -42,6 +42,79 @@
#ifndef NCR53C8XX_H
#define NCR53C8XX_H
/*
** Define the BSD style u_int32 and u_int64 type.
** Are in fact u_int32_t and u_int64_t :-)
*/
typedef u32 u_int32;
typedef u64 u_int64;
typedef u_long vm_offset_t;
#include "sym53c8xx_defs.h"
/*==========================================================
**
** Structures used by the detection routine to transmit
** device configuration to the attach function.
**
**==========================================================
*/
typedef struct {
int bus;
u_char device_fn;
u_long base;
u_long base_2;
u_long io_port;
u_long base_c;
u_long base_2_c;
u_long base_v;
u_long base_2_v;
int irq;
/* port and reg fields to use INB, OUTB macros */
u_long base_io;
volatile struct ncr_reg *reg;
} ncr_slot;
/*==========================================================
**
** Structure used to store the NVRAM content.
**
**==========================================================
*/
typedef struct {
int type;
#define SCSI_NCR_SYMBIOS_NVRAM (1)
#define SCSI_NCR_TEKRAM_NVRAM (2)
#ifdef SCSI_NCR_NVRAM_SUPPORT
union {
Symbios_nvram Symbios;
Tekram_nvram Tekram;
} data;
#endif
} ncr_nvram;
/*==========================================================
**
** Structure used by detection routine to save data on
** each detected board for attach.
**
**==========================================================
*/
typedef struct {
struct device *dev;
ncr_slot slot;
ncr_chip chip;
ncr_nvram *nvram;
u_char host_id;
#ifdef SCSI_NCR_PQS_PDS_SUPPORT
u_char pqs_pds;
#endif
__u8 differential;
int attach_done;
} ncr_device;
extern struct Scsi_Host *ncr_attach (Scsi_Host_Template *tpnt, int unit, ncr_device *device);
extern int ncr53c8xx_release(struct Scsi_Host *host);
irqreturn_t ncr53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs);
#endif /* NCR53C8XX_H */
......@@ -795,7 +795,7 @@ static m_addr_t ___dma_getp(m_pool_s *mp)
dma_addr_t daddr;
vp = (m_addr_t) dma_alloc_coherent(mp->bush,
PAGE_SIZE<<MEMO_PAGE_ORDER,
&daddr, GFP_KERNEL);
&daddr, GFP_ATOMIC);
if (vp) {
int hc = VTOB_HASH_CODE(vp);
vbp->vaddr = vp;
......@@ -1098,66 +1098,6 @@ static struct ncr_driver_setup
#define bootverbose (np->verbose)
/*==========================================================
**
** Structures used by the detection routine to transmit
** device configuration to the attach function.
**
**==========================================================
*/
typedef struct {
int bus;
u_char device_fn;
u_long base;
u_long base_2;
u_long io_port;
u_long base_c;
u_long base_2_c;
int irq;
/* port and reg fields to use INB, OUTB macros */
u_long base_io;
volatile struct ncr_reg *reg;
} ncr_slot;
/*==========================================================
**
** Structure used to store the NVRAM content.
**
**==========================================================
*/
typedef struct {
int type;
#define SCSI_NCR_SYMBIOS_NVRAM (1)
#define SCSI_NCR_TEKRAM_NVRAM (2)
#ifdef SCSI_NCR_NVRAM_SUPPORT
union {
Symbios_nvram Symbios;
Tekram_nvram Tekram;
} data;
#endif
} ncr_nvram;
/*==========================================================
**
** Structure used by detection routine to save data on
** each detected board for attach.
**
**==========================================================
*/
typedef struct {
device_t dev;
ncr_slot slot;
ncr_chip chip;
ncr_nvram *nvram;
u_char host_id;
#ifdef SCSI_NCR_PQS_PDS_SUPPORT
u_char pqs_pds;
#endif
int attach_done;
} ncr_device;
static int ncr_attach (Scsi_Host_Template *tpnt, int unit, ncr_device *device);
/*==========================================================
**
** NVRAM detection and reading.
......
......@@ -85,7 +85,7 @@
/*
* No more an option, enabled by default.
*/
#ifndef ENABLE_SCSI_ZALON
#ifndef CONFIG_SCSI_NCR53C8XX_NO_NVRAM
# ifndef CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT
# define CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT
# endif
......@@ -188,10 +188,6 @@
#define SCSI_NCR_IOMAPPED
#define SCSI_NCR_PCI_MEM_NOT_SUPPORTED
#endif
#elif defined(__sparc__)
#undef SCSI_NCR_IOMAPPED
#elif defined(__hppa__) && defined(ENABLE_SCSI_ZALON)
#undef SCSI_NCR_IOMAPPED
#endif
/*
......@@ -532,7 +528,6 @@
*/
#if defined(SCSI_NCR_IOMAPPED)
/*
* IO mapped only input / ouput
*/
......@@ -593,7 +588,7 @@
#else
#ifdef ENABLE_SCSI_ZALON
#ifdef CONFIG_SCSI_NCR53C8XX_NO_WORD_TRANSFERS
/* 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
......@@ -601,7 +596,7 @@
#endif
#define INL_OFF(o) readl_raw((char *)np->reg + (o))
#ifdef ENABLE_SCSI_ZALON
#ifdef CONFIG_SCSI_NCR53C8XX_NO_WORD_TRANSFERS
/* 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
......@@ -654,8 +649,8 @@
** NCR53C8XX Device Ids
*/
#ifndef PSEUDO_ZALON_720_ID
#define PSEUDO_ZALON_720_ID 0x5a00
#ifndef PSEUDO_720_ID
#define PSEUDO_720_ID 0x5a00
#endif
#ifndef PCI_DEVICE_ID_NCR_53C810
......@@ -785,7 +780,7 @@ typedef struct {
#define SCSI_NCR_CHIP_TABLE \
{ \
{PSEUDO_ZALON_720_ID, 0x0f, "720", 3, 8, 4, \
{PSEUDO_720_ID, 0x0f, "720", 3, 8, 4, \
FE_WIDE|FE_DIFF|FE_EHP|FE_MUX|FE_EA} \
, \
{PCI_DEVICE_ID_NCR_53C810, 0x0f, "810", 4, 8, 4, \
......@@ -860,7 +855,7 @@ typedef struct {
*/
#define SCSI_NCR_CHIP_IDS \
{ \
PSEUDO_ZALON_720_ID, \
PSEUDO_720_ID, \
PCI_DEVICE_ID_NCR_53C810, \
PCI_DEVICE_ID_NCR_53C815, \
PCI_DEVICE_ID_NCR_53C820, \
......
......@@ -24,30 +24,24 @@
#include "scsi.h"
#include "hosts.h"
/*
* ** Define the BSD style u_int32 and u_int64 type.
* ** Are in fact u_int32_t and u_int64_t :-)
* */
typedef u32 u_int32;
typedef u64 u_int64;
typedef u_long vm_offset_t;
#include "ncr53c8xx.h"
#include "zalon.h"
MODULE_AUTHOR("Richard Hirst");
MODULE_DESCRIPTION("Bluefish/Zalon 720 SCSI Driver");
MODULE_LICENSE("GPL");
static ncr_chip zalon720_chip __initdata = {
.device_id = PSEUDO_720_ID,
.revision_id = 0x0f,
.name = "720",
.burst_max = 3,
.offset_max = 8,
.nr_divisor = 4,
.features = FE_WIDE | FE_DIFF | FE_EHP| FE_MUX | FE_EA,
};
/* hosts_* are kluges to pass info between the zalon7xx_detected()
** and the register_parisc_driver() callbacks.
*/
static Scsi_Host_Template *hosts_tptr;
static int hosts_used=0;
static int zalon_id = 0;
extern int zalon_attach(Scsi_Host_Template *tpnt,
unsigned long base_addr,
struct parisc_device *dev,
int irq_vector,
int unit
);
#if 0
......@@ -81,6 +75,11 @@ lasi_scsi_clock(void * hpa, int defaultclock)
}
#endif
static Scsi_Host_Template zalon7xx_template = {
.module = THIS_MODULE,
.proc_name = "zalon7xx",
};
static int __init
zalon_scsi_callback(struct parisc_device *dev)
{
......@@ -88,6 +87,10 @@ zalon_scsi_callback(struct parisc_device *dev)
u32 zalon_vers;
int irq;
unsigned long zalon = dev->hpa;
unsigned long io_port = zalon + GSC_SCSI_ZALON_OFFSET;
static int unit = 0;
struct Scsi_Host *host;
ncr_device device;
__raw_writel(CMD_RESET, zalon + IO_MODULE_IO_COMMAND);
while (!(__raw_readl(zalon + IO_MODULE_IO_STATUS) & IOSTATUS_RY))
......@@ -112,17 +115,43 @@ zalon_scsi_callback(struct parisc_device *dev)
if ( zalon_vers == 0)
printk(KERN_WARNING "%s: Zalon 1.1 or earlier\n", __FUNCTION__);
/*
** 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);
memset(&device, 0, sizeof(ncr_device));
/* The following three are needed before any other access. */
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. */
device.chip = zalon720_chip;
device.host_id = 7;
device.dev = &dev->dev;
device.slot.base = (u_long)io_port;
device.slot.base_c = (u_long)io_port;
device.slot.irq = irq;
device.differential = 2;
host = ncr_attach(&zalon7xx_template, unit, &device);
if(!host)
goto fail;
strlcpy(dev->dev.name, "zalon7xx", sizeof(dev->dev.name));
if(request_irq(irq, ncr53c8xx_intr, SA_SHIRQ, dev->dev.name, host)) {
printk(KERN_ERR "%s: irq problem with %d, detaching\n ",
dev->dev.name, irq);
goto fail;
}
unit++;
if (hosts_used == 0)
zalon_id++;
dev_set_drvdata(&dev->dev, host);
hosts_used = (hosts_used == 0);
return (hosts_used == 0);
scsi_add_host(host, &dev->dev);
return 0;
fail:
return -ENODEV;
}
static struct parisc_device_id zalon_tbl[] = {
......@@ -132,30 +161,35 @@ static struct parisc_device_id zalon_tbl[] = {
MODULE_DEVICE_TABLE(parisc, zalon_tbl);
static int __exit zalon_remove(struct parisc_device *dev)
{
struct Scsi_Host *host = dev_get_drvdata(&dev->dev);
int irq = host->irq;
scsi_remove_host(host);
ncr53c8xx_release(host);
free_irq(irq, host);
return 0;
}
static struct parisc_driver zalon_driver = {
.name = "GSC SCSI (Zalon)",
.id_table = zalon_tbl,
.probe = zalon_scsi_callback,
.remove = __devexit_p(zalon_remove),
};
int zalon7xx_detect(Scsi_Host_Template *tpnt)
static int __init zalon7xx_init(void)
{
/* "pass" the parameter to the callback functions */
hosts_tptr = tpnt;
hosts_used = 0;
/* claim all zalon cards. */
register_parisc_driver(&zalon_driver);
/* Check if any callbacks actually found/claimed anything. */
return (hosts_used != 0);
return register_parisc_driver(&zalon_driver);
}
extern int ncr53c8xx_release(struct Scsi_Host *host);
int zalon7xx_release(struct Scsi_Host *host)
static void __exit zalon7xx_exit(void)
{
ncr53c8xx_release(host);
unregister_parisc_driver(&zalon_driver);
return 1;
}
module_init(zalon7xx_init);
module_exit(zalon7xx_exit);
......@@ -2,21 +2,8 @@
#define ZALON7XX_H
#include <linux/types.h>
#include "sym53c8xx_defs.h"
extern int zalon7xx_detect(Scsi_Host_Template *);
#include <scsi/scsicam.h>
extern struct proc_dir_entry proc_scsi_zalon7xx;
/* borrowed from drivers/scsi/ncr53c8xx.h */
int zalon7xx_detect(Scsi_Host_Template *tpnt);
const char *ncr53c8xx_info(struct Scsi_Host *host);
int ncr53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int zalon7xx_release(struct Scsi_Host *);
#define GSC_SCSI_ZALON_OFFSET 0x800
#define IO_MODULE_EIM (1*4)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment