diff options
-rw-r--r-- | drivers/scsi/Kconfig | 16 | ||||
-rw-r--r-- | drivers/scsi/Makefile | 1 | ||||
-rw-r--r-- | drivers/scsi/zorro7xx.c | 181 |
3 files changed, 189 insertions, 9 deletions
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 8e53586a3f12..874cfee29358 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig | |||
@@ -1008,7 +1008,7 @@ config SCSI_STEX | |||
1008 | 1008 | ||
1009 | config 53C700_BE_BUS | 1009 | config 53C700_BE_BUS |
1010 | bool | 1010 | bool |
1011 | depends on SCSI_A4000T || MVME16x_SCSI || BVME6000_SCSI | 1011 | depends on SCSI_A4000T || SCSI_ZORRO7XX || MVME16x_SCSI || BVME6000_SCSI |
1012 | default y | 1012 | default y |
1013 | 1013 | ||
1014 | config SCSI_SYM53C8XX_2 | 1014 | config SCSI_SYM53C8XX_2 |
@@ -1625,11 +1625,13 @@ config SCSI_A4000T | |||
1625 | To compile this driver as a module, choose M here: the | 1625 | To compile this driver as a module, choose M here: the |
1626 | module will be called a4000t. | 1626 | module will be called a4000t. |
1627 | 1627 | ||
1628 | config SCSI_AMIGA7XX | 1628 | config SCSI_ZORRO7XX |
1629 | bool "Amiga NCR53c710 SCSI support (EXPERIMENTAL)" | 1629 | tristate "Zorro NCR53c710 SCSI support (EXPERIMENTAL)" |
1630 | depends on AMIGA && SCSI && EXPERIMENTAL && BROKEN | 1630 | depends on ZORRO && SCSI && EXPERIMENTAL |
1631 | select SCSI_SPI_ATTRS | ||
1631 | help | 1632 | help |
1632 | Support for various NCR53c710-based SCSI controllers on the Amiga. | 1633 | Support for various NCR53c710-based SCSI controllers on Zorro |
1634 | expansion boards for the Amiga. | ||
1633 | This includes: | 1635 | This includes: |
1634 | - the Amiga 4091 Zorro III SCSI-2 controller, | 1636 | - the Amiga 4091 Zorro III SCSI-2 controller, |
1635 | - the MacroSystem Development's WarpEngine Amiga SCSI-2 controller | 1637 | - the MacroSystem Development's WarpEngine Amiga SCSI-2 controller |
@@ -1638,10 +1640,6 @@ config SCSI_AMIGA7XX | |||
1638 | - the SCSI controller on the Phase5 Blizzard PowerUP 603e+ | 1640 | - the SCSI controller on the Phase5 Blizzard PowerUP 603e+ |
1639 | accelerator card for the Amiga 1200, | 1641 | accelerator card for the Amiga 1200, |
1640 | - the SCSI controller on the GVP Turbo 040/060 accelerator. | 1642 | - the SCSI controller on the GVP Turbo 040/060 accelerator. |
1641 | Note that all of the above SCSI controllers, except for the builtin | ||
1642 | SCSI controller on the Amiga 4000T, reside on the Zorro expansion | ||
1643 | bus, so you also have to enable Zorro bus support if you want to use | ||
1644 | them. | ||
1645 | 1643 | ||
1646 | config OKTAGON_SCSI | 1644 | config OKTAGON_SCSI |
1647 | tristate "BSC Oktagon SCSI support (EXPERIMENTAL)" | 1645 | tristate "BSC Oktagon SCSI support (EXPERIMENTAL)" |
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile index 1fd7fbc56ba3..3027b5330d7e 100644 --- a/drivers/scsi/Makefile +++ b/drivers/scsi/Makefile | |||
@@ -38,6 +38,7 @@ obj-$(CONFIG_SCSI_SAS_LIBSAS) += libsas/ | |||
38 | obj-$(CONFIG_ISCSI_TCP) += libiscsi.o iscsi_tcp.o | 38 | obj-$(CONFIG_ISCSI_TCP) += libiscsi.o iscsi_tcp.o |
39 | obj-$(CONFIG_INFINIBAND_ISER) += libiscsi.o | 39 | obj-$(CONFIG_INFINIBAND_ISER) += libiscsi.o |
40 | obj-$(CONFIG_SCSI_A4000T) += 53c700.o a4000t.o | 40 | obj-$(CONFIG_SCSI_A4000T) += 53c700.o a4000t.o |
41 | obj-$(CONFIG_SCSI_ZORRO7XX) += 53c700.o zorro7xx.o | ||
41 | obj-$(CONFIG_A3000_SCSI) += a3000.o wd33c93.o | 42 | obj-$(CONFIG_A3000_SCSI) += a3000.o wd33c93.o |
42 | obj-$(CONFIG_A2091_SCSI) += a2091.o wd33c93.o | 43 | obj-$(CONFIG_A2091_SCSI) += a2091.o wd33c93.o |
43 | obj-$(CONFIG_GVP11_SCSI) += gvp11.o wd33c93.o | 44 | obj-$(CONFIG_GVP11_SCSI) += gvp11.o wd33c93.o |
diff --git a/drivers/scsi/zorro7xx.c b/drivers/scsi/zorro7xx.c new file mode 100644 index 000000000000..93fa8b8d8a8b --- /dev/null +++ b/drivers/scsi/zorro7xx.c | |||
@@ -0,0 +1,181 @@ | |||
1 | /* | ||
2 | * Detection routine for the NCR53c710 based Amiga SCSI Controllers for Linux. | ||
3 | * Amiga MacroSystemUS WarpEngine SCSI controller. | ||
4 | * Amiga Technologies/DKB A4091 SCSI controller. | ||
5 | * | ||
6 | * Written 1997 by Alan Hourihane <alanh@fairlite.demon.co.uk> | ||
7 | * plus modifications of the 53c7xx.c driver to support the Amiga. | ||
8 | * | ||
9 | * Rewritten to use 53c700.c by Kars de Jong <jongk@linux-m68k.org> | ||
10 | */ | ||
11 | |||
12 | #include <linux/module.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/zorro.h> | ||
16 | #include <asm/amigaints.h> | ||
17 | #include <scsi/scsi_host.h> | ||
18 | #include <scsi/scsi_transport_spi.h> | ||
19 | |||
20 | #include "53c700.h" | ||
21 | |||
22 | MODULE_AUTHOR("Alan Hourihane <alanh@fairlite.demon.co.uk> / Kars de Jong <jongk@linux-m68k.org>"); | ||
23 | MODULE_DESCRIPTION("Amiga Zorro NCR53C710 driver"); | ||
24 | MODULE_LICENSE("GPL"); | ||
25 | |||
26 | |||
27 | static struct scsi_host_template zorro7xx_scsi_driver_template = { | ||
28 | .proc_name = "zorro7xx", | ||
29 | .this_id = 7, | ||
30 | .module = THIS_MODULE, | ||
31 | }; | ||
32 | |||
33 | static struct zorro_driver_data { | ||
34 | const char *name; | ||
35 | unsigned long offset; | ||
36 | int absolute; /* offset is absolute address */ | ||
37 | } zorro7xx_driver_data[] __devinitdata = { | ||
38 | { .name = "PowerUP 603e+", .offset = 0xf40000, .absolute = 1 }, | ||
39 | { .name = "WarpEngine 40xx", .offset = 0x40000 }, | ||
40 | { .name = "A4091", .offset = 0x800000 }, | ||
41 | { .name = "GForce 040/060", .offset = 0x40000 }, | ||
42 | { 0 } | ||
43 | }; | ||
44 | |||
45 | static struct zorro_device_id zorro7xx_zorro_tbl[] __devinitdata = { | ||
46 | { | ||
47 | .id = ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS, | ||
48 | .driver_data = (unsigned long)&zorro7xx_driver_data[0], | ||
49 | }, | ||
50 | { | ||
51 | .id = ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx, | ||
52 | .driver_data = (unsigned long)&zorro7xx_driver_data[1], | ||
53 | }, | ||
54 | { | ||
55 | .id = ZORRO_PROD_CBM_A4091_1, | ||
56 | .driver_data = (unsigned long)&zorro7xx_driver_data[2], | ||
57 | }, | ||
58 | { | ||
59 | .id = ZORRO_PROD_CBM_A4091_2, | ||
60 | .driver_data = (unsigned long)&zorro7xx_driver_data[2], | ||
61 | }, | ||
62 | { | ||
63 | .id = ZORRO_PROD_GVP_GFORCE_040_060, | ||
64 | .driver_data = (unsigned long)&zorro7xx_driver_data[3], | ||
65 | }, | ||
66 | { 0 } | ||
67 | }; | ||
68 | MODULE_DEVICE_TABLE(zorro, zorro7xx_zorro_tbl); | ||
69 | |||
70 | static int __devinit zorro7xx_init_one(struct zorro_dev *z, | ||
71 | const struct zorro_device_id *ent) | ||
72 | { | ||
73 | struct Scsi_Host * host = NULL; | ||
74 | struct NCR_700_Host_Parameters *hostdata; | ||
75 | struct zorro_driver_data *zdd; | ||
76 | unsigned long board, ioaddr; | ||
77 | |||
78 | board = zorro_resource_start(z); | ||
79 | zdd = (struct zorro_driver_data *)ent->driver_data; | ||
80 | |||
81 | if (zdd->absolute) { | ||
82 | ioaddr = zdd->offset; | ||
83 | } else { | ||
84 | ioaddr = board + zdd->offset; | ||
85 | } | ||
86 | |||
87 | if (!zorro_request_device(z, zdd->name)) { | ||
88 | printk(KERN_ERR "zorro7xx: cannot reserve region 0x%lx, abort\n", | ||
89 | board); | ||
90 | return -EBUSY; | ||
91 | } | ||
92 | |||
93 | hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL); | ||
94 | if (hostdata == NULL) { | ||
95 | printk(KERN_ERR "zorro7xx: Failed to allocate host data\n"); | ||
96 | goto out_release; | ||
97 | } | ||
98 | |||
99 | memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters)); | ||
100 | |||
101 | /* Fill in the required pieces of hostdata */ | ||
102 | if (ioaddr > 0x01000000) | ||
103 | hostdata->base = ioremap(ioaddr, zorro_resource_len(z)); | ||
104 | else | ||
105 | hostdata->base = (void __iomem *)ZTWO_VADDR(ioaddr); | ||
106 | |||
107 | hostdata->clock = 50; | ||
108 | hostdata->chip710 = 1; | ||
109 | |||
110 | /* Settings for at least WarpEngine 40xx */ | ||
111 | hostdata->ctest7_extra = CTEST7_TT1; | ||
112 | |||
113 | zorro7xx_scsi_driver_template.name = zdd->name; | ||
114 | |||
115 | /* and register the chip */ | ||
116 | host = NCR_700_detect(&zorro7xx_scsi_driver_template, hostdata, | ||
117 | &z->dev); | ||
118 | if (!host) { | ||
119 | printk(KERN_ERR "zorro7xx: No host detected; " | ||
120 | "board configuration problem?\n"); | ||
121 | goto out_free; | ||
122 | } | ||
123 | |||
124 | host->this_id = 7; | ||
125 | host->base = ioaddr; | ||
126 | host->irq = IRQ_AMIGA_PORTS; | ||
127 | |||
128 | if (request_irq(host->irq, NCR_700_intr, IRQF_SHARED, "zorro7xx-scsi", | ||
129 | host)) { | ||
130 | printk(KERN_ERR "zorro7xx: request_irq failed\n"); | ||
131 | goto out_put_host; | ||
132 | } | ||
133 | |||
134 | scsi_scan_host(host); | ||
135 | |||
136 | return 0; | ||
137 | |||
138 | out_put_host: | ||
139 | scsi_host_put(host); | ||
140 | out_free: | ||
141 | if (ioaddr > 0x01000000) | ||
142 | iounmap(hostdata->base); | ||
143 | kfree(hostdata); | ||
144 | out_release: | ||
145 | zorro_release_device(z); | ||
146 | |||
147 | return -ENODEV; | ||
148 | } | ||
149 | |||
150 | static __devexit void zorro7xx_remove_one(struct zorro_dev *z) | ||
151 | { | ||
152 | struct Scsi_Host *host = dev_to_shost(&z->dev); | ||
153 | struct NCR_700_Host_Parameters *hostdata = shost_priv(host); | ||
154 | |||
155 | scsi_remove_host(host); | ||
156 | |||
157 | NCR_700_release(host); | ||
158 | kfree(hostdata); | ||
159 | free_irq(host->irq, host); | ||
160 | zorro_release_device(z); | ||
161 | } | ||
162 | |||
163 | static struct zorro_driver zorro7xx_driver = { | ||
164 | .name = "zorro7xx-scsi", | ||
165 | .id_table = zorro7xx_zorro_tbl, | ||
166 | .probe = zorro7xx_init_one, | ||
167 | .remove = __devexit_p(zorro7xx_remove_one), | ||
168 | }; | ||
169 | |||
170 | static int __init zorro7xx_scsi_init(void) | ||
171 | { | ||
172 | return zorro_register_driver(&zorro7xx_driver); | ||
173 | } | ||
174 | |||
175 | static void __exit zorro7xx_scsi_exit(void) | ||
176 | { | ||
177 | zorro_unregister_driver(&zorro7xx_driver); | ||
178 | } | ||
179 | |||
180 | module_init(zorro7xx_scsi_init); | ||
181 | module_exit(zorro7xx_scsi_exit); | ||