Skip to content

Commit

Permalink
sun3_scsi: Convert to platform device
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Finn Thain authored and Christoph Hellwig committed Nov 20, 2014
1 parent 4e70520 commit 0d31f87
Show file tree
Hide file tree
Showing 3 changed files with 245 additions and 222 deletions.
60 changes: 60 additions & 0 deletions arch/m68k/sun3/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/console.h>
#include <linux/init.h>
#include <linux/bootmem.h>
#include <linux/platform_device.h>

#include <asm/oplib.h>
#include <asm/setup.h>
Expand All @@ -27,6 +28,7 @@
#include <asm/sun3mmu.h>
#include <asm/rtc.h>
#include <asm/machdep.h>
#include <asm/machines.h>
#include <asm/idprom.h>
#include <asm/intersil.h>
#include <asm/irq.h>
Expand Down Expand Up @@ -169,3 +171,61 @@ static void __init sun3_sched_init(irq_handler_t timer_routine)
intersil_clear();
}

#ifdef CONFIG_SUN3_SCSI

static const struct resource sun3_scsi_vme_rsrc[] __initconst = {
{
.flags = IORESOURCE_IRQ,
.start = SUN3_VEC_VMESCSI0,
.end = SUN3_VEC_VMESCSI0,
}, {
.flags = IORESOURCE_MEM,
.start = 0xff200000,
.end = 0xff200021,
}, {
.flags = IORESOURCE_IRQ,
.start = SUN3_VEC_VMESCSI1,
.end = SUN3_VEC_VMESCSI1,
}, {
.flags = IORESOURCE_MEM,
.start = 0xff204000,
.end = 0xff204021,
},
};

/*
* Int: level 2 autovector
* IO: type 1, base 0x00140000, 5 bits phys space: A<4..0>
*/
static const struct resource sun3_scsi_rsrc[] __initconst = {
{
.flags = IORESOURCE_IRQ,
.start = 2,
.end = 2,
}, {
.flags = IORESOURCE_MEM,
.start = 0x00140000,
.end = 0x0014001f,
},
};

int __init sun3_platform_init(void)
{
switch (idprom->id_machtype) {
case SM_SUN3 | SM_3_160:
case SM_SUN3 | SM_3_260:
platform_device_register_simple("sun3_scsi_vme", -1,
sun3_scsi_vme_rsrc, ARRAY_SIZE(sun3_scsi_vme_rsrc));
break;
case SM_SUN3 | SM_3_50:
case SM_SUN3 | SM_3_60:
platform_device_register_simple("sun3_scsi", -1,
sun3_scsi_rsrc, ARRAY_SIZE(sun3_scsi_rsrc));
break;
}
return 0;
}

arch_initcall(sun3_platform_init);

#endif
Loading

0 comments on commit 0d31f87

Please sign in to comment.