blob: b20b1318462cb190d67ab62700c81312fbb0ecf2 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/module.h>
14#include <linux/types.h>
15#include <linux/mm.h>
16#include <linux/tty.h>
17#include <linux/console.h>
18#include <linux/interrupt.h>
19/* keyb */
20#include <linux/random.h>
21#include <linux/delay.h>
22/* keyb */
23#include <linux/init.h>
24#include <linux/vt_kern.h>
Laurent Vivier8852ecd2008-11-15 16:10:10 +010025#include <linux/platform_device.h>
Finn Thain18814ee2009-11-17 20:03:05 +110026#include <linux/adb.h>
27#include <linux/cuda.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
29#define BOOTINFO_COMPAT_1_0
30#include <asm/setup.h>
31#include <asm/bootinfo.h>
32
33#include <asm/system.h>
34#include <asm/io.h>
35#include <asm/irq.h>
36#include <asm/pgtable.h>
37#include <asm/rtc.h>
38#include <asm/machdep.h>
39
40#include <asm/macintosh.h>
41#include <asm/macints.h>
42#include <asm/machw.h>
43
44#include <asm/mac_iop.h>
45#include <asm/mac_via.h>
46#include <asm/mac_oss.h>
47#include <asm/mac_psc.h>
48
49/* Mac bootinfo struct */
Linus Torvalds1da177e2005-04-16 15:20:36 -070050struct mac_booter_data mac_bi_data;
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Linus Torvalds1da177e2005-04-16 15:20:36 -070052/* The phys. video addr. - might be bogus on some machines */
Adrian Bunk8dfbdf42008-07-17 21:16:25 +020053static unsigned long mac_orig_videoaddr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
55/* Mac specific timer functions */
Roman Zippel6ff58012007-05-01 22:32:43 +020056extern unsigned long mac_gettimeoffset(void);
57extern int mac_hwclk(int, struct rtc_time *);
58extern int mac_set_clock_mmss(unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -070059extern void iop_preinit(void);
60extern void iop_init(void);
61extern void via_init(void);
David Howells40220c12006-10-09 12:19:47 +010062extern void via_init_clock(irq_handler_t func);
Linus Torvalds1da177e2005-04-16 15:20:36 -070063extern void via_flush_cache(void);
64extern void oss_init(void);
65extern void psc_init(void);
66extern void baboon_init(void);
67
68extern void mac_mksound(unsigned int, unsigned int);
69
Linus Torvalds1da177e2005-04-16 15:20:36 -070070static void mac_get_model(char *str);
Adrian Bunk8dfbdf42008-07-17 21:16:25 +020071static void mac_identify(void);
72static void mac_report_hardware(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070073
Finn Thain93edd022011-10-24 01:11:12 +110074#ifdef CONFIG_EARLY_PRINTK
75asmlinkage void __init mac_early_print(const char *s, unsigned n);
76
77static void __init mac_early_cons_write(struct console *con,
78 const char *s, unsigned n)
79{
80 mac_early_print(s, n);
81}
82
83static struct console __initdata mac_early_cons = {
84 .name = "early",
85 .write = mac_early_cons_write,
86 .flags = CON_PRINTBUFFER | CON_BOOT,
87 .index = -1
88};
89
90int __init mac_unregister_early_cons(void)
91{
92 /* mac_early_print can't be used after init sections are discarded */
93 return unregister_console(&mac_early_cons);
94}
95
96late_initcall(mac_unregister_early_cons);
97#endif
98
Al Viro66a3f822007-07-20 04:33:28 +010099static void __init mac_sched_init(irq_handler_t vector)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100{
101 via_init_clock(vector);
102}
103
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104/*
105 * Parse a Macintosh-specific record in the bootinfo
106 */
107
108int __init mac_parse_bootinfo(const struct bi_record *record)
109{
Roman Zippel6ff58012007-05-01 22:32:43 +0200110 int unknown = 0;
111 const u_long *data = record->data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112
Roman Zippel6ff58012007-05-01 22:32:43 +0200113 switch (record->tag) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114 case BI_MAC_MODEL:
Roman Zippel6ff58012007-05-01 22:32:43 +0200115 mac_bi_data.id = *data;
116 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117 case BI_MAC_VADDR:
Roman Zippel6ff58012007-05-01 22:32:43 +0200118 mac_bi_data.videoaddr = *data;
119 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 case BI_MAC_VDEPTH:
Roman Zippel6ff58012007-05-01 22:32:43 +0200121 mac_bi_data.videodepth = *data;
122 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123 case BI_MAC_VROW:
Roman Zippel6ff58012007-05-01 22:32:43 +0200124 mac_bi_data.videorow = *data;
125 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700126 case BI_MAC_VDIM:
Roman Zippel6ff58012007-05-01 22:32:43 +0200127 mac_bi_data.dimensions = *data;
128 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 case BI_MAC_VLOGICAL:
Roman Zippel6ff58012007-05-01 22:32:43 +0200130 mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
131 mac_orig_videoaddr = *data;
132 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133 case BI_MAC_SCCBASE:
Roman Zippel6ff58012007-05-01 22:32:43 +0200134 mac_bi_data.sccbase = *data;
135 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136 case BI_MAC_BTIME:
Roman Zippel6ff58012007-05-01 22:32:43 +0200137 mac_bi_data.boottime = *data;
138 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139 case BI_MAC_GMTBIAS:
Roman Zippel6ff58012007-05-01 22:32:43 +0200140 mac_bi_data.gmtbias = *data;
141 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142 case BI_MAC_MEMSIZE:
Roman Zippel6ff58012007-05-01 22:32:43 +0200143 mac_bi_data.memsize = *data;
144 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 case BI_MAC_CPUID:
Roman Zippel6ff58012007-05-01 22:32:43 +0200146 mac_bi_data.cpuid = *data;
147 break;
148 case BI_MAC_ROMBASE:
149 mac_bi_data.rombase = *data;
150 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151 default:
Roman Zippel6ff58012007-05-01 22:32:43 +0200152 unknown = 1;
153 break;
154 }
155 return unknown;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156}
157
158/*
159 * Flip into 24bit mode for an instant - flushes the L2 cache card. We
160 * have to disable interrupts for this. Our IRQ handlers will crap
161 * themselves if they take an IRQ in 24bit mode!
162 */
163
164static void mac_cache_card_flush(int writeback)
165{
166 unsigned long flags;
Roman Zippel6ff58012007-05-01 22:32:43 +0200167
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168 local_irq_save(flags);
169 via_flush_cache();
170 local_irq_restore(flags);
171}
172
173void __init config_mac(void)
174{
Roman Zippel6ff58012007-05-01 22:32:43 +0200175 if (!MACH_IS_MAC)
Frans Popb9b0d8b2010-02-06 18:47:11 +0100176 printk(KERN_ERR "ERROR: no Mac, but config_mac() called!!\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177
Roman Zippel6ff58012007-05-01 22:32:43 +0200178 mach_sched_init = mac_sched_init;
179 mach_init_IRQ = mac_init_IRQ;
180 mach_get_model = mac_get_model;
181 mach_gettimeoffset = mac_gettimeoffset;
Roman Zippel6ff58012007-05-01 22:32:43 +0200182 mach_hwclk = mac_hwclk;
Roman Zippel6ff58012007-05-01 22:32:43 +0200183 mach_set_clock_mmss = mac_set_clock_mmss;
184 mach_reset = mac_reset;
185 mach_halt = mac_poweroff;
186 mach_power_off = mac_poweroff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187 mach_max_dma_address = 0xffffffff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
Roman Zippel6ff58012007-05-01 22:32:43 +0200189 mach_beep = mac_mksound;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700191
Finn Thain93edd022011-10-24 01:11:12 +1100192#ifdef CONFIG_EARLY_PRINTK
193 register_console(&mac_early_cons);
194#endif
195
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196 /*
197 * Determine hardware present
198 */
199
200 mac_identify();
201 mac_report_hardware();
202
Roman Zippel6ff58012007-05-01 22:32:43 +0200203 /*
204 * AFAIK only the IIci takes a cache card. The IIfx has onboard
205 * cache ... someone needs to figure out how to tell if it's on or
206 * not.
207 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208
209 if (macintosh_config->ident == MAC_MODEL_IICI
Roman Zippel6ff58012007-05-01 22:32:43 +0200210 || macintosh_config->ident == MAC_MODEL_IIFX)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211 mach_l2_flush = mac_cache_card_flush;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212}
213
214
215/*
Finn Thain53aac0a2009-11-04 00:39:09 +1100216 * Macintosh Table: hardcoded model configuration data.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217 *
Finn Thain53aac0a2009-11-04 00:39:09 +1100218 * Much of this was defined by Alan, based on who knows what docs.
219 * I've added a lot more, and some of that was pure guesswork based
220 * on hardware pages present on the Mac web site. Possibly wildly
221 * inaccurate, so look here if a new Mac model won't run. Example: if
222 * a Mac crashes immediately after the VIA1 registers have been dumped
223 * to the screen, it probably died attempting to read DirB on a RBV.
224 * Meaning it should have MAC_VIA_IIci here :-)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225 */
226
227struct mac_model *macintosh_config;
228EXPORT_SYMBOL(macintosh_config);
229
Roman Zippel6ff58012007-05-01 22:32:43 +0200230static struct mac_model mac_data_table[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100232 * We'll pretend to be a Macintosh II, that's pretty safe.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233 */
234
235 {
236 .ident = MAC_MODEL_II,
237 .name = "Unknown",
238 .adb_type = MAC_ADB_II,
239 .via_type = MAC_VIA_II,
240 .scsi_type = MAC_SCSI_OLD,
241 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100242 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100243 .floppy_type = MAC_FLOPPY_IWM,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700244 },
245
246 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100247 * Original Mac II hardware
Linus Torvalds1da177e2005-04-16 15:20:36 -0700248 */
249
250 {
251 .ident = MAC_MODEL_II,
252 .name = "II",
253 .adb_type = MAC_ADB_II,
254 .via_type = MAC_VIA_II,
255 .scsi_type = MAC_SCSI_OLD,
256 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100257 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100258 .floppy_type = MAC_FLOPPY_IWM,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259 }, {
260 .ident = MAC_MODEL_IIX,
261 .name = "IIx",
262 .adb_type = MAC_ADB_II,
263 .via_type = MAC_VIA_II,
264 .scsi_type = MAC_SCSI_OLD,
265 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100266 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100267 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700268 }, {
269 .ident = MAC_MODEL_IICX,
270 .name = "IIcx",
271 .adb_type = MAC_ADB_II,
272 .via_type = MAC_VIA_II,
273 .scsi_type = MAC_SCSI_OLD,
274 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100275 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100276 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277 }, {
278 .ident = MAC_MODEL_SE30,
279 .name = "SE/30",
280 .adb_type = MAC_ADB_II,
281 .via_type = MAC_VIA_II,
282 .scsi_type = MAC_SCSI_OLD,
283 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100284 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100285 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286 },
287
288 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100289 * Weirdified Mac II hardware - all subtly different. Gee thanks
290 * Apple. All these boxes seem to have VIA2 in a different place to
291 * the Mac II (+1A000 rather than +4000)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292 * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
293 */
294
295 {
296 .ident = MAC_MODEL_IICI,
297 .name = "IIci",
298 .adb_type = MAC_ADB_II,
299 .via_type = MAC_VIA_IIci,
300 .scsi_type = MAC_SCSI_OLD,
301 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100302 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100303 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700304 }, {
305 .ident = MAC_MODEL_IIFX,
306 .name = "IIfx",
307 .adb_type = MAC_ADB_IOP,
308 .via_type = MAC_VIA_IIci,
309 .scsi_type = MAC_SCSI_OLD,
310 .scc_type = MAC_SCC_IOP,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100311 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100312 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313 }, {
314 .ident = MAC_MODEL_IISI,
315 .name = "IIsi",
316 .adb_type = MAC_ADB_IISI,
317 .via_type = MAC_VIA_IIci,
318 .scsi_type = MAC_SCSI_OLD,
319 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100320 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100321 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700322 }, {
323 .ident = MAC_MODEL_IIVI,
324 .name = "IIvi",
325 .adb_type = MAC_ADB_IISI,
326 .via_type = MAC_VIA_IIci,
327 .scsi_type = MAC_SCSI_OLD,
328 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100329 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100330 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700331 }, {
332 .ident = MAC_MODEL_IIVX,
333 .name = "IIvx",
334 .adb_type = MAC_ADB_IISI,
335 .via_type = MAC_VIA_IIci,
336 .scsi_type = MAC_SCSI_OLD,
337 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100338 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100339 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340 },
341
342 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100343 * Classic models (guessing: similar to SE/30? Nope, similar to LC...)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344 */
345
346 {
347 .ident = MAC_MODEL_CLII,
348 .name = "Classic II",
349 .adb_type = MAC_ADB_IISI,
350 .via_type = MAC_VIA_IIci,
351 .scsi_type = MAC_SCSI_OLD,
352 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100353 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100354 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700355 }, {
356 .ident = MAC_MODEL_CCL,
357 .name = "Color Classic",
358 .adb_type = MAC_ADB_CUDA,
359 .via_type = MAC_VIA_IIci,
360 .scsi_type = MAC_SCSI_OLD,
361 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100362 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100363 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Finn Thain1b460102010-05-29 03:27:18 +1000364 }, {
365 .ident = MAC_MODEL_CCLII,
366 .name = "Color Classic II",
367 .adb_type = MAC_ADB_CUDA,
368 .via_type = MAC_VIA_IIci,
369 .scsi_type = MAC_SCSI_OLD,
370 .scc_type = MAC_SCC_II,
371 .nubus_type = MAC_NUBUS,
372 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100373 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700374
375 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100376 * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377 */
378
379 {
380 .ident = MAC_MODEL_LC,
381 .name = "LC",
382 .adb_type = MAC_ADB_IISI,
383 .via_type = MAC_VIA_IIci,
384 .scsi_type = MAC_SCSI_OLD,
385 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100386 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100387 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388 }, {
389 .ident = MAC_MODEL_LCII,
390 .name = "LC II",
391 .adb_type = MAC_ADB_IISI,
392 .via_type = MAC_VIA_IIci,
393 .scsi_type = MAC_SCSI_OLD,
394 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100395 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100396 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397 }, {
398 .ident = MAC_MODEL_LCIII,
399 .name = "LC III",
400 .adb_type = MAC_ADB_IISI,
401 .via_type = MAC_VIA_IIci,
402 .scsi_type = MAC_SCSI_OLD,
403 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100404 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100405 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700406 },
407
408 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100409 * Quadra. Video is at 0xF9000000, via is like a MacII. We label it
410 * differently as some of the stuff connected to VIA2 seems different.
411 * Better SCSI chip and onboard ethernet using a NatSemi SONIC except
412 * the 660AV and 840AV which use an AMD 79C940 (MACE).
413 * The 700, 900 and 950 have some I/O chips in the wrong place to
414 * confuse us. The 840AV has a SCSI location of its own (same as
415 * the 660AV).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700416 */
417
418 {
419 .ident = MAC_MODEL_Q605,
420 .name = "Quadra 605",
421 .adb_type = MAC_ADB_CUDA,
422 .via_type = MAC_VIA_QUADRA,
423 .scsi_type = MAC_SCSI_QUADRA,
424 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100425 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100426 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700427 }, {
428 .ident = MAC_MODEL_Q605_ACC,
429 .name = "Quadra 605",
430 .adb_type = MAC_ADB_CUDA,
431 .via_type = MAC_VIA_QUADRA,
432 .scsi_type = MAC_SCSI_QUADRA,
433 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100434 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100435 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436 }, {
437 .ident = MAC_MODEL_Q610,
438 .name = "Quadra 610",
439 .adb_type = MAC_ADB_II,
440 .via_type = MAC_VIA_QUADRA,
441 .scsi_type = MAC_SCSI_QUADRA,
442 .scc_type = MAC_SCC_QUADRA,
443 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100444 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100445 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700446 }, {
447 .ident = MAC_MODEL_Q630,
448 .name = "Quadra 630",
449 .adb_type = MAC_ADB_CUDA,
450 .via_type = MAC_VIA_QUADRA,
451 .scsi_type = MAC_SCSI_QUADRA,
452 .ide_type = MAC_IDE_QUADRA,
453 .scc_type = MAC_SCC_QUADRA,
454 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100455 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100456 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700457 }, {
458 .ident = MAC_MODEL_Q650,
459 .name = "Quadra 650",
460 .adb_type = MAC_ADB_II,
461 .via_type = MAC_VIA_QUADRA,
462 .scsi_type = MAC_SCSI_QUADRA,
463 .scc_type = MAC_SCC_QUADRA,
464 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100465 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100466 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467 },
Finn Thain53aac0a2009-11-04 00:39:09 +1100468 /* The Q700 does have a NS Sonic */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700469 {
470 .ident = MAC_MODEL_Q700,
471 .name = "Quadra 700",
472 .adb_type = MAC_ADB_II,
473 .via_type = MAC_VIA_QUADRA,
474 .scsi_type = MAC_SCSI_QUADRA2,
475 .scc_type = MAC_SCC_QUADRA,
476 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100477 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100478 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479 }, {
480 .ident = MAC_MODEL_Q800,
481 .name = "Quadra 800",
482 .adb_type = MAC_ADB_II,
483 .via_type = MAC_VIA_QUADRA,
484 .scsi_type = MAC_SCSI_QUADRA,
485 .scc_type = MAC_SCC_QUADRA,
486 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100487 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100488 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489 }, {
490 .ident = MAC_MODEL_Q840,
491 .name = "Quadra 840AV",
492 .adb_type = MAC_ADB_CUDA,
493 .via_type = MAC_VIA_QUADRA,
494 .scsi_type = MAC_SCSI_QUADRA3,
495 .scc_type = MAC_SCC_PSC,
496 .ether_type = MAC_ETHER_MACE,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100497 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100498 .floppy_type = MAC_FLOPPY_AV,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700499 }, {
500 .ident = MAC_MODEL_Q900,
501 .name = "Quadra 900",
502 .adb_type = MAC_ADB_IOP,
503 .via_type = MAC_VIA_QUADRA,
504 .scsi_type = MAC_SCSI_QUADRA2,
505 .scc_type = MAC_SCC_IOP,
506 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100507 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100508 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700509 }, {
510 .ident = MAC_MODEL_Q950,
511 .name = "Quadra 950",
512 .adb_type = MAC_ADB_IOP,
513 .via_type = MAC_VIA_QUADRA,
514 .scsi_type = MAC_SCSI_QUADRA2,
515 .scc_type = MAC_SCC_IOP,
516 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100517 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100518 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700519 },
520
521 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100522 * Performa - more LC type machines
Linus Torvalds1da177e2005-04-16 15:20:36 -0700523 */
524
525 {
526 .ident = MAC_MODEL_P460,
Finn Thain53aac0a2009-11-04 00:39:09 +1100527 .name = "Performa 460",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700528 .adb_type = MAC_ADB_IISI,
529 .via_type = MAC_VIA_IIci,
530 .scsi_type = MAC_SCSI_OLD,
531 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100532 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100533 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700534 }, {
535 .ident = MAC_MODEL_P475,
Finn Thain53aac0a2009-11-04 00:39:09 +1100536 .name = "Performa 475",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700537 .adb_type = MAC_ADB_CUDA,
538 .via_type = MAC_VIA_QUADRA,
539 .scsi_type = MAC_SCSI_QUADRA,
540 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100541 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100542 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700543 }, {
544 .ident = MAC_MODEL_P475F,
Finn Thain53aac0a2009-11-04 00:39:09 +1100545 .name = "Performa 475",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700546 .adb_type = MAC_ADB_CUDA,
547 .via_type = MAC_VIA_QUADRA,
548 .scsi_type = MAC_SCSI_QUADRA,
549 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100550 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100551 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700552 }, {
553 .ident = MAC_MODEL_P520,
Finn Thain53aac0a2009-11-04 00:39:09 +1100554 .name = "Performa 520",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700555 .adb_type = MAC_ADB_CUDA,
556 .via_type = MAC_VIA_IIci,
557 .scsi_type = MAC_SCSI_OLD,
558 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100559 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100560 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700561 }, {
562 .ident = MAC_MODEL_P550,
Finn Thain53aac0a2009-11-04 00:39:09 +1100563 .name = "Performa 550",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700564 .adb_type = MAC_ADB_CUDA,
565 .via_type = MAC_VIA_IIci,
566 .scsi_type = MAC_SCSI_OLD,
567 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100568 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100569 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700570 },
Finn Thain53aac0a2009-11-04 00:39:09 +1100571 /* These have the comm slot, and therefore possibly SONIC ethernet */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700572 {
573 .ident = MAC_MODEL_P575,
574 .name = "Performa 575",
575 .adb_type = MAC_ADB_CUDA,
576 .via_type = MAC_VIA_QUADRA,
577 .scsi_type = MAC_SCSI_QUADRA,
578 .scc_type = MAC_SCC_II,
579 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100580 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100581 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700582 }, {
583 .ident = MAC_MODEL_P588,
584 .name = "Performa 588",
585 .adb_type = MAC_ADB_CUDA,
586 .via_type = MAC_VIA_QUADRA,
587 .scsi_type = MAC_SCSI_QUADRA,
588 .ide_type = MAC_IDE_QUADRA,
589 .scc_type = MAC_SCC_II,
590 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100591 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100592 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700593 }, {
594 .ident = MAC_MODEL_TV,
595 .name = "TV",
596 .adb_type = MAC_ADB_CUDA,
Finn Thain8d9f0142011-10-24 01:11:16 +1100597 .via_type = MAC_VIA_IIci,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700598 .scsi_type = MAC_SCSI_OLD,
599 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100600 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100601 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700602 }, {
603 .ident = MAC_MODEL_P600,
604 .name = "Performa 600",
605 .adb_type = MAC_ADB_IISI,
606 .via_type = MAC_VIA_IIci,
607 .scsi_type = MAC_SCSI_OLD,
608 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100609 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100610 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700611 },
612
613 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100614 * Centris - just guessing again; maybe like Quadra.
615 * The C610 may or may not have SONIC. We probe to make sure.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700616 */
617
Linus Torvalds1da177e2005-04-16 15:20:36 -0700618 {
619 .ident = MAC_MODEL_C610,
620 .name = "Centris 610",
621 .adb_type = MAC_ADB_II,
622 .via_type = MAC_VIA_QUADRA,
623 .scsi_type = MAC_SCSI_QUADRA,
624 .scc_type = MAC_SCC_QUADRA,
625 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100626 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100627 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700628 }, {
629 .ident = MAC_MODEL_C650,
630 .name = "Centris 650",
631 .adb_type = MAC_ADB_II,
632 .via_type = MAC_VIA_QUADRA,
633 .scsi_type = MAC_SCSI_QUADRA,
634 .scc_type = MAC_SCC_QUADRA,
635 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100636 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100637 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638 }, {
639 .ident = MAC_MODEL_C660,
640 .name = "Centris 660AV",
641 .adb_type = MAC_ADB_CUDA,
642 .via_type = MAC_VIA_QUADRA,
643 .scsi_type = MAC_SCSI_QUADRA3,
644 .scc_type = MAC_SCC_PSC,
645 .ether_type = MAC_ETHER_MACE,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100646 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100647 .floppy_type = MAC_FLOPPY_AV,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700648 },
649
650 /*
651 * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
652 * and a PMU (in two variations?) for ADB. Most of them use the
653 * Quadra-style VIAs. A few models also have IDE from hell.
654 */
655
656 {
657 .ident = MAC_MODEL_PB140,
658 .name = "PowerBook 140",
659 .adb_type = MAC_ADB_PB1,
660 .via_type = MAC_VIA_QUADRA,
661 .scsi_type = MAC_SCSI_OLD,
662 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100663 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100664 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700665 }, {
666 .ident = MAC_MODEL_PB145,
667 .name = "PowerBook 145",
668 .adb_type = MAC_ADB_PB1,
669 .via_type = MAC_VIA_QUADRA,
670 .scsi_type = MAC_SCSI_OLD,
671 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100672 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100673 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700674 }, {
675 .ident = MAC_MODEL_PB150,
676 .name = "PowerBook 150",
Finn Thain4107c452011-10-24 01:11:20 +1100677 .adb_type = MAC_ADB_PB2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700678 .via_type = MAC_VIA_IIci,
679 .scsi_type = MAC_SCSI_OLD,
680 .ide_type = MAC_IDE_PB,
681 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100682 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100683 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700684 }, {
685 .ident = MAC_MODEL_PB160,
686 .name = "PowerBook 160",
687 .adb_type = MAC_ADB_PB1,
688 .via_type = MAC_VIA_QUADRA,
689 .scsi_type = MAC_SCSI_OLD,
690 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100691 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100692 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700693 }, {
694 .ident = MAC_MODEL_PB165,
695 .name = "PowerBook 165",
696 .adb_type = MAC_ADB_PB1,
697 .via_type = MAC_VIA_QUADRA,
698 .scsi_type = MAC_SCSI_OLD,
699 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100700 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100701 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700702 }, {
703 .ident = MAC_MODEL_PB165C,
704 .name = "PowerBook 165c",
705 .adb_type = MAC_ADB_PB1,
706 .via_type = MAC_VIA_QUADRA,
707 .scsi_type = MAC_SCSI_OLD,
708 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100709 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100710 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700711 }, {
712 .ident = MAC_MODEL_PB170,
713 .name = "PowerBook 170",
714 .adb_type = MAC_ADB_PB1,
715 .via_type = MAC_VIA_QUADRA,
716 .scsi_type = MAC_SCSI_OLD,
717 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100718 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100719 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700720 }, {
721 .ident = MAC_MODEL_PB180,
722 .name = "PowerBook 180",
723 .adb_type = MAC_ADB_PB1,
724 .via_type = MAC_VIA_QUADRA,
725 .scsi_type = MAC_SCSI_OLD,
726 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100727 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100728 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700729 }, {
730 .ident = MAC_MODEL_PB180C,
731 .name = "PowerBook 180c",
732 .adb_type = MAC_ADB_PB1,
733 .via_type = MAC_VIA_QUADRA,
734 .scsi_type = MAC_SCSI_OLD,
735 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100736 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100737 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700738 }, {
739 .ident = MAC_MODEL_PB190,
740 .name = "PowerBook 190",
741 .adb_type = MAC_ADB_PB2,
742 .via_type = MAC_VIA_QUADRA,
743 .scsi_type = MAC_SCSI_OLD,
744 .ide_type = MAC_IDE_BABOON,
745 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100746 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100747 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700748 }, {
749 .ident = MAC_MODEL_PB520,
750 .name = "PowerBook 520",
751 .adb_type = MAC_ADB_PB2,
752 .via_type = MAC_VIA_QUADRA,
753 .scsi_type = MAC_SCSI_OLD,
754 .scc_type = MAC_SCC_QUADRA,
755 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100756 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100757 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700758 },
759
760 /*
761 * PowerBook Duos are pretty much like normal PowerBooks
762 * All of these probably have onboard SONIC in the Dock which
763 * means we'll have to probe for it eventually.
764 *
Simon Arlott0c79cf62007-10-20 01:20:32 +0200765 * Are these really MAC_VIA_IIci? The developer notes for the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700766 * Duos show pretty much the same custom parts as in most of
767 * the other PowerBooks which would imply MAC_VIA_QUADRA.
768 */
769
770 {
771 .ident = MAC_MODEL_PB210,
772 .name = "PowerBook Duo 210",
773 .adb_type = MAC_ADB_PB2,
774 .via_type = MAC_VIA_IIci,
775 .scsi_type = MAC_SCSI_OLD,
776 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100777 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100778 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700779 }, {
780 .ident = MAC_MODEL_PB230,
781 .name = "PowerBook Duo 230",
782 .adb_type = MAC_ADB_PB2,
783 .via_type = MAC_VIA_IIci,
784 .scsi_type = MAC_SCSI_OLD,
785 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100786 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100787 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700788 }, {
789 .ident = MAC_MODEL_PB250,
790 .name = "PowerBook Duo 250",
791 .adb_type = MAC_ADB_PB2,
792 .via_type = MAC_VIA_IIci,
793 .scsi_type = MAC_SCSI_OLD,
794 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100795 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100796 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700797 }, {
798 .ident = MAC_MODEL_PB270C,
799 .name = "PowerBook Duo 270c",
800 .adb_type = MAC_ADB_PB2,
801 .via_type = MAC_VIA_IIci,
802 .scsi_type = MAC_SCSI_OLD,
803 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100804 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100805 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700806 }, {
807 .ident = MAC_MODEL_PB280,
808 .name = "PowerBook Duo 280",
809 .adb_type = MAC_ADB_PB2,
810 .via_type = MAC_VIA_IIci,
811 .scsi_type = MAC_SCSI_OLD,
812 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100813 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100814 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700815 }, {
816 .ident = MAC_MODEL_PB280C,
817 .name = "PowerBook Duo 280c",
818 .adb_type = MAC_ADB_PB2,
819 .via_type = MAC_VIA_IIci,
820 .scsi_type = MAC_SCSI_OLD,
821 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100822 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100823 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700824 },
825
826 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100827 * Other stuff?
Linus Torvalds1da177e2005-04-16 15:20:36 -0700828 */
Finn Thain53aac0a2009-11-04 00:39:09 +1100829
Linus Torvalds1da177e2005-04-16 15:20:36 -0700830 {
831 .ident = -1
832 }
833};
834
Finn Thain80614e52009-11-17 20:06:48 +1100835static struct resource scc_a_rsrcs[] = {
836 { .flags = IORESOURCE_MEM },
837 { .flags = IORESOURCE_IRQ },
838};
839
840static struct resource scc_b_rsrcs[] = {
841 { .flags = IORESOURCE_MEM },
842 { .flags = IORESOURCE_IRQ },
843};
844
845struct platform_device scc_a_pdev = {
846 .name = "scc",
847 .id = 0,
848 .num_resources = ARRAY_SIZE(scc_a_rsrcs),
849 .resource = scc_a_rsrcs,
850};
851EXPORT_SYMBOL(scc_a_pdev);
852
853struct platform_device scc_b_pdev = {
854 .name = "scc",
855 .id = 1,
856 .num_resources = ARRAY_SIZE(scc_b_rsrcs),
857 .resource = scc_b_rsrcs,
858};
859EXPORT_SYMBOL(scc_b_pdev);
860
Adrian Bunk8dfbdf42008-07-17 21:16:25 +0200861static void __init mac_identify(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700862{
863 struct mac_model *m;
864
865 /* Penguin data useful? */
866 int model = mac_bi_data.id;
867 if (!model) {
868 /* no bootinfo model id -> NetBSD booter was used! */
869 /* XXX FIXME: breaks for model > 31 */
Roman Zippel6ff58012007-05-01 22:32:43 +0200870 model = (mac_bi_data.cpuid >> 2) & 63;
Finn Thain53aac0a2009-11-04 00:39:09 +1100871 printk(KERN_WARNING "No bootinfo model ID, using cpuid instead "
872 "(obsolete bootloader?)\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700873 }
874
875 macintosh_config = mac_data_table;
Roman Zippel6ff58012007-05-01 22:32:43 +0200876 for (m = macintosh_config; m->ident != -1; m++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700877 if (m->ident == model) {
878 macintosh_config = m;
879 break;
880 }
881 }
882
Finn Thain80614e52009-11-17 20:06:48 +1100883 /* Set up serial port resources for the console initcall. */
884
885 scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2;
886 scc_a_rsrcs[0].end = scc_a_rsrcs[0].start;
887 scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase;
888 scc_b_rsrcs[0].end = scc_b_rsrcs[0].start;
889
890 switch (macintosh_config->scc_type) {
891 case MAC_SCC_PSC:
892 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A;
893 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B;
894 break;
895 default:
Finn Thainda3fb3c2011-10-24 01:11:18 +1100896 /* On non-PSC machines, the serial ports share an IRQ. */
897 if (macintosh_config->ident == MAC_MODEL_IIFX) {
898 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC;
899 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC;
900 } else {
901 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_AUTO_4;
902 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_AUTO_4;
903 }
Finn Thain80614e52009-11-17 20:06:48 +1100904 break;
905 }
906
Finn Thain53aac0a2009-11-04 00:39:09 +1100907 /*
908 * We need to pre-init the IOPs, if any. Otherwise
909 * the serial console won't work if the user had
910 * the serial ports set to "Faster" mode in MacOS.
911 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700912 iop_preinit();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700913
Frans Popb9b0d8b2010-02-06 18:47:11 +0100914 printk(KERN_INFO "Detected Macintosh model: %d\n", model);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700915
916 /*
917 * Report booter data:
918 */
Roman Zippel6ff58012007-05-01 22:32:43 +0200919 printk(KERN_DEBUG " Penguin bootinfo data:\n");
Finn Thain53aac0a2009-11-04 00:39:09 +1100920 printk(KERN_DEBUG " Video: addr 0x%lx "
921 "row 0x%lx depth %lx dimensions %ld x %ld\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700922 mac_bi_data.videoaddr, mac_bi_data.videorow,
923 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
924 mac_bi_data.dimensions >> 16);
Frans Popb9b0d8b2010-02-06 18:47:11 +0100925 printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700926 mac_bi_data.videological, mac_orig_videoaddr,
927 mac_bi_data.sccbase);
Frans Popb9b0d8b2010-02-06 18:47:11 +0100928 printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700929 mac_bi_data.boottime, mac_bi_data.gmtbias);
Frans Popb9b0d8b2010-02-06 18:47:11 +0100930 printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700931 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700932
Linus Torvalds1da177e2005-04-16 15:20:36 -0700933 iop_init();
934 via_init();
935 oss_init();
936 psc_init();
937 baboon_init();
Finn Thain18814ee2009-11-17 20:03:05 +1100938
939#ifdef CONFIG_ADB_CUDA
940 find_via_cuda();
941#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700942}
943
Adrian Bunk8dfbdf42008-07-17 21:16:25 +0200944static void __init mac_report_hardware(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700945{
946 printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
947}
948
949static void mac_get_model(char *str)
950{
Roman Zippel6ff58012007-05-01 22:32:43 +0200951 strcpy(str, "Macintosh ");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700952 strcat(str, macintosh_config->name);
953}
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100954
Finn Thain2724daf2009-11-04 00:39:56 +1100955static struct resource swim_rsrc = { .flags = IORESOURCE_MEM };
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100956
Finn Thain2724daf2009-11-04 00:39:56 +1100957static struct platform_device swim_pdev = {
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100958 .name = "swim",
959 .id = -1,
Finn Thain2724daf2009-11-04 00:39:56 +1100960 .num_resources = 1,
961 .resource = &swim_rsrc,
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100962};
963
Finn Thaincff75f12009-11-04 00:41:35 +1100964static struct platform_device esp_0_pdev = {
965 .name = "mac_esp",
966 .id = 0,
967};
968
969static struct platform_device esp_1_pdev = {
970 .name = "mac_esp",
971 .id = 1,
972};
973
Finn Thaineeb9c182009-11-04 00:42:02 +1100974static struct platform_device sonic_pdev = {
975 .name = "macsonic",
976 .id = -1,
977};
978
979static struct platform_device mace_pdev = {
980 .name = "macmace",
981 .id = -1,
982};
983
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100984int __init mac_platform_init(void)
985{
986 u8 *swim_base;
987
Finn Thain2724daf2009-11-04 00:39:56 +1100988 /*
Finn Thain80614e52009-11-17 20:06:48 +1100989 * Serial devices
990 */
991
992 platform_device_register(&scc_a_pdev);
993 platform_device_register(&scc_b_pdev);
994
995 /*
Finn Thain2724daf2009-11-04 00:39:56 +1100996 * Floppy device
997 */
998
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100999 switch (macintosh_config->floppy_type) {
1000 case MAC_FLOPPY_SWIM_ADDR1:
1001 swim_base = (u8 *)(VIA1_BASE + 0x1E000);
1002 break;
1003 case MAC_FLOPPY_SWIM_ADDR2:
1004 swim_base = (u8 *)(VIA1_BASE + 0x16000);
1005 break;
1006 default:
Finn Thain2724daf2009-11-04 00:39:56 +11001007 swim_base = NULL;
1008 break;
Laurent Vivier8852ecd2008-11-15 16:10:10 +01001009 }
1010
Finn Thain2724daf2009-11-04 00:39:56 +11001011 if (swim_base) {
1012 swim_rsrc.start = (resource_size_t) swim_base,
1013 swim_rsrc.end = (resource_size_t) swim_base + 0x2000,
1014 platform_device_register(&swim_pdev);
1015 }
Laurent Vivier8852ecd2008-11-15 16:10:10 +01001016
Finn Thaincff75f12009-11-04 00:41:35 +11001017 /*
1018 * SCSI device(s)
1019 */
1020
1021 switch (macintosh_config->scsi_type) {
1022 case MAC_SCSI_QUADRA:
1023 case MAC_SCSI_QUADRA3:
1024 platform_device_register(&esp_0_pdev);
1025 break;
1026 case MAC_SCSI_QUADRA2:
1027 platform_device_register(&esp_0_pdev);
1028 if ((macintosh_config->ident == MAC_MODEL_Q900) ||
1029 (macintosh_config->ident == MAC_MODEL_Q950))
1030 platform_device_register(&esp_1_pdev);
1031 break;
1032 }
1033
Finn Thaineeb9c182009-11-04 00:42:02 +11001034 /*
1035 * Ethernet device
1036 */
1037
1038 switch (macintosh_config->ether_type) {
1039 case MAC_ETHER_SONIC:
1040 platform_device_register(&sonic_pdev);
1041 break;
1042 case MAC_ETHER_MACE:
1043 platform_device_register(&mace_pdev);
1044 break;
1045 }
1046
Finn Thain2724daf2009-11-04 00:39:56 +11001047 return 0;
Laurent Vivier8852ecd2008-11-15 16:10:10 +01001048}
1049
1050arch_initcall(mac_platform_init);