Geert Uytterhoeven | 0d30546 | 2009-04-05 12:40:41 +0200 | [diff] [blame] | 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 */ |
Geert Uytterhoeven | fa6688e | 2009-04-05 12:45:56 +0200 | [diff] [blame] | 59 | |
| 60 | |
| 61 | static int __init amiga_init_devices(void) |
| 62 | { |
| 63 | if (!MACH_IS_AMIGA) |
| 64 | return -ENODEV; |
| 65 | |
| 66 | /* video hardware */ |
| 67 | if (AMIGAHW_PRESENT(AMI_VIDEO)) |
| 68 | platform_device_register_simple("amiga-video", -1, NULL, 0); |
| 69 | |
Geert Uytterhoeven | ff2db7c | 2009-04-05 12:59:54 +0200 | [diff] [blame] | 70 | |
| 71 | /* sound hardware */ |
| 72 | if (AMIGAHW_PRESENT(AMI_AUDIO)) |
| 73 | platform_device_register_simple("amiga-audio", -1, NULL, 0); |
| 74 | |
Geert Uytterhoeven | 92183b3 | 2009-04-05 13:02:13 +0200 | [diff] [blame] | 75 | |
| 76 | /* storage interfaces */ |
| 77 | if (AMIGAHW_PRESENT(AMI_FLOPPY)) |
| 78 | platform_device_register_simple("amiga-floppy", -1, NULL, 0); |
| 79 | |
Geert Uytterhoeven | fa6688e | 2009-04-05 12:45:56 +0200 | [diff] [blame] | 80 | return 0; |
| 81 | } |
| 82 | |
| 83 | device_initcall(amiga_init_devices); |