Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * linux/arch/m68k/mac/config.c | |
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 | /* | |
10 | * Miscellaneous linux stuff | |
11 | */ | |
12 | ||
084b3600 | 13 | #include <linux/errno.h> |
1da177e4 LT |
14 | #include <linux/module.h> |
15 | #include <linux/types.h> | |
16 | #include <linux/mm.h> | |
17 | #include <linux/tty.h> | |
18 | #include <linux/console.h> | |
19 | #include <linux/interrupt.h> | |
20 | /* keyb */ | |
21 | #include <linux/random.h> | |
22 | #include <linux/delay.h> | |
23 | /* keyb */ | |
24 | #include <linux/init.h> | |
25 | #include <linux/vt_kern.h> | |
8852ecd9 | 26 | #include <linux/platform_device.h> |
18814ee8 FT |
27 | #include <linux/adb.h> |
28 | #include <linux/cuda.h> | |
a64138ec | 29 | #include <linux/pmu.h> |
084b3600 | 30 | #include <linux/rtc.h> |
1da177e4 | 31 | |
1da177e4 LT |
32 | #include <asm/setup.h> |
33 | #include <asm/bootinfo.h> | |
4c3c522b | 34 | #include <asm/bootinfo-mac.h> |
abe48101 | 35 | #include <asm/byteorder.h> |
1da177e4 | 36 | |
1da177e4 LT |
37 | #include <asm/io.h> |
38 | #include <asm/irq.h> | |
1da177e4 LT |
39 | #include <asm/machdep.h> |
40 | ||
41 | #include <asm/macintosh.h> | |
42 | #include <asm/macints.h> | |
43 | #include <asm/machw.h> | |
44 | ||
45 | #include <asm/mac_iop.h> | |
46 | #include <asm/mac_via.h> | |
47 | #include <asm/mac_oss.h> | |
48 | #include <asm/mac_psc.h> | |
49 | ||
50 | /* Mac bootinfo struct */ | |
1da177e4 | 51 | struct mac_booter_data mac_bi_data; |
1da177e4 | 52 | |
1da177e4 | 53 | /* The phys. video addr. - might be bogus on some machines */ |
8dfbdf4a | 54 | static unsigned long mac_orig_videoaddr; |
1da177e4 | 55 | |
6ff5801a | 56 | extern int mac_hwclk(int, struct rtc_time *); |
1da177e4 LT |
57 | extern void iop_preinit(void); |
58 | extern void iop_init(void); | |
59 | extern void via_init(void); | |
40220c1a | 60 | extern void via_init_clock(irq_handler_t func); |
1da177e4 LT |
61 | extern void oss_init(void); |
62 | extern void psc_init(void); | |
63 | extern void baboon_init(void); | |
64 | ||
65 | extern void mac_mksound(unsigned int, unsigned int); | |
66 | ||
1da177e4 | 67 | static void mac_get_model(char *str); |
8dfbdf4a AB |
68 | static void mac_identify(void); |
69 | static void mac_report_hardware(void); | |
1da177e4 | 70 | |
66a3f820 | 71 | static void __init mac_sched_init(irq_handler_t vector) |
1da177e4 LT |
72 | { |
73 | via_init_clock(vector); | |
74 | } | |
75 | ||
1da177e4 LT |
76 | /* |
77 | * Parse a Macintosh-specific record in the bootinfo | |
78 | */ | |
79 | ||
80 | int __init mac_parse_bootinfo(const struct bi_record *record) | |
81 | { | |
6ff5801a | 82 | int unknown = 0; |
abe48101 | 83 | const void *data = record->data; |
1da177e4 | 84 | |
abe48101 | 85 | switch (be16_to_cpu(record->tag)) { |
1da177e4 | 86 | case BI_MAC_MODEL: |
abe48101 | 87 | mac_bi_data.id = be32_to_cpup(data); |
6ff5801a | 88 | break; |
1da177e4 | 89 | case BI_MAC_VADDR: |
abe48101 | 90 | mac_bi_data.videoaddr = be32_to_cpup(data); |
6ff5801a | 91 | break; |
1da177e4 | 92 | case BI_MAC_VDEPTH: |
abe48101 | 93 | mac_bi_data.videodepth = be32_to_cpup(data); |
6ff5801a | 94 | break; |
1da177e4 | 95 | case BI_MAC_VROW: |
abe48101 | 96 | mac_bi_data.videorow = be32_to_cpup(data); |
6ff5801a | 97 | break; |
1da177e4 | 98 | case BI_MAC_VDIM: |
abe48101 | 99 | mac_bi_data.dimensions = be32_to_cpup(data); |
6ff5801a | 100 | break; |
1da177e4 | 101 | case BI_MAC_VLOGICAL: |
abe48101 GU |
102 | mac_orig_videoaddr = be32_to_cpup(data); |
103 | mac_bi_data.videological = | |
104 | VIDEOMEMBASE + (mac_orig_videoaddr & ~VIDEOMEMMASK); | |
6ff5801a | 105 | break; |
1da177e4 | 106 | case BI_MAC_SCCBASE: |
abe48101 | 107 | mac_bi_data.sccbase = be32_to_cpup(data); |
6ff5801a | 108 | break; |
1da177e4 | 109 | case BI_MAC_BTIME: |
abe48101 | 110 | mac_bi_data.boottime = be32_to_cpup(data); |
6ff5801a | 111 | break; |
1da177e4 | 112 | case BI_MAC_GMTBIAS: |
abe48101 | 113 | mac_bi_data.gmtbias = be32_to_cpup(data); |
6ff5801a | 114 | break; |
1da177e4 | 115 | case BI_MAC_MEMSIZE: |
abe48101 | 116 | mac_bi_data.memsize = be32_to_cpup(data); |
6ff5801a | 117 | break; |
1da177e4 | 118 | case BI_MAC_CPUID: |
abe48101 | 119 | mac_bi_data.cpuid = be32_to_cpup(data); |
6ff5801a RZ |
120 | break; |
121 | case BI_MAC_ROMBASE: | |
abe48101 | 122 | mac_bi_data.rombase = be32_to_cpup(data); |
6ff5801a | 123 | break; |
1da177e4 | 124 | default: |
6ff5801a RZ |
125 | unknown = 1; |
126 | break; | |
127 | } | |
128 | return unknown; | |
1da177e4 LT |
129 | } |
130 | ||
1da177e4 LT |
131 | void __init config_mac(void) |
132 | { | |
6ff5801a | 133 | if (!MACH_IS_MAC) |
889121b4 | 134 | pr_err("ERROR: no Mac, but config_mac() called!!\n"); |
1da177e4 | 135 | |
6ff5801a RZ |
136 | mach_sched_init = mac_sched_init; |
137 | mach_init_IRQ = mac_init_IRQ; | |
138 | mach_get_model = mac_get_model; | |
6ff5801a | 139 | mach_hwclk = mac_hwclk; |
6ff5801a RZ |
140 | mach_reset = mac_reset; |
141 | mach_halt = mac_poweroff; | |
142 | mach_power_off = mac_poweroff; | |
1da177e4 | 143 | mach_max_dma_address = 0xffffffff; |
a1a9e88f | 144 | #if IS_ENABLED(CONFIG_INPUT_M68K_BEEP) |
6ff5801a | 145 | mach_beep = mac_mksound; |
1da177e4 LT |
146 | #endif |
147 | ||
148 | /* | |
149 | * Determine hardware present | |
150 | */ | |
151 | ||
152 | mac_identify(); | |
153 | mac_report_hardware(); | |
154 | ||
6ff5801a RZ |
155 | /* |
156 | * AFAIK only the IIci takes a cache card. The IIfx has onboard | |
157 | * cache ... someone needs to figure out how to tell if it's on or | |
158 | * not. | |
159 | */ | |
1da177e4 | 160 | |
bcc44f6b FT |
161 | if (macintosh_config->ident == MAC_MODEL_IICI) |
162 | mach_l2_flush = via_l2_flush; | |
1da177e4 LT |
163 | } |
164 | ||
165 | ||
166 | /* | |
53aac0ad | 167 | * Macintosh Table: hardcoded model configuration data. |
1da177e4 | 168 | * |
53aac0ad FT |
169 | * Much of this was defined by Alan, based on who knows what docs. |
170 | * I've added a lot more, and some of that was pure guesswork based | |
171 | * on hardware pages present on the Mac web site. Possibly wildly | |
172 | * inaccurate, so look here if a new Mac model won't run. Example: if | |
173 | * a Mac crashes immediately after the VIA1 registers have been dumped | |
174 | * to the screen, it probably died attempting to read DirB on a RBV. | |
608e287b | 175 | * Meaning it should have MAC_VIA_IICI here :-) |
1da177e4 LT |
176 | */ |
177 | ||
178 | struct mac_model *macintosh_config; | |
179 | EXPORT_SYMBOL(macintosh_config); | |
180 | ||
6ff5801a | 181 | static struct mac_model mac_data_table[] = { |
1da177e4 | 182 | /* |
53aac0ad | 183 | * We'll pretend to be a Macintosh II, that's pretty safe. |
1da177e4 LT |
184 | */ |
185 | ||
186 | { | |
187 | .ident = MAC_MODEL_II, | |
188 | .name = "Unknown", | |
189 | .adb_type = MAC_ADB_II, | |
190 | .via_type = MAC_VIA_II, | |
191 | .scsi_type = MAC_SCSI_OLD, | |
192 | .scc_type = MAC_SCC_II, | |
b87eaec2 | 193 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 194 | .floppy_type = MAC_FLOPPY_UNSUPPORTED, /* IWM */ |
1da177e4 LT |
195 | }, |
196 | ||
197 | /* | |
53aac0ad | 198 | * Original Mac II hardware |
1da177e4 LT |
199 | */ |
200 | ||
201 | { | |
202 | .ident = MAC_MODEL_II, | |
203 | .name = "II", | |
204 | .adb_type = MAC_ADB_II, | |
205 | .via_type = MAC_VIA_II, | |
206 | .scsi_type = MAC_SCSI_OLD, | |
207 | .scc_type = MAC_SCC_II, | |
b87eaec2 | 208 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 209 | .floppy_type = MAC_FLOPPY_UNSUPPORTED, /* IWM */ |
1da177e4 LT |
210 | }, { |
211 | .ident = MAC_MODEL_IIX, | |
212 | .name = "IIx", | |
213 | .adb_type = MAC_ADB_II, | |
214 | .via_type = MAC_VIA_II, | |
215 | .scsi_type = MAC_SCSI_OLD, | |
216 | .scc_type = MAC_SCC_II, | |
b87eaec2 | 217 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 218 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
219 | }, { |
220 | .ident = MAC_MODEL_IICX, | |
221 | .name = "IIcx", | |
222 | .adb_type = MAC_ADB_II, | |
223 | .via_type = MAC_VIA_II, | |
224 | .scsi_type = MAC_SCSI_OLD, | |
225 | .scc_type = MAC_SCC_II, | |
b87eaec2 | 226 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 227 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
228 | }, { |
229 | .ident = MAC_MODEL_SE30, | |
230 | .name = "SE/30", | |
231 | .adb_type = MAC_ADB_II, | |
232 | .via_type = MAC_VIA_II, | |
233 | .scsi_type = MAC_SCSI_OLD, | |
234 | .scc_type = MAC_SCC_II, | |
b87eaec2 | 235 | .expansion_type = MAC_EXP_PDS, |
aee6bff1 | 236 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
237 | }, |
238 | ||
239 | /* | |
53aac0ad FT |
240 | * Weirdified Mac II hardware - all subtly different. Gee thanks |
241 | * Apple. All these boxes seem to have VIA2 in a different place to | |
242 | * the Mac II (+1A000 rather than +4000) | |
1da177e4 LT |
243 | * CSA: see http://developer.apple.com/technotes/hw/hw_09.html |
244 | */ | |
245 | ||
246 | { | |
247 | .ident = MAC_MODEL_IICI, | |
248 | .name = "IIci", | |
249 | .adb_type = MAC_ADB_II, | |
608e287b | 250 | .via_type = MAC_VIA_IICI, |
1da177e4 LT |
251 | .scsi_type = MAC_SCSI_OLD, |
252 | .scc_type = MAC_SCC_II, | |
b87eaec2 | 253 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 254 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
255 | }, { |
256 | .ident = MAC_MODEL_IIFX, | |
257 | .name = "IIfx", | |
258 | .adb_type = MAC_ADB_IOP, | |
608e287b | 259 | .via_type = MAC_VIA_IICI, |
cbad48de | 260 | .scsi_type = MAC_SCSI_IIFX, |
1da177e4 | 261 | .scc_type = MAC_SCC_IOP, |
b87eaec2 | 262 | .expansion_type = MAC_EXP_PDS_NUBUS, |
aee6bff1 | 263 | .floppy_type = MAC_FLOPPY_SWIM_IOP, /* SWIM */ |
1da177e4 LT |
264 | }, { |
265 | .ident = MAC_MODEL_IISI, | |
266 | .name = "IIsi", | |
f74faec6 | 267 | .adb_type = MAC_ADB_EGRET, |
608e287b | 268 | .via_type = MAC_VIA_IICI, |
1da177e4 LT |
269 | .scsi_type = MAC_SCSI_OLD, |
270 | .scc_type = MAC_SCC_II, | |
b87eaec2 | 271 | .expansion_type = MAC_EXP_PDS_NUBUS, |
aee6bff1 | 272 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
273 | }, { |
274 | .ident = MAC_MODEL_IIVI, | |
275 | .name = "IIvi", | |
f74faec6 | 276 | .adb_type = MAC_ADB_EGRET, |
608e287b | 277 | .via_type = MAC_VIA_IICI, |
2e874d17 | 278 | .scsi_type = MAC_SCSI_LC, |
1da177e4 | 279 | .scc_type = MAC_SCC_II, |
b87eaec2 | 280 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 281 | .floppy_type = MAC_FLOPPY_LC, /* SWIM */ |
1da177e4 LT |
282 | }, { |
283 | .ident = MAC_MODEL_IIVX, | |
284 | .name = "IIvx", | |
f74faec6 | 285 | .adb_type = MAC_ADB_EGRET, |
608e287b | 286 | .via_type = MAC_VIA_IICI, |
2e874d17 | 287 | .scsi_type = MAC_SCSI_LC, |
1da177e4 | 288 | .scc_type = MAC_SCC_II, |
b87eaec2 | 289 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 290 | .floppy_type = MAC_FLOPPY_LC, /* SWIM */ |
1da177e4 LT |
291 | }, |
292 | ||
293 | /* | |
53aac0ad | 294 | * Classic models (guessing: similar to SE/30? Nope, similar to LC...) |
1da177e4 LT |
295 | */ |
296 | ||
297 | { | |
298 | .ident = MAC_MODEL_CLII, | |
299 | .name = "Classic II", | |
f74faec6 | 300 | .adb_type = MAC_ADB_EGRET, |
608e287b | 301 | .via_type = MAC_VIA_IICI, |
2e874d17 | 302 | .scsi_type = MAC_SCSI_LC, |
1da177e4 | 303 | .scc_type = MAC_SCC_II, |
aee6bff1 | 304 | .floppy_type = MAC_FLOPPY_LC, /* SWIM */ |
1da177e4 LT |
305 | }, { |
306 | .ident = MAC_MODEL_CCL, | |
307 | .name = "Color Classic", | |
308 | .adb_type = MAC_ADB_CUDA, | |
608e287b | 309 | .via_type = MAC_VIA_IICI, |
2e874d17 | 310 | .scsi_type = MAC_SCSI_LC, |
1da177e4 | 311 | .scc_type = MAC_SCC_II, |
b87eaec2 | 312 | .expansion_type = MAC_EXP_PDS, |
aee6bff1 | 313 | .floppy_type = MAC_FLOPPY_LC, /* SWIM 2 */ |
1b460102 FT |
314 | }, { |
315 | .ident = MAC_MODEL_CCLII, | |
316 | .name = "Color Classic II", | |
317 | .adb_type = MAC_ADB_CUDA, | |
608e287b | 318 | .via_type = MAC_VIA_IICI, |
2e874d17 | 319 | .scsi_type = MAC_SCSI_LC, |
1b460102 | 320 | .scc_type = MAC_SCC_II, |
b87eaec2 | 321 | .expansion_type = MAC_EXP_PDS, |
aee6bff1 | 322 | .floppy_type = MAC_FLOPPY_LC, /* SWIM 2 */ |
7ad93b42 | 323 | }, |
1da177e4 LT |
324 | |
325 | /* | |
53aac0ad | 326 | * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi |
1da177e4 LT |
327 | */ |
328 | ||
329 | { | |
330 | .ident = MAC_MODEL_LC, | |
331 | .name = "LC", | |
f74faec6 | 332 | .adb_type = MAC_ADB_EGRET, |
608e287b | 333 | .via_type = MAC_VIA_IICI, |
2e874d17 | 334 | .scsi_type = MAC_SCSI_LC, |
1da177e4 | 335 | .scc_type = MAC_SCC_II, |
b87eaec2 | 336 | .expansion_type = MAC_EXP_PDS, |
aee6bff1 | 337 | .floppy_type = MAC_FLOPPY_LC, /* SWIM */ |
1da177e4 LT |
338 | }, { |
339 | .ident = MAC_MODEL_LCII, | |
340 | .name = "LC II", | |
f74faec6 | 341 | .adb_type = MAC_ADB_EGRET, |
608e287b | 342 | .via_type = MAC_VIA_IICI, |
2e874d17 | 343 | .scsi_type = MAC_SCSI_LC, |
1da177e4 | 344 | .scc_type = MAC_SCC_II, |
b87eaec2 | 345 | .expansion_type = MAC_EXP_PDS, |
aee6bff1 | 346 | .floppy_type = MAC_FLOPPY_LC, /* SWIM */ |
1da177e4 LT |
347 | }, { |
348 | .ident = MAC_MODEL_LCIII, | |
349 | .name = "LC III", | |
f74faec6 | 350 | .adb_type = MAC_ADB_EGRET, |
608e287b | 351 | .via_type = MAC_VIA_IICI, |
2e874d17 | 352 | .scsi_type = MAC_SCSI_LC, |
1da177e4 | 353 | .scc_type = MAC_SCC_II, |
b87eaec2 | 354 | .expansion_type = MAC_EXP_PDS, |
aee6bff1 | 355 | .floppy_type = MAC_FLOPPY_LC, /* SWIM 2 */ |
1da177e4 LT |
356 | }, |
357 | ||
358 | /* | |
53aac0ad FT |
359 | * Quadra. Video is at 0xF9000000, via is like a MacII. We label it |
360 | * differently as some of the stuff connected to VIA2 seems different. | |
361 | * Better SCSI chip and onboard ethernet using a NatSemi SONIC except | |
362 | * the 660AV and 840AV which use an AMD 79C940 (MACE). | |
363 | * The 700, 900 and 950 have some I/O chips in the wrong place to | |
364 | * confuse us. The 840AV has a SCSI location of its own (same as | |
365 | * the 660AV). | |
1da177e4 LT |
366 | */ |
367 | ||
368 | { | |
369 | .ident = MAC_MODEL_Q605, | |
370 | .name = "Quadra 605", | |
371 | .adb_type = MAC_ADB_CUDA, | |
372 | .via_type = MAC_VIA_QUADRA, | |
373 | .scsi_type = MAC_SCSI_QUADRA, | |
374 | .scc_type = MAC_SCC_QUADRA, | |
b87eaec2 | 375 | .expansion_type = MAC_EXP_PDS, |
aee6bff1 | 376 | .floppy_type = MAC_FLOPPY_QUADRA, /* SWIM 2 */ |
1da177e4 LT |
377 | }, { |
378 | .ident = MAC_MODEL_Q605_ACC, | |
379 | .name = "Quadra 605", | |
380 | .adb_type = MAC_ADB_CUDA, | |
381 | .via_type = MAC_VIA_QUADRA, | |
382 | .scsi_type = MAC_SCSI_QUADRA, | |
383 | .scc_type = MAC_SCC_QUADRA, | |
b87eaec2 | 384 | .expansion_type = MAC_EXP_PDS, |
aee6bff1 | 385 | .floppy_type = MAC_FLOPPY_QUADRA, /* SWIM 2 */ |
1da177e4 LT |
386 | }, { |
387 | .ident = MAC_MODEL_Q610, | |
388 | .name = "Quadra 610", | |
389 | .adb_type = MAC_ADB_II, | |
390 | .via_type = MAC_VIA_QUADRA, | |
391 | .scsi_type = MAC_SCSI_QUADRA, | |
392 | .scc_type = MAC_SCC_QUADRA, | |
393 | .ether_type = MAC_ETHER_SONIC, | |
b87eaec2 | 394 | .expansion_type = MAC_EXP_PDS_NUBUS, |
aee6bff1 | 395 | .floppy_type = MAC_FLOPPY_QUADRA, /* SWIM 2 */ |
1da177e4 LT |
396 | }, { |
397 | .ident = MAC_MODEL_Q630, | |
398 | .name = "Quadra 630", | |
399 | .adb_type = MAC_ADB_CUDA, | |
400 | .via_type = MAC_VIA_QUADRA, | |
401 | .scsi_type = MAC_SCSI_QUADRA, | |
402 | .ide_type = MAC_IDE_QUADRA, | |
403 | .scc_type = MAC_SCC_QUADRA, | |
b87eaec2 | 404 | .expansion_type = MAC_EXP_PDS_COMM, |
aee6bff1 | 405 | .floppy_type = MAC_FLOPPY_QUADRA, /* SWIM 2 */ |
1da177e4 LT |
406 | }, { |
407 | .ident = MAC_MODEL_Q650, | |
408 | .name = "Quadra 650", | |
409 | .adb_type = MAC_ADB_II, | |
410 | .via_type = MAC_VIA_QUADRA, | |
411 | .scsi_type = MAC_SCSI_QUADRA, | |
412 | .scc_type = MAC_SCC_QUADRA, | |
413 | .ether_type = MAC_ETHER_SONIC, | |
b87eaec2 | 414 | .expansion_type = MAC_EXP_PDS_NUBUS, |
aee6bff1 | 415 | .floppy_type = MAC_FLOPPY_QUADRA, /* SWIM 2 */ |
1da177e4 | 416 | }, |
53aac0ad | 417 | /* The Q700 does have a NS Sonic */ |
1da177e4 LT |
418 | { |
419 | .ident = MAC_MODEL_Q700, | |
420 | .name = "Quadra 700", | |
421 | .adb_type = MAC_ADB_II, | |
422 | .via_type = MAC_VIA_QUADRA, | |
423 | .scsi_type = MAC_SCSI_QUADRA2, | |
424 | .scc_type = MAC_SCC_QUADRA, | |
425 | .ether_type = MAC_ETHER_SONIC, | |
b87eaec2 | 426 | .expansion_type = MAC_EXP_PDS_NUBUS, |
aee6bff1 | 427 | .floppy_type = MAC_FLOPPY_QUADRA, /* SWIM */ |
1da177e4 LT |
428 | }, { |
429 | .ident = MAC_MODEL_Q800, | |
430 | .name = "Quadra 800", | |
431 | .adb_type = MAC_ADB_II, | |
432 | .via_type = MAC_VIA_QUADRA, | |
433 | .scsi_type = MAC_SCSI_QUADRA, | |
434 | .scc_type = MAC_SCC_QUADRA, | |
435 | .ether_type = MAC_ETHER_SONIC, | |
b87eaec2 | 436 | .expansion_type = MAC_EXP_PDS_NUBUS, |
aee6bff1 | 437 | .floppy_type = MAC_FLOPPY_QUADRA, /* SWIM 2 */ |
1da177e4 LT |
438 | }, { |
439 | .ident = MAC_MODEL_Q840, | |
440 | .name = "Quadra 840AV", | |
441 | .adb_type = MAC_ADB_CUDA, | |
442 | .via_type = MAC_VIA_QUADRA, | |
443 | .scsi_type = MAC_SCSI_QUADRA3, | |
444 | .scc_type = MAC_SCC_PSC, | |
445 | .ether_type = MAC_ETHER_MACE, | |
b87eaec2 | 446 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 447 | .floppy_type = MAC_FLOPPY_UNSUPPORTED, /* New Age */ |
1da177e4 LT |
448 | }, { |
449 | .ident = MAC_MODEL_Q900, | |
450 | .name = "Quadra 900", | |
451 | .adb_type = MAC_ADB_IOP, | |
452 | .via_type = MAC_VIA_QUADRA, | |
453 | .scsi_type = MAC_SCSI_QUADRA2, | |
454 | .scc_type = MAC_SCC_IOP, | |
455 | .ether_type = MAC_ETHER_SONIC, | |
b87eaec2 | 456 | .expansion_type = MAC_EXP_PDS_NUBUS, |
aee6bff1 | 457 | .floppy_type = MAC_FLOPPY_SWIM_IOP, /* SWIM */ |
1da177e4 LT |
458 | }, { |
459 | .ident = MAC_MODEL_Q950, | |
460 | .name = "Quadra 950", | |
461 | .adb_type = MAC_ADB_IOP, | |
462 | .via_type = MAC_VIA_QUADRA, | |
463 | .scsi_type = MAC_SCSI_QUADRA2, | |
464 | .scc_type = MAC_SCC_IOP, | |
465 | .ether_type = MAC_ETHER_SONIC, | |
b87eaec2 | 466 | .expansion_type = MAC_EXP_PDS_NUBUS, |
aee6bff1 | 467 | .floppy_type = MAC_FLOPPY_SWIM_IOP, /* SWIM */ |
1da177e4 LT |
468 | }, |
469 | ||
470 | /* | |
53aac0ad | 471 | * Performa - more LC type machines |
1da177e4 LT |
472 | */ |
473 | ||
474 | { | |
475 | .ident = MAC_MODEL_P460, | |
53aac0ad | 476 | .name = "Performa 460", |
f74faec6 | 477 | .adb_type = MAC_ADB_EGRET, |
608e287b | 478 | .via_type = MAC_VIA_IICI, |
2e874d17 | 479 | .scsi_type = MAC_SCSI_LC, |
1da177e4 | 480 | .scc_type = MAC_SCC_II, |
b87eaec2 | 481 | .expansion_type = MAC_EXP_PDS, |
aee6bff1 | 482 | .floppy_type = MAC_FLOPPY_LC, /* SWIM 2 */ |
1da177e4 LT |
483 | }, { |
484 | .ident = MAC_MODEL_P475, | |
53aac0ad | 485 | .name = "Performa 475", |
1da177e4 LT |
486 | .adb_type = MAC_ADB_CUDA, |
487 | .via_type = MAC_VIA_QUADRA, | |
488 | .scsi_type = MAC_SCSI_QUADRA, | |
489 | .scc_type = MAC_SCC_II, | |
b87eaec2 | 490 | .expansion_type = MAC_EXP_PDS, |
aee6bff1 | 491 | .floppy_type = MAC_FLOPPY_QUADRA, /* SWIM 2 */ |
1da177e4 LT |
492 | }, { |
493 | .ident = MAC_MODEL_P475F, | |
53aac0ad | 494 | .name = "Performa 475", |
1da177e4 LT |
495 | .adb_type = MAC_ADB_CUDA, |
496 | .via_type = MAC_VIA_QUADRA, | |
497 | .scsi_type = MAC_SCSI_QUADRA, | |
498 | .scc_type = MAC_SCC_II, | |
b87eaec2 | 499 | .expansion_type = MAC_EXP_PDS, |
aee6bff1 | 500 | .floppy_type = MAC_FLOPPY_QUADRA, /* SWIM 2 */ |
1da177e4 LT |
501 | }, { |
502 | .ident = MAC_MODEL_P520, | |
53aac0ad | 503 | .name = "Performa 520", |
1da177e4 | 504 | .adb_type = MAC_ADB_CUDA, |
608e287b | 505 | .via_type = MAC_VIA_IICI, |
2e874d17 | 506 | .scsi_type = MAC_SCSI_LC, |
1da177e4 | 507 | .scc_type = MAC_SCC_II, |
b87eaec2 | 508 | .expansion_type = MAC_EXP_PDS, |
aee6bff1 | 509 | .floppy_type = MAC_FLOPPY_LC, /* SWIM 2 */ |
1da177e4 LT |
510 | }, { |
511 | .ident = MAC_MODEL_P550, | |
53aac0ad | 512 | .name = "Performa 550", |
1da177e4 | 513 | .adb_type = MAC_ADB_CUDA, |
608e287b | 514 | .via_type = MAC_VIA_IICI, |
2e874d17 | 515 | .scsi_type = MAC_SCSI_LC, |
1da177e4 | 516 | .scc_type = MAC_SCC_II, |
b87eaec2 | 517 | .expansion_type = MAC_EXP_PDS, |
aee6bff1 | 518 | .floppy_type = MAC_FLOPPY_LC, /* SWIM 2 */ |
1da177e4 | 519 | }, |
53aac0ad | 520 | /* These have the comm slot, and therefore possibly SONIC ethernet */ |
1da177e4 LT |
521 | { |
522 | .ident = MAC_MODEL_P575, | |
523 | .name = "Performa 575", | |
524 | .adb_type = MAC_ADB_CUDA, | |
525 | .via_type = MAC_VIA_QUADRA, | |
526 | .scsi_type = MAC_SCSI_QUADRA, | |
527 | .scc_type = MAC_SCC_II, | |
b87eaec2 | 528 | .expansion_type = MAC_EXP_PDS_COMM, |
aee6bff1 | 529 | .floppy_type = MAC_FLOPPY_QUADRA, /* SWIM 2 */ |
1da177e4 LT |
530 | }, { |
531 | .ident = MAC_MODEL_P588, | |
532 | .name = "Performa 588", | |
533 | .adb_type = MAC_ADB_CUDA, | |
534 | .via_type = MAC_VIA_QUADRA, | |
535 | .scsi_type = MAC_SCSI_QUADRA, | |
536 | .ide_type = MAC_IDE_QUADRA, | |
537 | .scc_type = MAC_SCC_II, | |
b87eaec2 | 538 | .expansion_type = MAC_EXP_PDS_COMM, |
aee6bff1 | 539 | .floppy_type = MAC_FLOPPY_QUADRA, /* SWIM 2 */ |
1da177e4 LT |
540 | }, { |
541 | .ident = MAC_MODEL_TV, | |
542 | .name = "TV", | |
543 | .adb_type = MAC_ADB_CUDA, | |
608e287b | 544 | .via_type = MAC_VIA_IICI, |
2e874d17 | 545 | .scsi_type = MAC_SCSI_LC, |
1da177e4 | 546 | .scc_type = MAC_SCC_II, |
aee6bff1 | 547 | .floppy_type = MAC_FLOPPY_LC, /* SWIM 2 */ |
1da177e4 LT |
548 | }, { |
549 | .ident = MAC_MODEL_P600, | |
550 | .name = "Performa 600", | |
f74faec6 | 551 | .adb_type = MAC_ADB_EGRET, |
608e287b | 552 | .via_type = MAC_VIA_IICI, |
2e874d17 | 553 | .scsi_type = MAC_SCSI_LC, |
1da177e4 | 554 | .scc_type = MAC_SCC_II, |
b87eaec2 | 555 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 556 | .floppy_type = MAC_FLOPPY_LC, /* SWIM */ |
1da177e4 LT |
557 | }, |
558 | ||
559 | /* | |
53aac0ad FT |
560 | * Centris - just guessing again; maybe like Quadra. |
561 | * The C610 may or may not have SONIC. We probe to make sure. | |
1da177e4 LT |
562 | */ |
563 | ||
1da177e4 LT |
564 | { |
565 | .ident = MAC_MODEL_C610, | |
566 | .name = "Centris 610", | |
567 | .adb_type = MAC_ADB_II, | |
568 | .via_type = MAC_VIA_QUADRA, | |
569 | .scsi_type = MAC_SCSI_QUADRA, | |
570 | .scc_type = MAC_SCC_QUADRA, | |
571 | .ether_type = MAC_ETHER_SONIC, | |
b87eaec2 | 572 | .expansion_type = MAC_EXP_PDS_NUBUS, |
aee6bff1 | 573 | .floppy_type = MAC_FLOPPY_QUADRA, /* SWIM 2 */ |
1da177e4 LT |
574 | }, { |
575 | .ident = MAC_MODEL_C650, | |
576 | .name = "Centris 650", | |
577 | .adb_type = MAC_ADB_II, | |
578 | .via_type = MAC_VIA_QUADRA, | |
579 | .scsi_type = MAC_SCSI_QUADRA, | |
580 | .scc_type = MAC_SCC_QUADRA, | |
581 | .ether_type = MAC_ETHER_SONIC, | |
b87eaec2 | 582 | .expansion_type = MAC_EXP_PDS_NUBUS, |
aee6bff1 | 583 | .floppy_type = MAC_FLOPPY_QUADRA, /* SWIM 2 */ |
1da177e4 LT |
584 | }, { |
585 | .ident = MAC_MODEL_C660, | |
586 | .name = "Centris 660AV", | |
587 | .adb_type = MAC_ADB_CUDA, | |
588 | .via_type = MAC_VIA_QUADRA, | |
589 | .scsi_type = MAC_SCSI_QUADRA3, | |
590 | .scc_type = MAC_SCC_PSC, | |
591 | .ether_type = MAC_ETHER_MACE, | |
b87eaec2 | 592 | .expansion_type = MAC_EXP_PDS_NUBUS, |
aee6bff1 | 593 | .floppy_type = MAC_FLOPPY_UNSUPPORTED, /* New Age */ |
1da177e4 LT |
594 | }, |
595 | ||
596 | /* | |
597 | * The PowerBooks all the same "Combo" custom IC for SCSI and SCC | |
598 | * and a PMU (in two variations?) for ADB. Most of them use the | |
599 | * Quadra-style VIAs. A few models also have IDE from hell. | |
600 | */ | |
601 | ||
602 | { | |
603 | .ident = MAC_MODEL_PB140, | |
604 | .name = "PowerBook 140", | |
605 | .adb_type = MAC_ADB_PB1, | |
606 | .via_type = MAC_VIA_QUADRA, | |
607 | .scsi_type = MAC_SCSI_OLD, | |
608 | .scc_type = MAC_SCC_QUADRA, | |
aee6bff1 | 609 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
610 | }, { |
611 | .ident = MAC_MODEL_PB145, | |
612 | .name = "PowerBook 145", | |
613 | .adb_type = MAC_ADB_PB1, | |
614 | .via_type = MAC_VIA_QUADRA, | |
615 | .scsi_type = MAC_SCSI_OLD, | |
616 | .scc_type = MAC_SCC_QUADRA, | |
aee6bff1 | 617 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
618 | }, { |
619 | .ident = MAC_MODEL_PB150, | |
620 | .name = "PowerBook 150", | |
4107c459 | 621 | .adb_type = MAC_ADB_PB2, |
608e287b | 622 | .via_type = MAC_VIA_IICI, |
1da177e4 LT |
623 | .scsi_type = MAC_SCSI_OLD, |
624 | .ide_type = MAC_IDE_PB, | |
625 | .scc_type = MAC_SCC_QUADRA, | |
aee6bff1 | 626 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
627 | }, { |
628 | .ident = MAC_MODEL_PB160, | |
629 | .name = "PowerBook 160", | |
630 | .adb_type = MAC_ADB_PB1, | |
631 | .via_type = MAC_VIA_QUADRA, | |
632 | .scsi_type = MAC_SCSI_OLD, | |
633 | .scc_type = MAC_SCC_QUADRA, | |
aee6bff1 | 634 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
635 | }, { |
636 | .ident = MAC_MODEL_PB165, | |
637 | .name = "PowerBook 165", | |
638 | .adb_type = MAC_ADB_PB1, | |
639 | .via_type = MAC_VIA_QUADRA, | |
640 | .scsi_type = MAC_SCSI_OLD, | |
641 | .scc_type = MAC_SCC_QUADRA, | |
aee6bff1 | 642 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
643 | }, { |
644 | .ident = MAC_MODEL_PB165C, | |
645 | .name = "PowerBook 165c", | |
646 | .adb_type = MAC_ADB_PB1, | |
647 | .via_type = MAC_VIA_QUADRA, | |
648 | .scsi_type = MAC_SCSI_OLD, | |
649 | .scc_type = MAC_SCC_QUADRA, | |
aee6bff1 | 650 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
651 | }, { |
652 | .ident = MAC_MODEL_PB170, | |
653 | .name = "PowerBook 170", | |
654 | .adb_type = MAC_ADB_PB1, | |
655 | .via_type = MAC_VIA_QUADRA, | |
656 | .scsi_type = MAC_SCSI_OLD, | |
657 | .scc_type = MAC_SCC_QUADRA, | |
aee6bff1 | 658 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
659 | }, { |
660 | .ident = MAC_MODEL_PB180, | |
661 | .name = "PowerBook 180", | |
662 | .adb_type = MAC_ADB_PB1, | |
663 | .via_type = MAC_VIA_QUADRA, | |
664 | .scsi_type = MAC_SCSI_OLD, | |
665 | .scc_type = MAC_SCC_QUADRA, | |
aee6bff1 | 666 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
667 | }, { |
668 | .ident = MAC_MODEL_PB180C, | |
669 | .name = "PowerBook 180c", | |
670 | .adb_type = MAC_ADB_PB1, | |
671 | .via_type = MAC_VIA_QUADRA, | |
672 | .scsi_type = MAC_SCSI_OLD, | |
673 | .scc_type = MAC_SCC_QUADRA, | |
aee6bff1 | 674 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
675 | }, { |
676 | .ident = MAC_MODEL_PB190, | |
677 | .name = "PowerBook 190", | |
678 | .adb_type = MAC_ADB_PB2, | |
679 | .via_type = MAC_VIA_QUADRA, | |
e5f0d2e2 | 680 | .scsi_type = MAC_SCSI_OLD, |
1da177e4 LT |
681 | .ide_type = MAC_IDE_BABOON, |
682 | .scc_type = MAC_SCC_QUADRA, | |
aee6bff1 | 683 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM 2 */ |
1da177e4 LT |
684 | }, { |
685 | .ident = MAC_MODEL_PB520, | |
686 | .name = "PowerBook 520", | |
687 | .adb_type = MAC_ADB_PB2, | |
688 | .via_type = MAC_VIA_QUADRA, | |
cf85d895 | 689 | .scsi_type = MAC_SCSI_OLD, |
1da177e4 LT |
690 | .scc_type = MAC_SCC_QUADRA, |
691 | .ether_type = MAC_ETHER_SONIC, | |
aee6bff1 | 692 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM 2 */ |
1da177e4 LT |
693 | }, |
694 | ||
695 | /* | |
696 | * PowerBook Duos are pretty much like normal PowerBooks | |
697 | * All of these probably have onboard SONIC in the Dock which | |
698 | * means we'll have to probe for it eventually. | |
1da177e4 LT |
699 | */ |
700 | ||
701 | { | |
702 | .ident = MAC_MODEL_PB210, | |
703 | .name = "PowerBook Duo 210", | |
704 | .adb_type = MAC_ADB_PB2, | |
608e287b | 705 | .via_type = MAC_VIA_IICI, |
cbad48de | 706 | .scsi_type = MAC_SCSI_DUO, |
1da177e4 | 707 | .scc_type = MAC_SCC_QUADRA, |
b87eaec2 | 708 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 709 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
710 | }, { |
711 | .ident = MAC_MODEL_PB230, | |
712 | .name = "PowerBook Duo 230", | |
713 | .adb_type = MAC_ADB_PB2, | |
608e287b | 714 | .via_type = MAC_VIA_IICI, |
cbad48de | 715 | .scsi_type = MAC_SCSI_DUO, |
1da177e4 | 716 | .scc_type = MAC_SCC_QUADRA, |
b87eaec2 | 717 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 718 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
719 | }, { |
720 | .ident = MAC_MODEL_PB250, | |
721 | .name = "PowerBook Duo 250", | |
722 | .adb_type = MAC_ADB_PB2, | |
608e287b | 723 | .via_type = MAC_VIA_IICI, |
cbad48de | 724 | .scsi_type = MAC_SCSI_DUO, |
1da177e4 | 725 | .scc_type = MAC_SCC_QUADRA, |
b87eaec2 | 726 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 727 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
728 | }, { |
729 | .ident = MAC_MODEL_PB270C, | |
730 | .name = "PowerBook Duo 270c", | |
731 | .adb_type = MAC_ADB_PB2, | |
608e287b | 732 | .via_type = MAC_VIA_IICI, |
cbad48de | 733 | .scsi_type = MAC_SCSI_DUO, |
1da177e4 | 734 | .scc_type = MAC_SCC_QUADRA, |
b87eaec2 | 735 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 736 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
737 | }, { |
738 | .ident = MAC_MODEL_PB280, | |
739 | .name = "PowerBook Duo 280", | |
740 | .adb_type = MAC_ADB_PB2, | |
608e287b | 741 | .via_type = MAC_VIA_IICI, |
cbad48de | 742 | .scsi_type = MAC_SCSI_DUO, |
1da177e4 | 743 | .scc_type = MAC_SCC_QUADRA, |
b87eaec2 | 744 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 745 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
746 | }, { |
747 | .ident = MAC_MODEL_PB280C, | |
748 | .name = "PowerBook Duo 280c", | |
749 | .adb_type = MAC_ADB_PB2, | |
608e287b | 750 | .via_type = MAC_VIA_IICI, |
cbad48de | 751 | .scsi_type = MAC_SCSI_DUO, |
1da177e4 | 752 | .scc_type = MAC_SCC_QUADRA, |
b87eaec2 | 753 | .expansion_type = MAC_EXP_NUBUS, |
aee6bff1 | 754 | .floppy_type = MAC_FLOPPY_OLD, /* SWIM */ |
1da177e4 LT |
755 | }, |
756 | ||
757 | /* | |
53aac0ad | 758 | * Other stuff? |
1da177e4 | 759 | */ |
53aac0ad | 760 | |
1da177e4 LT |
761 | { |
762 | .ident = -1 | |
763 | } | |
764 | }; | |
765 | ||
80614e5a FT |
766 | static struct resource scc_a_rsrcs[] = { |
767 | { .flags = IORESOURCE_MEM }, | |
768 | { .flags = IORESOURCE_IRQ }, | |
769 | }; | |
770 | ||
771 | static struct resource scc_b_rsrcs[] = { | |
772 | { .flags = IORESOURCE_MEM }, | |
773 | { .flags = IORESOURCE_IRQ }, | |
774 | }; | |
775 | ||
776 | struct platform_device scc_a_pdev = { | |
777 | .name = "scc", | |
778 | .id = 0, | |
779 | .num_resources = ARRAY_SIZE(scc_a_rsrcs), | |
780 | .resource = scc_a_rsrcs, | |
781 | }; | |
782 | EXPORT_SYMBOL(scc_a_pdev); | |
783 | ||
784 | struct platform_device scc_b_pdev = { | |
785 | .name = "scc", | |
786 | .id = 1, | |
787 | .num_resources = ARRAY_SIZE(scc_b_rsrcs), | |
788 | .resource = scc_b_rsrcs, | |
789 | }; | |
790 | EXPORT_SYMBOL(scc_b_pdev); | |
791 | ||
8dfbdf4a | 792 | static void __init mac_identify(void) |
1da177e4 LT |
793 | { |
794 | struct mac_model *m; | |
795 | ||
796 | /* Penguin data useful? */ | |
797 | int model = mac_bi_data.id; | |
798 | if (!model) { | |
799 | /* no bootinfo model id -> NetBSD booter was used! */ | |
800 | /* XXX FIXME: breaks for model > 31 */ | |
6ff5801a | 801 | model = (mac_bi_data.cpuid >> 2) & 63; |
889121b4 | 802 | pr_warn("No bootinfo model ID, using cpuid instead (obsolete bootloader?)\n"); |
1da177e4 LT |
803 | } |
804 | ||
805 | macintosh_config = mac_data_table; | |
6ff5801a | 806 | for (m = macintosh_config; m->ident != -1; m++) { |
1da177e4 LT |
807 | if (m->ident == model) { |
808 | macintosh_config = m; | |
809 | break; | |
810 | } | |
811 | } | |
812 | ||
80614e5a FT |
813 | /* Set up serial port resources for the console initcall. */ |
814 | ||
815 | scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2; | |
816 | scc_a_rsrcs[0].end = scc_a_rsrcs[0].start; | |
817 | scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase; | |
818 | scc_b_rsrcs[0].end = scc_b_rsrcs[0].start; | |
819 | ||
820 | switch (macintosh_config->scc_type) { | |
821 | case MAC_SCC_PSC: | |
822 | scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A; | |
823 | scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B; | |
824 | break; | |
825 | default: | |
da3fb3c9 FT |
826 | /* On non-PSC machines, the serial ports share an IRQ. */ |
827 | if (macintosh_config->ident == MAC_MODEL_IIFX) { | |
828 | scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; | |
829 | scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; | |
830 | } else { | |
831 | scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_AUTO_4; | |
832 | scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_AUTO_4; | |
833 | } | |
80614e5a FT |
834 | break; |
835 | } | |
836 | ||
53aac0ad FT |
837 | /* |
838 | * We need to pre-init the IOPs, if any. Otherwise | |
839 | * the serial console won't work if the user had | |
840 | * the serial ports set to "Faster" mode in MacOS. | |
841 | */ | |
1da177e4 | 842 | iop_preinit(); |
1da177e4 | 843 | |
889121b4 | 844 | pr_info("Detected Macintosh model: %d\n", model); |
1da177e4 LT |
845 | |
846 | /* | |
847 | * Report booter data: | |
848 | */ | |
6ff5801a | 849 | printk(KERN_DEBUG " Penguin bootinfo data:\n"); |
889121b4 | 850 | printk(KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n", |
1da177e4 LT |
851 | mac_bi_data.videoaddr, mac_bi_data.videorow, |
852 | mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, | |
853 | mac_bi_data.dimensions >> 16); | |
b9b0d8b4 | 854 | printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n", |
1da177e4 LT |
855 | mac_bi_data.videological, mac_orig_videoaddr, |
856 | mac_bi_data.sccbase); | |
b9b0d8b4 | 857 | printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n", |
1da177e4 | 858 | mac_bi_data.boottime, mac_bi_data.gmtbias); |
b9b0d8b4 | 859 | printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n", |
1da177e4 | 860 | mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); |
1da177e4 | 861 | |
1da177e4 | 862 | iop_init(); |
1da177e4 | 863 | oss_init(); |
7a0bb442 | 864 | via_init(); |
1da177e4 LT |
865 | psc_init(); |
866 | baboon_init(); | |
18814ee8 FT |
867 | |
868 | #ifdef CONFIG_ADB_CUDA | |
869 | find_via_cuda(); | |
870 | #endif | |
ebd72227 | 871 | #ifdef CONFIG_ADB_PMU |
a64138ec FT |
872 | find_via_pmu(); |
873 | #endif | |
1da177e4 LT |
874 | } |
875 | ||
8dfbdf4a | 876 | static void __init mac_report_hardware(void) |
1da177e4 | 877 | { |
889121b4 | 878 | pr_info("Apple Macintosh %s\n", macintosh_config->name); |
1da177e4 LT |
879 | } |
880 | ||
881 | static void mac_get_model(char *str) | |
882 | { | |
6ff5801a | 883 | strcpy(str, "Macintosh "); |
1da177e4 LT |
884 | strcat(str, macintosh_config->name); |
885 | } | |
8852ecd9 | 886 | |
cbad48de FT |
887 | static const struct resource mac_scsi_iifx_rsrc[] __initconst = { |
888 | { | |
889 | .flags = IORESOURCE_IRQ, | |
890 | .start = IRQ_MAC_SCSI, | |
891 | .end = IRQ_MAC_SCSI, | |
892 | }, { | |
893 | .flags = IORESOURCE_MEM, | |
894 | .start = 0x50008000, | |
895 | .end = 0x50009FFF, | |
8fb9a64e FT |
896 | }, { |
897 | .flags = IORESOURCE_MEM, | |
898 | .start = 0x50008000, | |
899 | .end = 0x50009FFF, | |
cbad48de FT |
900 | }, |
901 | }; | |
902 | ||
903 | static const struct resource mac_scsi_duo_rsrc[] __initconst = { | |
904 | { | |
905 | .flags = IORESOURCE_MEM, | |
906 | .start = 0xFEE02000, | |
907 | .end = 0xFEE03FFF, | |
908 | }, | |
909 | }; | |
910 | ||
911 | static const struct resource mac_scsi_old_rsrc[] __initconst = { | |
912 | { | |
913 | .flags = IORESOURCE_IRQ, | |
914 | .start = IRQ_MAC_SCSI, | |
915 | .end = IRQ_MAC_SCSI, | |
916 | }, { | |
917 | .flags = IORESOURCE_MEM, | |
918 | .start = 0x50010000, | |
919 | .end = 0x50011FFF, | |
920 | }, { | |
921 | .flags = IORESOURCE_MEM, | |
922 | .start = 0x50006000, | |
923 | .end = 0x50007FFF, | |
924 | }, | |
925 | }; | |
926 | ||
cbad48de FT |
927 | static const struct resource mac_scsi_ccl_rsrc[] __initconst = { |
928 | { | |
929 | .flags = IORESOURCE_IRQ, | |
930 | .start = IRQ_MAC_SCSI, | |
931 | .end = IRQ_MAC_SCSI, | |
932 | }, { | |
933 | .flags = IORESOURCE_MEM, | |
934 | .start = 0x50F10000, | |
935 | .end = 0x50F11FFF, | |
936 | }, { | |
937 | .flags = IORESOURCE_MEM, | |
938 | .start = 0x50F06000, | |
939 | .end = 0x50F07FFF, | |
940 | }, | |
941 | }; | |
942 | ||
8852ecd9 LV |
943 | int __init mac_platform_init(void) |
944 | { | |
aee6bff1 | 945 | phys_addr_t swim_base = 0; |
8852ecd9 | 946 | |
6cfeba53 GU |
947 | if (!MACH_IS_MAC) |
948 | return -ENODEV; | |
949 | ||
80614e5a FT |
950 | /* |
951 | * Serial devices | |
952 | */ | |
953 | ||
954 | platform_device_register(&scc_a_pdev); | |
955 | platform_device_register(&scc_b_pdev); | |
956 | ||
2724daf4 FT |
957 | /* |
958 | * Floppy device | |
959 | */ | |
960 | ||
8852ecd9 | 961 | switch (macintosh_config->floppy_type) { |
aee6bff1 FT |
962 | case MAC_FLOPPY_QUADRA: |
963 | swim_base = 0x5001E000; | |
8852ecd9 | 964 | break; |
aee6bff1 FT |
965 | case MAC_FLOPPY_OLD: |
966 | swim_base = 0x50016000; | |
8852ecd9 | 967 | break; |
aee6bff1 FT |
968 | case MAC_FLOPPY_LC: |
969 | swim_base = 0x50F16000; | |
2724daf4 | 970 | break; |
8852ecd9 LV |
971 | } |
972 | ||
2724daf4 | 973 | if (swim_base) { |
a9373f40 FT |
974 | struct resource swim_rsrc = { |
975 | .flags = IORESOURCE_MEM, | |
aee6bff1 FT |
976 | .start = swim_base, |
977 | .end = swim_base + 0x1FFF, | |
a9373f40 FT |
978 | }; |
979 | ||
980 | platform_device_register_simple("swim", -1, &swim_rsrc, 1); | |
2724daf4 | 981 | } |
8852ecd9 | 982 | |
cff75f1f FT |
983 | /* |
984 | * SCSI device(s) | |
985 | */ | |
986 | ||
987 | switch (macintosh_config->scsi_type) { | |
988 | case MAC_SCSI_QUADRA: | |
989 | case MAC_SCSI_QUADRA3: | |
a9373f40 | 990 | platform_device_register_simple("mac_esp", 0, NULL, 0); |
cff75f1f FT |
991 | break; |
992 | case MAC_SCSI_QUADRA2: | |
a9373f40 | 993 | platform_device_register_simple("mac_esp", 0, NULL, 0); |
cff75f1f FT |
994 | if ((macintosh_config->ident == MAC_MODEL_Q900) || |
995 | (macintosh_config->ident == MAC_MODEL_Q950)) | |
a9373f40 | 996 | platform_device_register_simple("mac_esp", 1, NULL, 0); |
cff75f1f | 997 | break; |
cbad48de FT |
998 | case MAC_SCSI_IIFX: |
999 | /* Addresses from The Guide to Mac Family Hardware. | |
1000 | * $5000 8000 - $5000 9FFF: SCSI DMA | |
8fb9a64e | 1001 | * $5000 A000 - $5000 BFFF: Alternate SCSI |
cbad48de FT |
1002 | * $5000 C000 - $5000 DFFF: Alternate SCSI (DMA) |
1003 | * $5000 E000 - $5000 FFFF: Alternate SCSI (Hsk) | |
8fb9a64e FT |
1004 | * The A/UX header file sys/uconfig.h says $50F0 8000. |
1005 | * The "SCSI DMA" custom IC embeds the 53C80 core and | |
1006 | * supports Programmed IO, DMA and PDMA (hardware handshake). | |
cbad48de FT |
1007 | */ |
1008 | platform_device_register_simple("mac_scsi", 0, | |
1009 | mac_scsi_iifx_rsrc, ARRAY_SIZE(mac_scsi_iifx_rsrc)); | |
1010 | break; | |
1011 | case MAC_SCSI_DUO: | |
1012 | /* Addresses from the Duo Dock II Developer Note. | |
1013 | * $FEE0 2000 - $FEE0 3FFF: normal mode | |
1014 | * $FEE0 4000 - $FEE0 5FFF: pseudo DMA without /DRQ | |
1015 | * $FEE0 6000 - $FEE0 7FFF: pseudo DMA with /DRQ | |
1016 | * The NetBSD code indicates that both 5380 chips share | |
1017 | * an IRQ (?) which would need careful handling (see mac_esp). | |
1018 | */ | |
1019 | platform_device_register_simple("mac_scsi", 1, | |
1020 | mac_scsi_duo_rsrc, ARRAY_SIZE(mac_scsi_duo_rsrc)); | |
df561f66 | 1021 | fallthrough; |
cbad48de FT |
1022 | case MAC_SCSI_OLD: |
1023 | /* Addresses from Developer Notes for Duo System, | |
1024 | * PowerBook 180 & 160, 140 & 170, Macintosh IIsi | |
1025 | * and also from The Guide to Mac Family Hardware for | |
1026 | * SE/30, II, IIx, IIcx, IIci. | |
1027 | * $5000 6000 - $5000 7FFF: pseudo-DMA with /DRQ | |
1028 | * $5001 0000 - $5001 1FFF: normal mode | |
1029 | * $5001 2000 - $5001 3FFF: pseudo-DMA without /DRQ | |
1030 | * GMFH says that $5000 0000 - $50FF FFFF "wraps | |
1031 | * $5000 0000 - $5001 FFFF eight times" (!) | |
1032 | * mess.org says IIci and Color Classic do not alias | |
1033 | * I/O address space. | |
1034 | */ | |
1035 | platform_device_register_simple("mac_scsi", 0, | |
1036 | mac_scsi_old_rsrc, ARRAY_SIZE(mac_scsi_old_rsrc)); | |
1037 | break; | |
2e874d17 FT |
1038 | case MAC_SCSI_LC: |
1039 | /* Addresses from Mac LC data in Designing Cards & Drivers 3ed. | |
1040 | * Also from the Developer Notes for Classic II, LC III, | |
1041 | * Color Classic and IIvx. | |
cbad48de FT |
1042 | * $50F0 6000 - $50F0 7FFF: SCSI handshake |
1043 | * $50F1 0000 - $50F1 1FFF: SCSI | |
1044 | * $50F1 2000 - $50F1 3FFF: SCSI DMA | |
1045 | */ | |
1046 | platform_device_register_simple("mac_scsi", 0, | |
1047 | mac_scsi_ccl_rsrc, ARRAY_SIZE(mac_scsi_ccl_rsrc)); | |
1048 | break; | |
cff75f1f FT |
1049 | } |
1050 | ||
eeb9c182 FT |
1051 | /* |
1052 | * Ethernet device | |
1053 | */ | |
1054 | ||
b87eaec2 FT |
1055 | if (macintosh_config->ether_type == MAC_ETHER_SONIC || |
1056 | macintosh_config->expansion_type == MAC_EXP_PDS_COMM) | |
a9373f40 | 1057 | platform_device_register_simple("macsonic", -1, NULL, 0); |
b87eaec2 | 1058 | |
43bf2e6d FT |
1059 | if (macintosh_config->expansion_type == MAC_EXP_PDS || |
1060 | macintosh_config->expansion_type == MAC_EXP_PDS_COMM) | |
1061 | platform_device_register_simple("mac89x0", -1, NULL, 0); | |
1062 | ||
b87eaec2 | 1063 | if (macintosh_config->ether_type == MAC_ETHER_MACE) |
a9373f40 | 1064 | platform_device_register_simple("macmace", -1, NULL, 0); |
eeb9c182 | 1065 | |
2724daf4 | 1066 | return 0; |
8852ecd9 LV |
1067 | } |
1068 | ||
1069 | arch_initcall(mac_platform_init); |