xref: /openbmc/linux/arch/m68k/mac/config.c (revision 64c70b1c)
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 
13 #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>
25 
26 #define BOOTINFO_COMPAT_1_0
27 #include <asm/setup.h>
28 #include <asm/bootinfo.h>
29 
30 #include <asm/system.h>
31 #include <asm/io.h>
32 #include <asm/irq.h>
33 #include <asm/pgtable.h>
34 #include <asm/rtc.h>
35 #include <asm/machdep.h>
36 
37 #include <asm/macintosh.h>
38 #include <asm/macints.h>
39 #include <asm/machw.h>
40 
41 #include <asm/mac_iop.h>
42 #include <asm/mac_via.h>
43 #include <asm/mac_oss.h>
44 #include <asm/mac_psc.h>
45 
46 /* Mac bootinfo struct */
47 
48 struct mac_booter_data mac_bi_data;
49 int mac_bisize = sizeof mac_bi_data;
50 
51 struct mac_hw_present mac_hw_present;
52 
53 /* New m68k bootinfo stuff and videobase */
54 
55 extern int m68k_num_memory;
56 extern struct mem_info m68k_memory[NUM_MEMINFO];
57 
58 extern struct mem_info m68k_ramdisk;
59 
60 extern char m68k_command_line[CL_SIZE];
61 
62 void *mac_env;					/* Loaded by the boot asm */
63 
64 /* The phys. video addr. - might be bogus on some machines */
65 unsigned long mac_orig_videoaddr;
66 
67 /* Mac specific timer functions */
68 extern unsigned long mac_gettimeoffset(void);
69 extern int mac_hwclk(int, struct rtc_time *);
70 extern int mac_set_clock_mmss(unsigned long);
71 extern int show_mac_interrupts(struct seq_file *, void *);
72 extern void iop_preinit(void);
73 extern void iop_init(void);
74 extern void via_init(void);
75 extern void via_init_clock(irq_handler_t func);
76 extern void via_flush_cache(void);
77 extern void oss_init(void);
78 extern void psc_init(void);
79 extern void baboon_init(void);
80 
81 extern void mac_mksound(unsigned int, unsigned int);
82 
83 extern void nubus_sweep_video(void);
84 
85 static void mac_get_model(char *str);
86 
87 static void mac_sched_init(irq_handler_t vector)
88 {
89 	via_init_clock(vector);
90 }
91 
92 /*
93  * Parse a Macintosh-specific record in the bootinfo
94  */
95 
96 int __init mac_parse_bootinfo(const struct bi_record *record)
97 {
98 	int unknown = 0;
99 	const u_long *data = record->data;
100 
101 	switch (record->tag) {
102 	case BI_MAC_MODEL:
103 		mac_bi_data.id = *data;
104 		break;
105 	case BI_MAC_VADDR:
106 		mac_bi_data.videoaddr = *data;
107 		break;
108 	case BI_MAC_VDEPTH:
109 		mac_bi_data.videodepth = *data;
110 		break;
111 	case BI_MAC_VROW:
112 		mac_bi_data.videorow = *data;
113 		break;
114 	case BI_MAC_VDIM:
115 		mac_bi_data.dimensions = *data;
116 		break;
117 	case BI_MAC_VLOGICAL:
118 		mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
119 		mac_orig_videoaddr = *data;
120 		break;
121 	case BI_MAC_SCCBASE:
122 		mac_bi_data.sccbase = *data;
123 		break;
124 	case BI_MAC_BTIME:
125 		mac_bi_data.boottime = *data;
126 		break;
127 	case BI_MAC_GMTBIAS:
128 		mac_bi_data.gmtbias = *data;
129 		break;
130 	case BI_MAC_MEMSIZE:
131 		mac_bi_data.memsize = *data;
132 		break;
133 	case BI_MAC_CPUID:
134 		mac_bi_data.cpuid = *data;
135 		break;
136 	case BI_MAC_ROMBASE:
137 		mac_bi_data.rombase = *data;
138 		break;
139 	default:
140 		unknown = 1;
141 		break;
142 	}
143 	return unknown;
144 }
145 
146 /*
147  * Flip into 24bit mode for an instant - flushes the L2 cache card. We
148  * have to disable interrupts for this. Our IRQ handlers will crap
149  * themselves if they take an IRQ in 24bit mode!
150  */
151 
152 static void mac_cache_card_flush(int writeback)
153 {
154 	unsigned long flags;
155 
156 	local_irq_save(flags);
157 	via_flush_cache();
158 	local_irq_restore(flags);
159 }
160 
161 void __init config_mac(void)
162 {
163 	if (!MACH_IS_MAC)
164 		printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
165 
166 	mach_sched_init = mac_sched_init;
167 	mach_init_IRQ = mac_init_IRQ;
168 	mach_get_model = mac_get_model;
169 	mach_gettimeoffset = mac_gettimeoffset;
170 #warning move to adb/via init
171 #if 0
172 	mach_hwclk = mac_hwclk;
173 #endif
174 	mach_set_clock_mmss = mac_set_clock_mmss;
175 	mach_reset = mac_reset;
176 	mach_halt = mac_poweroff;
177 	mach_power_off = mac_poweroff;
178 	mach_max_dma_address = 0xffffffff;
179 #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
180 	mach_beep = mac_mksound;
181 #endif
182 #ifdef CONFIG_HEARTBEAT
183 #if 0
184 	mach_heartbeat = mac_heartbeat;
185 	mach_heartbeat_irq = IRQ_MAC_TIMER;
186 #endif
187 #endif
188 
189 	/*
190 	 * Determine hardware present
191 	 */
192 
193 	mac_identify();
194 	mac_report_hardware();
195 
196 	/*
197 	 * AFAIK only the IIci takes a cache card.  The IIfx has onboard
198 	 * cache ... someone needs to figure out how to tell if it's on or
199 	 * not.
200 	 */
201 
202 	if (macintosh_config->ident == MAC_MODEL_IICI
203 	    || macintosh_config->ident == MAC_MODEL_IIFX)
204 		mach_l2_flush = mac_cache_card_flush;
205 
206 	/*
207 	 * Check for machine specific fixups.
208 	 */
209 
210 #ifdef OLD_NUBUS_CODE
211 	nubus_sweep_video();
212 #endif
213 }
214 
215 
216 /*
217  *	Macintosh Table: hardcoded model configuration data.
218  *
219  *	Much of this was defined by Alan, based on who knows what docs.
220  *	I've added a lot more, and some of that was pure guesswork based
221  *	on hardware pages present on the Mac web site. Possibly wildly
222  *	inaccurate, so look here if a new Mac model won't run. Example: if
223  *	a Mac crashes immediately after the VIA1 registers have been dumped
224  *	to the screen, it probably died attempting to read DirB on a RBV.
225  *	Meaning it should have MAC_VIA_IIci here :-)
226  */
227 
228 struct mac_model *macintosh_config;
229 EXPORT_SYMBOL(macintosh_config);
230 
231 static struct mac_model mac_data_table[] = {
232 	/*
233 	 *	We'll pretend to be a Macintosh II, that's pretty safe.
234 	 */
235 
236 	{
237 		.ident		= MAC_MODEL_II,
238 		.name		= "Unknown",
239 		.adb_type	= MAC_ADB_II,
240 		.via_type	= MAC_VIA_II,
241 		.scsi_type	= MAC_SCSI_OLD,
242 		.scc_type	= MAC_SCC_II,
243 		.nubus_type	= MAC_NUBUS
244 	},
245 
246 	/*
247 	 *	Original MacII hardware
248 	 *
249 	 */
250 
251 	{
252 		.ident		= MAC_MODEL_II,
253 		.name		= "II",
254 		.adb_type	= MAC_ADB_II,
255 		.via_type	= MAC_VIA_II,
256 		.scsi_type	= MAC_SCSI_OLD,
257 		.scc_type	= MAC_SCC_II,
258 		.nubus_type	= MAC_NUBUS
259 	}, {
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,
266 		.nubus_type	= MAC_NUBUS
267 	}, {
268 		.ident		= MAC_MODEL_IICX,
269 		.name		= "IIcx",
270 		.adb_type	= MAC_ADB_II,
271 		.via_type	= MAC_VIA_II,
272 		.scsi_type	= MAC_SCSI_OLD,
273 		.scc_type	= MAC_SCC_II,
274 		.nubus_type	= MAC_NUBUS
275 	}, {
276 		.ident		= MAC_MODEL_SE30,
277 		.name		= "SE/30",
278 		.adb_type	= MAC_ADB_II,
279 		.via_type	= MAC_VIA_II,
280 		.scsi_type	= MAC_SCSI_OLD,
281 		.scc_type	= MAC_SCC_II,
282 		.nubus_type	= MAC_NUBUS
283 	},
284 
285 	/*
286 	 *	Weirdified MacII hardware - all subtley different. Gee thanks
287 	 *	Apple. All these boxes seem to have VIA2 in a different place to
288 	 *	the MacII (+1A000 rather than +4000)
289 	 * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
290 	 */
291 
292 	{
293 		.ident		= MAC_MODEL_IICI,
294 		.name		= "IIci",
295 		.adb_type	= MAC_ADB_II,
296 		.via_type	= MAC_VIA_IIci,
297 		.scsi_type	= MAC_SCSI_OLD,
298 		.scc_type	= MAC_SCC_II,
299 		.nubus_type	= MAC_NUBUS
300 	}, {
301 		.ident		= MAC_MODEL_IIFX,
302 		.name		= "IIfx",
303 		.adb_type	= MAC_ADB_IOP,
304 		.via_type	= MAC_VIA_IIci,
305 		.scsi_type	= MAC_SCSI_OLD,
306 		.scc_type	= MAC_SCC_IOP,
307 		.nubus_type	= MAC_NUBUS
308 	}, {
309 		.ident		= MAC_MODEL_IISI,
310 		.name		= "IIsi",
311 		.adb_type	= MAC_ADB_IISI,
312 		.via_type	= MAC_VIA_IIci,
313 		.scsi_type	= MAC_SCSI_OLD,
314 		.scc_type	= MAC_SCC_II,
315 		.nubus_type	= MAC_NUBUS
316 	}, {
317 		.ident		= MAC_MODEL_IIVI,
318 		.name		= "IIvi",
319 		.adb_type	= MAC_ADB_IISI,
320 		.via_type	= MAC_VIA_IIci,
321 		.scsi_type	= MAC_SCSI_OLD,
322 		.scc_type	= MAC_SCC_II,
323 		.nubus_type	= MAC_NUBUS
324 	}, {
325 		.ident		= MAC_MODEL_IIVX,
326 		.name		= "IIvx",
327 		.adb_type	= MAC_ADB_IISI,
328 		.via_type	= MAC_VIA_IIci,
329 		.scsi_type	= MAC_SCSI_OLD,
330 		.scc_type	= MAC_SCC_II,
331 		.nubus_type	= MAC_NUBUS
332 	},
333 
334 	/*
335 	 *	Classic models (guessing: similar to SE/30 ?? Nope, similar to LC ...)
336 	 */
337 
338 	{
339 		.ident		= MAC_MODEL_CLII,
340 		.name		= "Classic II",
341 		.adb_type	= MAC_ADB_IISI,
342 		.via_type	= MAC_VIA_IIci,
343 		.scsi_type	= MAC_SCSI_OLD,
344 		.scc_type	= MAC_SCC_II,
345 		.nubus_type	= MAC_NUBUS
346 	}, {
347 		.ident		= MAC_MODEL_CCL,
348 		.name		= "Color Classic",
349 		.adb_type	= MAC_ADB_CUDA,
350 		.via_type	= MAC_VIA_IIci,
351 		.scsi_type	= MAC_SCSI_OLD,
352 		.scc_type	= MAC_SCC_II,
353 		.nubus_type	= MAC_NUBUS},
354 
355 	/*
356 	 *	Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
357 	 */
358 
359 	{
360 		.ident		= MAC_MODEL_LC,
361 		.name		= "LC",
362 		.adb_type	= MAC_ADB_IISI,
363 		.via_type	= MAC_VIA_IIci,
364 		.scsi_type	= MAC_SCSI_OLD,
365 		.scc_type	= MAC_SCC_II,
366 		.nubus_type	= MAC_NUBUS
367 	}, {
368 		.ident		= MAC_MODEL_LCII,
369 		.name		= "LC II",
370 		.adb_type	= MAC_ADB_IISI,
371 		.via_type	= MAC_VIA_IIci,
372 		.scsi_type	= MAC_SCSI_OLD,
373 		.scc_type	= MAC_SCC_II,
374 		.nubus_type	= MAC_NUBUS
375 	}, {
376 		.ident		= MAC_MODEL_LCIII,
377 		.name		= "LC III",
378 		.adb_type	= MAC_ADB_IISI,
379 		.via_type	= MAC_VIA_IIci,
380 		.scsi_type	= MAC_SCSI_OLD,
381 		.scc_type	= MAC_SCC_II,
382 		.nubus_type	= MAC_NUBUS
383 	},
384 
385 	/*
386 	 *	Quadra. Video is at 0xF9000000, via is like a MacII. We label it differently
387 	 *	as some of the stuff connected to VIA2 seems different. Better SCSI chip and
388 	 *	onboard ethernet using a NatSemi SONIC except the 660AV and 840AV which use an
389 	 *	AMD 79C940 (MACE).
390 	 *	The 700, 900 and 950 have some I/O chips in the wrong place to
391 	 *	confuse us. The 840AV has a SCSI location of its own (same as
392 	 *	the 660AV).
393 	 */
394 
395 	{
396 		.ident		= MAC_MODEL_Q605,
397 		.name		= "Quadra 605",
398 		.adb_type	= MAC_ADB_CUDA,
399 		.via_type	= MAC_VIA_QUADRA,
400 		.scsi_type	= MAC_SCSI_QUADRA,
401 		.scc_type	= MAC_SCC_QUADRA,
402 		.nubus_type	= MAC_NUBUS
403 	}, {
404 		.ident		= MAC_MODEL_Q605_ACC,
405 		.name		= "Quadra 605",
406 		.adb_type	= MAC_ADB_CUDA,
407 		.via_type	= MAC_VIA_QUADRA,
408 		.scsi_type	= MAC_SCSI_QUADRA,
409 		.scc_type	= MAC_SCC_QUADRA,
410 		.nubus_type	= MAC_NUBUS
411 	}, {
412 		.ident		= MAC_MODEL_Q610,
413 		.name		= "Quadra 610",
414 		.adb_type	= MAC_ADB_II,
415 		.via_type	= MAC_VIA_QUADRA,
416 		.scsi_type	= MAC_SCSI_QUADRA,
417 		.scc_type	= MAC_SCC_QUADRA,
418 		.ether_type	= MAC_ETHER_SONIC,
419 		.nubus_type	= MAC_NUBUS
420 	}, {
421 		.ident		= MAC_MODEL_Q630,
422 		.name		= "Quadra 630",
423 		.adb_type	= MAC_ADB_CUDA,
424 		.via_type	= MAC_VIA_QUADRA,
425 		.scsi_type	= MAC_SCSI_QUADRA,
426 		.ide_type	= MAC_IDE_QUADRA,
427 		.scc_type	= MAC_SCC_QUADRA,
428 		.ether_type	= MAC_ETHER_SONIC,
429 		.nubus_type	= MAC_NUBUS
430 	}, {
431 		.ident		= MAC_MODEL_Q650,
432 		.name		= "Quadra 650",
433 		.adb_type	= MAC_ADB_II,
434 		.via_type	= MAC_VIA_QUADRA,
435 		.scsi_type	= MAC_SCSI_QUADRA,
436 		.scc_type	= MAC_SCC_QUADRA,
437 		.ether_type	= MAC_ETHER_SONIC,
438 		.nubus_type	= MAC_NUBUS
439 	},
440 	/*	The Q700 does have a NS Sonic */
441 	{
442 		.ident		= MAC_MODEL_Q700,
443 		.name		= "Quadra 700",
444 		.adb_type	= MAC_ADB_II,
445 		.via_type	= MAC_VIA_QUADRA,
446 		.scsi_type	= MAC_SCSI_QUADRA2,
447 		.scc_type	= MAC_SCC_QUADRA,
448 		.ether_type	= MAC_ETHER_SONIC,
449 		.nubus_type	= MAC_NUBUS
450 	}, {
451 		.ident		= MAC_MODEL_Q800,
452 		.name		= "Quadra 800",
453 		.adb_type	= MAC_ADB_II,
454 		.via_type	= MAC_VIA_QUADRA,
455 		.scsi_type	= MAC_SCSI_QUADRA,
456 		.scc_type	= MAC_SCC_QUADRA,
457 		.ether_type	= MAC_ETHER_SONIC,
458 		.nubus_type	= MAC_NUBUS
459 	}, {
460 		.ident		= MAC_MODEL_Q840,
461 		.name		= "Quadra 840AV",
462 		.adb_type	= MAC_ADB_CUDA,
463 		.via_type	= MAC_VIA_QUADRA,
464 		.scsi_type	= MAC_SCSI_QUADRA3,
465 		.scc_type	= MAC_SCC_PSC,
466 		.ether_type	= MAC_ETHER_MACE,
467 		.nubus_type	= MAC_NUBUS
468 	}, {
469 		.ident		= MAC_MODEL_Q900,
470 		.name		= "Quadra 900",
471 		.adb_type	= MAC_ADB_IOP,
472 		.via_type	= MAC_VIA_QUADRA,
473 		.scsi_type	= MAC_SCSI_QUADRA2,
474 		.scc_type	= MAC_SCC_IOP,
475 		.ether_type	= MAC_ETHER_SONIC,
476 		.nubus_type	= MAC_NUBUS
477 	}, {
478 		.ident		= MAC_MODEL_Q950,
479 		.name		= "Quadra 950",
480 		.adb_type	= MAC_ADB_IOP,
481 		.via_type	= MAC_VIA_QUADRA,
482 		.scsi_type	= MAC_SCSI_QUADRA2,
483 		.scc_type	= MAC_SCC_IOP,
484 		.ether_type	= MAC_ETHER_SONIC,
485 		.nubus_type	= MAC_NUBUS
486 	},
487 
488 	/*
489 	 *	Performa - more LC type machines
490 	 */
491 
492 	{
493 		.ident		= MAC_MODEL_P460,
494 		.name		=  "Performa 460",
495 		.adb_type	= MAC_ADB_IISI,
496 		.via_type	= MAC_VIA_IIci,
497 		.scsi_type	= MAC_SCSI_OLD,
498 		.scc_type	= MAC_SCC_II,
499 		.nubus_type	= MAC_NUBUS
500 	}, {
501 		.ident		= MAC_MODEL_P475,
502 		.name		=  "Performa 475",
503 		.adb_type	= MAC_ADB_CUDA,
504 		.via_type	= MAC_VIA_QUADRA,
505 		.scsi_type	= MAC_SCSI_QUADRA,
506 		.scc_type	= MAC_SCC_II,
507 		.nubus_type	= MAC_NUBUS
508 	}, {
509 		.ident		= MAC_MODEL_P475F,
510 		.name		=  "Performa 475",
511 		.adb_type	= MAC_ADB_CUDA,
512 		.via_type	= MAC_VIA_QUADRA,
513 		.scsi_type	= MAC_SCSI_QUADRA,
514 		.scc_type	= MAC_SCC_II,
515 		.nubus_type	= MAC_NUBUS
516 	}, {
517 		.ident		= MAC_MODEL_P520,
518 		.name		=  "Performa 520",
519 		.adb_type	= MAC_ADB_CUDA,
520 		.via_type	= MAC_VIA_IIci,
521 		.scsi_type	= MAC_SCSI_OLD,
522 		.scc_type	= MAC_SCC_II,
523 		.nubus_type	= MAC_NUBUS
524 	}, {
525 		.ident		= MAC_MODEL_P550,
526 		.name		=  "Performa 550",
527 		.adb_type	= MAC_ADB_CUDA,
528 		.via_type	= MAC_VIA_IIci,
529 		.scsi_type	= MAC_SCSI_OLD,
530 		.scc_type	= MAC_SCC_II,
531 		.nubus_type	= MAC_NUBUS
532 	},
533 	/* These have the comm slot, and therefore the possibility of SONIC ethernet */
534 	{
535 		.ident		= MAC_MODEL_P575,
536 		.name		= "Performa 575",
537 		.adb_type	= MAC_ADB_CUDA,
538 		.via_type	= MAC_VIA_QUADRA,
539 		.scsi_type	= MAC_SCSI_QUADRA,
540 		.scc_type	= MAC_SCC_II,
541 		.ether_type	= MAC_ETHER_SONIC,
542 		.nubus_type	= MAC_NUBUS
543 	}, {
544 		.ident		= MAC_MODEL_P588,
545 		.name		= "Performa 588",
546 		.adb_type	= MAC_ADB_CUDA,
547 		.via_type	= MAC_VIA_QUADRA,
548 		.scsi_type	= MAC_SCSI_QUADRA,
549 		.ide_type	= MAC_IDE_QUADRA,
550 		.scc_type	= MAC_SCC_II,
551 		.ether_type	= MAC_ETHER_SONIC,
552 		.nubus_type	= MAC_NUBUS
553 	}, {
554 		.ident		= MAC_MODEL_TV,
555 		.name		= "TV",
556 		.adb_type	= MAC_ADB_CUDA,
557 		.via_type	= MAC_VIA_QUADRA,
558 		.scsi_type	= MAC_SCSI_OLD,
559 		.scc_type	= MAC_SCC_II,
560 		.nubus_type	= MAC_NUBUS
561 	}, {
562 		.ident		= MAC_MODEL_P600,
563 		.name		= "Performa 600",
564 		.adb_type	= MAC_ADB_IISI,
565 		.via_type	= MAC_VIA_IIci,
566 		.scsi_type	= MAC_SCSI_OLD,
567 		.scc_type	= MAC_SCC_II,
568 		.nubus_type	= MAC_NUBUS
569 	},
570 
571 	/*
572 	 *	Centris - just guessing again; maybe like Quadra
573 	 */
574 
575 	/* The C610 may or may not have SONIC.  We probe to make sure */
576 	{
577 		.ident		= MAC_MODEL_C610,
578 		.name		= "Centris 610",
579 		.adb_type	= MAC_ADB_II,
580 		.via_type	= MAC_VIA_QUADRA,
581 		.scsi_type	= MAC_SCSI_QUADRA,
582 		.scc_type	= MAC_SCC_QUADRA,
583 		.ether_type	= MAC_ETHER_SONIC,
584 		.nubus_type	= MAC_NUBUS
585 	}, {
586 		.ident		= MAC_MODEL_C650,
587 		.name		= "Centris 650",
588 		.adb_type	= MAC_ADB_II,
589 		.via_type	= MAC_VIA_QUADRA,
590 		.scsi_type	= MAC_SCSI_QUADRA,
591 		.scc_type	= MAC_SCC_QUADRA,
592 		.ether_type	= MAC_ETHER_SONIC,
593 		.nubus_type	= MAC_NUBUS
594 	}, {
595 		.ident		= MAC_MODEL_C660,
596 		.name		= "Centris 660AV",
597 		.adb_type	= MAC_ADB_CUDA,
598 		.via_type	= MAC_VIA_QUADRA,
599 		.scsi_type	= MAC_SCSI_QUADRA3,
600 		.scc_type	= MAC_SCC_PSC,
601 		.ether_type	= MAC_ETHER_MACE,
602 		.nubus_type	= MAC_NUBUS
603 	},
604 
605 	/*
606 	 * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
607 	 * and a PMU (in two variations?) for ADB. Most of them use the
608 	 * Quadra-style VIAs. A few models also have IDE from hell.
609 	 */
610 
611 	{
612 		.ident		= MAC_MODEL_PB140,
613 		.name		= "PowerBook 140",
614 		.adb_type	= MAC_ADB_PB1,
615 		.via_type	= MAC_VIA_QUADRA,
616 		.scsi_type	= MAC_SCSI_OLD,
617 		.scc_type	= MAC_SCC_QUADRA,
618 		.nubus_type	= MAC_NUBUS
619 	}, {
620 		.ident		= MAC_MODEL_PB145,
621 		.name		= "PowerBook 145",
622 		.adb_type	= MAC_ADB_PB1,
623 		.via_type	= MAC_VIA_QUADRA,
624 		.scsi_type	= MAC_SCSI_OLD,
625 		.scc_type	= MAC_SCC_QUADRA,
626 		.nubus_type	= MAC_NUBUS
627 	}, {
628 		.ident		= MAC_MODEL_PB150,
629 		.name		= "PowerBook 150",
630 		.adb_type	= MAC_ADB_PB1,
631 		.via_type	= MAC_VIA_IIci,
632 		.scsi_type	= MAC_SCSI_OLD,
633 		.ide_type	= MAC_IDE_PB,
634 		.scc_type	= MAC_SCC_QUADRA,
635 		.nubus_type	= MAC_NUBUS
636 	}, {
637 		.ident		= MAC_MODEL_PB160,
638 		.name		= "PowerBook 160",
639 		.adb_type	= MAC_ADB_PB1,
640 		.via_type	= MAC_VIA_QUADRA,
641 		.scsi_type	= MAC_SCSI_OLD,
642 		.scc_type	= MAC_SCC_QUADRA,
643 		.nubus_type	= MAC_NUBUS
644 	}, {
645 		.ident		= MAC_MODEL_PB165,
646 		.name		= "PowerBook 165",
647 		.adb_type	= MAC_ADB_PB1,
648 		.via_type	= MAC_VIA_QUADRA,
649 		.scsi_type	= MAC_SCSI_OLD,
650 		.scc_type	= MAC_SCC_QUADRA,
651 		.nubus_type	= MAC_NUBUS
652 	}, {
653 		.ident		= MAC_MODEL_PB165C,
654 		.name		= "PowerBook 165c",
655 		.adb_type	= MAC_ADB_PB1,
656 		.via_type	= MAC_VIA_QUADRA,
657 		.scsi_type	= MAC_SCSI_OLD,
658 		.scc_type	= MAC_SCC_QUADRA,
659 		.nubus_type	= MAC_NUBUS
660 	}, {
661 		.ident		= MAC_MODEL_PB170,
662 		.name		= "PowerBook 170",
663 		.adb_type	= MAC_ADB_PB1,
664 		.via_type	= MAC_VIA_QUADRA,
665 		.scsi_type	= MAC_SCSI_OLD,
666 		.scc_type	= MAC_SCC_QUADRA,
667 		.nubus_type	= MAC_NUBUS
668 	}, {
669 		.ident		= MAC_MODEL_PB180,
670 		.name		= "PowerBook 180",
671 		.adb_type	= MAC_ADB_PB1,
672 		.via_type	= MAC_VIA_QUADRA,
673 		.scsi_type	= MAC_SCSI_OLD,
674 		.scc_type	= MAC_SCC_QUADRA,
675 		.nubus_type	= MAC_NUBUS
676 	}, {
677 		.ident		= MAC_MODEL_PB180C,
678 		.name		= "PowerBook 180c",
679 		.adb_type	= MAC_ADB_PB1,
680 		.via_type	= MAC_VIA_QUADRA,
681 		.scsi_type	= MAC_SCSI_OLD,
682 		.scc_type	= MAC_SCC_QUADRA,
683 		.nubus_type	= MAC_NUBUS
684 	}, {
685 		.ident		= MAC_MODEL_PB190,
686 		.name		= "PowerBook 190",
687 		.adb_type	= MAC_ADB_PB2,
688 		.via_type	= MAC_VIA_QUADRA,
689 		.scsi_type	= MAC_SCSI_OLD,
690 		.ide_type	= MAC_IDE_BABOON,
691 		.scc_type	= MAC_SCC_QUADRA,
692 		.nubus_type	= MAC_NUBUS
693 	}, {
694 		.ident		= MAC_MODEL_PB520,
695 		.name		= "PowerBook 520",
696 		.adb_type	= MAC_ADB_PB2,
697 		.via_type	= MAC_VIA_QUADRA,
698 		.scsi_type	= MAC_SCSI_OLD,
699 		.scc_type	= MAC_SCC_QUADRA,
700 		.ether_type	= MAC_ETHER_SONIC,
701 		.nubus_type	= MAC_NUBUS
702 	},
703 
704 	/*
705 	 * PowerBook Duos are pretty much like normal PowerBooks
706 	 * All of these probably have onboard SONIC in the Dock which
707 	 * means we'll have to probe for it eventually.
708 	 *
709 	 * Are these reallly MAC_VIA_IIci? The developer notes for the
710 	 * Duos show pretty much the same custom parts as in most of
711 	 * the other PowerBooks which would imply MAC_VIA_QUADRA.
712 	 */
713 
714 	{
715 		.ident		= MAC_MODEL_PB210,
716 		.name		= "PowerBook Duo 210",
717 		.adb_type	= MAC_ADB_PB2,
718 		.via_type	= MAC_VIA_IIci,
719 		.scsi_type	= MAC_SCSI_OLD,
720 		.scc_type	= MAC_SCC_QUADRA,
721 		.nubus_type	= MAC_NUBUS
722 	}, {
723 		.ident		= MAC_MODEL_PB230,
724 		.name		= "PowerBook Duo 230",
725 		.adb_type	= MAC_ADB_PB2,
726 		.via_type	= MAC_VIA_IIci,
727 		.scsi_type	= MAC_SCSI_OLD,
728 		.scc_type	= MAC_SCC_QUADRA,
729 		.nubus_type	= MAC_NUBUS
730 	}, {
731 		.ident		= MAC_MODEL_PB250,
732 		.name		= "PowerBook Duo 250",
733 		.adb_type	= MAC_ADB_PB2,
734 		.via_type	= MAC_VIA_IIci,
735 		.scsi_type	= MAC_SCSI_OLD,
736 		.scc_type	= MAC_SCC_QUADRA,
737 		.nubus_type	= MAC_NUBUS
738 	}, {
739 		.ident		= MAC_MODEL_PB270C,
740 		.name		= "PowerBook Duo 270c",
741 		.adb_type	= MAC_ADB_PB2,
742 		.via_type	= MAC_VIA_IIci,
743 		.scsi_type	= MAC_SCSI_OLD,
744 		.scc_type	= MAC_SCC_QUADRA,
745 		.nubus_type	= MAC_NUBUS
746 	}, {
747 		.ident		= MAC_MODEL_PB280,
748 		.name		= "PowerBook Duo 280",
749 		.adb_type	= MAC_ADB_PB2,
750 		.via_type	= MAC_VIA_IIci,
751 		.scsi_type	= MAC_SCSI_OLD,
752 		.scc_type	= MAC_SCC_QUADRA,
753 		.nubus_type	= MAC_NUBUS
754 	}, {
755 		.ident		= MAC_MODEL_PB280C,
756 		.name		= "PowerBook Duo 280c",
757 		.adb_type	= MAC_ADB_PB2,
758 		.via_type	= MAC_VIA_IIci,
759 		.scsi_type	= MAC_SCSI_OLD,
760 		.scc_type	= MAC_SCC_QUADRA,
761 		.nubus_type	= MAC_NUBUS
762 	},
763 
764 	/*
765 	 *	Other stuff ??
766 	 */
767 	{
768 		.ident		= -1
769 	}
770 };
771 
772 void mac_identify(void)
773 {
774 	struct mac_model *m;
775 
776 	/* Penguin data useful? */
777 	int model = mac_bi_data.id;
778 	if (!model) {
779 		/* no bootinfo model id -> NetBSD booter was used! */
780 		/* XXX FIXME: breaks for model > 31 */
781 		model = (mac_bi_data.cpuid >> 2) & 63;
782 		printk(KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
783 	}
784 
785 	macintosh_config = mac_data_table;
786 	for (m = macintosh_config; m->ident != -1; m++) {
787 		if (m->ident == model) {
788 			macintosh_config = m;
789 			break;
790 		}
791 	}
792 
793 	/* We need to pre-init the IOPs, if any. Otherwise */
794 	/* the serial console won't work if the user had   */
795 	/* the serial ports set to "Faster" mode in MacOS. */
796 
797 	iop_preinit();
798 
799 	printk(KERN_INFO "Detected Macintosh model: %d \n", model);
800 
801 	/*
802 	 * Report booter data:
803 	 */
804 	printk(KERN_DEBUG " Penguin bootinfo data:\n");
805 	printk(KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
806 		mac_bi_data.videoaddr, mac_bi_data.videorow,
807 		mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
808 		mac_bi_data.dimensions >> 16);
809 	printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
810 		mac_bi_data.videological, mac_orig_videoaddr,
811 		mac_bi_data.sccbase);
812 	printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n",
813 		mac_bi_data.boottime, mac_bi_data.gmtbias);
814 	printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
815 		mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
816 #if 0
817 	printk("Ramdisk: addr 0x%lx size 0x%lx\n",
818 		m68k_ramdisk.addr, m68k_ramdisk.size);
819 #endif
820 
821 	/*
822 	 * TODO: set the various fields in macintosh_config->hw_present here!
823 	 */
824 	switch (macintosh_config->scsi_type) {
825 	case MAC_SCSI_OLD:
826 		MACHW_SET(MAC_SCSI_80);
827 		break;
828 	case MAC_SCSI_QUADRA:
829 	case MAC_SCSI_QUADRA2:
830 	case MAC_SCSI_QUADRA3:
831 		MACHW_SET(MAC_SCSI_96);
832 		if ((macintosh_config->ident == MAC_MODEL_Q900) ||
833 		    (macintosh_config->ident == MAC_MODEL_Q950))
834 			MACHW_SET(MAC_SCSI_96_2);
835 		break;
836 	default:
837 		printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
838 		MACHW_SET(MAC_SCSI_80);
839 		break;
840 	}
841 
842 	iop_init();
843 	via_init();
844 	oss_init();
845 	psc_init();
846 	baboon_init();
847 }
848 
849 void mac_report_hardware(void)
850 {
851 	printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
852 }
853 
854 static void mac_get_model(char *str)
855 {
856 	strcpy(str, "Macintosh ");
857 	strcat(str, macintosh_config->name);
858 }
859