diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2009-12-08 14:12:20 -0500 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2010-05-26 13:51:09 -0400 |
commit | 9aed2302655854586069d90e0d59ce3a0e12809d (patch) | |
tree | 7d5314f1f7b60891cfe8adb8be4fd6fdbacfae0b /arch/m68k/amiga/platform.c | |
parent | a24a6b22254bca8d54be6c8b7d8730d09f1058cc (diff) |
m68k: amiga - Amiga Gayle IDE platform device conversion
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/amiga/platform.c')
-rw-r--r-- | arch/m68k/amiga/platform.c | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/arch/m68k/amiga/platform.c b/arch/m68k/amiga/platform.c index 027e4cae88ff..907f6f5f2cac 100644 --- a/arch/m68k/amiga/platform.c +++ b/arch/m68k/amiga/platform.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/zorro.h> | 11 | #include <linux/zorro.h> |
12 | 12 | ||
13 | #include <asm/amigahw.h> | 13 | #include <asm/amigahw.h> |
14 | #include <asm/amigayle.h> | ||
14 | 15 | ||
15 | 16 | ||
16 | #ifdef CONFIG_ZORRO | 17 | #ifdef CONFIG_ZORRO |
@@ -55,7 +56,24 @@ static int __init amiga_init_bus(void) | |||
55 | 56 | ||
56 | subsys_initcall(amiga_init_bus); | 57 | subsys_initcall(amiga_init_bus); |
57 | 58 | ||
58 | #endif /* CONFIG_ZORRO */ | 59 | |
60 | static int z_dev_present(zorro_id id) | ||
61 | { | ||
62 | unsigned int i; | ||
63 | |||
64 | for (i = 0; i < zorro_num_autocon; i++) | ||
65 | if (zorro_autocon[i].rom.er_Manufacturer == ZORRO_MANUF(id) && | ||
66 | zorro_autocon[i].rom.er_Product == ZORRO_PROD(id)) | ||
67 | return 1; | ||
68 | |||
69 | return 0; | ||
70 | } | ||
71 | |||
72 | #else /* !CONFIG_ZORRO */ | ||
73 | |||
74 | static inline int z_dev_present(zorro_id id) { return 0; } | ||
75 | |||
76 | #endif /* !CONFIG_ZORRO */ | ||
59 | 77 | ||
60 | 78 | ||
61 | static const struct resource a3000_scsi_resource __initconst = { | 79 | static const struct resource a3000_scsi_resource __initconst = { |
@@ -72,8 +90,36 @@ static const struct resource a4000t_scsi_resource __initconst = { | |||
72 | }; | 90 | }; |
73 | 91 | ||
74 | 92 | ||
93 | static const struct resource a1200_ide_resource __initconst = { | ||
94 | .start = 0xda0000, | ||
95 | .end = 0xda1fff, | ||
96 | .flags = IORESOURCE_MEM, | ||
97 | }; | ||
98 | |||
99 | static const struct gayle_ide_platform_data a1200_ide_pdata __initconst = { | ||
100 | .base = 0xda0000, | ||
101 | .irqport = 0xda9000, | ||
102 | .explicit_ack = 1, | ||
103 | }; | ||
104 | |||
105 | |||
106 | static const struct resource a4000_ide_resource __initconst = { | ||
107 | .start = 0xdd2000, | ||
108 | .end = 0xdd3fff, | ||
109 | .flags = IORESOURCE_MEM, | ||
110 | }; | ||
111 | |||
112 | static const struct gayle_ide_platform_data a4000_ide_pdata __initconst = { | ||
113 | .base = 0xdd2020, | ||
114 | .irqport = 0xdd3020, | ||
115 | .explicit_ack = 0, | ||
116 | }; | ||
117 | |||
118 | |||
75 | static int __init amiga_init_devices(void) | 119 | static int __init amiga_init_devices(void) |
76 | { | 120 | { |
121 | struct platform_device *pdev; | ||
122 | |||
77 | if (!MACH_IS_AMIGA) | 123 | if (!MACH_IS_AMIGA) |
78 | return -ENODEV; | 124 | return -ENODEV; |
79 | 125 | ||
@@ -99,6 +145,21 @@ static int __init amiga_init_devices(void) | |||
99 | platform_device_register_simple("amiga-a4000t-scsi", -1, | 145 | platform_device_register_simple("amiga-a4000t-scsi", -1, |
100 | &a4000t_scsi_resource, 1); | 146 | &a4000t_scsi_resource, 1); |
101 | 147 | ||
148 | if (AMIGAHW_PRESENT(A1200_IDE) || | ||
149 | z_dev_present(ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530_SCSI_IDE)) { | ||
150 | pdev = platform_device_register_simple("amiga-gayle-ide", -1, | ||
151 | &a1200_ide_resource, 1); | ||
152 | platform_device_add_data(pdev, &a1200_ide_pdata, | ||
153 | sizeof(a1200_ide_pdata)); | ||
154 | } | ||
155 | |||
156 | if (AMIGAHW_PRESENT(A4000_IDE)) { | ||
157 | pdev = platform_device_register_simple("amiga-gayle-ide", -1, | ||
158 | &a4000_ide_resource, 1); | ||
159 | platform_device_add_data(pdev, &a4000_ide_pdata, | ||
160 | sizeof(a4000_ide_pdata)); | ||
161 | } | ||
162 | |||
102 | return 0; | 163 | return 0; |
103 | } | 164 | } |
104 | 165 | ||