]> bbs.cooldavid.org Git - net-next-2.6.git/blob - arch/m68k/amiga/platform.c
m68k: amiga - A3000 SCSI platform device conversion
[net-next-2.6.git] / arch / m68k / amiga / platform.c
1 /*
2  *  Copyright (C) 2007-2009 Geert Uytterhoeven
3  *
4  * This file is subject to the terms and conditions of the GNU General Public
5  * License.  See the file COPYING in the main directory of this archive
6  * for more details.
7  */
8
9 #include <linux/init.h>
10 #include <linux/platform_device.h>
11 #include <linux/zorro.h>
12
13 #include <asm/amigahw.h>
14
15
16 #ifdef CONFIG_ZORRO
17
18 static const struct resource zorro_resources[] __initconst = {
19         /* Zorro II regions (on Zorro II/III) */
20         {
21                 .name   = "Zorro II exp",
22                 .start  = 0x00e80000,
23                 .end    = 0x00efffff,
24                 .flags  = IORESOURCE_MEM,
25         }, {
26                 .name   = "Zorro II mem",
27                 .start  = 0x00200000,
28                 .end    = 0x009fffff,
29                 .flags  = IORESOURCE_MEM,
30         },
31         /* Zorro III regions (on Zorro III only) */
32         {
33                 .name   = "Zorro III exp",
34                 .start  = 0xff000000,
35                 .end    = 0xffffffff,
36                 .flags  = IORESOURCE_MEM,
37         }, {
38                 .name   = "Zorro III cfg",
39                 .start  = 0x40000000,
40                 .end    = 0x7fffffff,
41                 .flags  = IORESOURCE_MEM,
42         }
43 };
44
45
46 static int __init amiga_init_bus(void)
47 {
48         if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
49                 return -ENODEV;
50
51         platform_device_register_simple("amiga-zorro", -1, zorro_resources,
52                                         AMIGAHW_PRESENT(ZORRO3) ? 4 : 2);
53         return 0;
54 }
55
56 subsys_initcall(amiga_init_bus);
57
58 #endif /* CONFIG_ZORRO */
59
60
61 static const struct resource a3000_scsi_resource __initconst = {
62         .start  = 0xdd0000,
63         .end    = 0xdd00ff,
64         .flags  = IORESOURCE_MEM,
65 };
66
67
68 static int __init amiga_init_devices(void)
69 {
70         if (!MACH_IS_AMIGA)
71                 return -ENODEV;
72
73         /* video hardware */
74         if (AMIGAHW_PRESENT(AMI_VIDEO))
75                 platform_device_register_simple("amiga-video", -1, NULL, 0);
76
77
78         /* sound hardware */
79         if (AMIGAHW_PRESENT(AMI_AUDIO))
80                 platform_device_register_simple("amiga-audio", -1, NULL, 0);
81
82
83         /* storage interfaces */
84         if (AMIGAHW_PRESENT(AMI_FLOPPY))
85                 platform_device_register_simple("amiga-floppy", -1, NULL, 0);
86
87         if (AMIGAHW_PRESENT(A3000_SCSI))
88                 platform_device_register_simple("amiga-a3000-scsi", -1,
89                                                 &a3000_scsi_resource, 1);
90
91         return 0;
92 }
93
94 device_initcall(amiga_init_devices);