aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2014-11-12 20:21:28 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-20 03:11:15 -0500
commit0d31f8759109cbc1e6fc196d08e6b0e8a9e93b3f (patch)
tree0242252808935d73935d5132275f3920936ca394 /arch/m68k
parent4e705205252ffc6979b938ab10facf765692f5cf (diff)
sun3_scsi: Convert to platform device
Convert sun3_scsi to platform device and eliminate scsi_register(). Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/sun3/config.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index f59ec58083f8..a8b942bf7163 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -16,6 +16,7 @@
16#include <linux/console.h> 16#include <linux/console.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/bootmem.h> 18#include <linux/bootmem.h>
19#include <linux/platform_device.h>
19 20
20#include <asm/oplib.h> 21#include <asm/oplib.h>
21#include <asm/setup.h> 22#include <asm/setup.h>
@@ -27,6 +28,7 @@
27#include <asm/sun3mmu.h> 28#include <asm/sun3mmu.h>
28#include <asm/rtc.h> 29#include <asm/rtc.h>
29#include <asm/machdep.h> 30#include <asm/machdep.h>
31#include <asm/machines.h>
30#include <asm/idprom.h> 32#include <asm/idprom.h>
31#include <asm/intersil.h> 33#include <asm/intersil.h>
32#include <asm/irq.h> 34#include <asm/irq.h>
@@ -169,3 +171,61 @@ static void __init sun3_sched_init(irq_handler_t timer_routine)
169 intersil_clear(); 171 intersil_clear();
170} 172}
171 173
174#ifdef CONFIG_SUN3_SCSI
175
176static const struct resource sun3_scsi_vme_rsrc[] __initconst = {
177 {
178 .flags = IORESOURCE_IRQ,
179 .start = SUN3_VEC_VMESCSI0,
180 .end = SUN3_VEC_VMESCSI0,
181 }, {
182 .flags = IORESOURCE_MEM,
183 .start = 0xff200000,
184 .end = 0xff200021,
185 }, {
186 .flags = IORESOURCE_IRQ,
187 .start = SUN3_VEC_VMESCSI1,
188 .end = SUN3_VEC_VMESCSI1,
189 }, {
190 .flags = IORESOURCE_MEM,
191 .start = 0xff204000,
192 .end = 0xff204021,
193 },
194};
195
196/*
197 * Int: level 2 autovector
198 * IO: type 1, base 0x00140000, 5 bits phys space: A<4..0>
199 */
200static const struct resource sun3_scsi_rsrc[] __initconst = {
201 {
202 .flags = IORESOURCE_IRQ,
203 .start = 2,
204 .end = 2,
205 }, {
206 .flags = IORESOURCE_MEM,
207 .start = 0x00140000,
208 .end = 0x0014001f,
209 },
210};
211
212int __init sun3_platform_init(void)
213{
214 switch (idprom->id_machtype) {
215 case SM_SUN3 | SM_3_160:
216 case SM_SUN3 | SM_3_260:
217 platform_device_register_simple("sun3_scsi_vme", -1,
218 sun3_scsi_vme_rsrc, ARRAY_SIZE(sun3_scsi_vme_rsrc));
219 break;
220 case SM_SUN3 | SM_3_50:
221 case SM_SUN3 | SM_3_60:
222 platform_device_register_simple("sun3_scsi", -1,
223 sun3_scsi_rsrc, ARRAY_SIZE(sun3_scsi_rsrc));
224 break;
225 }
226 return 0;
227}
228
229arch_initcall(sun3_platform_init);
230
231#endif