diff options
author | Kars de Jong <jongk@linux-m68k.org> | 2007-06-17 08:47:08 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-06-17 17:18:27 -0400 |
commit | a16efc1cbf0a9e5ea9f99ae98fb774b60d05c35b (patch) | |
tree | c29b997faabf14246d9e677aaf83c6453446ce41 | |
parent | 506c7bbcd9bc042a782bdcdb0c926de4c9d62028 (diff) |
[SCSI] 53c700: Amiga 4000T NCR53c710 SCSI
New driver for the Amiga 4000T built-in NCR53c710 SCSI controller, using the
53c700 SCSI core.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r-- | drivers/scsi/Kconfig | 14 | ||||
-rw-r--r-- | drivers/scsi/Makefile | 1 | ||||
-rw-r--r-- | drivers/scsi/a4000t.c | 142 |
3 files changed, 155 insertions, 2 deletions
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 915bf6caffe0..8e53586a3f12 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 MVME16x_SCSI || BVME6000_SCSI | 1011 | depends on SCSI_A4000T || MVME16x_SCSI || BVME6000_SCSI |
1012 | default y | 1012 | default y |
1013 | 1013 | ||
1014 | config SCSI_SYM53C8XX_2 | 1014 | config SCSI_SYM53C8XX_2 |
@@ -1614,13 +1614,23 @@ config FASTLANE_SCSI | |||
1614 | If you have the Phase5 Fastlane Z3 SCSI controller, or plan to use | 1614 | If you have the Phase5 Fastlane Z3 SCSI controller, or plan to use |
1615 | one in the near future, say Y to this question. Otherwise, say N. | 1615 | one in the near future, say Y to this question. Otherwise, say N. |
1616 | 1616 | ||
1617 | config SCSI_A4000T | ||
1618 | tristate "A4000T NCR53c710 SCSI support (EXPERIMENTAL)" | ||
1619 | depends on AMIGA && SCSI && EXPERIMENTAL | ||
1620 | select SCSI_SPI_ATTRS | ||
1621 | help | ||
1622 | If you have an Amiga 4000T and have SCSI devices connected to the | ||
1623 | built-in SCSI controller, say Y. Otherwise, say N. | ||
1624 | |||
1625 | To compile this driver as a module, choose M here: the | ||
1626 | module will be called a4000t. | ||
1627 | |||
1617 | config SCSI_AMIGA7XX | 1628 | config SCSI_AMIGA7XX |
1618 | bool "Amiga NCR53c710 SCSI support (EXPERIMENTAL)" | 1629 | bool "Amiga NCR53c710 SCSI support (EXPERIMENTAL)" |
1619 | depends on AMIGA && SCSI && EXPERIMENTAL && BROKEN | 1630 | depends on AMIGA && SCSI && EXPERIMENTAL && BROKEN |
1620 | help | 1631 | help |
1621 | Support for various NCR53c710-based SCSI controllers on the Amiga. | 1632 | Support for various NCR53c710-based SCSI controllers on the Amiga. |
1622 | This includes: | 1633 | This includes: |
1623 | - the builtin SCSI controller on the Amiga 4000T, | ||
1624 | - the Amiga 4091 Zorro III SCSI-2 controller, | 1634 | - the Amiga 4091 Zorro III SCSI-2 controller, |
1625 | - the MacroSystem Development's WarpEngine Amiga SCSI-2 controller | 1635 | - the MacroSystem Development's WarpEngine Amiga SCSI-2 controller |
1626 | (info at | 1636 | (info at |
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile index 4bc4ef8d4209..1fd7fbc56ba3 100644 --- a/drivers/scsi/Makefile +++ b/drivers/scsi/Makefile | |||
@@ -37,6 +37,7 @@ obj-$(CONFIG_SCSI_SAS_LIBSAS) += libsas/ | |||
37 | 37 | ||
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_A3000_SCSI) += a3000.o wd33c93.o | 41 | obj-$(CONFIG_A3000_SCSI) += a3000.o wd33c93.o |
41 | obj-$(CONFIG_A2091_SCSI) += a2091.o wd33c93.o | 42 | obj-$(CONFIG_A2091_SCSI) += a2091.o wd33c93.o |
42 | obj-$(CONFIG_GVP11_SCSI) += gvp11.o wd33c93.o | 43 | obj-$(CONFIG_GVP11_SCSI) += gvp11.o wd33c93.o |
diff --git a/drivers/scsi/a4000t.c b/drivers/scsi/a4000t.c new file mode 100644 index 000000000000..e1c6eda64c51 --- /dev/null +++ b/drivers/scsi/a4000t.c | |||
@@ -0,0 +1,142 @@ | |||
1 | /* | ||
2 | * Detection routine for the NCR53c710 based Amiga SCSI Controllers for Linux. | ||
3 | * Amiga Technologies A4000T SCSI controller. | ||
4 | * | ||
5 | * Written 1997 by Alan Hourihane <alanh@fairlite.demon.co.uk> | ||
6 | * plus modifications of the 53c7xx.c driver to support the Amiga. | ||
7 | * | ||
8 | * Rewritten to use 53c700.c by Kars de Jong <jongk@linux-m68k.org> | ||
9 | */ | ||
10 | |||
11 | #include <linux/module.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <asm/amigaints.h> | ||
16 | #include <scsi/scsi_host.h> | ||
17 | #include <scsi/scsi_transport_spi.h> | ||
18 | |||
19 | #include "53c700.h" | ||
20 | |||
21 | MODULE_AUTHOR("Alan Hourihane <alanh@fairlite.demon.co.uk> / Kars de Jong <jongk@linux-m68k.org>"); | ||
22 | MODULE_DESCRIPTION("Amiga A4000T NCR53C710 driver"); | ||
23 | MODULE_LICENSE("GPL"); | ||
24 | |||
25 | |||
26 | static struct scsi_host_template a4000t_scsi_driver_template = { | ||
27 | .name = "A4000T builtin SCSI", | ||
28 | .proc_name = "A4000t", | ||
29 | .this_id = 7, | ||
30 | .module = THIS_MODULE, | ||
31 | }; | ||
32 | |||
33 | static struct platform_device *a4000t_scsi_device; | ||
34 | |||
35 | #define A4000T_SCSI_ADDR 0xdd0040 | ||
36 | |||
37 | static int __devinit a4000t_probe(struct device *dev) | ||
38 | { | ||
39 | struct Scsi_Host * host = NULL; | ||
40 | struct NCR_700_Host_Parameters *hostdata; | ||
41 | |||
42 | if (!(MACH_IS_AMIGA && AMIGAHW_PRESENT(A4000_SCSI))) | ||
43 | goto out; | ||
44 | |||
45 | if (!request_mem_region(A4000T_SCSI_ADDR, 0x1000, | ||
46 | "A4000T builtin SCSI")) | ||
47 | goto out; | ||
48 | |||
49 | hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL); | ||
50 | if (hostdata == NULL) { | ||
51 | printk(KERN_ERR "a4000t-scsi: Failed to allocate host data\n"); | ||
52 | goto out_release; | ||
53 | } | ||
54 | memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters)); | ||
55 | |||
56 | /* Fill in the required pieces of hostdata */ | ||
57 | hostdata->base = (void __iomem *)ZTWO_VADDR(A4000T_SCSI_ADDR); | ||
58 | hostdata->clock = 50; | ||
59 | hostdata->chip710 = 1; | ||
60 | hostdata->dmode_extra = DMODE_FC2; | ||
61 | hostdata->dcntl_extra = EA_710; | ||
62 | |||
63 | /* and register the chip */ | ||
64 | host = NCR_700_detect(&a4000t_scsi_driver_template, hostdata, dev); | ||
65 | if (!host) { | ||
66 | printk(KERN_ERR "a4000t-scsi: No host detected; " | ||
67 | "board configuration problem?\n"); | ||
68 | goto out_free; | ||
69 | } | ||
70 | |||
71 | host->this_id = 7; | ||
72 | host->base = A4000T_SCSI_ADDR; | ||
73 | host->irq = IRQ_AMIGA_PORTS; | ||
74 | |||
75 | if (request_irq(host->irq, NCR_700_intr, IRQF_SHARED, "a4000t-scsi", | ||
76 | host)) { | ||
77 | printk(KERN_ERR "a4000t-scsi: request_irq failed\n"); | ||
78 | goto out_put_host; | ||
79 | } | ||
80 | |||
81 | scsi_scan_host(host); | ||
82 | |||
83 | return 0; | ||
84 | |||
85 | out_put_host: | ||
86 | scsi_host_put(host); | ||
87 | out_free: | ||
88 | kfree(hostdata); | ||
89 | out_release: | ||
90 | release_mem_region(A4000T_SCSI_ADDR, 0x1000); | ||
91 | out: | ||
92 | return -ENODEV; | ||
93 | } | ||
94 | |||
95 | static __devexit int a4000t_device_remove(struct device *dev) | ||
96 | { | ||
97 | struct Scsi_Host *host = dev_to_shost(dev); | ||
98 | struct NCR_700_Host_Parameters *hostdata = shost_priv(host); | ||
99 | |||
100 | scsi_remove_host(host); | ||
101 | |||
102 | NCR_700_release(host); | ||
103 | kfree(hostdata); | ||
104 | free_irq(host->irq, host); | ||
105 | release_mem_region(A4000T_SCSI_ADDR, 0x1000); | ||
106 | |||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | static struct device_driver a4000t_scsi_driver = { | ||
111 | .name = "a4000t-scsi", | ||
112 | .bus = &platform_bus_type, | ||
113 | .probe = a4000t_probe, | ||
114 | .remove = __devexit_p(a4000t_device_remove), | ||
115 | }; | ||
116 | |||
117 | static int __init a4000t_scsi_init(void) | ||
118 | { | ||
119 | int err; | ||
120 | |||
121 | err = driver_register(&a4000t_scsi_driver); | ||
122 | if (err) | ||
123 | return err; | ||
124 | |||
125 | a4000t_scsi_device = platform_device_register_simple("a4000t-scsi", | ||
126 | -1, NULL, 0); | ||
127 | if (IS_ERR(a4000t_scsi_device)) { | ||
128 | driver_unregister(&a4000t_scsi_driver); | ||
129 | return PTR_ERR(a4000t_scsi_device); | ||
130 | } | ||
131 | |||
132 | return err; | ||
133 | } | ||
134 | |||
135 | static void __exit a4000t_scsi_exit(void) | ||
136 | { | ||
137 | platform_device_unregister(a4000t_scsi_device); | ||
138 | driver_unregister(&a4000t_scsi_driver); | ||
139 | } | ||
140 | |||
141 | module_init(a4000t_scsi_init); | ||
142 | module_exit(a4000t_scsi_exit); | ||